From bd218fb7cab0b7e06fc68c346e576139000276a4 Mon Sep 17 00:00:00 2001 From: Christian Thaeter Date: Tue, 17 Jul 2007 20:42:07 +0200 Subject: [PATCH] example code showing plugin usage --- tests/examples/DIR_INFO | 3 +++ tests/examples/plugin_main.c | 28 ++++++++++++++++++++++++++++ 2 files changed, 31 insertions(+) create mode 100644 tests/examples/DIR_INFO create mode 100644 tests/examples/plugin_main.c diff --git a/tests/examples/DIR_INFO b/tests/examples/DIR_INFO new file mode 100644 index 000000000..2c5e28d26 --- /dev/null +++ b/tests/examples/DIR_INFO @@ -0,0 +1,3 @@ +working example code +This directory contains example code which shows how to use specific features. +All examples will be build and run as part of the testsuite diff --git a/tests/examples/plugin_main.c b/tests/examples/plugin_main.c new file mode 100644 index 000000000..b50e74cbc --- /dev/null +++ b/tests/examples/plugin_main.c @@ -0,0 +1,28 @@ + + +#include "plugin.h" +#include "hello_interface.h" + + +int +main(int argc, char** argv) +{ + /* + 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. + */ + + struct hello_interface_1* hello_de = + cinelerra_interface_open ("hello_1", "german_1", sizeof(struct hello_interface_1)); + if (!hello) CINELERRA_DIE; + + struct hello_interface_1* hello_en = + cinelerra_interface_open ("hello_1", "english_1", sizeof(struct hello_interface_1)); + if (!hello) CINELERRA_DIE; + + hello_de->say_hello(); + hello_en->say_hello(); + + cinelerra_interface_close (hello_en); + cinelerra_interface_close (hello_de); +}