From 34f03fe525ac9c9e646ac77b9b0b655bd46d433b Mon Sep 17 00:00:00 2001 From: Wouter Paesen Date: Wed, 14 Jun 2006 18:07:51 +0000 Subject: ext/soundtouch/: Make pitch element controllable via GstController interface (#344821). Original commit message from CVS: Patch by: Wouter Paesen * ext/soundtouch/Makefile.am: * ext/soundtouch/gstpitch.cc: Make pitch element controllable via GstController interface (#344821). * configure.ac: Up core requirements to 0.10.8.1/CVS because earlier GstControllers can't handle float properties correctly. Check for GstController CFLAGS and LIBS. * tests/icles/Makefile.am: * tests/icles/pitch-test.c: (main): Add small test program for the above (welcome to the 80s!). --- ext/soundtouch/Makefile.am | 6 +++--- ext/soundtouch/gstpitch.cc | 11 ++++++++--- 2 files changed, 11 insertions(+), 6 deletions(-) (limited to 'ext/soundtouch') diff --git a/ext/soundtouch/Makefile.am b/ext/soundtouch/Makefile.am index d286bfce..e7523bfb 100644 --- a/ext/soundtouch/Makefile.am +++ b/ext/soundtouch/Makefile.am @@ -2,8 +2,8 @@ plugin_LTLIBRARIES = libgstpitch.la libgstpitch_la_SOURCES = gstpitch.cc -libgstpitch_la_CXXFLAGS = @GST_CFLAGS@ @GST_BASE_CFLAGS@ @SOUNDTOUCH_CFLAGS@ -libgstpitch_la_LIBADD = @GST_LIBS@ @GST_BASE_LIBS@ @SOUNDTOUCH_LIBS@ -libgstpitch_la_LDFLAGS = @GST_PLUGIN_LDFLAGS@ +libgstpitch_la_CXXFLAGS = $(GST_CFLAGS) $(GST_BASE_CFLAGS) $(SOUNDTOUCH_CFLAGS) $(GST_CONTROLLER_CFLAGS) +libgstpitch_la_LIBADD = $(GST_LIBS) $(GST_BASE_LIBS) $(SOUNDTOUCH_LIBS) $(GST_CONTROLLER_LIBS) +libgstpitch_la_LDFLAGS = $(GST_PLUGIN_LDFLAGS) noinst_HEADERS = gstpitch.hh diff --git a/ext/soundtouch/gstpitch.cc b/ext/soundtouch/gstpitch.cc index c0040865..8b09c2c4 100644 --- a/ext/soundtouch/gstpitch.cc +++ b/ext/soundtouch/gstpitch.cc @@ -22,6 +22,7 @@ #endif #include +#include #include "gstpitch.hh" #include @@ -136,17 +137,17 @@ gst_pitch_class_init (GstPitchClass * klass) g_object_class_install_property (gobject_class, ARG_PITCH, g_param_spec_float ("pitch", "Pitch", "Audio stream pitch", 0.1, 10.0, 1.0, - (GParamFlags) G_PARAM_READWRITE)); + (GParamFlags) (G_PARAM_READWRITE | GST_PARAM_CONTROLLABLE))); g_object_class_install_property (gobject_class, ARG_TEMPO, g_param_spec_float ("tempo", "Tempo", "Audio stream tempo", 0.1, 10.0, 1.0, - (GParamFlags) G_PARAM_READWRITE)); + (GParamFlags) (G_PARAM_READWRITE | GST_PARAM_CONTROLLABLE))); g_object_class_install_property (gobject_class, ARG_RATE, g_param_spec_float ("rate", "Rate", "Audio stream rate", 0.1, 10.0, 1.0, - (GParamFlags) G_PARAM_READWRITE)); + (GParamFlags) (G_PARAM_READWRITE | GST_PARAM_CONTROLLABLE))); g_type_class_add_private (gobject_class, sizeof (GstPitchPrivate)); } @@ -640,6 +641,8 @@ gst_pitch_chain (GstPad * pad, GstBuffer * buffer) pitch = GST_PITCH (GST_PAD_PARENT (pad)); priv = GST_PITCH_GET_PRIVATE (pitch); + gst_object_sync_values (G_OBJECT (pitch), pitch->next_buffer_time); + /* push the received samples on the soundtouch buffer */ GST_LOG_OBJECT (pitch, "incoming buffer (%d samples)", (gint) (GST_BUFFER_SIZE (buffer) / pitch->sample_size)); @@ -696,6 +699,8 @@ gst_pitch_change_state (GstElement * element, GstStateChange transition) static gboolean plugin_init (GstPlugin * plugin) { + gst_controller_init (NULL, NULL); + GST_DEBUG_CATEGORY_INIT (pitch_debug, "pitch", 0, "audio pitch control element"); -- cgit v1.2.1