summaryrefslogtreecommitdiff
path: root/ext/soundtouch
diff options
context:
space:
mode:
authorWouter Paesen <wouter@kangaroot.net>2006-06-14 18:07:51 +0000
committerTim-Philipp Müller <tim@centricular.net>2006-06-14 18:07:51 +0000
commit34f03fe525ac9c9e646ac77b9b0b655bd46d433b (patch)
tree9fc3d837bc70e7ffc468e796146c5620499e53e9 /ext/soundtouch
parentbed0b905a19551aa9cfec0dcfd1f744c1576c5a1 (diff)
ext/soundtouch/: Make pitch element controllable via GstController interface (#344821).
Original commit message from CVS: Patch by: Wouter Paesen <wouter at kangaroot net> * 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!).
Diffstat (limited to 'ext/soundtouch')
-rw-r--r--ext/soundtouch/Makefile.am6
-rw-r--r--ext/soundtouch/gstpitch.cc11
2 files changed, 11 insertions, 6 deletions
diff --git a/ext/soundtouch/Makefile.am b/ext/soundtouch/Makefile.am
index d286bfce6..e7523bfbb 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 c0040865d..8b09c2c4a 100644
--- a/ext/soundtouch/gstpitch.cc
+++ b/ext/soundtouch/gstpitch.cc
@@ -22,6 +22,7 @@
#endif
#include <gst/gst.h>
+#include <gst/controller/gstcontroller.h>
#include "gstpitch.hh"
#include <math.h>
@@ -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");