Found at: http://www.kinodv.org/article/print/33/-1/12/ |
Kino Plugin HowTo |
This document provides a brief HOWTO create new plug-ins to the Kino Magick sub-system.
AM_DISABLE_STATIC AC_PROG_CXX AM_PROG_LIBTOOL |
KINO_INCLUDE = $(prefix)/include/kino libdir = $(prefix)/lib/kino |
INCLUDES = \ $(GNOME_INCLUDEDIR) \ -I$(KINO_INCLUDE) |
lib_LTLIBRARIES = libmykinoplugin.la
libmykinoplugin_la_SOURCES = \
support.c support.h \
interface.c interface.h \
callbacks.c callbacks.h \
mykinoplugin.cc {+ any additional defined}
libmykinoplugin_la_LIBADD = $(GNOME_LIBDIR) $(GNOMEUI_LIBS)
|
#include <image_create.h> |
class MyPlugin : public GDKImageCreate
{
public:
char *GetDescription( ) const;
void CreateFrame( uint8_t *pixels, int width, int height,
double position, double delta_frame );
int GetNumberOfFrames( );
void AttachWidgets( GtkBin *bin );
void DetachWidgets( GtkBin *bin );
void InterpretWidgets( GtkBin *bin );
}
|
#include <image_filters.h> |
class MyPlugin : public GDKImageFilter
{
public:
char *GetDescription( ) const;
void FilterFrame( uint8_t *pixels, int width, int height,
double position, double delta_frame );
void AttachWidgets( GtkBin *bin );
void DetachWidgets( GtkBin *bin );
void InterpretWidgets( GtkBin *bin );
}
|
#include <image_transitions.h> |
class MyPlugin : public GDKImageTransition
{
public:
char *GetDescription( ) const;
void GetFrame( uint8_t *aframe, uint8_t *bframe, int width, int height,
double position, double delta_frame, bool reverse );
void AttachWidgets( GtkBin *bin );
void DetachWidgets( GtkBin *bin );
void InterpretWidgets( GtkBin *bin );
}
|
#include <audio_filters.h> |
class MyPlugin : public GDKAudioFilter
{
public:
char *GetDescription( ) const;
void GetFrame( int16_t **io, int frequency,
int channels, int samples, double position, double delta_frame );
void AttachWidgets( GtkBin *bin );
void DetachWidgets( GtkBin *bin );
void InterpretWidgets( GtkBin *bin );
}
|
#include <audio_transitions.h> |
class MyPlugin : public GDKAudioTransition
{
public:
char *GetDescription( ) const;
void GetFrame( int16_t **aframe, int16_t **bframe, int frequency,
int channels, int samples, double position, double delta_frame );
void AttachWidgets( GtkBin *bin );
void DetachWidgets( GtkBin *bin );
void InterpretWidgets( GtkBin *bin );
}
|
class Whatever : public GDK...
{
private:
GtkWidget *window;
... any vars used to hold ui obtained values ...
public:
Whatever()
{
window = create_window_mykinoplugin();
}
virtual ~Whatever()
{
gtk_widget_destroy( window );
}
.... image/audio manipulation as above...
void AttachWidgets( GtkBin *bin )
{
gtk_widget_reparent( ( GTK_BIN( window ) )->child, GTK_WIDGET( bin ) );
}
void DetachWidgets( GtkBin *bin )
{
gtk_widget_reparent( ( GTK_BIN( bin ) )->child, GTK_WIDGET( window ) );
}
void InterpretWidgets( GtkBin *bin )
{
... whatever you need to do ....
}
}
|
extern "C" {
GDKImageFilter *GetImageFilter( int index )
{
switch( index )
{
case 0: return new Whatever();
}
return NULL;
}
}
|
./autogen.sh ./configure |
make |
make install |
make distclean cd .. tar cvf mykinoplugin.tar mykinoplugin gzip -9 mykinoplugin.tar |