<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" "http://docbook.org/xml/4.5/docbookx.dtd" [
<!ENTITY legal SYSTEM "legal.xml">
<!ENTITY url_refdocs_base "http://developer.gnome.org/grilo/unstable/">
<!ENTITY url_examples_base "http://git.gnome.org/browse/grilo-plugins/tree/help/examples/">
<!ENTITY uuml "&#252;">
<!ENTITY szlig "&#223;">
<!ENTITY verbar "&#124;">
<!ENTITY copy "&#169;">
<!ENTITY nbsp "&#160;">
]>
<!-- The XSL for developer.gnome.org requires this id. --><book id="index" lang="eu">

  <bookinfo>

    <title>Grilo pluginak</title>

    <authorgroup>
      <author><firstname>Murray</firstname> <surname>Cumming</surname></author>
    </authorgroup>

    <abstract>

      <!-- This text is copied from the introduction. -->
      <para>Grilo aplikazioa API bakarrarekin iturburu anitzetako multimedia-edukiak arakatzeko eta bilatzeko lan-marko bat da. Grilo pluginek multimedia-edukien eta metadatuen hainbat iturburuetara sartzeko aukera ematen dute.</para>
    </abstract>

    <copyright><year>2012</year> <holder>Openismus GmbH</holder></copyright>

    <legalnotice>
      <para>Baimena ematen da dokumentu hau kopiatu, banatu eta/edo aldatzeko Free Software Foundation-ek argitaratutako GNU Dokumentazio Librearen Lizentziaren 1.2 bertsioan edo berriago batean ezarritako baldintzetan, atal aldaezinik gabe, aurreko azaleko testurik gabe eta atzeko azaleko testurik gabe. GFDL lizentziaren kopia bat jasotzeko, joan Free Software Foundation fundazioaren webgunera edo idatzi Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301, USA. helbidera.</para>
    </legalnotice>

  </bookinfo>

<chapter id="chapter-introduction">
<title>Sarrera</title>

<para>Grilo aplikazioa API bakarrarekin iturburu anitzetako multimedia-edukiak arakatzeko eta bilatzeko lan-marko bat da. Grilo pluginek multimedia-edukien eta metadatuen hainbat iturburuetara sartzeko aukera ematen dute.</para>
</chapter>


<chapter id="chapter-plugins">
<title>Grilo pluginak</title>


<sect1 id="sec-plugin-bookmarks">
<title>Laster-markak</title>
<para>Hau laster-marketarako Grilo plugin bat da. Pluginaren IDa <literal>"grl-bookmarks"</literal> da.</para>
</sect1>

<sect1 id="sec-plugin-dmap">
<title>DMap</title>
<para>Hau DMap-erako Grilo plugin bat da. Pluginaren IDa <literal>"grl-dmap"</literal> da.</para>
</sect1>

<sect1 id="sec-plugin-filesystem">
<title>Fitxategi-sistema</title>
<para>Hau fitxategi-sistemarako Grilo plugin bat da. Pluginaren IDa <literal>"grl-filesystem"</literal> da.</para>
</sect1>

<sect1 id="sec-plugin-flickr">
<title>Flickr</title>
<para>Hau Flickr-erako Grilo plugin bat da. Pluginaren IDa <literal>"grl-flickr"</literal> da.</para>
</sect1>

<sect1 id="sec-plugin-gravatar">
<title>Gravatar</title>
<para>Hau Gravatar-erako Grilo plugin bat da. Pluginaren IDa <literal>"grl-gravatar"</literal> da.</para>
</sect1>

<sect1 id="sec-plugin-jamendo">
<title>Jamendo</title>
<para>Hau Jamendorako Grilo plugin bat da. Pluginaren IDa <literal>"grl-jamendo"</literal> da.</para>
</sect1>

<sect1 id="sec-plugin-local-metadata">
<title>Metadatu lokalak</title>
<para>Hau metadatu lokaletarako Grilo plugin bat da. Pluginaren IDa <literal>"grl-local-metadata"</literal> da.</para>
</sect1>

<sect1 id="sec-plugin-metadata-store">
<title>Metadatuen biltegia</title>
<para>Hau metadatu-biltegirako Grilo plugin bat da. Pluginaren IDa <literal>"grl-metadata-store"</literal> da.</para>
</sect1>

<sect1 id="sec-plugin-optical-media">
<title>Euskarri optikoa</title>
<para>Hau euskarri optikoetarako Grilo plugin bat da. Pluginaren IDa <literal>"grl-optical-media"</literal> da.</para>
</sect1>

<sect1 id="sec-plugin-podcasts">
<title>Podcast-ak</title>
<para>Hau podcast-etarako Grilo plugin bat da. Pluginaren IDa <literal>"grl-podcasts"</literal> da.</para>
</sect1>

<sect1 id="sec-plugin-shoutcast">
<title>Shoutcast</title>
<para>Hau Shoutcast-erako Grilo plugin bat da. Pluginaren IDa <literal>"grl-shoutcast"</literal> da.</para>
</sect1>

<sect1 id="sec-plugin-tmdb">
<title>TMDb plugina</title>
<para>TMDb pluginak <ulink url="http://themoviedb.org">TMDb lineako zerbitzutik</ulink> atzitzen du filmen informazioa. Komunitateak elikatzen duen datu-base bat da. Bere pluginaren IDa <literal>"grl-tmdb"</literal> da</para>
<para>Plugin hau erabili baino lehen, TMDB API gakoa ezarri behar da <ulink url="http://developer.gnome.org/grilo/unstable/GrlConfig.html#grl-config-set-api-key"><function>grl_config_set_api_key()</function></ulink> erabilita.</para>
<para>Ondoren, <ulink url="http://developer.gnome.org/grilo/unstable/GrlSource.html#grl-source-resolve"><function>grl_source_resolve()</function></ulink> erabili daiteke GrlMediaItem elementuei buruzko xehetasunak aurkitzeko..</para>
<para>Plugin honek ez du onartzen <ulink url="http://developer.gnome.org/grilo/unstable/GrlSource.html#grl-source-search"><function>grl_source_search()</function></ulink> edo <ulink url="http://developer.gnome.org/grilo/unstable/GrlSource.html#grl-source-query"><function>grl_source_query()</function></ulink> bidezko kontsultak.</para>

<para>Grilo aplikazioaren TMDb pluginaren erabileraren adibide sinple bat:</para>

<para>Fitxategia: <ulink url="http://git.gnome.org/browse/grilo-plugins/tree/help/examples/example-tmdb.c"><filename>example-tmdb.c</filename></ulink></para>
<programlisting>
/*
 * Copyright (C) 2012 Canonical Ltd.
 *
 * Author: Jens Georg &lt;jensg@openismus.com&gt;
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public License
 * as published by the Free Software Foundation; version 2.1 of
 * the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful, but
 * WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
 * 02110-1301 USA
 *
 */

#include &lt;grilo.h&gt;
#include &lt;stdio.h&gt;

/**
 * This TMDB key is just for testing.
 * For real-world use, please request your own key from
 * http://api.themoviedb.org
 */
#define TMDB_KEY "719b9b296835b04cd919c4bf5220828a"

#define TMDB_PLUGIN_ID "grl-tmdb"

GMainLoop *loop = NULL;
GrlKeyID director_key = 0;

static void
resolve_cb (GrlSource *src, guint operation_id, GrlMedia *media, gpointer user_data, const GError *error)
{
  const char *title, *studio;

  g_assert_no_error (error);
  g_assert (media);

  title = grl_media_get_title (media);
  studio = grl_media_get_studio (media);
  printf ("Media: Title='%s', Studio='%s'\n",
    title, studio);

  if (director_key != 0) {
    const gchar *director =
      grl_data_get_string (GRL_DATA (media), director_key);
    printf ("  Director=%s\n", director);
  }

  g_main_loop_quit (loop);
}

int main (int argc, char *argv[])
{
  GrlRegistry *reg;
  GrlConfig *config;
  GError *error = NULL;
  GrlSource *src;
  gboolean plugin_activated;
  GrlCaps *caps;
  GrlOperationOptions *options;
  GrlMedia *media;
  const GList *keys;
  const GList* l;

  grl_init (&amp;argc, &amp;argv);

  /*
   * Set the TMDB API key:
   * You must use your own TMDB API key in your own application.
   */
  reg = grl_registry_get_default ();
  config = grl_config_new (TMDB_PLUGIN_ID, NULL);
  grl_config_set_api_key (config, TMDB_KEY);
  grl_registry_add_config (reg, config, NULL);
  grl_registry_load_all_plugins (reg, FALSE, NULL);

  /*
   * Get the plugin:
   */
  error = NULL;
  plugin_activated =
    grl_registry_activate_plugin_by_id (reg, TMDB_PLUGIN_ID, &amp;error);
  g_assert (plugin_activated);
  g_assert_no_error (error);

  /*
   * Get the Grilo source:
   */
  src = grl_registry_lookup_source (reg, TMDB_PLUGIN_ID);

  /*
   * Check that it has the expected capability:
   */
  g_assert (grl_source_supported_operations (src) &amp; GRL_OP_RESOLVE);
  caps = grl_source_get_caps (src, GRL_OP_RESOLVE);
  g_assert (caps);

  options = grl_operation_options_new (caps);

  /*
   * A media item that we will give to the TMDB plugin,
   * to discover its details.
   */
  media = grl_media_video_new ();
  grl_media_set_title (media, "Sherlock Holmes");

  /*
   * Discover what keys are provided by the source:
   */
  keys = grl_source_supported_keys (src);
  for (l = keys; l != NULL; l = l-&gt;next) {
    const gchar *name;
    GrlKeyID id = GPOINTER_TO_INT (l-&gt;data);

    g_assert (id);

    name = grl_metadata_key_get_name (id);
    printf ("Supported key: %s\n", name);

    /*
     * Remember this for later use:
     * You may instead use grl_registry_lookup_metadata_key_name().
     */
    if (g_strcmp0 (name, "tmdb-director") == 0) {
      director_key = id;
    }
  }

  /*
   * Ask the TMDB plugin for the media item's details,
   * from the TMDB online service:
   */
  grl_source_resolve (src, media,
    keys, options,
    resolve_cb, NULL);

  /*
   * Start the main loop so our callback can be called:
   */
  loop = g_main_loop_new (NULL, FALSE);
  g_main_loop_run (loop);

  /*
   * Release objects:
   */
  g_object_unref (media);
  g_object_unref (config);
  g_object_unref (options);

  /*
   * Deinitialize Grilo:
   */
  grl_deinit ();
}



</programlisting>

</sect1>

<sect1 id="sec-plugin-tracker">
<title>Tracker</title>
<para>Hau Tracker-erako Grilo plugin bat da. Pluginaren IDa <literal>"grl-tracker"</literal> da.</para>
</sect1>

<sect1 id="sec-plugin-vimeo">
<title>Vimeo</title>
<para>Hau Vimeorako Grilo plugin bat da. Pluginaren IDa <literal>"grl-vimeo"</literal> da.</para>
</sect1>

<sect1 id="sec-plugin-youtube">
<title>YouTube</title>
<para>Hau Youtuberako Grilo plugin bat da. Pluginaren IDa <literal>"grl-youtube"</literal> da.</para>
</sect1>

<sect1 id="sec-plugin-dleyna">
<title>DLeyna</title>
<para>Hau UPnP/DLNArako Grilo plugin bat da. Pluginaren IDa <literal>"grl-dleyna"</literal> da.</para>
</sect1>

</chapter>

</book>
