summaryrefslogtreecommitdiffstats
path: root/ext/smoothwave
diff options
context:
space:
mode:
authorAndy Wingo <wingo@pobox.com>2002-01-04 21:53:21 +0000
committerAndy Wingo <wingo@pobox.com>2002-01-04 21:53:21 +0000
commitd16d24c9b227ea2ccb7d90070b2b4587efcaabab (patch)
tree5f06a9f794383ee7033d391954c8830816ff6c54 /ext/smoothwave
parent684fe6b617b1dbd5ca3c5ba5392e4542d124c86a (diff)
downloadgst-plugins-bad-d16d24c9b227ea2ccb7d90070b2b4587efcaabab.tar.gz
gst-plugins-bad-d16d24c9b227ea2ccb7d90070b2b4587efcaabab.tar.bz2
gst-plugins-bad-d16d24c9b227ea2ccb7d90070b2b4587efcaabab.zip
wave.c -> demo-osssrc.c this is probably broken, but then so is smoothwave
Original commit message from CVS: wave.c -> demo-osssrc.c this is probably broken, but then so is smoothwave
Diffstat (limited to 'ext/smoothwave')
-rw-r--r--ext/smoothwave/Makefile.am8
-rw-r--r--ext/smoothwave/demo-osssrc.c61
2 files changed, 69 insertions, 0 deletions
diff --git a/ext/smoothwave/Makefile.am b/ext/smoothwave/Makefile.am
index f000c7a4..e46a9572 100644
--- a/ext/smoothwave/Makefile.am
+++ b/ext/smoothwave/Makefile.am
@@ -8,4 +8,12 @@ libgstsmoothwave_la_LIBADD = $(GTK_LIBS)
noinst_HEADERS = gstsmoothwave.h
+if HAVE_GTK
+noinst_PROGRAMS = demo-osssrc
+endif
+
+demo_osssrc_SOURCES = demo-osssrc.c
+demo_osssrc_CFLAGS = $(GST_CFLAGS) $(GTK_CFLAGS)
+demo_osssrc_LDFLAGS = $(GST_LIBS) $(GTK_LIBS)
+
EXTRA_DIST = README
diff --git a/ext/smoothwave/demo-osssrc.c b/ext/smoothwave/demo-osssrc.c
new file mode 100644
index 00000000..6f5ee57a
--- /dev/null
+++ b/ext/smoothwave/demo-osssrc.c
@@ -0,0 +1,61 @@
+#include <gnome.h>
+#include <gst/gst.h>
+
+extern gboolean _gst_plugin_spew;
+
+gboolean idle_func(gpointer data);
+
+GtkWidget *drawingarea;
+
+int main(int argc,char *argv[]) {
+ GstElement *bin;
+ GstElementFactory *srcfactory;
+ GstElement *src;
+ GstElementFactory *wavefactory;
+ GstElement *wave;
+
+ GtkWidget *appwindow;
+
+ _gst_plugin_spew = TRUE;
+
+ gst_init(&argc,&argv);
+ gst_plugin_load("libsmoothwave.so");
+ gnome_init("Wave","0.0.1",argc,argv);
+
+ bin = gst_bin_new("bin");
+
+ srcfactory = gst_elementfactory_find("audiosrc");
+ g_return_val_if_fail(srcfactory != NULL, -1);
+ wavefactory = gst_elementfactory_find("smoothwave");
+ g_return_val_if_fail(wavefactory != NULL, -1);
+
+ src = gst_elementfactory_create(srcfactory,"src");
+ gtk_object_set(GTK_OBJECT(src),"bytes_per_read",(gulong)2048,NULL);
+ wave = gst_elementfactory_create(wavefactory,"wave");
+ gtk_object_set(GTK_OBJECT(wave),"width",256,"height",100,NULL);
+
+
+ gst_bin_add(GST_BIN(bin),GST_ELEMENT(src));
+ gst_bin_add(GST_BIN(bin),GST_ELEMENT(wave));
+
+ gst_pad_connect(gst_element_get_pad(src,"src"),
+ gst_element_get_pad(wave,"sink"));
+
+ appwindow = gnome_app_new("wave","Wave");
+ gnome_app_set_contents(GNOME_APP(appwindow),gst_util_get_pointer_arg(GTK_OBJECT(wave),"widget"));
+ gtk_widget_show_all(appwindow);
+
+ gst_element_set_state(GST_ELEMENT(bin),GST_STATE_READY);
+ gst_element_set_state(GST_ELEMENT(bin),GST_STATE_PLAYING);
+
+ g_idle_add(idle_func,bin);
+
+ gtk_main();
+
+ return 0;
+}
+
+gboolean idle_func(gpointer data) {
+ gst_bin_iterate(GST_BIN(data));
+ return TRUE;
+}