<?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="nl">

  <bookinfo>

    <title>Grilo-plug-ins</title>

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

    <abstract>

      <!-- This text is copied from the introduction. -->
      <para>Grilo is a framework for browsing and searching media content from various sources using a single API. The Grilo Plugins plugins for the Grilo framework to provide access to various sources of media and metadata.
      </para>
    </abstract>

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

    <legalnotice>
      <para>
        Permission is granted to copy, distribute and/or modify this document
        under the terms of the GNU Free Documentation License, Version 1.2
        or any later version published by the Free Software Foundation;
        with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts.
        You may obtain a copy of the GNU Free Documentation License from the Free Software Foundation by visiting their Web site or by writing to: Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301, USA.
      </para>
    </legalnotice>

  
    <othercredit class="translator">
      <personname>
        <firstname>Nathan Follens</firstname>
      </personname>
      <email>nfollens@gnome.org</email>
    </othercredit>
    <copyright>
      
        <year>2022.</year>
      
      <holder>Nathan Follens</holder>
    </copyright>
  </bookinfo>

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

<para>Grilo is a framework for browsing and searching media content from various sources using a single API. The Grilo Plugins plugins for the Grilo framework to provide access to various sources of media and metadata.</para>
</chapter>


<chapter id="chapter-plugins">
<title>Grilo-plug-ins</title>


<sect1 id="sec-plugin-apple-trailers">
<title>Apple Trailers</title>
<para>Dit is een Grilo-plug-in voor Apple Trailers. Zijn plug-in-ID is <literal>"grl-apple-trailers"</literal></para>
</sect1>

<sect1 id="sec-plugin-bookmarks">
<title>Bladwijzers</title>
<para>Dit is een Grilo-plug-in voor bladwijzers. Zijn plug-in-ID is <literal>"grl-bookmarks"</literal></para>
</sect1>

<sect1 id="sec-plugin-dmap">
<title>DMap</title>
<para>Dit is een Grilo-plug-in voor DMap. Zijn plug-in-ID is <literal>"grl-dmap"</literal></para>
</sect1>

<sect1 id="sec-plugin-filesystem">
<title>Bestandssysteem</title>
<para>Dit is een Grilo-plug-in voor het bestandssysteem. Zijn plug-in-ID is <literal>"grl-filesystem"</literal></para>
</sect1>

<sect1 id="sec-plugin-flickr">
<title>Flickr</title>
<para>Dit is een Grilo-plug-in voor Flickr. Zijn plug-in-ID is <literal>"grl-flickr"</literal></para>
</sect1>

<sect1 id="sec-plugin-gravatar">
<title>Gravatar</title>
<para>Dit is een Grilo-plug-in voor Gravatar. Zijn plug-in-ID is <literal>"grl-gravatar"</literal></para>
</sect1>

<sect1 id="sec-plugin-jamendo">
<title>Jamendo</title>
<para>Dit is een Grilo-plug-in voor Jamendo. Zijn plug-in-ID is <literal>"grl-jamendo"</literal></para>
</sect1>

<sect1 id="sec-plugin-local-metadata">
<title>Lokale metadata</title>
<para>Dit is een Grilo-plug-in voor lokale metadata. Zijn plug-in-ID is <literal>"grl-local-metadata"</literal></para>
</sect1>

<sect1 id="sec-plugin-metadata-store">
<title>Metadata-opslag</title>
<para>Dit is een Grilo-plug-in voor de metadata-opslag. Zijn plug-in-ID is <literal>"grl-metadata-store"</literal></para>
</sect1>

<sect1 id="sec-plugin-optical-media">
<title>Optische media</title>
<para>Dit is een Grilo-plug-in voor optische media. Zijn plug-in-ID is <literal>"grl-optical-media"</literal></para>
</sect1>

<sect1 id="sec-plugin-podcasts">
<title>Podcasts</title>
<para>Dit is een Grilo-plug-in voor podcasts. Zijn plug-in-ID is <literal>"grl-podcasts"</literal></para>
</sect1>

<sect1 id="sec-plugin-shoutcast">
<title>Shoutcast</title>
<para>Dit is een Grilo-plug-in voor Shoutcast. Zijn plug-in-ID is <literal>"grl-shoutcast"</literal></para>
</sect1>

<sect1 id="sec-plugin-tmdb">
<title>TMDb Plugin</title>
<para>De TMDb-plug-in haalt informatie over films op van de <ulink url="http://themoviedb.org">TMDb-onlinedienst</ulink>, een door de gemeenschap beheerde filmdatabase. Zijn plug-in-ID is <literal>"grl-tmdb"</literal></para>
<para>Voordat u deze plug-in gebruikt dient u de TMDb-API-sleutel in te stellen met <ulink url="http://developer.gnome.org/grilo/unstable/GrlConfig.html#grl-config-set-api-key"><function>grl_config_set_api_key()</function></ulink>.</para>
<para>Vervolgens kunt u <ulink url="http://developer.gnome.org/grilo/unstable/GrlSource.html#grl-source-resolve"><function>grl_source_resolve()</function></ulink> gebruiken om informatie over een bestaand GrlMediaItem te ontdekken.</para>
<para>Deze plug-in biedt geen ondersteuning voor zoeken via <ulink url="http://developer.gnome.org/grilo/unstable/GrlSource.html#grl-source-search"><function>grl_source_search()</function></ulink> of zoekopdrachten via <ulink url="http://developer.gnome.org/grilo/unstable/GrlSource.html#grl-source-query"><function>grl_source_query()</function></ulink>.</para>

<para>Hier is een eenvoudig voorbeeld hoe u de Grilo-TMDb-plug-in kunt gebruiken:</para>

<para>Bestand: <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;

/**
 * Deze TMDb-sleutel dient enkel om te testen.
 * Gelieve uw eigen sleutel aan te vragen bij
 * 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);

  /*
   * Stel de TMDb-API-sleutel in:
   * In uw eigen toepassing moet u uw eigen TMDb-API-sleutel gebruiken.
   */
  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);

  /*
   * De plug-in ophalen:
   */
  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);

  /*
   * De Grilo-bron ophalen:
   */
  src = grl_registry_lookup_source (reg, TMDB_PLUGIN_ID);

  /*
   * Controleren of deze over de verwachte mogelijkheid beschikt:
   */
  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);

  /*
   * Een media-item dat we aan de TMDb-plug-in geven
   * om informatie erover te ontdekken.
   */
  media = grl_media_video_new ();
  grl_media_set_title (media, "Sherlock Holmes");

  /*
   * Ontdekken welke sleutels door de bron geleverd worden:
   */
  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);

    /*
     * Onthoud dit voor later gebruik:
     * U kunt ook grl_registry_lookup_metadata_key_name() gebruiken.
     */
    if (g_strcmp0 (name, "tmdb-director") == 0) {
      director_key = id;
    }
  }

  /*
   * De TMDb-plug-in vragen om informatie over het media-item
   * van de TMDb-onlinedienst:
   */
  grl_source_resolve (src, media,
    keys, options,
    resolve_cb, NULL);

  /*
   * De main loop starten zodat onze callback gecalld kan worden:
   */
  loop = g_main_loop_new (NULL, FALSE);
  g_main_loop_run (loop);

  /*
   * Objecten releasen:
   */
  g_object_unref (media);
  g_object_unref (config);
  g_object_unref (options);

  /*
   * Grilo deïnitialiseren:
   */
  grl_deinit ();
}



</programlisting>

</sect1>

<sect1 id="sec-plugin-tracker">
<title>Tracker</title>
<para>Dit is een Grilo-plug-in voor Tracker. Zijn plug-in-ID is <literal>"grl-tracker"</literal></para>
</sect1>

<sect1 id="sec-plugin-vimeo">
<title>Vimeo</title>
<para>Dit is een Grilo-plug-in voor Vimeo. Zijn plug-in-ID is <literal>"grl-vimeo"</literal></para>
</sect1>

<sect1 id="sec-plugin-youtube">
<title>YouTube</title>
<para>Dit is een Grilo-plug-in voor YouTube. Zijn plug-in-ID is <literal>"grl-youtube"</literal></para>
</sect1>

<sect1 id="sec-plugin-dleyna">
<title>DLeyna</title>
<para>Dit is een Grilo-plug-in voor UPnP/DLNA. Zijn plug-in-ID is <literal>"grl-dleyna"</literal></para>
</sect1>

</chapter>

</book>
