From 8c1f324c555aa79ef196b2621f0dfa3cbe46d136 Mon Sep 17 00:00:00 2001 From: Christian Thaeter Date: Sat, 18 Aug 2007 05:05:58 +0200 Subject: [PATCH] fixed example for plugins --- tests/examples/example_plugin.c | 8 ++++---- tests/examples/plugin_main.c | 21 +++++++++++++-------- 2 files changed, 17 insertions(+), 12 deletions(-) diff --git a/tests/examples/example_plugin.c b/tests/examples/example_plugin.c index 2f4e96a6c..5cd035bf2 100644 --- a/tests/examples/example_plugin.c +++ b/tests/examples/example_plugin.c @@ -35,11 +35,11 @@ void bye(const char* m) } CINELERRA_INTERFACE_IMPLEMENT(hello, 1, german, myopen, myclose, - //CINELERRA_INTERFACE_FUNC(hello, hallo), - //CINELERRA_INTERFACE_FUNC(goodbye, tschuess) + hallo, + tschuess ); CINELERRA_INTERFACE_IMPLEMENT(hello, 1, english, myopen, myclose, - //CINELERRA_INTERFACE_FUNC(hello, hello), - //CINELERRA_INTERFACE_FUNC(goodbye, bye) + hello, + bye ); diff --git a/tests/examples/plugin_main.c b/tests/examples/plugin_main.c index d48838900..70180dffa 100644 --- a/tests/examples/plugin_main.c +++ b/tests/examples/plugin_main.c @@ -8,6 +8,9 @@ int main(int argc, char** argv) { NOBUG_INIT; + + cinelerra_init_plugin (); + /* we have a plugin 'hello_1' which provides us 2 hello interfaces, one for english and one for german output, open both try them, close them. @@ -15,20 +18,22 @@ main(int argc, char** argv) TODO("macros, doing casting and typing"); - CINELERRA_INTERFACE_TYPE(hello, 1)* hello_de = (CINELERRA_INTERFACE_TYPE(hello, 1)*) - cinelerra_interface_open ("hello_1", "german_1", sizeof(CINELERRA_INTERFACE_TYPE(hello, 1))); - TODO("new error handling, when finished if (!hello_de) CINELERRA_DIE"); + CINELERRA_INTERFACE_TYPE(hello, 1)* hello_de = + (CINELERRA_INTERFACE_TYPE(hello, 1)*) cinelerra_interface_open ("example_plugin", "german_1", sizeof(CINELERRA_INTERFACE_TYPE(hello, 1))); + + if (!hello_de) CINELERRA_DIE("loading plugin failed"); hello_de->hello(); - // struct hello_interface_1* hello_en = - // cinelerra_interface_open ("hello_1", "english_1", sizeof(struct hello_interface_1)); - // TODO if (!hello_en) CINELERRA_DIE; + CINELERRA_INTERFACE_TYPE(hello, 1)* hello_en = + (CINELERRA_INTERFACE_TYPE(hello, 1)*) cinelerra_interface_open ("example_plugin", "english_1", sizeof(CINELERRA_INTERFACE_TYPE(hello, 1))); - //hello_en->hello(); + if (!hello_en) CINELERRA_DIE("loading plugin failed"); - //cinelerra_interface_close (hello_en); + hello_en->hello(); + + cinelerra_interface_close (hello_en); cinelerra_interface_close (hello_de); #if 0