<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Recent changes to plugin</title><link>https://sourceforge.net/p/ags/wiki/plugin/</link><description>Recent changes to plugin</description><atom:link href="https://sourceforge.net/p/ags/wiki/plugin/feed" rel="self"/><language>en</language><lastBuildDate>Sun, 30 Nov 2014 08:33:56 -0000</lastBuildDate><atom:link href="https://sourceforge.net/p/ags/wiki/plugin/feed" rel="self" type="application/rss+xml"/><item><title>plugin modified by Joel Krähemann</title><link>https://sourceforge.net/p/ags/wiki/plugin/</link><description>&lt;div class="markdown_content"&gt;&lt;pre&gt;--- v4
+++ v5
@@ -1,6 +1,8 @@
 Plugin interface to do abstraction
 ==================
 The AgsPlugin interface defines some elementary functions like &lt;i&gt;get_name()&lt;/i&gt; or &lt;i&gt;set_name()&lt;/i&gt; and therefor &lt;i&gt;get_version()&lt;/i&gt;, &lt;i&gt;set_version()&lt;/i&gt;, &lt;i&gt;get_build_id()&lt;/i&gt; and &lt;i&gt;set_build_id()&lt;/i&gt;. Further it contains functions used to persist it using XML. This would be &lt;i&gt;get_xml_type()&lt;/i&gt;, &lt;i&gt;set_xml_type()&lt;/i&gt;, &lt;i&gt;read()&lt;/i&gt; and &lt;i&gt;write()&lt;/i&gt;. And &lt;i&gt;get_ports()&lt;/i&gt; and &lt;i&gt;set_ports()&lt;/i&gt; to allow thread safe communication between the different layers of Advanced Gtk+ Sequencer but to be said those functions accomplish for persisting and restoring.
+
+[[img src=AGS_plugin.png alt=Diagram width=600]]

 Hands-on
 ==================
&lt;/pre&gt;
&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Joel Krähemann</dc:creator><pubDate>Sun, 30 Nov 2014 08:33:56 -0000</pubDate><guid>https://sourceforge.netc6f28cbd678b3cc742d3f6ea4373da220cb8da01</guid></item><item><title>plugin modified by Joel Krähemann</title><link>https://sourceforge.net/p/ags/wiki/plugin/</link><description>&lt;div class="markdown_content"&gt;&lt;pre&gt;--- v3
+++ v4
@@ -1,4 +1,100 @@
 Plugin interface to do abstraction
 ==================
-The AgsPlugin interface defines some elementary functions like &lt;i&gt;get_name()&lt;/i&gt; or &lt;i&gt;set_name()&lt;/i&gt; and therefor &lt;i&gt;get_version()&lt;/i&gt;, &lt;i&gt;set_version()&lt;/i&gt;, &lt;i&gt;get_build_id()&lt;/i&gt; and &lt;i&gt;set_build_id()&lt;/i&gt;. Further it contains functions used to persist it using XML. This would be &lt;i&gt;get_xml_type()&lt;/i&gt;, &lt;i&gt;set_xml_type()&lt;/i&gt;, &lt;i&gt;read()&lt;/i&gt; and &lt;i&gt;write()&lt;/i&gt;. And &lt;i&gt;get_ports()&lt;/i&gt; and &lt;i&gt;set_ports()&lt;/i&gt; to allow thread safe communication between the different layers of Advanced Gtk+ Sequencer.
+The AgsPlugin interface defines some elementary functions like &lt;i&gt;get_name()&lt;/i&gt; or &lt;i&gt;set_name()&lt;/i&gt; and therefor &lt;i&gt;get_version()&lt;/i&gt;, &lt;i&gt;set_version()&lt;/i&gt;, &lt;i&gt;get_build_id()&lt;/i&gt; and &lt;i&gt;set_build_id()&lt;/i&gt;. Further it contains functions used to persist it using XML. This would be &lt;i&gt;get_xml_type()&lt;/i&gt;, &lt;i&gt;set_xml_type()&lt;/i&gt;, &lt;i&gt;read()&lt;/i&gt; and &lt;i&gt;write()&lt;/i&gt;. And &lt;i&gt;get_ports()&lt;/i&gt; and &lt;i&gt;set_ports()&lt;/i&gt; to allow thread safe communication between the different layers of Advanced Gtk+ Sequencer but to be said those functions accomplish for persisting and restoring.

+Hands-on
+==================
+The following example illustrates the usage of AgsPluginInterface with ags-echo effect.
+
+First you need to tell object type system to use the AgsPluginInterface this is normally done in the classes get_type() function.
+
+~~~~~~
+GType
+ags_echo_channel_get_type()
+{
+  static GType ags_type_echo_channel = 0;
+
+  if(!ags_type_echo_channel){
+    static const GTypeInfo ags_echo_channel_info = {
+      sizeof (AgsEchoChannelClass),
+      NULL, /* base_init */
+      NULL, /* base_finalize */
+      (GClassInitFunc) ags_echo_channel_class_init,
+      NULL, /* class_finalize */
+      NULL, /* class_channel */
+      sizeof (AgsEchoChannel),
+      0,    /* n_preallocs */
+      (GInstanceInitFunc) ags_echo_channel_init,
+    };
+
+    static const GInterfaceInfo ags_plugin_interface_info = {
+      (GInterfaceInitFunc) ags_echo_channel_plugin_interface_init,
+      NULL, /* interface_finalize */
+      NULL, /* interface_data */
+    };
+
+    ags_type_echo_channel = g_type_register_static(AGS_TYPE_RECALL_CHANNEL,
+                                                  "AgsEchoChannel\0",
+                                                  &amp;amp;ags_echo_channel_info,
+                                                  0);
+
+    g_type_add_interface_static(ags_type_echo_channel,
+                                AGS_TYPE_PLUGIN,
+                                &amp;amp;ags_plugin_interface_info);
+  }
+
+  return(ags_type_echo_channel);
+}
+~~~~~~
+
+Implement its set_ports() function.
+
+~~~~~~
+void
+ags_echo_channel_plugin_interface_init(AgsPluginInterface *plugin)
+{
+  ags_echo_channel_parent_plugin_interface = g_type_interface_peek_parent(plugin);
+
+
+  plugin-&amp;gt;set_ports = ags_echo_channel_set_ports;
+}
+~~~~~~
+
+Finally load the ports restored of XML file.
+
+~~~~~~
+ags_echo_channel_set_ports(AgsPlugin *plugin, GList *port)
+{
+  while(port != NULL){
+    if(!strncmp(AGS_PORT(port-&amp;gt;data)-&amp;gt;specifier,
+                "./delay[0]\0",
+                10)){
+      g_object_set(G_OBJECT(plugin),
+                   "delay\0", AGS_PORT(port-&amp;gt;data),
+                   NULL);
+    }else if(!strncmp(AGS_PORT(port-&amp;gt;data)-&amp;gt;specifier,
+                      "./repeat[0]\0",
+                      11)){
+      g_object_set(G_OBJECT(plugin),
+                   "repeat\0", AGS_PORT(port-&amp;gt;data),
+                   NULL);
+    }else if(!strncmp(AGS_PORT(port-&amp;gt;data)-&amp;gt;specifier,
+                      "./fade[0]\0",
+                      9)){
+      g_object_set(G_OBJECT(plugin),
+                   "fade\0", AGS_PORT(port-&amp;gt;data),
+                   NULL);
+    }else if(!strncmp(AGS_PORT(port-&amp;gt;data)-&amp;gt;specifier,
+                      "./dry[0]\0",
+                      8)){
+      g_object_set(G_OBJECT(plugin),
+                   "dry\0", AGS_PORT(port-&amp;gt;data),
+                   NULL);
+    }
+
+    port = port-&amp;gt;next;
+  }
+}
+~~~~~~
+
+Wow that's all.
&lt;/pre&gt;
&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Joel Krähemann</dc:creator><pubDate>Sun, 30 Nov 2014 02:43:07 -0000</pubDate><guid>https://sourceforge.net659e1c730e1c3b54cdfaa61ffd97d9b008a78591</guid></item><item><title>plugin modified by Joel Krähemann</title><link>https://sourceforge.net/p/ags/wiki/plugin/</link><description>&lt;div class="markdown_content"&gt;&lt;pre&gt;--- v2
+++ v3
@@ -1,4 +1,4 @@
 Plugin interface to do abstraction
 ==================
-The AgsPlugin interface defines some elementary functions like get_name() or set_name() and therefor get_version(), set_version(), get_build_id() and set_build_id(). Further it contains functions used to persist it using XML. This would be get_xml_type(), set_xml_type(), read() and write(). And get_ports() and set_ports() to allow thread safe communication between the different layers of Advanced Gtk+ Sequencer.
+The AgsPlugin interface defines some elementary functions like &lt;i&gt;get_name()&lt;/i&gt; or &lt;i&gt;set_name()&lt;/i&gt; and therefor &lt;i&gt;get_version()&lt;/i&gt;, &lt;i&gt;set_version()&lt;/i&gt;, &lt;i&gt;get_build_id()&lt;/i&gt; and &lt;i&gt;set_build_id()&lt;/i&gt;. Further it contains functions used to persist it using XML. This would be &lt;i&gt;get_xml_type()&lt;/i&gt;, &lt;i&gt;set_xml_type()&lt;/i&gt;, &lt;i&gt;read()&lt;/i&gt; and &lt;i&gt;write()&lt;/i&gt;. And &lt;i&gt;get_ports()&lt;/i&gt; and &lt;i&gt;set_ports()&lt;/i&gt; to allow thread safe communication between the different layers of Advanced Gtk+ Sequencer.

&lt;/pre&gt;
&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Joel Krähemann</dc:creator><pubDate>Sun, 30 Nov 2014 02:21:27 -0000</pubDate><guid>https://sourceforge.net5dceb8ee68a7a51ed71e99a403651831760f1778</guid></item><item><title>plugin modified by Joel Krähemann</title><link>https://sourceforge.net/p/ags/wiki/plugin/</link><description>&lt;div class="markdown_content"&gt;&lt;pre&gt;--- v1
+++ v2
@@ -1,3 +1,4 @@
 Plugin interface to do abstraction
 ==================
+The AgsPlugin interface defines some elementary functions like get_name() or set_name() and therefor get_version(), set_version(), get_build_id() and set_build_id(). Further it contains functions used to persist it using XML. This would be get_xml_type(), set_xml_type(), read() and write(). And get_ports() and set_ports() to allow thread safe communication between the different layers of Advanced Gtk+ Sequencer.

&lt;/pre&gt;
&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Joel Krähemann</dc:creator><pubDate>Sun, 30 Nov 2014 02:19:50 -0000</pubDate><guid>https://sourceforge.netd6e631315820d1416f256a73d6efc8d15207cd0a</guid></item><item><title>plugin modified by Joel Krähemann</title><link>https://sourceforge.net/p/ags/wiki/plugin/</link><description>&lt;div class="markdown_content"&gt;&lt;h1 id="plugin-interface-to-do-abstraction"&gt;Plugin interface to do abstraction&lt;/h1&gt;&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Joel Krähemann</dc:creator><pubDate>Sun, 30 Nov 2014 02:14:00 -0000</pubDate><guid>https://sourceforge.net43a2d48626989df25452e5ce8f0adfb704a770c7</guid></item></channel></rss>