libs/gst/controller/: API: Add GstLFOControlSource, a control source that gives values for specific timestamps based ...
Original commit message from CVS:
reviewed by: Stefan Kost <ensonic@users.sf.net>
* libs/gst/controller/Makefile.am:
* libs/gst/controller/gstlfocontrolsource.c: (_calculate_pos),
(gst_lfo_waveform_get_type), (gst_lfo_control_source_reset),
(gst_lfo_control_source_new),
(gst_lfo_control_source_set_waveform),
(gst_lfo_control_source_bind), (gst_lfo_control_source_init),
(gst_lfo_control_source_finalize),
(gst_lfo_control_source_dispose),
(gst_lfo_control_source_set_property),
(gst_lfo_control_source_get_property),
(gst_lfo_control_source_class_init):
* libs/gst/controller/gstlfocontrolsource.h:
* libs/gst/controller/gstlfocontrolsourceprivate.h:
API: Add GstLFOControlSource, a control source that gives values
for specific timestamps based on several periodic waveforms.
Fixes #459717.
* tests/check/libs/controller.c: (GST_START_TEST),
(gst_controller_suite):
* docs/libs/gstreamer-libs-docs.sgml:
* docs/libs/gstreamer-libs-sections.txt:
* docs/libs/gstreamer-libs.types:
Add documentation and unit tests for GstLFOControlSource.
2007-08-03 15:47:17 +00:00
|
|
|
/* GStreamer
|
|
|
|
*
|
2010-02-22 15:25:45 +00:00
|
|
|
* Copyright (C) 2007,2010 Sebastian Dröge <sebastian.droege@collabora.co.uk>
|
libs/gst/controller/: API: Add GstLFOControlSource, a control source that gives values for specific timestamps based ...
Original commit message from CVS:
reviewed by: Stefan Kost <ensonic@users.sf.net>
* libs/gst/controller/Makefile.am:
* libs/gst/controller/gstlfocontrolsource.c: (_calculate_pos),
(gst_lfo_waveform_get_type), (gst_lfo_control_source_reset),
(gst_lfo_control_source_new),
(gst_lfo_control_source_set_waveform),
(gst_lfo_control_source_bind), (gst_lfo_control_source_init),
(gst_lfo_control_source_finalize),
(gst_lfo_control_source_dispose),
(gst_lfo_control_source_set_property),
(gst_lfo_control_source_get_property),
(gst_lfo_control_source_class_init):
* libs/gst/controller/gstlfocontrolsource.h:
* libs/gst/controller/gstlfocontrolsourceprivate.h:
API: Add GstLFOControlSource, a control source that gives values
for specific timestamps based on several periodic waveforms.
Fixes #459717.
* tests/check/libs/controller.c: (GST_START_TEST),
(gst_controller_suite):
* docs/libs/gstreamer-libs-docs.sgml:
* docs/libs/gstreamer-libs-sections.txt:
* docs/libs/gstreamer-libs.types:
Add documentation and unit tests for GstLFOControlSource.
2007-08-03 15:47:17 +00:00
|
|
|
*
|
|
|
|
* gstlfocontrolsource.c: Control source that provides some periodic waveforms
|
|
|
|
* as control values.
|
|
|
|
*
|
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Library General Public
|
|
|
|
* License as published by the Free Software Foundation; either
|
|
|
|
* version 2 of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This library is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* Library General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Library General Public
|
|
|
|
* License along with this library; if not, write to the
|
|
|
|
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
|
|
|
* Boston, MA 02111-1307, USA.
|
|
|
|
*/
|
|
|
|
|
|
|
|
/**
|
|
|
|
* SECTION:gstlfocontrolsource
|
|
|
|
* @short_description: LFO control source
|
|
|
|
*
|
|
|
|
* #GstLFOControlSource is a #GstControlSource, that provides several periodic waveforms
|
|
|
|
* as control values. It supports all fundamental, numeric GValue types as property.
|
|
|
|
*
|
|
|
|
* To use #GstLFOControlSource get a new instance by calling gst_lfo_control_source_new(),
|
|
|
|
* bind it to a #GParamSpec and set the relevant properties or use
|
|
|
|
* gst_lfo_control_source_set_waveform.
|
|
|
|
*
|
|
|
|
* All functions are MT-safe.
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <glib-object.h>
|
|
|
|
#include <gst/gst.h>
|
2011-11-04 10:34:11 +00:00
|
|
|
#include <gst/gstcontrolsource.h>
|
libs/gst/controller/: API: Add GstLFOControlSource, a control source that gives values for specific timestamps based ...
Original commit message from CVS:
reviewed by: Stefan Kost <ensonic@users.sf.net>
* libs/gst/controller/Makefile.am:
* libs/gst/controller/gstlfocontrolsource.c: (_calculate_pos),
(gst_lfo_waveform_get_type), (gst_lfo_control_source_reset),
(gst_lfo_control_source_new),
(gst_lfo_control_source_set_waveform),
(gst_lfo_control_source_bind), (gst_lfo_control_source_init),
(gst_lfo_control_source_finalize),
(gst_lfo_control_source_dispose),
(gst_lfo_control_source_set_property),
(gst_lfo_control_source_get_property),
(gst_lfo_control_source_class_init):
* libs/gst/controller/gstlfocontrolsource.h:
* libs/gst/controller/gstlfocontrolsourceprivate.h:
API: Add GstLFOControlSource, a control source that gives values
for specific timestamps based on several periodic waveforms.
Fixes #459717.
* tests/check/libs/controller.c: (GST_START_TEST),
(gst_controller_suite):
* docs/libs/gstreamer-libs-docs.sgml:
* docs/libs/gstreamer-libs-sections.txt:
* docs/libs/gstreamer-libs.types:
Add documentation and unit tests for GstLFOControlSource.
2007-08-03 15:47:17 +00:00
|
|
|
|
|
|
|
#include "gstlfocontrolsource.h"
|
|
|
|
#include "gstlfocontrolsourceprivate.h"
|
|
|
|
|
2011-12-04 13:35:38 +00:00
|
|
|
#include "gst/glib-compat-private.h"
|
|
|
|
|
2010-10-05 14:05:43 +00:00
|
|
|
#include <gst/math-compat.h>
|
libs/gst/controller/: API: Add GstLFOControlSource, a control source that gives values for specific timestamps based ...
Original commit message from CVS:
reviewed by: Stefan Kost <ensonic@users.sf.net>
* libs/gst/controller/Makefile.am:
* libs/gst/controller/gstlfocontrolsource.c: (_calculate_pos),
(gst_lfo_waveform_get_type), (gst_lfo_control_source_reset),
(gst_lfo_control_source_new),
(gst_lfo_control_source_set_waveform),
(gst_lfo_control_source_bind), (gst_lfo_control_source_init),
(gst_lfo_control_source_finalize),
(gst_lfo_control_source_dispose),
(gst_lfo_control_source_set_property),
(gst_lfo_control_source_get_property),
(gst_lfo_control_source_class_init):
* libs/gst/controller/gstlfocontrolsource.h:
* libs/gst/controller/gstlfocontrolsourceprivate.h:
API: Add GstLFOControlSource, a control source that gives values
for specific timestamps based on several periodic waveforms.
Fixes #459717.
* tests/check/libs/controller.c: (GST_START_TEST),
(gst_controller_suite):
* docs/libs/gstreamer-libs-docs.sgml:
* docs/libs/gstreamer-libs-sections.txt:
* docs/libs/gstreamer-libs.types:
Add documentation and unit tests for GstLFOControlSource.
2007-08-03 15:47:17 +00:00
|
|
|
|
2011-11-04 10:34:11 +00:00
|
|
|
#define GST_CAT_DEFAULT controller_debug
|
|
|
|
GST_DEBUG_CATEGORY_STATIC (GST_CAT_DEFAULT);
|
|
|
|
|
|
|
|
|
2007-09-13 09:08:23 +00:00
|
|
|
#define EMPTY(x) (x)
|
|
|
|
|
libs/gst/controller/: API: Add GstLFOControlSource, a control source that gives values for specific timestamps based ...
Original commit message from CVS:
reviewed by: Stefan Kost <ensonic@users.sf.net>
* libs/gst/controller/Makefile.am:
* libs/gst/controller/gstlfocontrolsource.c: (_calculate_pos),
(gst_lfo_waveform_get_type), (gst_lfo_control_source_reset),
(gst_lfo_control_source_new),
(gst_lfo_control_source_set_waveform),
(gst_lfo_control_source_bind), (gst_lfo_control_source_init),
(gst_lfo_control_source_finalize),
(gst_lfo_control_source_dispose),
(gst_lfo_control_source_set_property),
(gst_lfo_control_source_get_property),
(gst_lfo_control_source_class_init):
* libs/gst/controller/gstlfocontrolsource.h:
* libs/gst/controller/gstlfocontrolsourceprivate.h:
API: Add GstLFOControlSource, a control source that gives values
for specific timestamps based on several periodic waveforms.
Fixes #459717.
* tests/check/libs/controller.c: (GST_START_TEST),
(gst_controller_suite):
* docs/libs/gstreamer-libs-docs.sgml:
* docs/libs/gstreamer-libs-sections.txt:
* docs/libs/gstreamer-libs.types:
Add documentation and unit tests for GstLFOControlSource.
2007-08-03 15:47:17 +00:00
|
|
|
/* FIXME: as % in C is not the modulo operator we need here for
|
|
|
|
* negative numbers implement our own. Are there better ways? */
|
|
|
|
static inline GstClockTime
|
|
|
|
_calculate_pos (GstClockTime timestamp, GstClockTime timeshift,
|
|
|
|
GstClockTime period)
|
|
|
|
{
|
|
|
|
while (timestamp < timeshift)
|
|
|
|
timestamp += period;
|
|
|
|
|
|
|
|
timestamp -= timeshift;
|
|
|
|
|
|
|
|
return timestamp % period;
|
|
|
|
}
|
|
|
|
|
2007-09-13 09:08:23 +00:00
|
|
|
#define DEFINE_SINE(type,round,convert) \
|
libs/gst/controller/: API: Add GstLFOControlSource, a control source that gives values for specific timestamps based ...
Original commit message from CVS:
reviewed by: Stefan Kost <ensonic@users.sf.net>
* libs/gst/controller/Makefile.am:
* libs/gst/controller/gstlfocontrolsource.c: (_calculate_pos),
(gst_lfo_waveform_get_type), (gst_lfo_control_source_reset),
(gst_lfo_control_source_new),
(gst_lfo_control_source_set_waveform),
(gst_lfo_control_source_bind), (gst_lfo_control_source_init),
(gst_lfo_control_source_finalize),
(gst_lfo_control_source_dispose),
(gst_lfo_control_source_set_property),
(gst_lfo_control_source_get_property),
(gst_lfo_control_source_class_init):
* libs/gst/controller/gstlfocontrolsource.h:
* libs/gst/controller/gstlfocontrolsourceprivate.h:
API: Add GstLFOControlSource, a control source that gives values
for specific timestamps based on several periodic waveforms.
Fixes #459717.
* tests/check/libs/controller.c: (GST_START_TEST),
(gst_controller_suite):
* docs/libs/gstreamer-libs-docs.sgml:
* docs/libs/gstreamer-libs-sections.txt:
* docs/libs/gstreamer-libs.types:
Add documentation and unit tests for GstLFOControlSource.
2007-08-03 15:47:17 +00:00
|
|
|
static inline g##type \
|
2010-02-22 15:25:45 +00:00
|
|
|
_sine_get_##type (GstLFOControlSource *self, g##type max, g##type min, gdouble amp, gdouble off, GstClockTime timeshift, GstClockTime period, gdouble frequency, GstClockTime timestamp) \
|
libs/gst/controller/: API: Add GstLFOControlSource, a control source that gives values for specific timestamps based ...
Original commit message from CVS:
reviewed by: Stefan Kost <ensonic@users.sf.net>
* libs/gst/controller/Makefile.am:
* libs/gst/controller/gstlfocontrolsource.c: (_calculate_pos),
(gst_lfo_waveform_get_type), (gst_lfo_control_source_reset),
(gst_lfo_control_source_new),
(gst_lfo_control_source_set_waveform),
(gst_lfo_control_source_bind), (gst_lfo_control_source_init),
(gst_lfo_control_source_finalize),
(gst_lfo_control_source_dispose),
(gst_lfo_control_source_set_property),
(gst_lfo_control_source_get_property),
(gst_lfo_control_source_class_init):
* libs/gst/controller/gstlfocontrolsource.h:
* libs/gst/controller/gstlfocontrolsourceprivate.h:
API: Add GstLFOControlSource, a control source that gives values
for specific timestamps based on several periodic waveforms.
Fixes #459717.
* tests/check/libs/controller.c: (GST_START_TEST),
(gst_controller_suite):
* docs/libs/gstreamer-libs-docs.sgml:
* docs/libs/gstreamer-libs-sections.txt:
* docs/libs/gstreamer-libs.types:
Add documentation and unit tests for GstLFOControlSource.
2007-08-03 15:47:17 +00:00
|
|
|
{ \
|
|
|
|
gdouble ret; \
|
2010-02-22 15:25:45 +00:00
|
|
|
GstClockTime pos = _calculate_pos (timestamp, timeshift, period); \
|
libs/gst/controller/: API: Add GstLFOControlSource, a control source that gives values for specific timestamps based ...
Original commit message from CVS:
reviewed by: Stefan Kost <ensonic@users.sf.net>
* libs/gst/controller/Makefile.am:
* libs/gst/controller/gstlfocontrolsource.c: (_calculate_pos),
(gst_lfo_waveform_get_type), (gst_lfo_control_source_reset),
(gst_lfo_control_source_new),
(gst_lfo_control_source_set_waveform),
(gst_lfo_control_source_bind), (gst_lfo_control_source_init),
(gst_lfo_control_source_finalize),
(gst_lfo_control_source_dispose),
(gst_lfo_control_source_set_property),
(gst_lfo_control_source_get_property),
(gst_lfo_control_source_class_init):
* libs/gst/controller/gstlfocontrolsource.h:
* libs/gst/controller/gstlfocontrolsourceprivate.h:
API: Add GstLFOControlSource, a control source that gives values
for specific timestamps based on several periodic waveforms.
Fixes #459717.
* tests/check/libs/controller.c: (GST_START_TEST),
(gst_controller_suite):
* docs/libs/gstreamer-libs-docs.sgml:
* docs/libs/gstreamer-libs-sections.txt:
* docs/libs/gstreamer-libs.types:
Add documentation and unit tests for GstLFOControlSource.
2007-08-03 15:47:17 +00:00
|
|
|
\
|
2010-02-22 15:25:45 +00:00
|
|
|
ret = sin (2.0 * M_PI * (frequency / GST_SECOND) * gst_guint64_to_gdouble (pos)); \
|
libs/gst/controller/: API: Add GstLFOControlSource, a control source that gives values for specific timestamps based ...
Original commit message from CVS:
reviewed by: Stefan Kost <ensonic@users.sf.net>
* libs/gst/controller/Makefile.am:
* libs/gst/controller/gstlfocontrolsource.c: (_calculate_pos),
(gst_lfo_waveform_get_type), (gst_lfo_control_source_reset),
(gst_lfo_control_source_new),
(gst_lfo_control_source_set_waveform),
(gst_lfo_control_source_bind), (gst_lfo_control_source_init),
(gst_lfo_control_source_finalize),
(gst_lfo_control_source_dispose),
(gst_lfo_control_source_set_property),
(gst_lfo_control_source_get_property),
(gst_lfo_control_source_class_init):
* libs/gst/controller/gstlfocontrolsource.h:
* libs/gst/controller/gstlfocontrolsourceprivate.h:
API: Add GstLFOControlSource, a control source that gives values
for specific timestamps based on several periodic waveforms.
Fixes #459717.
* tests/check/libs/controller.c: (GST_START_TEST),
(gst_controller_suite):
* docs/libs/gstreamer-libs-docs.sgml:
* docs/libs/gstreamer-libs-sections.txt:
* docs/libs/gstreamer-libs.types:
Add documentation and unit tests for GstLFOControlSource.
2007-08-03 15:47:17 +00:00
|
|
|
ret *= amp; \
|
|
|
|
ret += off; \
|
|
|
|
\
|
|
|
|
if (round) \
|
|
|
|
ret += 0.5; \
|
|
|
|
\
|
2007-09-13 09:08:23 +00:00
|
|
|
return (g##type) CLAMP (ret, convert (min), convert (max)); \
|
libs/gst/controller/: API: Add GstLFOControlSource, a control source that gives values for specific timestamps based ...
Original commit message from CVS:
reviewed by: Stefan Kost <ensonic@users.sf.net>
* libs/gst/controller/Makefile.am:
* libs/gst/controller/gstlfocontrolsource.c: (_calculate_pos),
(gst_lfo_waveform_get_type), (gst_lfo_control_source_reset),
(gst_lfo_control_source_new),
(gst_lfo_control_source_set_waveform),
(gst_lfo_control_source_bind), (gst_lfo_control_source_init),
(gst_lfo_control_source_finalize),
(gst_lfo_control_source_dispose),
(gst_lfo_control_source_set_property),
(gst_lfo_control_source_get_property),
(gst_lfo_control_source_class_init):
* libs/gst/controller/gstlfocontrolsource.h:
* libs/gst/controller/gstlfocontrolsourceprivate.h:
API: Add GstLFOControlSource, a control source that gives values
for specific timestamps based on several periodic waveforms.
Fixes #459717.
* tests/check/libs/controller.c: (GST_START_TEST),
(gst_controller_suite):
* docs/libs/gstreamer-libs-docs.sgml:
* docs/libs/gstreamer-libs-sections.txt:
* docs/libs/gstreamer-libs.types:
Add documentation and unit tests for GstLFOControlSource.
2007-08-03 15:47:17 +00:00
|
|
|
} \
|
|
|
|
\
|
|
|
|
static gboolean \
|
|
|
|
waveform_sine_get_##type (GstLFOControlSource *self, GstClockTime timestamp, \
|
|
|
|
GValue *value) \
|
|
|
|
{ \
|
2010-02-22 15:25:45 +00:00
|
|
|
g##type ret, max, min; \
|
|
|
|
gdouble amp, off, frequency; \
|
|
|
|
GstClockTime timeshift, period; \
|
|
|
|
\
|
libs/gst/controller/: API: Add GstLFOControlSource, a control source that gives values for specific timestamps based ...
Original commit message from CVS:
reviewed by: Stefan Kost <ensonic@users.sf.net>
* libs/gst/controller/Makefile.am:
* libs/gst/controller/gstlfocontrolsource.c: (_calculate_pos),
(gst_lfo_waveform_get_type), (gst_lfo_control_source_reset),
(gst_lfo_control_source_new),
(gst_lfo_control_source_set_waveform),
(gst_lfo_control_source_bind), (gst_lfo_control_source_init),
(gst_lfo_control_source_finalize),
(gst_lfo_control_source_dispose),
(gst_lfo_control_source_set_property),
(gst_lfo_control_source_get_property),
(gst_lfo_control_source_class_init):
* libs/gst/controller/gstlfocontrolsource.h:
* libs/gst/controller/gstlfocontrolsourceprivate.h:
API: Add GstLFOControlSource, a control source that gives values
for specific timestamps based on several periodic waveforms.
Fixes #459717.
* tests/check/libs/controller.c: (GST_START_TEST),
(gst_controller_suite):
* docs/libs/gstreamer-libs-docs.sgml:
* docs/libs/gstreamer-libs-sections.txt:
* docs/libs/gstreamer-libs.types:
Add documentation and unit tests for GstLFOControlSource.
2007-08-03 15:47:17 +00:00
|
|
|
g_mutex_lock (self->lock); \
|
2010-02-22 15:25:45 +00:00
|
|
|
max = g_value_get_##type (&self->priv->maximum_value); \
|
|
|
|
min = g_value_get_##type (&self->priv->minimum_value); \
|
|
|
|
amp = convert (g_value_get_##type (&self->priv->amplitude)); \
|
|
|
|
off = convert (g_value_get_##type (&self->priv->offset)); \
|
|
|
|
timeshift = self->priv->timeshift; \
|
|
|
|
period = self->priv->period; \
|
|
|
|
frequency = self->priv->frequency; \
|
|
|
|
\
|
|
|
|
ret = _sine_get_##type (self, max, min, amp, off, timeshift, period, frequency, timestamp); \
|
libs/gst/controller/: API: Add GstLFOControlSource, a control source that gives values for specific timestamps based ...
Original commit message from CVS:
reviewed by: Stefan Kost <ensonic@users.sf.net>
* libs/gst/controller/Makefile.am:
* libs/gst/controller/gstlfocontrolsource.c: (_calculate_pos),
(gst_lfo_waveform_get_type), (gst_lfo_control_source_reset),
(gst_lfo_control_source_new),
(gst_lfo_control_source_set_waveform),
(gst_lfo_control_source_bind), (gst_lfo_control_source_init),
(gst_lfo_control_source_finalize),
(gst_lfo_control_source_dispose),
(gst_lfo_control_source_set_property),
(gst_lfo_control_source_get_property),
(gst_lfo_control_source_class_init):
* libs/gst/controller/gstlfocontrolsource.h:
* libs/gst/controller/gstlfocontrolsourceprivate.h:
API: Add GstLFOControlSource, a control source that gives values
for specific timestamps based on several periodic waveforms.
Fixes #459717.
* tests/check/libs/controller.c: (GST_START_TEST),
(gst_controller_suite):
* docs/libs/gstreamer-libs-docs.sgml:
* docs/libs/gstreamer-libs-sections.txt:
* docs/libs/gstreamer-libs.types:
Add documentation and unit tests for GstLFOControlSource.
2007-08-03 15:47:17 +00:00
|
|
|
g_value_set_##type (value, ret); \
|
|
|
|
g_mutex_unlock (self->lock); \
|
|
|
|
return TRUE; \
|
|
|
|
} \
|
|
|
|
\
|
|
|
|
static gboolean \
|
|
|
|
waveform_sine_get_##type##_value_array (GstLFOControlSource *self, \
|
2011-12-06 07:35:57 +00:00
|
|
|
GstClockTime timestamp, GstClockTime interval, guint n_values, gpointer *_values) \
|
libs/gst/controller/: API: Add GstLFOControlSource, a control source that gives values for specific timestamps based ...
Original commit message from CVS:
reviewed by: Stefan Kost <ensonic@users.sf.net>
* libs/gst/controller/Makefile.am:
* libs/gst/controller/gstlfocontrolsource.c: (_calculate_pos),
(gst_lfo_waveform_get_type), (gst_lfo_control_source_reset),
(gst_lfo_control_source_new),
(gst_lfo_control_source_set_waveform),
(gst_lfo_control_source_bind), (gst_lfo_control_source_init),
(gst_lfo_control_source_finalize),
(gst_lfo_control_source_dispose),
(gst_lfo_control_source_set_property),
(gst_lfo_control_source_get_property),
(gst_lfo_control_source_class_init):
* libs/gst/controller/gstlfocontrolsource.h:
* libs/gst/controller/gstlfocontrolsourceprivate.h:
API: Add GstLFOControlSource, a control source that gives values
for specific timestamps based on several periodic waveforms.
Fixes #459717.
* tests/check/libs/controller.c: (GST_START_TEST),
(gst_controller_suite):
* docs/libs/gstreamer-libs-docs.sgml:
* docs/libs/gstreamer-libs-sections.txt:
* docs/libs/gstreamer-libs.types:
Add documentation and unit tests for GstLFOControlSource.
2007-08-03 15:47:17 +00:00
|
|
|
{ \
|
2011-12-06 07:35:57 +00:00
|
|
|
guint i; \
|
libs/gst/controller/: API: Add GstLFOControlSource, a control source that gives values for specific timestamps based ...
Original commit message from CVS:
reviewed by: Stefan Kost <ensonic@users.sf.net>
* libs/gst/controller/Makefile.am:
* libs/gst/controller/gstlfocontrolsource.c: (_calculate_pos),
(gst_lfo_waveform_get_type), (gst_lfo_control_source_reset),
(gst_lfo_control_source_new),
(gst_lfo_control_source_set_waveform),
(gst_lfo_control_source_bind), (gst_lfo_control_source_init),
(gst_lfo_control_source_finalize),
(gst_lfo_control_source_dispose),
(gst_lfo_control_source_set_property),
(gst_lfo_control_source_get_property),
(gst_lfo_control_source_class_init):
* libs/gst/controller/gstlfocontrolsource.h:
* libs/gst/controller/gstlfocontrolsourceprivate.h:
API: Add GstLFOControlSource, a control source that gives values
for specific timestamps based on several periodic waveforms.
Fixes #459717.
* tests/check/libs/controller.c: (GST_START_TEST),
(gst_controller_suite):
* docs/libs/gstreamer-libs-docs.sgml:
* docs/libs/gstreamer-libs-sections.txt:
* docs/libs/gstreamer-libs.types:
Add documentation and unit tests for GstLFOControlSource.
2007-08-03 15:47:17 +00:00
|
|
|
GstClockTime ts = timestamp; \
|
2011-12-06 07:35:57 +00:00
|
|
|
g##type *values = (g##type *) _values; \
|
2010-02-22 15:25:45 +00:00
|
|
|
g##type max, min; \
|
|
|
|
gdouble amp, off, frequency; \
|
|
|
|
GstClockTime timeshift, period; \
|
libs/gst/controller/: API: Add GstLFOControlSource, a control source that gives values for specific timestamps based ...
Original commit message from CVS:
reviewed by: Stefan Kost <ensonic@users.sf.net>
* libs/gst/controller/Makefile.am:
* libs/gst/controller/gstlfocontrolsource.c: (_calculate_pos),
(gst_lfo_waveform_get_type), (gst_lfo_control_source_reset),
(gst_lfo_control_source_new),
(gst_lfo_control_source_set_waveform),
(gst_lfo_control_source_bind), (gst_lfo_control_source_init),
(gst_lfo_control_source_finalize),
(gst_lfo_control_source_dispose),
(gst_lfo_control_source_set_property),
(gst_lfo_control_source_get_property),
(gst_lfo_control_source_class_init):
* libs/gst/controller/gstlfocontrolsource.h:
* libs/gst/controller/gstlfocontrolsourceprivate.h:
API: Add GstLFOControlSource, a control source that gives values
for specific timestamps based on several periodic waveforms.
Fixes #459717.
* tests/check/libs/controller.c: (GST_START_TEST),
(gst_controller_suite):
* docs/libs/gstreamer-libs-docs.sgml:
* docs/libs/gstreamer-libs-sections.txt:
* docs/libs/gstreamer-libs.types:
Add documentation and unit tests for GstLFOControlSource.
2007-08-03 15:47:17 +00:00
|
|
|
\
|
|
|
|
g_mutex_lock (self->lock); \
|
2010-02-22 15:25:45 +00:00
|
|
|
max = g_value_get_##type (&self->priv->maximum_value); \
|
|
|
|
min = g_value_get_##type (&self->priv->minimum_value); \
|
|
|
|
amp = convert (g_value_get_##type (&self->priv->amplitude)); \
|
|
|
|
off = convert (g_value_get_##type (&self->priv->offset)); \
|
|
|
|
timeshift = self->priv->timeshift; \
|
|
|
|
period = self->priv->period; \
|
|
|
|
frequency = self->priv->frequency; \
|
|
|
|
\
|
2011-12-06 07:35:57 +00:00
|
|
|
for(i = 0; i < n_values; i++) { \
|
2010-02-22 15:25:45 +00:00
|
|
|
*values = _sine_get_##type (self, max, min, amp, off, timeshift, period, frequency, ts); \
|
2011-12-06 07:35:57 +00:00
|
|
|
ts += interval; \
|
libs/gst/controller/: API: Add GstLFOControlSource, a control source that gives values for specific timestamps based ...
Original commit message from CVS:
reviewed by: Stefan Kost <ensonic@users.sf.net>
* libs/gst/controller/Makefile.am:
* libs/gst/controller/gstlfocontrolsource.c: (_calculate_pos),
(gst_lfo_waveform_get_type), (gst_lfo_control_source_reset),
(gst_lfo_control_source_new),
(gst_lfo_control_source_set_waveform),
(gst_lfo_control_source_bind), (gst_lfo_control_source_init),
(gst_lfo_control_source_finalize),
(gst_lfo_control_source_dispose),
(gst_lfo_control_source_set_property),
(gst_lfo_control_source_get_property),
(gst_lfo_control_source_class_init):
* libs/gst/controller/gstlfocontrolsource.h:
* libs/gst/controller/gstlfocontrolsourceprivate.h:
API: Add GstLFOControlSource, a control source that gives values
for specific timestamps based on several periodic waveforms.
Fixes #459717.
* tests/check/libs/controller.c: (GST_START_TEST),
(gst_controller_suite):
* docs/libs/gstreamer-libs-docs.sgml:
* docs/libs/gstreamer-libs-sections.txt:
* docs/libs/gstreamer-libs.types:
Add documentation and unit tests for GstLFOControlSource.
2007-08-03 15:47:17 +00:00
|
|
|
values++; \
|
|
|
|
} \
|
|
|
|
g_mutex_unlock (self->lock); \
|
|
|
|
return TRUE; \
|
|
|
|
}
|
|
|
|
|
2007-09-13 09:08:23 +00:00
|
|
|
DEFINE_SINE (int, TRUE, EMPTY);
|
|
|
|
DEFINE_SINE (uint, TRUE, EMPTY);
|
|
|
|
DEFINE_SINE (long, TRUE, EMPTY);
|
|
|
|
DEFINE_SINE (ulong, TRUE, EMPTY);
|
|
|
|
DEFINE_SINE (int64, TRUE, EMPTY);
|
2008-11-17 21:43:06 +00:00
|
|
|
DEFINE_SINE (uint64, TRUE, gst_guint64_to_gdouble);
|
2007-09-13 09:08:23 +00:00
|
|
|
DEFINE_SINE (float, FALSE, EMPTY);
|
|
|
|
DEFINE_SINE (double, FALSE, EMPTY);
|
libs/gst/controller/: API: Add GstLFOControlSource, a control source that gives values for specific timestamps based ...
Original commit message from CVS:
reviewed by: Stefan Kost <ensonic@users.sf.net>
* libs/gst/controller/Makefile.am:
* libs/gst/controller/gstlfocontrolsource.c: (_calculate_pos),
(gst_lfo_waveform_get_type), (gst_lfo_control_source_reset),
(gst_lfo_control_source_new),
(gst_lfo_control_source_set_waveform),
(gst_lfo_control_source_bind), (gst_lfo_control_source_init),
(gst_lfo_control_source_finalize),
(gst_lfo_control_source_dispose),
(gst_lfo_control_source_set_property),
(gst_lfo_control_source_get_property),
(gst_lfo_control_source_class_init):
* libs/gst/controller/gstlfocontrolsource.h:
* libs/gst/controller/gstlfocontrolsourceprivate.h:
API: Add GstLFOControlSource, a control source that gives values
for specific timestamps based on several periodic waveforms.
Fixes #459717.
* tests/check/libs/controller.c: (GST_START_TEST),
(gst_controller_suite):
* docs/libs/gstreamer-libs-docs.sgml:
* docs/libs/gstreamer-libs-sections.txt:
* docs/libs/gstreamer-libs.types:
Add documentation and unit tests for GstLFOControlSource.
2007-08-03 15:47:17 +00:00
|
|
|
|
|
|
|
static GstWaveformImplementation waveform_sine = {
|
|
|
|
(GstControlSourceGetValue) waveform_sine_get_int,
|
|
|
|
(GstControlSourceGetValueArray) waveform_sine_get_int_value_array,
|
|
|
|
(GstControlSourceGetValue) waveform_sine_get_uint,
|
|
|
|
(GstControlSourceGetValueArray) waveform_sine_get_uint_value_array,
|
|
|
|
(GstControlSourceGetValue) waveform_sine_get_long,
|
|
|
|
(GstControlSourceGetValueArray) waveform_sine_get_long_value_array,
|
|
|
|
(GstControlSourceGetValue) waveform_sine_get_ulong,
|
|
|
|
(GstControlSourceGetValueArray) waveform_sine_get_ulong_value_array,
|
|
|
|
(GstControlSourceGetValue) waveform_sine_get_int64,
|
|
|
|
(GstControlSourceGetValueArray) waveform_sine_get_int64_value_array,
|
|
|
|
(GstControlSourceGetValue) waveform_sine_get_uint64,
|
|
|
|
(GstControlSourceGetValueArray) waveform_sine_get_uint64_value_array,
|
|
|
|
(GstControlSourceGetValue) waveform_sine_get_float,
|
|
|
|
(GstControlSourceGetValueArray) waveform_sine_get_float_value_array,
|
|
|
|
(GstControlSourceGetValue) waveform_sine_get_double,
|
|
|
|
(GstControlSourceGetValueArray) waveform_sine_get_double_value_array
|
|
|
|
};
|
|
|
|
|
2007-09-13 09:08:23 +00:00
|
|
|
#define DEFINE_SQUARE(type,round, convert) \
|
libs/gst/controller/: API: Add GstLFOControlSource, a control source that gives values for specific timestamps based ...
Original commit message from CVS:
reviewed by: Stefan Kost <ensonic@users.sf.net>
* libs/gst/controller/Makefile.am:
* libs/gst/controller/gstlfocontrolsource.c: (_calculate_pos),
(gst_lfo_waveform_get_type), (gst_lfo_control_source_reset),
(gst_lfo_control_source_new),
(gst_lfo_control_source_set_waveform),
(gst_lfo_control_source_bind), (gst_lfo_control_source_init),
(gst_lfo_control_source_finalize),
(gst_lfo_control_source_dispose),
(gst_lfo_control_source_set_property),
(gst_lfo_control_source_get_property),
(gst_lfo_control_source_class_init):
* libs/gst/controller/gstlfocontrolsource.h:
* libs/gst/controller/gstlfocontrolsourceprivate.h:
API: Add GstLFOControlSource, a control source that gives values
for specific timestamps based on several periodic waveforms.
Fixes #459717.
* tests/check/libs/controller.c: (GST_START_TEST),
(gst_controller_suite):
* docs/libs/gstreamer-libs-docs.sgml:
* docs/libs/gstreamer-libs-sections.txt:
* docs/libs/gstreamer-libs.types:
Add documentation and unit tests for GstLFOControlSource.
2007-08-03 15:47:17 +00:00
|
|
|
\
|
|
|
|
static inline g##type \
|
2010-02-22 15:25:45 +00:00
|
|
|
_square_get_##type (GstLFOControlSource *self, g##type max, g##type min, gdouble amp, gdouble off, GstClockTime timeshift, GstClockTime period, gdouble frequency, GstClockTime timestamp) \
|
libs/gst/controller/: API: Add GstLFOControlSource, a control source that gives values for specific timestamps based ...
Original commit message from CVS:
reviewed by: Stefan Kost <ensonic@users.sf.net>
* libs/gst/controller/Makefile.am:
* libs/gst/controller/gstlfocontrolsource.c: (_calculate_pos),
(gst_lfo_waveform_get_type), (gst_lfo_control_source_reset),
(gst_lfo_control_source_new),
(gst_lfo_control_source_set_waveform),
(gst_lfo_control_source_bind), (gst_lfo_control_source_init),
(gst_lfo_control_source_finalize),
(gst_lfo_control_source_dispose),
(gst_lfo_control_source_set_property),
(gst_lfo_control_source_get_property),
(gst_lfo_control_source_class_init):
* libs/gst/controller/gstlfocontrolsource.h:
* libs/gst/controller/gstlfocontrolsourceprivate.h:
API: Add GstLFOControlSource, a control source that gives values
for specific timestamps based on several periodic waveforms.
Fixes #459717.
* tests/check/libs/controller.c: (GST_START_TEST),
(gst_controller_suite):
* docs/libs/gstreamer-libs-docs.sgml:
* docs/libs/gstreamer-libs-sections.txt:
* docs/libs/gstreamer-libs.types:
Add documentation and unit tests for GstLFOControlSource.
2007-08-03 15:47:17 +00:00
|
|
|
{ \
|
2010-02-22 15:25:45 +00:00
|
|
|
GstClockTime pos = _calculate_pos (timestamp, timeshift, period); \
|
libs/gst/controller/: API: Add GstLFOControlSource, a control source that gives values for specific timestamps based ...
Original commit message from CVS:
reviewed by: Stefan Kost <ensonic@users.sf.net>
* libs/gst/controller/Makefile.am:
* libs/gst/controller/gstlfocontrolsource.c: (_calculate_pos),
(gst_lfo_waveform_get_type), (gst_lfo_control_source_reset),
(gst_lfo_control_source_new),
(gst_lfo_control_source_set_waveform),
(gst_lfo_control_source_bind), (gst_lfo_control_source_init),
(gst_lfo_control_source_finalize),
(gst_lfo_control_source_dispose),
(gst_lfo_control_source_set_property),
(gst_lfo_control_source_get_property),
(gst_lfo_control_source_class_init):
* libs/gst/controller/gstlfocontrolsource.h:
* libs/gst/controller/gstlfocontrolsourceprivate.h:
API: Add GstLFOControlSource, a control source that gives values
for specific timestamps based on several periodic waveforms.
Fixes #459717.
* tests/check/libs/controller.c: (GST_START_TEST),
(gst_controller_suite):
* docs/libs/gstreamer-libs-docs.sgml:
* docs/libs/gstreamer-libs-sections.txt:
* docs/libs/gstreamer-libs.types:
Add documentation and unit tests for GstLFOControlSource.
2007-08-03 15:47:17 +00:00
|
|
|
gdouble ret; \
|
|
|
|
\
|
|
|
|
if (pos >= period / 2) \
|
|
|
|
ret = amp; \
|
|
|
|
else \
|
|
|
|
ret = - amp; \
|
|
|
|
\
|
|
|
|
ret += off; \
|
|
|
|
\
|
|
|
|
if (round) \
|
|
|
|
ret += 0.5; \
|
|
|
|
\
|
2007-09-13 09:08:23 +00:00
|
|
|
return (g##type) CLAMP (ret, convert (min), convert (max)); \
|
libs/gst/controller/: API: Add GstLFOControlSource, a control source that gives values for specific timestamps based ...
Original commit message from CVS:
reviewed by: Stefan Kost <ensonic@users.sf.net>
* libs/gst/controller/Makefile.am:
* libs/gst/controller/gstlfocontrolsource.c: (_calculate_pos),
(gst_lfo_waveform_get_type), (gst_lfo_control_source_reset),
(gst_lfo_control_source_new),
(gst_lfo_control_source_set_waveform),
(gst_lfo_control_source_bind), (gst_lfo_control_source_init),
(gst_lfo_control_source_finalize),
(gst_lfo_control_source_dispose),
(gst_lfo_control_source_set_property),
(gst_lfo_control_source_get_property),
(gst_lfo_control_source_class_init):
* libs/gst/controller/gstlfocontrolsource.h:
* libs/gst/controller/gstlfocontrolsourceprivate.h:
API: Add GstLFOControlSource, a control source that gives values
for specific timestamps based on several periodic waveforms.
Fixes #459717.
* tests/check/libs/controller.c: (GST_START_TEST),
(gst_controller_suite):
* docs/libs/gstreamer-libs-docs.sgml:
* docs/libs/gstreamer-libs-sections.txt:
* docs/libs/gstreamer-libs.types:
Add documentation and unit tests for GstLFOControlSource.
2007-08-03 15:47:17 +00:00
|
|
|
} \
|
|
|
|
\
|
|
|
|
static gboolean \
|
|
|
|
waveform_square_get_##type (GstLFOControlSource *self, GstClockTime timestamp, \
|
|
|
|
GValue *value) \
|
|
|
|
{ \
|
2010-02-22 15:25:45 +00:00
|
|
|
g##type ret, max, min; \
|
|
|
|
gdouble amp, off, frequency; \
|
|
|
|
GstClockTime timeshift, period; \
|
|
|
|
\
|
libs/gst/controller/: API: Add GstLFOControlSource, a control source that gives values for specific timestamps based ...
Original commit message from CVS:
reviewed by: Stefan Kost <ensonic@users.sf.net>
* libs/gst/controller/Makefile.am:
* libs/gst/controller/gstlfocontrolsource.c: (_calculate_pos),
(gst_lfo_waveform_get_type), (gst_lfo_control_source_reset),
(gst_lfo_control_source_new),
(gst_lfo_control_source_set_waveform),
(gst_lfo_control_source_bind), (gst_lfo_control_source_init),
(gst_lfo_control_source_finalize),
(gst_lfo_control_source_dispose),
(gst_lfo_control_source_set_property),
(gst_lfo_control_source_get_property),
(gst_lfo_control_source_class_init):
* libs/gst/controller/gstlfocontrolsource.h:
* libs/gst/controller/gstlfocontrolsourceprivate.h:
API: Add GstLFOControlSource, a control source that gives values
for specific timestamps based on several periodic waveforms.
Fixes #459717.
* tests/check/libs/controller.c: (GST_START_TEST),
(gst_controller_suite):
* docs/libs/gstreamer-libs-docs.sgml:
* docs/libs/gstreamer-libs-sections.txt:
* docs/libs/gstreamer-libs.types:
Add documentation and unit tests for GstLFOControlSource.
2007-08-03 15:47:17 +00:00
|
|
|
g_mutex_lock (self->lock); \
|
2010-02-22 15:25:45 +00:00
|
|
|
max = g_value_get_##type (&self->priv->maximum_value); \
|
|
|
|
min = g_value_get_##type (&self->priv->minimum_value); \
|
|
|
|
amp = convert (g_value_get_##type (&self->priv->amplitude)); \
|
|
|
|
off = convert (g_value_get_##type (&self->priv->offset)); \
|
|
|
|
timeshift = self->priv->timeshift; \
|
|
|
|
period = self->priv->period; \
|
|
|
|
frequency = self->priv->frequency; \
|
|
|
|
\
|
|
|
|
ret = _square_get_##type (self, max, min, amp, off, timeshift, period, frequency, timestamp); \
|
libs/gst/controller/: API: Add GstLFOControlSource, a control source that gives values for specific timestamps based ...
Original commit message from CVS:
reviewed by: Stefan Kost <ensonic@users.sf.net>
* libs/gst/controller/Makefile.am:
* libs/gst/controller/gstlfocontrolsource.c: (_calculate_pos),
(gst_lfo_waveform_get_type), (gst_lfo_control_source_reset),
(gst_lfo_control_source_new),
(gst_lfo_control_source_set_waveform),
(gst_lfo_control_source_bind), (gst_lfo_control_source_init),
(gst_lfo_control_source_finalize),
(gst_lfo_control_source_dispose),
(gst_lfo_control_source_set_property),
(gst_lfo_control_source_get_property),
(gst_lfo_control_source_class_init):
* libs/gst/controller/gstlfocontrolsource.h:
* libs/gst/controller/gstlfocontrolsourceprivate.h:
API: Add GstLFOControlSource, a control source that gives values
for specific timestamps based on several periodic waveforms.
Fixes #459717.
* tests/check/libs/controller.c: (GST_START_TEST),
(gst_controller_suite):
* docs/libs/gstreamer-libs-docs.sgml:
* docs/libs/gstreamer-libs-sections.txt:
* docs/libs/gstreamer-libs.types:
Add documentation and unit tests for GstLFOControlSource.
2007-08-03 15:47:17 +00:00
|
|
|
g_value_set_##type (value, ret); \
|
|
|
|
g_mutex_unlock (self->lock); \
|
|
|
|
return TRUE; \
|
|
|
|
} \
|
|
|
|
\
|
|
|
|
static gboolean \
|
|
|
|
waveform_square_get_##type##_value_array (GstLFOControlSource *self, \
|
2011-12-06 07:35:57 +00:00
|
|
|
GstClockTime timestamp, GstClockTime interval, guint n_values, gpointer *_values) \
|
libs/gst/controller/: API: Add GstLFOControlSource, a control source that gives values for specific timestamps based ...
Original commit message from CVS:
reviewed by: Stefan Kost <ensonic@users.sf.net>
* libs/gst/controller/Makefile.am:
* libs/gst/controller/gstlfocontrolsource.c: (_calculate_pos),
(gst_lfo_waveform_get_type), (gst_lfo_control_source_reset),
(gst_lfo_control_source_new),
(gst_lfo_control_source_set_waveform),
(gst_lfo_control_source_bind), (gst_lfo_control_source_init),
(gst_lfo_control_source_finalize),
(gst_lfo_control_source_dispose),
(gst_lfo_control_source_set_property),
(gst_lfo_control_source_get_property),
(gst_lfo_control_source_class_init):
* libs/gst/controller/gstlfocontrolsource.h:
* libs/gst/controller/gstlfocontrolsourceprivate.h:
API: Add GstLFOControlSource, a control source that gives values
for specific timestamps based on several periodic waveforms.
Fixes #459717.
* tests/check/libs/controller.c: (GST_START_TEST),
(gst_controller_suite):
* docs/libs/gstreamer-libs-docs.sgml:
* docs/libs/gstreamer-libs-sections.txt:
* docs/libs/gstreamer-libs.types:
Add documentation and unit tests for GstLFOControlSource.
2007-08-03 15:47:17 +00:00
|
|
|
{ \
|
2011-12-06 07:35:57 +00:00
|
|
|
guint i; \
|
libs/gst/controller/: API: Add GstLFOControlSource, a control source that gives values for specific timestamps based ...
Original commit message from CVS:
reviewed by: Stefan Kost <ensonic@users.sf.net>
* libs/gst/controller/Makefile.am:
* libs/gst/controller/gstlfocontrolsource.c: (_calculate_pos),
(gst_lfo_waveform_get_type), (gst_lfo_control_source_reset),
(gst_lfo_control_source_new),
(gst_lfo_control_source_set_waveform),
(gst_lfo_control_source_bind), (gst_lfo_control_source_init),
(gst_lfo_control_source_finalize),
(gst_lfo_control_source_dispose),
(gst_lfo_control_source_set_property),
(gst_lfo_control_source_get_property),
(gst_lfo_control_source_class_init):
* libs/gst/controller/gstlfocontrolsource.h:
* libs/gst/controller/gstlfocontrolsourceprivate.h:
API: Add GstLFOControlSource, a control source that gives values
for specific timestamps based on several periodic waveforms.
Fixes #459717.
* tests/check/libs/controller.c: (GST_START_TEST),
(gst_controller_suite):
* docs/libs/gstreamer-libs-docs.sgml:
* docs/libs/gstreamer-libs-sections.txt:
* docs/libs/gstreamer-libs.types:
Add documentation and unit tests for GstLFOControlSource.
2007-08-03 15:47:17 +00:00
|
|
|
GstClockTime ts = timestamp; \
|
2011-12-06 07:35:57 +00:00
|
|
|
g##type *values = (g##type *) _values; \
|
2010-02-22 15:25:45 +00:00
|
|
|
g##type max, min; \
|
|
|
|
gdouble amp, off, frequency; \
|
|
|
|
GstClockTime timeshift, period; \
|
libs/gst/controller/: API: Add GstLFOControlSource, a control source that gives values for specific timestamps based ...
Original commit message from CVS:
reviewed by: Stefan Kost <ensonic@users.sf.net>
* libs/gst/controller/Makefile.am:
* libs/gst/controller/gstlfocontrolsource.c: (_calculate_pos),
(gst_lfo_waveform_get_type), (gst_lfo_control_source_reset),
(gst_lfo_control_source_new),
(gst_lfo_control_source_set_waveform),
(gst_lfo_control_source_bind), (gst_lfo_control_source_init),
(gst_lfo_control_source_finalize),
(gst_lfo_control_source_dispose),
(gst_lfo_control_source_set_property),
(gst_lfo_control_source_get_property),
(gst_lfo_control_source_class_init):
* libs/gst/controller/gstlfocontrolsource.h:
* libs/gst/controller/gstlfocontrolsourceprivate.h:
API: Add GstLFOControlSource, a control source that gives values
for specific timestamps based on several periodic waveforms.
Fixes #459717.
* tests/check/libs/controller.c: (GST_START_TEST),
(gst_controller_suite):
* docs/libs/gstreamer-libs-docs.sgml:
* docs/libs/gstreamer-libs-sections.txt:
* docs/libs/gstreamer-libs.types:
Add documentation and unit tests for GstLFOControlSource.
2007-08-03 15:47:17 +00:00
|
|
|
\
|
|
|
|
g_mutex_lock (self->lock); \
|
2010-02-22 15:25:45 +00:00
|
|
|
max = g_value_get_##type (&self->priv->maximum_value); \
|
|
|
|
min = g_value_get_##type (&self->priv->minimum_value); \
|
|
|
|
amp = convert (g_value_get_##type (&self->priv->amplitude)); \
|
|
|
|
off = convert (g_value_get_##type (&self->priv->offset)); \
|
|
|
|
timeshift = self->priv->timeshift; \
|
|
|
|
period = self->priv->period; \
|
|
|
|
frequency = self->priv->frequency; \
|
|
|
|
\
|
2011-12-06 07:35:57 +00:00
|
|
|
for(i = 0; i < n_values; i++) { \
|
2010-02-22 15:25:45 +00:00
|
|
|
*values = _square_get_##type (self, max, min, amp, off, timeshift, period, frequency, ts); \
|
2011-12-06 07:35:57 +00:00
|
|
|
ts += interval; \
|
libs/gst/controller/: API: Add GstLFOControlSource, a control source that gives values for specific timestamps based ...
Original commit message from CVS:
reviewed by: Stefan Kost <ensonic@users.sf.net>
* libs/gst/controller/Makefile.am:
* libs/gst/controller/gstlfocontrolsource.c: (_calculate_pos),
(gst_lfo_waveform_get_type), (gst_lfo_control_source_reset),
(gst_lfo_control_source_new),
(gst_lfo_control_source_set_waveform),
(gst_lfo_control_source_bind), (gst_lfo_control_source_init),
(gst_lfo_control_source_finalize),
(gst_lfo_control_source_dispose),
(gst_lfo_control_source_set_property),
(gst_lfo_control_source_get_property),
(gst_lfo_control_source_class_init):
* libs/gst/controller/gstlfocontrolsource.h:
* libs/gst/controller/gstlfocontrolsourceprivate.h:
API: Add GstLFOControlSource, a control source that gives values
for specific timestamps based on several periodic waveforms.
Fixes #459717.
* tests/check/libs/controller.c: (GST_START_TEST),
(gst_controller_suite):
* docs/libs/gstreamer-libs-docs.sgml:
* docs/libs/gstreamer-libs-sections.txt:
* docs/libs/gstreamer-libs.types:
Add documentation and unit tests for GstLFOControlSource.
2007-08-03 15:47:17 +00:00
|
|
|
values++; \
|
|
|
|
} \
|
|
|
|
g_mutex_unlock (self->lock); \
|
|
|
|
return TRUE; \
|
|
|
|
}
|
|
|
|
|
2007-09-13 09:08:23 +00:00
|
|
|
DEFINE_SQUARE (int, TRUE, EMPTY);
|
|
|
|
DEFINE_SQUARE (uint, TRUE, EMPTY);
|
|
|
|
DEFINE_SQUARE (long, TRUE, EMPTY);
|
|
|
|
DEFINE_SQUARE (ulong, TRUE, EMPTY);
|
|
|
|
DEFINE_SQUARE (int64, TRUE, EMPTY);
|
2008-11-17 21:43:06 +00:00
|
|
|
DEFINE_SQUARE (uint64, TRUE, gst_guint64_to_gdouble);
|
2007-09-13 09:08:23 +00:00
|
|
|
DEFINE_SQUARE (float, FALSE, EMPTY);
|
|
|
|
DEFINE_SQUARE (double, FALSE, EMPTY);
|
libs/gst/controller/: API: Add GstLFOControlSource, a control source that gives values for specific timestamps based ...
Original commit message from CVS:
reviewed by: Stefan Kost <ensonic@users.sf.net>
* libs/gst/controller/Makefile.am:
* libs/gst/controller/gstlfocontrolsource.c: (_calculate_pos),
(gst_lfo_waveform_get_type), (gst_lfo_control_source_reset),
(gst_lfo_control_source_new),
(gst_lfo_control_source_set_waveform),
(gst_lfo_control_source_bind), (gst_lfo_control_source_init),
(gst_lfo_control_source_finalize),
(gst_lfo_control_source_dispose),
(gst_lfo_control_source_set_property),
(gst_lfo_control_source_get_property),
(gst_lfo_control_source_class_init):
* libs/gst/controller/gstlfocontrolsource.h:
* libs/gst/controller/gstlfocontrolsourceprivate.h:
API: Add GstLFOControlSource, a control source that gives values
for specific timestamps based on several periodic waveforms.
Fixes #459717.
* tests/check/libs/controller.c: (GST_START_TEST),
(gst_controller_suite):
* docs/libs/gstreamer-libs-docs.sgml:
* docs/libs/gstreamer-libs-sections.txt:
* docs/libs/gstreamer-libs.types:
Add documentation and unit tests for GstLFOControlSource.
2007-08-03 15:47:17 +00:00
|
|
|
|
|
|
|
static GstWaveformImplementation waveform_square = {
|
|
|
|
(GstControlSourceGetValue) waveform_square_get_int,
|
|
|
|
(GstControlSourceGetValueArray) waveform_square_get_int_value_array,
|
|
|
|
(GstControlSourceGetValue) waveform_square_get_uint,
|
|
|
|
(GstControlSourceGetValueArray) waveform_square_get_uint_value_array,
|
|
|
|
(GstControlSourceGetValue) waveform_square_get_long,
|
|
|
|
(GstControlSourceGetValueArray) waveform_square_get_long_value_array,
|
|
|
|
(GstControlSourceGetValue) waveform_square_get_ulong,
|
|
|
|
(GstControlSourceGetValueArray) waveform_square_get_ulong_value_array,
|
|
|
|
(GstControlSourceGetValue) waveform_square_get_int64,
|
|
|
|
(GstControlSourceGetValueArray) waveform_square_get_int64_value_array,
|
|
|
|
(GstControlSourceGetValue) waveform_square_get_uint64,
|
|
|
|
(GstControlSourceGetValueArray) waveform_square_get_uint64_value_array,
|
|
|
|
(GstControlSourceGetValue) waveform_square_get_float,
|
|
|
|
(GstControlSourceGetValueArray) waveform_square_get_float_value_array,
|
|
|
|
(GstControlSourceGetValue) waveform_square_get_double,
|
|
|
|
(GstControlSourceGetValueArray) waveform_square_get_double_value_array
|
|
|
|
};
|
|
|
|
|
2007-09-13 09:08:23 +00:00
|
|
|
#define DEFINE_SAW(type,round,convert) \
|
libs/gst/controller/: API: Add GstLFOControlSource, a control source that gives values for specific timestamps based ...
Original commit message from CVS:
reviewed by: Stefan Kost <ensonic@users.sf.net>
* libs/gst/controller/Makefile.am:
* libs/gst/controller/gstlfocontrolsource.c: (_calculate_pos),
(gst_lfo_waveform_get_type), (gst_lfo_control_source_reset),
(gst_lfo_control_source_new),
(gst_lfo_control_source_set_waveform),
(gst_lfo_control_source_bind), (gst_lfo_control_source_init),
(gst_lfo_control_source_finalize),
(gst_lfo_control_source_dispose),
(gst_lfo_control_source_set_property),
(gst_lfo_control_source_get_property),
(gst_lfo_control_source_class_init):
* libs/gst/controller/gstlfocontrolsource.h:
* libs/gst/controller/gstlfocontrolsourceprivate.h:
API: Add GstLFOControlSource, a control source that gives values
for specific timestamps based on several periodic waveforms.
Fixes #459717.
* tests/check/libs/controller.c: (GST_START_TEST),
(gst_controller_suite):
* docs/libs/gstreamer-libs-docs.sgml:
* docs/libs/gstreamer-libs-sections.txt:
* docs/libs/gstreamer-libs.types:
Add documentation and unit tests for GstLFOControlSource.
2007-08-03 15:47:17 +00:00
|
|
|
\
|
|
|
|
static inline g##type \
|
2010-02-22 15:25:45 +00:00
|
|
|
_saw_get_##type (GstLFOControlSource *self, g##type max, g##type min, gdouble amp, gdouble off, GstClockTime timeshift, GstClockTime period, gdouble frequency, GstClockTime timestamp) \
|
libs/gst/controller/: API: Add GstLFOControlSource, a control source that gives values for specific timestamps based ...
Original commit message from CVS:
reviewed by: Stefan Kost <ensonic@users.sf.net>
* libs/gst/controller/Makefile.am:
* libs/gst/controller/gstlfocontrolsource.c: (_calculate_pos),
(gst_lfo_waveform_get_type), (gst_lfo_control_source_reset),
(gst_lfo_control_source_new),
(gst_lfo_control_source_set_waveform),
(gst_lfo_control_source_bind), (gst_lfo_control_source_init),
(gst_lfo_control_source_finalize),
(gst_lfo_control_source_dispose),
(gst_lfo_control_source_set_property),
(gst_lfo_control_source_get_property),
(gst_lfo_control_source_class_init):
* libs/gst/controller/gstlfocontrolsource.h:
* libs/gst/controller/gstlfocontrolsourceprivate.h:
API: Add GstLFOControlSource, a control source that gives values
for specific timestamps based on several periodic waveforms.
Fixes #459717.
* tests/check/libs/controller.c: (GST_START_TEST),
(gst_controller_suite):
* docs/libs/gstreamer-libs-docs.sgml:
* docs/libs/gstreamer-libs-sections.txt:
* docs/libs/gstreamer-libs.types:
Add documentation and unit tests for GstLFOControlSource.
2007-08-03 15:47:17 +00:00
|
|
|
{ \
|
2010-02-22 15:25:45 +00:00
|
|
|
GstClockTime pos = _calculate_pos (timestamp, timeshift, period); \
|
libs/gst/controller/: API: Add GstLFOControlSource, a control source that gives values for specific timestamps based ...
Original commit message from CVS:
reviewed by: Stefan Kost <ensonic@users.sf.net>
* libs/gst/controller/Makefile.am:
* libs/gst/controller/gstlfocontrolsource.c: (_calculate_pos),
(gst_lfo_waveform_get_type), (gst_lfo_control_source_reset),
(gst_lfo_control_source_new),
(gst_lfo_control_source_set_waveform),
(gst_lfo_control_source_bind), (gst_lfo_control_source_init),
(gst_lfo_control_source_finalize),
(gst_lfo_control_source_dispose),
(gst_lfo_control_source_set_property),
(gst_lfo_control_source_get_property),
(gst_lfo_control_source_class_init):
* libs/gst/controller/gstlfocontrolsource.h:
* libs/gst/controller/gstlfocontrolsourceprivate.h:
API: Add GstLFOControlSource, a control source that gives values
for specific timestamps based on several periodic waveforms.
Fixes #459717.
* tests/check/libs/controller.c: (GST_START_TEST),
(gst_controller_suite):
* docs/libs/gstreamer-libs-docs.sgml:
* docs/libs/gstreamer-libs-sections.txt:
* docs/libs/gstreamer-libs.types:
Add documentation and unit tests for GstLFOControlSource.
2007-08-03 15:47:17 +00:00
|
|
|
gdouble ret; \
|
|
|
|
\
|
2008-11-17 21:43:06 +00:00
|
|
|
ret = - ((gst_guint64_to_gdouble (pos) - gst_guint64_to_gdouble (period) / 2.0) * ((2.0 * amp) / gst_guint64_to_gdouble (period)));\
|
libs/gst/controller/: API: Add GstLFOControlSource, a control source that gives values for specific timestamps based ...
Original commit message from CVS:
reviewed by: Stefan Kost <ensonic@users.sf.net>
* libs/gst/controller/Makefile.am:
* libs/gst/controller/gstlfocontrolsource.c: (_calculate_pos),
(gst_lfo_waveform_get_type), (gst_lfo_control_source_reset),
(gst_lfo_control_source_new),
(gst_lfo_control_source_set_waveform),
(gst_lfo_control_source_bind), (gst_lfo_control_source_init),
(gst_lfo_control_source_finalize),
(gst_lfo_control_source_dispose),
(gst_lfo_control_source_set_property),
(gst_lfo_control_source_get_property),
(gst_lfo_control_source_class_init):
* libs/gst/controller/gstlfocontrolsource.h:
* libs/gst/controller/gstlfocontrolsourceprivate.h:
API: Add GstLFOControlSource, a control source that gives values
for specific timestamps based on several periodic waveforms.
Fixes #459717.
* tests/check/libs/controller.c: (GST_START_TEST),
(gst_controller_suite):
* docs/libs/gstreamer-libs-docs.sgml:
* docs/libs/gstreamer-libs-sections.txt:
* docs/libs/gstreamer-libs.types:
Add documentation and unit tests for GstLFOControlSource.
2007-08-03 15:47:17 +00:00
|
|
|
\
|
|
|
|
ret += off; \
|
|
|
|
\
|
|
|
|
if (round) \
|
|
|
|
ret += 0.5; \
|
|
|
|
\
|
2007-09-13 09:08:23 +00:00
|
|
|
return (g##type) CLAMP (ret, convert (min), convert (max)); \
|
libs/gst/controller/: API: Add GstLFOControlSource, a control source that gives values for specific timestamps based ...
Original commit message from CVS:
reviewed by: Stefan Kost <ensonic@users.sf.net>
* libs/gst/controller/Makefile.am:
* libs/gst/controller/gstlfocontrolsource.c: (_calculate_pos),
(gst_lfo_waveform_get_type), (gst_lfo_control_source_reset),
(gst_lfo_control_source_new),
(gst_lfo_control_source_set_waveform),
(gst_lfo_control_source_bind), (gst_lfo_control_source_init),
(gst_lfo_control_source_finalize),
(gst_lfo_control_source_dispose),
(gst_lfo_control_source_set_property),
(gst_lfo_control_source_get_property),
(gst_lfo_control_source_class_init):
* libs/gst/controller/gstlfocontrolsource.h:
* libs/gst/controller/gstlfocontrolsourceprivate.h:
API: Add GstLFOControlSource, a control source that gives values
for specific timestamps based on several periodic waveforms.
Fixes #459717.
* tests/check/libs/controller.c: (GST_START_TEST),
(gst_controller_suite):
* docs/libs/gstreamer-libs-docs.sgml:
* docs/libs/gstreamer-libs-sections.txt:
* docs/libs/gstreamer-libs.types:
Add documentation and unit tests for GstLFOControlSource.
2007-08-03 15:47:17 +00:00
|
|
|
} \
|
|
|
|
\
|
|
|
|
static gboolean \
|
|
|
|
waveform_saw_get_##type (GstLFOControlSource *self, GstClockTime timestamp, \
|
|
|
|
GValue *value) \
|
|
|
|
{ \
|
2010-02-22 15:25:45 +00:00
|
|
|
g##type ret, max, min; \
|
|
|
|
gdouble amp, off, frequency; \
|
|
|
|
GstClockTime timeshift, period; \
|
|
|
|
\
|
libs/gst/controller/: API: Add GstLFOControlSource, a control source that gives values for specific timestamps based ...
Original commit message from CVS:
reviewed by: Stefan Kost <ensonic@users.sf.net>
* libs/gst/controller/Makefile.am:
* libs/gst/controller/gstlfocontrolsource.c: (_calculate_pos),
(gst_lfo_waveform_get_type), (gst_lfo_control_source_reset),
(gst_lfo_control_source_new),
(gst_lfo_control_source_set_waveform),
(gst_lfo_control_source_bind), (gst_lfo_control_source_init),
(gst_lfo_control_source_finalize),
(gst_lfo_control_source_dispose),
(gst_lfo_control_source_set_property),
(gst_lfo_control_source_get_property),
(gst_lfo_control_source_class_init):
* libs/gst/controller/gstlfocontrolsource.h:
* libs/gst/controller/gstlfocontrolsourceprivate.h:
API: Add GstLFOControlSource, a control source that gives values
for specific timestamps based on several periodic waveforms.
Fixes #459717.
* tests/check/libs/controller.c: (GST_START_TEST),
(gst_controller_suite):
* docs/libs/gstreamer-libs-docs.sgml:
* docs/libs/gstreamer-libs-sections.txt:
* docs/libs/gstreamer-libs.types:
Add documentation and unit tests for GstLFOControlSource.
2007-08-03 15:47:17 +00:00
|
|
|
g_mutex_lock (self->lock); \
|
2010-02-22 15:25:45 +00:00
|
|
|
max = g_value_get_##type (&self->priv->maximum_value); \
|
|
|
|
min = g_value_get_##type (&self->priv->minimum_value); \
|
|
|
|
amp = convert (g_value_get_##type (&self->priv->amplitude)); \
|
|
|
|
off = convert (g_value_get_##type (&self->priv->offset)); \
|
|
|
|
timeshift = self->priv->timeshift; \
|
|
|
|
period = self->priv->period; \
|
|
|
|
frequency = self->priv->frequency; \
|
|
|
|
\
|
|
|
|
ret = _saw_get_##type (self, max, min, amp, off, timeshift, period, frequency, timestamp); \
|
libs/gst/controller/: API: Add GstLFOControlSource, a control source that gives values for specific timestamps based ...
Original commit message from CVS:
reviewed by: Stefan Kost <ensonic@users.sf.net>
* libs/gst/controller/Makefile.am:
* libs/gst/controller/gstlfocontrolsource.c: (_calculate_pos),
(gst_lfo_waveform_get_type), (gst_lfo_control_source_reset),
(gst_lfo_control_source_new),
(gst_lfo_control_source_set_waveform),
(gst_lfo_control_source_bind), (gst_lfo_control_source_init),
(gst_lfo_control_source_finalize),
(gst_lfo_control_source_dispose),
(gst_lfo_control_source_set_property),
(gst_lfo_control_source_get_property),
(gst_lfo_control_source_class_init):
* libs/gst/controller/gstlfocontrolsource.h:
* libs/gst/controller/gstlfocontrolsourceprivate.h:
API: Add GstLFOControlSource, a control source that gives values
for specific timestamps based on several periodic waveforms.
Fixes #459717.
* tests/check/libs/controller.c: (GST_START_TEST),
(gst_controller_suite):
* docs/libs/gstreamer-libs-docs.sgml:
* docs/libs/gstreamer-libs-sections.txt:
* docs/libs/gstreamer-libs.types:
Add documentation and unit tests for GstLFOControlSource.
2007-08-03 15:47:17 +00:00
|
|
|
g_value_set_##type (value, ret); \
|
|
|
|
g_mutex_unlock (self->lock); \
|
|
|
|
return TRUE; \
|
|
|
|
} \
|
|
|
|
\
|
|
|
|
static gboolean \
|
|
|
|
waveform_saw_get_##type##_value_array (GstLFOControlSource *self, \
|
2011-12-06 07:35:57 +00:00
|
|
|
GstClockTime timestamp, GstClockTime interval, guint n_values, gpointer *_values) \
|
libs/gst/controller/: API: Add GstLFOControlSource, a control source that gives values for specific timestamps based ...
Original commit message from CVS:
reviewed by: Stefan Kost <ensonic@users.sf.net>
* libs/gst/controller/Makefile.am:
* libs/gst/controller/gstlfocontrolsource.c: (_calculate_pos),
(gst_lfo_waveform_get_type), (gst_lfo_control_source_reset),
(gst_lfo_control_source_new),
(gst_lfo_control_source_set_waveform),
(gst_lfo_control_source_bind), (gst_lfo_control_source_init),
(gst_lfo_control_source_finalize),
(gst_lfo_control_source_dispose),
(gst_lfo_control_source_set_property),
(gst_lfo_control_source_get_property),
(gst_lfo_control_source_class_init):
* libs/gst/controller/gstlfocontrolsource.h:
* libs/gst/controller/gstlfocontrolsourceprivate.h:
API: Add GstLFOControlSource, a control source that gives values
for specific timestamps based on several periodic waveforms.
Fixes #459717.
* tests/check/libs/controller.c: (GST_START_TEST),
(gst_controller_suite):
* docs/libs/gstreamer-libs-docs.sgml:
* docs/libs/gstreamer-libs-sections.txt:
* docs/libs/gstreamer-libs.types:
Add documentation and unit tests for GstLFOControlSource.
2007-08-03 15:47:17 +00:00
|
|
|
{ \
|
2011-12-06 07:35:57 +00:00
|
|
|
guint i; \
|
libs/gst/controller/: API: Add GstLFOControlSource, a control source that gives values for specific timestamps based ...
Original commit message from CVS:
reviewed by: Stefan Kost <ensonic@users.sf.net>
* libs/gst/controller/Makefile.am:
* libs/gst/controller/gstlfocontrolsource.c: (_calculate_pos),
(gst_lfo_waveform_get_type), (gst_lfo_control_source_reset),
(gst_lfo_control_source_new),
(gst_lfo_control_source_set_waveform),
(gst_lfo_control_source_bind), (gst_lfo_control_source_init),
(gst_lfo_control_source_finalize),
(gst_lfo_control_source_dispose),
(gst_lfo_control_source_set_property),
(gst_lfo_control_source_get_property),
(gst_lfo_control_source_class_init):
* libs/gst/controller/gstlfocontrolsource.h:
* libs/gst/controller/gstlfocontrolsourceprivate.h:
API: Add GstLFOControlSource, a control source that gives values
for specific timestamps based on several periodic waveforms.
Fixes #459717.
* tests/check/libs/controller.c: (GST_START_TEST),
(gst_controller_suite):
* docs/libs/gstreamer-libs-docs.sgml:
* docs/libs/gstreamer-libs-sections.txt:
* docs/libs/gstreamer-libs.types:
Add documentation and unit tests for GstLFOControlSource.
2007-08-03 15:47:17 +00:00
|
|
|
GstClockTime ts = timestamp; \
|
2011-12-06 07:35:57 +00:00
|
|
|
g##type *values = (g##type *) _values; \
|
2010-02-22 15:25:45 +00:00
|
|
|
g##type max, min; \
|
|
|
|
gdouble amp, off, frequency; \
|
|
|
|
GstClockTime timeshift, period; \
|
libs/gst/controller/: API: Add GstLFOControlSource, a control source that gives values for specific timestamps based ...
Original commit message from CVS:
reviewed by: Stefan Kost <ensonic@users.sf.net>
* libs/gst/controller/Makefile.am:
* libs/gst/controller/gstlfocontrolsource.c: (_calculate_pos),
(gst_lfo_waveform_get_type), (gst_lfo_control_source_reset),
(gst_lfo_control_source_new),
(gst_lfo_control_source_set_waveform),
(gst_lfo_control_source_bind), (gst_lfo_control_source_init),
(gst_lfo_control_source_finalize),
(gst_lfo_control_source_dispose),
(gst_lfo_control_source_set_property),
(gst_lfo_control_source_get_property),
(gst_lfo_control_source_class_init):
* libs/gst/controller/gstlfocontrolsource.h:
* libs/gst/controller/gstlfocontrolsourceprivate.h:
API: Add GstLFOControlSource, a control source that gives values
for specific timestamps based on several periodic waveforms.
Fixes #459717.
* tests/check/libs/controller.c: (GST_START_TEST),
(gst_controller_suite):
* docs/libs/gstreamer-libs-docs.sgml:
* docs/libs/gstreamer-libs-sections.txt:
* docs/libs/gstreamer-libs.types:
Add documentation and unit tests for GstLFOControlSource.
2007-08-03 15:47:17 +00:00
|
|
|
\
|
|
|
|
g_mutex_lock (self->lock); \
|
2010-02-22 15:25:45 +00:00
|
|
|
max = g_value_get_##type (&self->priv->maximum_value); \
|
|
|
|
min = g_value_get_##type (&self->priv->minimum_value); \
|
|
|
|
amp = convert (g_value_get_##type (&self->priv->amplitude)); \
|
|
|
|
off = convert (g_value_get_##type (&self->priv->offset)); \
|
|
|
|
timeshift = self->priv->timeshift; \
|
|
|
|
period = self->priv->period; \
|
|
|
|
frequency = self->priv->frequency; \
|
|
|
|
\
|
2011-12-06 07:35:57 +00:00
|
|
|
for(i = 0; i < n_values; i++) { \
|
2010-02-22 15:25:45 +00:00
|
|
|
*values = _saw_get_##type (self, max, min, amp, off, timeshift, period, frequency, ts); \
|
2011-12-06 07:35:57 +00:00
|
|
|
ts += interval; \
|
libs/gst/controller/: API: Add GstLFOControlSource, a control source that gives values for specific timestamps based ...
Original commit message from CVS:
reviewed by: Stefan Kost <ensonic@users.sf.net>
* libs/gst/controller/Makefile.am:
* libs/gst/controller/gstlfocontrolsource.c: (_calculate_pos),
(gst_lfo_waveform_get_type), (gst_lfo_control_source_reset),
(gst_lfo_control_source_new),
(gst_lfo_control_source_set_waveform),
(gst_lfo_control_source_bind), (gst_lfo_control_source_init),
(gst_lfo_control_source_finalize),
(gst_lfo_control_source_dispose),
(gst_lfo_control_source_set_property),
(gst_lfo_control_source_get_property),
(gst_lfo_control_source_class_init):
* libs/gst/controller/gstlfocontrolsource.h:
* libs/gst/controller/gstlfocontrolsourceprivate.h:
API: Add GstLFOControlSource, a control source that gives values
for specific timestamps based on several periodic waveforms.
Fixes #459717.
* tests/check/libs/controller.c: (GST_START_TEST),
(gst_controller_suite):
* docs/libs/gstreamer-libs-docs.sgml:
* docs/libs/gstreamer-libs-sections.txt:
* docs/libs/gstreamer-libs.types:
Add documentation and unit tests for GstLFOControlSource.
2007-08-03 15:47:17 +00:00
|
|
|
values++; \
|
|
|
|
} \
|
|
|
|
g_mutex_unlock (self->lock); \
|
|
|
|
return TRUE; \
|
|
|
|
}
|
|
|
|
|
2007-09-13 09:08:23 +00:00
|
|
|
DEFINE_SAW (int, TRUE, EMPTY);
|
|
|
|
DEFINE_SAW (uint, TRUE, EMPTY);
|
|
|
|
DEFINE_SAW (long, TRUE, EMPTY);
|
|
|
|
DEFINE_SAW (ulong, TRUE, EMPTY);
|
|
|
|
DEFINE_SAW (int64, TRUE, EMPTY);
|
2008-11-17 21:43:06 +00:00
|
|
|
DEFINE_SAW (uint64, TRUE, gst_guint64_to_gdouble);
|
2007-09-13 09:08:23 +00:00
|
|
|
DEFINE_SAW (float, FALSE, EMPTY);
|
|
|
|
DEFINE_SAW (double, FALSE, EMPTY);
|
libs/gst/controller/: API: Add GstLFOControlSource, a control source that gives values for specific timestamps based ...
Original commit message from CVS:
reviewed by: Stefan Kost <ensonic@users.sf.net>
* libs/gst/controller/Makefile.am:
* libs/gst/controller/gstlfocontrolsource.c: (_calculate_pos),
(gst_lfo_waveform_get_type), (gst_lfo_control_source_reset),
(gst_lfo_control_source_new),
(gst_lfo_control_source_set_waveform),
(gst_lfo_control_source_bind), (gst_lfo_control_source_init),
(gst_lfo_control_source_finalize),
(gst_lfo_control_source_dispose),
(gst_lfo_control_source_set_property),
(gst_lfo_control_source_get_property),
(gst_lfo_control_source_class_init):
* libs/gst/controller/gstlfocontrolsource.h:
* libs/gst/controller/gstlfocontrolsourceprivate.h:
API: Add GstLFOControlSource, a control source that gives values
for specific timestamps based on several periodic waveforms.
Fixes #459717.
* tests/check/libs/controller.c: (GST_START_TEST),
(gst_controller_suite):
* docs/libs/gstreamer-libs-docs.sgml:
* docs/libs/gstreamer-libs-sections.txt:
* docs/libs/gstreamer-libs.types:
Add documentation and unit tests for GstLFOControlSource.
2007-08-03 15:47:17 +00:00
|
|
|
|
|
|
|
static GstWaveformImplementation waveform_saw = {
|
|
|
|
(GstControlSourceGetValue) waveform_saw_get_int,
|
|
|
|
(GstControlSourceGetValueArray) waveform_saw_get_int_value_array,
|
|
|
|
(GstControlSourceGetValue) waveform_saw_get_uint,
|
|
|
|
(GstControlSourceGetValueArray) waveform_saw_get_uint_value_array,
|
|
|
|
(GstControlSourceGetValue) waveform_saw_get_long,
|
|
|
|
(GstControlSourceGetValueArray) waveform_saw_get_long_value_array,
|
|
|
|
(GstControlSourceGetValue) waveform_saw_get_ulong,
|
|
|
|
(GstControlSourceGetValueArray) waveform_saw_get_ulong_value_array,
|
|
|
|
(GstControlSourceGetValue) waveform_saw_get_int64,
|
|
|
|
(GstControlSourceGetValueArray) waveform_saw_get_int64_value_array,
|
|
|
|
(GstControlSourceGetValue) waveform_saw_get_uint64,
|
|
|
|
(GstControlSourceGetValueArray) waveform_saw_get_uint64_value_array,
|
|
|
|
(GstControlSourceGetValue) waveform_saw_get_float,
|
|
|
|
(GstControlSourceGetValueArray) waveform_saw_get_float_value_array,
|
|
|
|
(GstControlSourceGetValue) waveform_saw_get_double,
|
|
|
|
(GstControlSourceGetValueArray) waveform_saw_get_double_value_array
|
|
|
|
};
|
|
|
|
|
2007-09-13 09:08:23 +00:00
|
|
|
#define DEFINE_RSAW(type,round,convert) \
|
libs/gst/controller/: API: Add GstLFOControlSource, a control source that gives values for specific timestamps based ...
Original commit message from CVS:
reviewed by: Stefan Kost <ensonic@users.sf.net>
* libs/gst/controller/Makefile.am:
* libs/gst/controller/gstlfocontrolsource.c: (_calculate_pos),
(gst_lfo_waveform_get_type), (gst_lfo_control_source_reset),
(gst_lfo_control_source_new),
(gst_lfo_control_source_set_waveform),
(gst_lfo_control_source_bind), (gst_lfo_control_source_init),
(gst_lfo_control_source_finalize),
(gst_lfo_control_source_dispose),
(gst_lfo_control_source_set_property),
(gst_lfo_control_source_get_property),
(gst_lfo_control_source_class_init):
* libs/gst/controller/gstlfocontrolsource.h:
* libs/gst/controller/gstlfocontrolsourceprivate.h:
API: Add GstLFOControlSource, a control source that gives values
for specific timestamps based on several periodic waveforms.
Fixes #459717.
* tests/check/libs/controller.c: (GST_START_TEST),
(gst_controller_suite):
* docs/libs/gstreamer-libs-docs.sgml:
* docs/libs/gstreamer-libs-sections.txt:
* docs/libs/gstreamer-libs.types:
Add documentation and unit tests for GstLFOControlSource.
2007-08-03 15:47:17 +00:00
|
|
|
\
|
|
|
|
static inline g##type \
|
2010-02-22 15:25:45 +00:00
|
|
|
_rsaw_get_##type (GstLFOControlSource *self, g##type max, g##type min, gdouble amp, gdouble off, GstClockTime timeshift, GstClockTime period, gdouble frequency, GstClockTime timestamp) \
|
libs/gst/controller/: API: Add GstLFOControlSource, a control source that gives values for specific timestamps based ...
Original commit message from CVS:
reviewed by: Stefan Kost <ensonic@users.sf.net>
* libs/gst/controller/Makefile.am:
* libs/gst/controller/gstlfocontrolsource.c: (_calculate_pos),
(gst_lfo_waveform_get_type), (gst_lfo_control_source_reset),
(gst_lfo_control_source_new),
(gst_lfo_control_source_set_waveform),
(gst_lfo_control_source_bind), (gst_lfo_control_source_init),
(gst_lfo_control_source_finalize),
(gst_lfo_control_source_dispose),
(gst_lfo_control_source_set_property),
(gst_lfo_control_source_get_property),
(gst_lfo_control_source_class_init):
* libs/gst/controller/gstlfocontrolsource.h:
* libs/gst/controller/gstlfocontrolsourceprivate.h:
API: Add GstLFOControlSource, a control source that gives values
for specific timestamps based on several periodic waveforms.
Fixes #459717.
* tests/check/libs/controller.c: (GST_START_TEST),
(gst_controller_suite):
* docs/libs/gstreamer-libs-docs.sgml:
* docs/libs/gstreamer-libs-sections.txt:
* docs/libs/gstreamer-libs.types:
Add documentation and unit tests for GstLFOControlSource.
2007-08-03 15:47:17 +00:00
|
|
|
{ \
|
2010-02-22 15:25:45 +00:00
|
|
|
GstClockTime pos = _calculate_pos (timestamp, timeshift, period); \
|
libs/gst/controller/: API: Add GstLFOControlSource, a control source that gives values for specific timestamps based ...
Original commit message from CVS:
reviewed by: Stefan Kost <ensonic@users.sf.net>
* libs/gst/controller/Makefile.am:
* libs/gst/controller/gstlfocontrolsource.c: (_calculate_pos),
(gst_lfo_waveform_get_type), (gst_lfo_control_source_reset),
(gst_lfo_control_source_new),
(gst_lfo_control_source_set_waveform),
(gst_lfo_control_source_bind), (gst_lfo_control_source_init),
(gst_lfo_control_source_finalize),
(gst_lfo_control_source_dispose),
(gst_lfo_control_source_set_property),
(gst_lfo_control_source_get_property),
(gst_lfo_control_source_class_init):
* libs/gst/controller/gstlfocontrolsource.h:
* libs/gst/controller/gstlfocontrolsourceprivate.h:
API: Add GstLFOControlSource, a control source that gives values
for specific timestamps based on several periodic waveforms.
Fixes #459717.
* tests/check/libs/controller.c: (GST_START_TEST),
(gst_controller_suite):
* docs/libs/gstreamer-libs-docs.sgml:
* docs/libs/gstreamer-libs-sections.txt:
* docs/libs/gstreamer-libs.types:
Add documentation and unit tests for GstLFOControlSource.
2007-08-03 15:47:17 +00:00
|
|
|
gdouble ret; \
|
|
|
|
\
|
2008-11-17 21:43:06 +00:00
|
|
|
ret = ((gst_guint64_to_gdouble (pos) - gst_guint64_to_gdouble (period) / 2.0) * ((2.0 * amp) / gst_guint64_to_gdouble (period)));\
|
libs/gst/controller/: API: Add GstLFOControlSource, a control source that gives values for specific timestamps based ...
Original commit message from CVS:
reviewed by: Stefan Kost <ensonic@users.sf.net>
* libs/gst/controller/Makefile.am:
* libs/gst/controller/gstlfocontrolsource.c: (_calculate_pos),
(gst_lfo_waveform_get_type), (gst_lfo_control_source_reset),
(gst_lfo_control_source_new),
(gst_lfo_control_source_set_waveform),
(gst_lfo_control_source_bind), (gst_lfo_control_source_init),
(gst_lfo_control_source_finalize),
(gst_lfo_control_source_dispose),
(gst_lfo_control_source_set_property),
(gst_lfo_control_source_get_property),
(gst_lfo_control_source_class_init):
* libs/gst/controller/gstlfocontrolsource.h:
* libs/gst/controller/gstlfocontrolsourceprivate.h:
API: Add GstLFOControlSource, a control source that gives values
for specific timestamps based on several periodic waveforms.
Fixes #459717.
* tests/check/libs/controller.c: (GST_START_TEST),
(gst_controller_suite):
* docs/libs/gstreamer-libs-docs.sgml:
* docs/libs/gstreamer-libs-sections.txt:
* docs/libs/gstreamer-libs.types:
Add documentation and unit tests for GstLFOControlSource.
2007-08-03 15:47:17 +00:00
|
|
|
\
|
|
|
|
ret += off; \
|
|
|
|
\
|
|
|
|
if (round) \
|
|
|
|
ret += 0.5; \
|
|
|
|
\
|
2007-09-13 09:08:23 +00:00
|
|
|
return (g##type) CLAMP (ret, convert (min), convert (max)); \
|
libs/gst/controller/: API: Add GstLFOControlSource, a control source that gives values for specific timestamps based ...
Original commit message from CVS:
reviewed by: Stefan Kost <ensonic@users.sf.net>
* libs/gst/controller/Makefile.am:
* libs/gst/controller/gstlfocontrolsource.c: (_calculate_pos),
(gst_lfo_waveform_get_type), (gst_lfo_control_source_reset),
(gst_lfo_control_source_new),
(gst_lfo_control_source_set_waveform),
(gst_lfo_control_source_bind), (gst_lfo_control_source_init),
(gst_lfo_control_source_finalize),
(gst_lfo_control_source_dispose),
(gst_lfo_control_source_set_property),
(gst_lfo_control_source_get_property),
(gst_lfo_control_source_class_init):
* libs/gst/controller/gstlfocontrolsource.h:
* libs/gst/controller/gstlfocontrolsourceprivate.h:
API: Add GstLFOControlSource, a control source that gives values
for specific timestamps based on several periodic waveforms.
Fixes #459717.
* tests/check/libs/controller.c: (GST_START_TEST),
(gst_controller_suite):
* docs/libs/gstreamer-libs-docs.sgml:
* docs/libs/gstreamer-libs-sections.txt:
* docs/libs/gstreamer-libs.types:
Add documentation and unit tests for GstLFOControlSource.
2007-08-03 15:47:17 +00:00
|
|
|
} \
|
|
|
|
\
|
|
|
|
static gboolean \
|
|
|
|
waveform_rsaw_get_##type (GstLFOControlSource *self, GstClockTime timestamp, \
|
|
|
|
GValue *value) \
|
|
|
|
{ \
|
2010-02-22 15:25:45 +00:00
|
|
|
g##type ret, max, min; \
|
|
|
|
gdouble amp, off, frequency; \
|
|
|
|
GstClockTime timeshift, period; \
|
|
|
|
\
|
libs/gst/controller/: API: Add GstLFOControlSource, a control source that gives values for specific timestamps based ...
Original commit message from CVS:
reviewed by: Stefan Kost <ensonic@users.sf.net>
* libs/gst/controller/Makefile.am:
* libs/gst/controller/gstlfocontrolsource.c: (_calculate_pos),
(gst_lfo_waveform_get_type), (gst_lfo_control_source_reset),
(gst_lfo_control_source_new),
(gst_lfo_control_source_set_waveform),
(gst_lfo_control_source_bind), (gst_lfo_control_source_init),
(gst_lfo_control_source_finalize),
(gst_lfo_control_source_dispose),
(gst_lfo_control_source_set_property),
(gst_lfo_control_source_get_property),
(gst_lfo_control_source_class_init):
* libs/gst/controller/gstlfocontrolsource.h:
* libs/gst/controller/gstlfocontrolsourceprivate.h:
API: Add GstLFOControlSource, a control source that gives values
for specific timestamps based on several periodic waveforms.
Fixes #459717.
* tests/check/libs/controller.c: (GST_START_TEST),
(gst_controller_suite):
* docs/libs/gstreamer-libs-docs.sgml:
* docs/libs/gstreamer-libs-sections.txt:
* docs/libs/gstreamer-libs.types:
Add documentation and unit tests for GstLFOControlSource.
2007-08-03 15:47:17 +00:00
|
|
|
g_mutex_lock (self->lock); \
|
2010-02-22 15:25:45 +00:00
|
|
|
max = g_value_get_##type (&self->priv->maximum_value); \
|
|
|
|
min = g_value_get_##type (&self->priv->minimum_value); \
|
|
|
|
amp = convert (g_value_get_##type (&self->priv->amplitude)); \
|
|
|
|
off = convert (g_value_get_##type (&self->priv->offset)); \
|
|
|
|
timeshift = self->priv->timeshift; \
|
|
|
|
period = self->priv->period; \
|
|
|
|
frequency = self->priv->frequency; \
|
|
|
|
\
|
|
|
|
ret = _rsaw_get_##type (self, max, min, amp, off, timeshift, period, frequency, timestamp); \
|
libs/gst/controller/: API: Add GstLFOControlSource, a control source that gives values for specific timestamps based ...
Original commit message from CVS:
reviewed by: Stefan Kost <ensonic@users.sf.net>
* libs/gst/controller/Makefile.am:
* libs/gst/controller/gstlfocontrolsource.c: (_calculate_pos),
(gst_lfo_waveform_get_type), (gst_lfo_control_source_reset),
(gst_lfo_control_source_new),
(gst_lfo_control_source_set_waveform),
(gst_lfo_control_source_bind), (gst_lfo_control_source_init),
(gst_lfo_control_source_finalize),
(gst_lfo_control_source_dispose),
(gst_lfo_control_source_set_property),
(gst_lfo_control_source_get_property),
(gst_lfo_control_source_class_init):
* libs/gst/controller/gstlfocontrolsource.h:
* libs/gst/controller/gstlfocontrolsourceprivate.h:
API: Add GstLFOControlSource, a control source that gives values
for specific timestamps based on several periodic waveforms.
Fixes #459717.
* tests/check/libs/controller.c: (GST_START_TEST),
(gst_controller_suite):
* docs/libs/gstreamer-libs-docs.sgml:
* docs/libs/gstreamer-libs-sections.txt:
* docs/libs/gstreamer-libs.types:
Add documentation and unit tests for GstLFOControlSource.
2007-08-03 15:47:17 +00:00
|
|
|
g_value_set_##type (value, ret); \
|
|
|
|
g_mutex_unlock (self->lock); \
|
|
|
|
return TRUE; \
|
|
|
|
} \
|
|
|
|
\
|
|
|
|
static gboolean \
|
|
|
|
waveform_rsaw_get_##type##_value_array (GstLFOControlSource *self, \
|
2011-12-06 07:35:57 +00:00
|
|
|
GstClockTime timestamp, GstClockTime interval, guint n_values, gpointer *_values) \
|
libs/gst/controller/: API: Add GstLFOControlSource, a control source that gives values for specific timestamps based ...
Original commit message from CVS:
reviewed by: Stefan Kost <ensonic@users.sf.net>
* libs/gst/controller/Makefile.am:
* libs/gst/controller/gstlfocontrolsource.c: (_calculate_pos),
(gst_lfo_waveform_get_type), (gst_lfo_control_source_reset),
(gst_lfo_control_source_new),
(gst_lfo_control_source_set_waveform),
(gst_lfo_control_source_bind), (gst_lfo_control_source_init),
(gst_lfo_control_source_finalize),
(gst_lfo_control_source_dispose),
(gst_lfo_control_source_set_property),
(gst_lfo_control_source_get_property),
(gst_lfo_control_source_class_init):
* libs/gst/controller/gstlfocontrolsource.h:
* libs/gst/controller/gstlfocontrolsourceprivate.h:
API: Add GstLFOControlSource, a control source that gives values
for specific timestamps based on several periodic waveforms.
Fixes #459717.
* tests/check/libs/controller.c: (GST_START_TEST),
(gst_controller_suite):
* docs/libs/gstreamer-libs-docs.sgml:
* docs/libs/gstreamer-libs-sections.txt:
* docs/libs/gstreamer-libs.types:
Add documentation and unit tests for GstLFOControlSource.
2007-08-03 15:47:17 +00:00
|
|
|
{ \
|
2011-12-06 07:35:57 +00:00
|
|
|
guint i; \
|
libs/gst/controller/: API: Add GstLFOControlSource, a control source that gives values for specific timestamps based ...
Original commit message from CVS:
reviewed by: Stefan Kost <ensonic@users.sf.net>
* libs/gst/controller/Makefile.am:
* libs/gst/controller/gstlfocontrolsource.c: (_calculate_pos),
(gst_lfo_waveform_get_type), (gst_lfo_control_source_reset),
(gst_lfo_control_source_new),
(gst_lfo_control_source_set_waveform),
(gst_lfo_control_source_bind), (gst_lfo_control_source_init),
(gst_lfo_control_source_finalize),
(gst_lfo_control_source_dispose),
(gst_lfo_control_source_set_property),
(gst_lfo_control_source_get_property),
(gst_lfo_control_source_class_init):
* libs/gst/controller/gstlfocontrolsource.h:
* libs/gst/controller/gstlfocontrolsourceprivate.h:
API: Add GstLFOControlSource, a control source that gives values
for specific timestamps based on several periodic waveforms.
Fixes #459717.
* tests/check/libs/controller.c: (GST_START_TEST),
(gst_controller_suite):
* docs/libs/gstreamer-libs-docs.sgml:
* docs/libs/gstreamer-libs-sections.txt:
* docs/libs/gstreamer-libs.types:
Add documentation and unit tests for GstLFOControlSource.
2007-08-03 15:47:17 +00:00
|
|
|
GstClockTime ts = timestamp; \
|
2011-12-06 07:35:57 +00:00
|
|
|
g##type *values = (g##type *) _values; \
|
2010-02-22 15:25:45 +00:00
|
|
|
g##type max, min; \
|
|
|
|
gdouble amp, off, frequency; \
|
|
|
|
GstClockTime timeshift, period; \
|
libs/gst/controller/: API: Add GstLFOControlSource, a control source that gives values for specific timestamps based ...
Original commit message from CVS:
reviewed by: Stefan Kost <ensonic@users.sf.net>
* libs/gst/controller/Makefile.am:
* libs/gst/controller/gstlfocontrolsource.c: (_calculate_pos),
(gst_lfo_waveform_get_type), (gst_lfo_control_source_reset),
(gst_lfo_control_source_new),
(gst_lfo_control_source_set_waveform),
(gst_lfo_control_source_bind), (gst_lfo_control_source_init),
(gst_lfo_control_source_finalize),
(gst_lfo_control_source_dispose),
(gst_lfo_control_source_set_property),
(gst_lfo_control_source_get_property),
(gst_lfo_control_source_class_init):
* libs/gst/controller/gstlfocontrolsource.h:
* libs/gst/controller/gstlfocontrolsourceprivate.h:
API: Add GstLFOControlSource, a control source that gives values
for specific timestamps based on several periodic waveforms.
Fixes #459717.
* tests/check/libs/controller.c: (GST_START_TEST),
(gst_controller_suite):
* docs/libs/gstreamer-libs-docs.sgml:
* docs/libs/gstreamer-libs-sections.txt:
* docs/libs/gstreamer-libs.types:
Add documentation and unit tests for GstLFOControlSource.
2007-08-03 15:47:17 +00:00
|
|
|
\
|
|
|
|
g_mutex_lock (self->lock); \
|
2010-02-22 15:25:45 +00:00
|
|
|
max = g_value_get_##type (&self->priv->maximum_value); \
|
|
|
|
min = g_value_get_##type (&self->priv->minimum_value); \
|
|
|
|
amp = convert (g_value_get_##type (&self->priv->amplitude)); \
|
|
|
|
off = convert (g_value_get_##type (&self->priv->offset)); \
|
|
|
|
timeshift = self->priv->timeshift; \
|
|
|
|
period = self->priv->period; \
|
|
|
|
frequency = self->priv->frequency; \
|
|
|
|
\
|
2011-12-06 07:35:57 +00:00
|
|
|
for(i = 0; i < n_values; i++) { \
|
2010-02-22 15:25:45 +00:00
|
|
|
*values = _rsaw_get_##type (self, max, min, amp, off, timeshift, period, frequency, ts); \
|
2011-12-06 07:35:57 +00:00
|
|
|
ts += interval; \
|
libs/gst/controller/: API: Add GstLFOControlSource, a control source that gives values for specific timestamps based ...
Original commit message from CVS:
reviewed by: Stefan Kost <ensonic@users.sf.net>
* libs/gst/controller/Makefile.am:
* libs/gst/controller/gstlfocontrolsource.c: (_calculate_pos),
(gst_lfo_waveform_get_type), (gst_lfo_control_source_reset),
(gst_lfo_control_source_new),
(gst_lfo_control_source_set_waveform),
(gst_lfo_control_source_bind), (gst_lfo_control_source_init),
(gst_lfo_control_source_finalize),
(gst_lfo_control_source_dispose),
(gst_lfo_control_source_set_property),
(gst_lfo_control_source_get_property),
(gst_lfo_control_source_class_init):
* libs/gst/controller/gstlfocontrolsource.h:
* libs/gst/controller/gstlfocontrolsourceprivate.h:
API: Add GstLFOControlSource, a control source that gives values
for specific timestamps based on several periodic waveforms.
Fixes #459717.
* tests/check/libs/controller.c: (GST_START_TEST),
(gst_controller_suite):
* docs/libs/gstreamer-libs-docs.sgml:
* docs/libs/gstreamer-libs-sections.txt:
* docs/libs/gstreamer-libs.types:
Add documentation and unit tests for GstLFOControlSource.
2007-08-03 15:47:17 +00:00
|
|
|
values++; \
|
|
|
|
} \
|
|
|
|
g_mutex_unlock (self->lock); \
|
|
|
|
return TRUE; \
|
|
|
|
}
|
|
|
|
|
2007-09-13 09:08:23 +00:00
|
|
|
DEFINE_RSAW (int, TRUE, EMPTY);
|
|
|
|
DEFINE_RSAW (uint, TRUE, EMPTY);
|
|
|
|
DEFINE_RSAW (long, TRUE, EMPTY);
|
|
|
|
DEFINE_RSAW (ulong, TRUE, EMPTY);
|
|
|
|
DEFINE_RSAW (int64, TRUE, EMPTY);
|
2008-11-17 21:43:06 +00:00
|
|
|
DEFINE_RSAW (uint64, TRUE, gst_guint64_to_gdouble);
|
2007-09-13 09:08:23 +00:00
|
|
|
DEFINE_RSAW (float, FALSE, EMPTY);
|
|
|
|
DEFINE_RSAW (double, FALSE, EMPTY);
|
libs/gst/controller/: API: Add GstLFOControlSource, a control source that gives values for specific timestamps based ...
Original commit message from CVS:
reviewed by: Stefan Kost <ensonic@users.sf.net>
* libs/gst/controller/Makefile.am:
* libs/gst/controller/gstlfocontrolsource.c: (_calculate_pos),
(gst_lfo_waveform_get_type), (gst_lfo_control_source_reset),
(gst_lfo_control_source_new),
(gst_lfo_control_source_set_waveform),
(gst_lfo_control_source_bind), (gst_lfo_control_source_init),
(gst_lfo_control_source_finalize),
(gst_lfo_control_source_dispose),
(gst_lfo_control_source_set_property),
(gst_lfo_control_source_get_property),
(gst_lfo_control_source_class_init):
* libs/gst/controller/gstlfocontrolsource.h:
* libs/gst/controller/gstlfocontrolsourceprivate.h:
API: Add GstLFOControlSource, a control source that gives values
for specific timestamps based on several periodic waveforms.
Fixes #459717.
* tests/check/libs/controller.c: (GST_START_TEST),
(gst_controller_suite):
* docs/libs/gstreamer-libs-docs.sgml:
* docs/libs/gstreamer-libs-sections.txt:
* docs/libs/gstreamer-libs.types:
Add documentation and unit tests for GstLFOControlSource.
2007-08-03 15:47:17 +00:00
|
|
|
|
|
|
|
static GstWaveformImplementation waveform_rsaw = {
|
|
|
|
(GstControlSourceGetValue) waveform_rsaw_get_int,
|
|
|
|
(GstControlSourceGetValueArray) waveform_rsaw_get_int_value_array,
|
|
|
|
(GstControlSourceGetValue) waveform_rsaw_get_uint,
|
|
|
|
(GstControlSourceGetValueArray) waveform_rsaw_get_uint_value_array,
|
|
|
|
(GstControlSourceGetValue) waveform_rsaw_get_long,
|
|
|
|
(GstControlSourceGetValueArray) waveform_rsaw_get_long_value_array,
|
|
|
|
(GstControlSourceGetValue) waveform_rsaw_get_ulong,
|
|
|
|
(GstControlSourceGetValueArray) waveform_rsaw_get_ulong_value_array,
|
|
|
|
(GstControlSourceGetValue) waveform_rsaw_get_int64,
|
|
|
|
(GstControlSourceGetValueArray) waveform_rsaw_get_int64_value_array,
|
|
|
|
(GstControlSourceGetValue) waveform_rsaw_get_uint64,
|
|
|
|
(GstControlSourceGetValueArray) waveform_rsaw_get_uint64_value_array,
|
|
|
|
(GstControlSourceGetValue) waveform_rsaw_get_float,
|
|
|
|
(GstControlSourceGetValueArray) waveform_rsaw_get_float_value_array,
|
|
|
|
(GstControlSourceGetValue) waveform_rsaw_get_double,
|
|
|
|
(GstControlSourceGetValueArray) waveform_rsaw_get_double_value_array
|
|
|
|
};
|
|
|
|
|
2007-09-13 09:08:23 +00:00
|
|
|
#define DEFINE_TRIANGLE(type,round,convert) \
|
libs/gst/controller/: API: Add GstLFOControlSource, a control source that gives values for specific timestamps based ...
Original commit message from CVS:
reviewed by: Stefan Kost <ensonic@users.sf.net>
* libs/gst/controller/Makefile.am:
* libs/gst/controller/gstlfocontrolsource.c: (_calculate_pos),
(gst_lfo_waveform_get_type), (gst_lfo_control_source_reset),
(gst_lfo_control_source_new),
(gst_lfo_control_source_set_waveform),
(gst_lfo_control_source_bind), (gst_lfo_control_source_init),
(gst_lfo_control_source_finalize),
(gst_lfo_control_source_dispose),
(gst_lfo_control_source_set_property),
(gst_lfo_control_source_get_property),
(gst_lfo_control_source_class_init):
* libs/gst/controller/gstlfocontrolsource.h:
* libs/gst/controller/gstlfocontrolsourceprivate.h:
API: Add GstLFOControlSource, a control source that gives values
for specific timestamps based on several periodic waveforms.
Fixes #459717.
* tests/check/libs/controller.c: (GST_START_TEST),
(gst_controller_suite):
* docs/libs/gstreamer-libs-docs.sgml:
* docs/libs/gstreamer-libs-sections.txt:
* docs/libs/gstreamer-libs.types:
Add documentation and unit tests for GstLFOControlSource.
2007-08-03 15:47:17 +00:00
|
|
|
\
|
|
|
|
static inline g##type \
|
2010-02-22 15:25:45 +00:00
|
|
|
_triangle_get_##type (GstLFOControlSource *self, g##type max, g##type min, gdouble amp, gdouble off, GstClockTime timeshift, GstClockTime period, gdouble frequency, GstClockTime timestamp) \
|
libs/gst/controller/: API: Add GstLFOControlSource, a control source that gives values for specific timestamps based ...
Original commit message from CVS:
reviewed by: Stefan Kost <ensonic@users.sf.net>
* libs/gst/controller/Makefile.am:
* libs/gst/controller/gstlfocontrolsource.c: (_calculate_pos),
(gst_lfo_waveform_get_type), (gst_lfo_control_source_reset),
(gst_lfo_control_source_new),
(gst_lfo_control_source_set_waveform),
(gst_lfo_control_source_bind), (gst_lfo_control_source_init),
(gst_lfo_control_source_finalize),
(gst_lfo_control_source_dispose),
(gst_lfo_control_source_set_property),
(gst_lfo_control_source_get_property),
(gst_lfo_control_source_class_init):
* libs/gst/controller/gstlfocontrolsource.h:
* libs/gst/controller/gstlfocontrolsourceprivate.h:
API: Add GstLFOControlSource, a control source that gives values
for specific timestamps based on several periodic waveforms.
Fixes #459717.
* tests/check/libs/controller.c: (GST_START_TEST),
(gst_controller_suite):
* docs/libs/gstreamer-libs-docs.sgml:
* docs/libs/gstreamer-libs-sections.txt:
* docs/libs/gstreamer-libs.types:
Add documentation and unit tests for GstLFOControlSource.
2007-08-03 15:47:17 +00:00
|
|
|
{ \
|
2010-02-22 15:25:45 +00:00
|
|
|
GstClockTime pos = _calculate_pos (timestamp, timeshift, period); \
|
libs/gst/controller/: API: Add GstLFOControlSource, a control source that gives values for specific timestamps based ...
Original commit message from CVS:
reviewed by: Stefan Kost <ensonic@users.sf.net>
* libs/gst/controller/Makefile.am:
* libs/gst/controller/gstlfocontrolsource.c: (_calculate_pos),
(gst_lfo_waveform_get_type), (gst_lfo_control_source_reset),
(gst_lfo_control_source_new),
(gst_lfo_control_source_set_waveform),
(gst_lfo_control_source_bind), (gst_lfo_control_source_init),
(gst_lfo_control_source_finalize),
(gst_lfo_control_source_dispose),
(gst_lfo_control_source_set_property),
(gst_lfo_control_source_get_property),
(gst_lfo_control_source_class_init):
* libs/gst/controller/gstlfocontrolsource.h:
* libs/gst/controller/gstlfocontrolsourceprivate.h:
API: Add GstLFOControlSource, a control source that gives values
for specific timestamps based on several periodic waveforms.
Fixes #459717.
* tests/check/libs/controller.c: (GST_START_TEST),
(gst_controller_suite):
* docs/libs/gstreamer-libs-docs.sgml:
* docs/libs/gstreamer-libs-sections.txt:
* docs/libs/gstreamer-libs.types:
Add documentation and unit tests for GstLFOControlSource.
2007-08-03 15:47:17 +00:00
|
|
|
gdouble ret; \
|
|
|
|
\
|
2008-11-17 21:43:06 +00:00
|
|
|
if (gst_guint64_to_gdouble (pos) <= gst_guint64_to_gdouble (period) / 4.0) \
|
|
|
|
ret = gst_guint64_to_gdouble (pos) * ((4.0 * amp) / gst_guint64_to_gdouble (period)); \
|
|
|
|
else if (gst_guint64_to_gdouble (pos) <= (3.0 * gst_guint64_to_gdouble (period)) / 4.0) \
|
|
|
|
ret = -(gst_guint64_to_gdouble (pos) - gst_guint64_to_gdouble (period) / 2.0) * ((4.0 * amp) / gst_guint64_to_gdouble (period)); \
|
libs/gst/controller/: API: Add GstLFOControlSource, a control source that gives values for specific timestamps based ...
Original commit message from CVS:
reviewed by: Stefan Kost <ensonic@users.sf.net>
* libs/gst/controller/Makefile.am:
* libs/gst/controller/gstlfocontrolsource.c: (_calculate_pos),
(gst_lfo_waveform_get_type), (gst_lfo_control_source_reset),
(gst_lfo_control_source_new),
(gst_lfo_control_source_set_waveform),
(gst_lfo_control_source_bind), (gst_lfo_control_source_init),
(gst_lfo_control_source_finalize),
(gst_lfo_control_source_dispose),
(gst_lfo_control_source_set_property),
(gst_lfo_control_source_get_property),
(gst_lfo_control_source_class_init):
* libs/gst/controller/gstlfocontrolsource.h:
* libs/gst/controller/gstlfocontrolsourceprivate.h:
API: Add GstLFOControlSource, a control source that gives values
for specific timestamps based on several periodic waveforms.
Fixes #459717.
* tests/check/libs/controller.c: (GST_START_TEST),
(gst_controller_suite):
* docs/libs/gstreamer-libs-docs.sgml:
* docs/libs/gstreamer-libs-sections.txt:
* docs/libs/gstreamer-libs.types:
Add documentation and unit tests for GstLFOControlSource.
2007-08-03 15:47:17 +00:00
|
|
|
else \
|
2008-11-17 21:43:06 +00:00
|
|
|
ret = gst_guint64_to_gdouble (period) - gst_guint64_to_gdouble (pos) * ((4.0 * amp) / gst_guint64_to_gdouble (period)); \
|
libs/gst/controller/: API: Add GstLFOControlSource, a control source that gives values for specific timestamps based ...
Original commit message from CVS:
reviewed by: Stefan Kost <ensonic@users.sf.net>
* libs/gst/controller/Makefile.am:
* libs/gst/controller/gstlfocontrolsource.c: (_calculate_pos),
(gst_lfo_waveform_get_type), (gst_lfo_control_source_reset),
(gst_lfo_control_source_new),
(gst_lfo_control_source_set_waveform),
(gst_lfo_control_source_bind), (gst_lfo_control_source_init),
(gst_lfo_control_source_finalize),
(gst_lfo_control_source_dispose),
(gst_lfo_control_source_set_property),
(gst_lfo_control_source_get_property),
(gst_lfo_control_source_class_init):
* libs/gst/controller/gstlfocontrolsource.h:
* libs/gst/controller/gstlfocontrolsourceprivate.h:
API: Add GstLFOControlSource, a control source that gives values
for specific timestamps based on several periodic waveforms.
Fixes #459717.
* tests/check/libs/controller.c: (GST_START_TEST),
(gst_controller_suite):
* docs/libs/gstreamer-libs-docs.sgml:
* docs/libs/gstreamer-libs-sections.txt:
* docs/libs/gstreamer-libs.types:
Add documentation and unit tests for GstLFOControlSource.
2007-08-03 15:47:17 +00:00
|
|
|
\
|
|
|
|
ret += off; \
|
|
|
|
\
|
|
|
|
if (round) \
|
|
|
|
ret += 0.5; \
|
|
|
|
\
|
2007-09-13 09:08:23 +00:00
|
|
|
return (g##type) CLAMP (ret, convert (min), convert (max)); \
|
libs/gst/controller/: API: Add GstLFOControlSource, a control source that gives values for specific timestamps based ...
Original commit message from CVS:
reviewed by: Stefan Kost <ensonic@users.sf.net>
* libs/gst/controller/Makefile.am:
* libs/gst/controller/gstlfocontrolsource.c: (_calculate_pos),
(gst_lfo_waveform_get_type), (gst_lfo_control_source_reset),
(gst_lfo_control_source_new),
(gst_lfo_control_source_set_waveform),
(gst_lfo_control_source_bind), (gst_lfo_control_source_init),
(gst_lfo_control_source_finalize),
(gst_lfo_control_source_dispose),
(gst_lfo_control_source_set_property),
(gst_lfo_control_source_get_property),
(gst_lfo_control_source_class_init):
* libs/gst/controller/gstlfocontrolsource.h:
* libs/gst/controller/gstlfocontrolsourceprivate.h:
API: Add GstLFOControlSource, a control source that gives values
for specific timestamps based on several periodic waveforms.
Fixes #459717.
* tests/check/libs/controller.c: (GST_START_TEST),
(gst_controller_suite):
* docs/libs/gstreamer-libs-docs.sgml:
* docs/libs/gstreamer-libs-sections.txt:
* docs/libs/gstreamer-libs.types:
Add documentation and unit tests for GstLFOControlSource.
2007-08-03 15:47:17 +00:00
|
|
|
} \
|
|
|
|
\
|
|
|
|
static gboolean \
|
|
|
|
waveform_triangle_get_##type (GstLFOControlSource *self, GstClockTime timestamp, \
|
|
|
|
GValue *value) \
|
|
|
|
{ \
|
2010-02-22 15:25:45 +00:00
|
|
|
g##type ret, max, min; \
|
|
|
|
gdouble amp, off, frequency; \
|
|
|
|
GstClockTime timeshift, period; \
|
|
|
|
\
|
libs/gst/controller/: API: Add GstLFOControlSource, a control source that gives values for specific timestamps based ...
Original commit message from CVS:
reviewed by: Stefan Kost <ensonic@users.sf.net>
* libs/gst/controller/Makefile.am:
* libs/gst/controller/gstlfocontrolsource.c: (_calculate_pos),
(gst_lfo_waveform_get_type), (gst_lfo_control_source_reset),
(gst_lfo_control_source_new),
(gst_lfo_control_source_set_waveform),
(gst_lfo_control_source_bind), (gst_lfo_control_source_init),
(gst_lfo_control_source_finalize),
(gst_lfo_control_source_dispose),
(gst_lfo_control_source_set_property),
(gst_lfo_control_source_get_property),
(gst_lfo_control_source_class_init):
* libs/gst/controller/gstlfocontrolsource.h:
* libs/gst/controller/gstlfocontrolsourceprivate.h:
API: Add GstLFOControlSource, a control source that gives values
for specific timestamps based on several periodic waveforms.
Fixes #459717.
* tests/check/libs/controller.c: (GST_START_TEST),
(gst_controller_suite):
* docs/libs/gstreamer-libs-docs.sgml:
* docs/libs/gstreamer-libs-sections.txt:
* docs/libs/gstreamer-libs.types:
Add documentation and unit tests for GstLFOControlSource.
2007-08-03 15:47:17 +00:00
|
|
|
g_mutex_lock (self->lock); \
|
2010-02-22 15:25:45 +00:00
|
|
|
max = g_value_get_##type (&self->priv->maximum_value); \
|
|
|
|
min = g_value_get_##type (&self->priv->minimum_value); \
|
|
|
|
amp = convert (g_value_get_##type (&self->priv->amplitude)); \
|
|
|
|
off = convert (g_value_get_##type (&self->priv->offset)); \
|
|
|
|
timeshift = self->priv->timeshift; \
|
|
|
|
period = self->priv->period; \
|
|
|
|
frequency = self->priv->frequency; \
|
|
|
|
\
|
|
|
|
ret = _triangle_get_##type (self, max, min, amp, off, timeshift, period, frequency, timestamp); \
|
libs/gst/controller/: API: Add GstLFOControlSource, a control source that gives values for specific timestamps based ...
Original commit message from CVS:
reviewed by: Stefan Kost <ensonic@users.sf.net>
* libs/gst/controller/Makefile.am:
* libs/gst/controller/gstlfocontrolsource.c: (_calculate_pos),
(gst_lfo_waveform_get_type), (gst_lfo_control_source_reset),
(gst_lfo_control_source_new),
(gst_lfo_control_source_set_waveform),
(gst_lfo_control_source_bind), (gst_lfo_control_source_init),
(gst_lfo_control_source_finalize),
(gst_lfo_control_source_dispose),
(gst_lfo_control_source_set_property),
(gst_lfo_control_source_get_property),
(gst_lfo_control_source_class_init):
* libs/gst/controller/gstlfocontrolsource.h:
* libs/gst/controller/gstlfocontrolsourceprivate.h:
API: Add GstLFOControlSource, a control source that gives values
for specific timestamps based on several periodic waveforms.
Fixes #459717.
* tests/check/libs/controller.c: (GST_START_TEST),
(gst_controller_suite):
* docs/libs/gstreamer-libs-docs.sgml:
* docs/libs/gstreamer-libs-sections.txt:
* docs/libs/gstreamer-libs.types:
Add documentation and unit tests for GstLFOControlSource.
2007-08-03 15:47:17 +00:00
|
|
|
g_value_set_##type (value, ret); \
|
|
|
|
g_mutex_unlock (self->lock); \
|
|
|
|
return TRUE; \
|
|
|
|
} \
|
|
|
|
\
|
|
|
|
static gboolean \
|
|
|
|
waveform_triangle_get_##type##_value_array (GstLFOControlSource *self, \
|
2011-12-06 07:35:57 +00:00
|
|
|
GstClockTime timestamp, GstClockTime interval, guint n_values, gpointer *_values) \
|
libs/gst/controller/: API: Add GstLFOControlSource, a control source that gives values for specific timestamps based ...
Original commit message from CVS:
reviewed by: Stefan Kost <ensonic@users.sf.net>
* libs/gst/controller/Makefile.am:
* libs/gst/controller/gstlfocontrolsource.c: (_calculate_pos),
(gst_lfo_waveform_get_type), (gst_lfo_control_source_reset),
(gst_lfo_control_source_new),
(gst_lfo_control_source_set_waveform),
(gst_lfo_control_source_bind), (gst_lfo_control_source_init),
(gst_lfo_control_source_finalize),
(gst_lfo_control_source_dispose),
(gst_lfo_control_source_set_property),
(gst_lfo_control_source_get_property),
(gst_lfo_control_source_class_init):
* libs/gst/controller/gstlfocontrolsource.h:
* libs/gst/controller/gstlfocontrolsourceprivate.h:
API: Add GstLFOControlSource, a control source that gives values
for specific timestamps based on several periodic waveforms.
Fixes #459717.
* tests/check/libs/controller.c: (GST_START_TEST),
(gst_controller_suite):
* docs/libs/gstreamer-libs-docs.sgml:
* docs/libs/gstreamer-libs-sections.txt:
* docs/libs/gstreamer-libs.types:
Add documentation and unit tests for GstLFOControlSource.
2007-08-03 15:47:17 +00:00
|
|
|
{ \
|
2011-12-06 07:35:57 +00:00
|
|
|
guint i; \
|
libs/gst/controller/: API: Add GstLFOControlSource, a control source that gives values for specific timestamps based ...
Original commit message from CVS:
reviewed by: Stefan Kost <ensonic@users.sf.net>
* libs/gst/controller/Makefile.am:
* libs/gst/controller/gstlfocontrolsource.c: (_calculate_pos),
(gst_lfo_waveform_get_type), (gst_lfo_control_source_reset),
(gst_lfo_control_source_new),
(gst_lfo_control_source_set_waveform),
(gst_lfo_control_source_bind), (gst_lfo_control_source_init),
(gst_lfo_control_source_finalize),
(gst_lfo_control_source_dispose),
(gst_lfo_control_source_set_property),
(gst_lfo_control_source_get_property),
(gst_lfo_control_source_class_init):
* libs/gst/controller/gstlfocontrolsource.h:
* libs/gst/controller/gstlfocontrolsourceprivate.h:
API: Add GstLFOControlSource, a control source that gives values
for specific timestamps based on several periodic waveforms.
Fixes #459717.
* tests/check/libs/controller.c: (GST_START_TEST),
(gst_controller_suite):
* docs/libs/gstreamer-libs-docs.sgml:
* docs/libs/gstreamer-libs-sections.txt:
* docs/libs/gstreamer-libs.types:
Add documentation and unit tests for GstLFOControlSource.
2007-08-03 15:47:17 +00:00
|
|
|
GstClockTime ts = timestamp; \
|
2011-12-06 07:35:57 +00:00
|
|
|
g##type *values = (g##type *) _values; \
|
2010-02-22 15:25:45 +00:00
|
|
|
g##type max, min; \
|
|
|
|
gdouble amp, off, frequency; \
|
|
|
|
GstClockTime timeshift, period; \
|
libs/gst/controller/: API: Add GstLFOControlSource, a control source that gives values for specific timestamps based ...
Original commit message from CVS:
reviewed by: Stefan Kost <ensonic@users.sf.net>
* libs/gst/controller/Makefile.am:
* libs/gst/controller/gstlfocontrolsource.c: (_calculate_pos),
(gst_lfo_waveform_get_type), (gst_lfo_control_source_reset),
(gst_lfo_control_source_new),
(gst_lfo_control_source_set_waveform),
(gst_lfo_control_source_bind), (gst_lfo_control_source_init),
(gst_lfo_control_source_finalize),
(gst_lfo_control_source_dispose),
(gst_lfo_control_source_set_property),
(gst_lfo_control_source_get_property),
(gst_lfo_control_source_class_init):
* libs/gst/controller/gstlfocontrolsource.h:
* libs/gst/controller/gstlfocontrolsourceprivate.h:
API: Add GstLFOControlSource, a control source that gives values
for specific timestamps based on several periodic waveforms.
Fixes #459717.
* tests/check/libs/controller.c: (GST_START_TEST),
(gst_controller_suite):
* docs/libs/gstreamer-libs-docs.sgml:
* docs/libs/gstreamer-libs-sections.txt:
* docs/libs/gstreamer-libs.types:
Add documentation and unit tests for GstLFOControlSource.
2007-08-03 15:47:17 +00:00
|
|
|
\
|
|
|
|
g_mutex_lock (self->lock); \
|
2010-02-22 15:25:45 +00:00
|
|
|
max = g_value_get_##type (&self->priv->maximum_value); \
|
|
|
|
min = g_value_get_##type (&self->priv->minimum_value); \
|
|
|
|
amp = convert (g_value_get_##type (&self->priv->amplitude)); \
|
|
|
|
off = convert (g_value_get_##type (&self->priv->offset)); \
|
|
|
|
timeshift = self->priv->timeshift; \
|
|
|
|
period = self->priv->period; \
|
|
|
|
frequency = self->priv->frequency; \
|
|
|
|
\
|
2011-12-06 07:35:57 +00:00
|
|
|
for(i = 0; i < n_values; i++) { \
|
2010-02-22 15:25:45 +00:00
|
|
|
*values = _triangle_get_##type (self, max, min, amp, off, timeshift, period, frequency, ts); \
|
2011-12-06 07:35:57 +00:00
|
|
|
ts += interval; \
|
libs/gst/controller/: API: Add GstLFOControlSource, a control source that gives values for specific timestamps based ...
Original commit message from CVS:
reviewed by: Stefan Kost <ensonic@users.sf.net>
* libs/gst/controller/Makefile.am:
* libs/gst/controller/gstlfocontrolsource.c: (_calculate_pos),
(gst_lfo_waveform_get_type), (gst_lfo_control_source_reset),
(gst_lfo_control_source_new),
(gst_lfo_control_source_set_waveform),
(gst_lfo_control_source_bind), (gst_lfo_control_source_init),
(gst_lfo_control_source_finalize),
(gst_lfo_control_source_dispose),
(gst_lfo_control_source_set_property),
(gst_lfo_control_source_get_property),
(gst_lfo_control_source_class_init):
* libs/gst/controller/gstlfocontrolsource.h:
* libs/gst/controller/gstlfocontrolsourceprivate.h:
API: Add GstLFOControlSource, a control source that gives values
for specific timestamps based on several periodic waveforms.
Fixes #459717.
* tests/check/libs/controller.c: (GST_START_TEST),
(gst_controller_suite):
* docs/libs/gstreamer-libs-docs.sgml:
* docs/libs/gstreamer-libs-sections.txt:
* docs/libs/gstreamer-libs.types:
Add documentation and unit tests for GstLFOControlSource.
2007-08-03 15:47:17 +00:00
|
|
|
values++; \
|
|
|
|
} \
|
|
|
|
g_mutex_unlock (self->lock); \
|
|
|
|
return TRUE; \
|
|
|
|
}
|
|
|
|
|
2007-09-13 09:08:23 +00:00
|
|
|
DEFINE_TRIANGLE (int, TRUE, EMPTY);
|
|
|
|
DEFINE_TRIANGLE (uint, TRUE, EMPTY);
|
|
|
|
DEFINE_TRIANGLE (long, TRUE, EMPTY);
|
|
|
|
DEFINE_TRIANGLE (ulong, TRUE, EMPTY);
|
|
|
|
DEFINE_TRIANGLE (int64, TRUE, EMPTY);
|
2008-11-17 21:43:06 +00:00
|
|
|
DEFINE_TRIANGLE (uint64, TRUE, gst_guint64_to_gdouble);
|
2007-09-13 09:08:23 +00:00
|
|
|
DEFINE_TRIANGLE (float, FALSE, EMPTY);
|
|
|
|
DEFINE_TRIANGLE (double, FALSE, EMPTY);
|
libs/gst/controller/: API: Add GstLFOControlSource, a control source that gives values for specific timestamps based ...
Original commit message from CVS:
reviewed by: Stefan Kost <ensonic@users.sf.net>
* libs/gst/controller/Makefile.am:
* libs/gst/controller/gstlfocontrolsource.c: (_calculate_pos),
(gst_lfo_waveform_get_type), (gst_lfo_control_source_reset),
(gst_lfo_control_source_new),
(gst_lfo_control_source_set_waveform),
(gst_lfo_control_source_bind), (gst_lfo_control_source_init),
(gst_lfo_control_source_finalize),
(gst_lfo_control_source_dispose),
(gst_lfo_control_source_set_property),
(gst_lfo_control_source_get_property),
(gst_lfo_control_source_class_init):
* libs/gst/controller/gstlfocontrolsource.h:
* libs/gst/controller/gstlfocontrolsourceprivate.h:
API: Add GstLFOControlSource, a control source that gives values
for specific timestamps based on several periodic waveforms.
Fixes #459717.
* tests/check/libs/controller.c: (GST_START_TEST),
(gst_controller_suite):
* docs/libs/gstreamer-libs-docs.sgml:
* docs/libs/gstreamer-libs-sections.txt:
* docs/libs/gstreamer-libs.types:
Add documentation and unit tests for GstLFOControlSource.
2007-08-03 15:47:17 +00:00
|
|
|
|
|
|
|
static GstWaveformImplementation waveform_triangle = {
|
|
|
|
(GstControlSourceGetValue) waveform_triangle_get_int,
|
|
|
|
(GstControlSourceGetValueArray) waveform_triangle_get_int_value_array,
|
|
|
|
(GstControlSourceGetValue) waveform_triangle_get_uint,
|
|
|
|
(GstControlSourceGetValueArray) waveform_triangle_get_uint_value_array,
|
|
|
|
(GstControlSourceGetValue) waveform_triangle_get_long,
|
|
|
|
(GstControlSourceGetValueArray) waveform_triangle_get_long_value_array,
|
|
|
|
(GstControlSourceGetValue) waveform_triangle_get_ulong,
|
|
|
|
(GstControlSourceGetValueArray) waveform_triangle_get_ulong_value_array,
|
|
|
|
(GstControlSourceGetValue) waveform_triangle_get_int64,
|
|
|
|
(GstControlSourceGetValueArray) waveform_triangle_get_int64_value_array,
|
|
|
|
(GstControlSourceGetValue) waveform_triangle_get_uint64,
|
|
|
|
(GstControlSourceGetValueArray) waveform_triangle_get_uint64_value_array,
|
|
|
|
(GstControlSourceGetValue) waveform_triangle_get_float,
|
|
|
|
(GstControlSourceGetValueArray) waveform_triangle_get_float_value_array,
|
|
|
|
(GstControlSourceGetValue) waveform_triangle_get_double,
|
|
|
|
(GstControlSourceGetValueArray) waveform_triangle_get_double_value_array
|
|
|
|
};
|
|
|
|
|
|
|
|
static GstWaveformImplementation *waveforms[] = {
|
|
|
|
&waveform_sine,
|
|
|
|
&waveform_square,
|
|
|
|
&waveform_saw,
|
|
|
|
&waveform_rsaw,
|
|
|
|
&waveform_triangle
|
|
|
|
};
|
|
|
|
|
2011-09-13 22:04:09 +00:00
|
|
|
static const guint num_waveforms = G_N_ELEMENTS (waveforms);
|
libs/gst/controller/: API: Add GstLFOControlSource, a control source that gives values for specific timestamps based ...
Original commit message from CVS:
reviewed by: Stefan Kost <ensonic@users.sf.net>
* libs/gst/controller/Makefile.am:
* libs/gst/controller/gstlfocontrolsource.c: (_calculate_pos),
(gst_lfo_waveform_get_type), (gst_lfo_control_source_reset),
(gst_lfo_control_source_new),
(gst_lfo_control_source_set_waveform),
(gst_lfo_control_source_bind), (gst_lfo_control_source_init),
(gst_lfo_control_source_finalize),
(gst_lfo_control_source_dispose),
(gst_lfo_control_source_set_property),
(gst_lfo_control_source_get_property),
(gst_lfo_control_source_class_init):
* libs/gst/controller/gstlfocontrolsource.h:
* libs/gst/controller/gstlfocontrolsourceprivate.h:
API: Add GstLFOControlSource, a control source that gives values
for specific timestamps based on several periodic waveforms.
Fixes #459717.
* tests/check/libs/controller.c: (GST_START_TEST),
(gst_controller_suite):
* docs/libs/gstreamer-libs-docs.sgml:
* docs/libs/gstreamer-libs-sections.txt:
* docs/libs/gstreamer-libs.types:
Add documentation and unit tests for GstLFOControlSource.
2007-08-03 15:47:17 +00:00
|
|
|
|
|
|
|
enum
|
|
|
|
{
|
|
|
|
PROP_WAVEFORM = 1,
|
|
|
|
PROP_FREQUENCY,
|
|
|
|
PROP_TIMESHIFT,
|
|
|
|
PROP_AMPLITUDE,
|
|
|
|
PROP_OFFSET
|
|
|
|
};
|
|
|
|
|
|
|
|
GType
|
|
|
|
gst_lfo_waveform_get_type (void)
|
|
|
|
{
|
2010-10-08 08:34:47 +00:00
|
|
|
static gsize gtype = 0;
|
|
|
|
static const GEnumValue values[] = {
|
|
|
|
{GST_LFO_WAVEFORM_SINE, "GST_LFO_WAVEFORM_SINE",
|
|
|
|
"sine"},
|
|
|
|
{GST_LFO_WAVEFORM_SQUARE, "GST_LFO_WAVEFORM_SQUARE",
|
|
|
|
"square"},
|
|
|
|
{GST_LFO_WAVEFORM_SAW, "GST_LFO_WAVEFORM_SAW",
|
|
|
|
"saw"},
|
|
|
|
{GST_LFO_WAVEFORM_REVERSE_SAW, "GST_LFO_WAVEFORM_REVERSE_SAW",
|
|
|
|
"reverse-saw"},
|
|
|
|
{GST_LFO_WAVEFORM_TRIANGLE, "GST_LFO_WAVEFORM_TRIANGLE",
|
|
|
|
"triangle"},
|
|
|
|
{0, NULL, NULL}
|
|
|
|
};
|
|
|
|
|
|
|
|
if (g_once_init_enter (>ype)) {
|
|
|
|
GType tmp = g_enum_register_static ("GstLFOWaveform", values);
|
|
|
|
g_once_init_leave (>ype, tmp);
|
libs/gst/controller/: API: Add GstLFOControlSource, a control source that gives values for specific timestamps based ...
Original commit message from CVS:
reviewed by: Stefan Kost <ensonic@users.sf.net>
* libs/gst/controller/Makefile.am:
* libs/gst/controller/gstlfocontrolsource.c: (_calculate_pos),
(gst_lfo_waveform_get_type), (gst_lfo_control_source_reset),
(gst_lfo_control_source_new),
(gst_lfo_control_source_set_waveform),
(gst_lfo_control_source_bind), (gst_lfo_control_source_init),
(gst_lfo_control_source_finalize),
(gst_lfo_control_source_dispose),
(gst_lfo_control_source_set_property),
(gst_lfo_control_source_get_property),
(gst_lfo_control_source_class_init):
* libs/gst/controller/gstlfocontrolsource.h:
* libs/gst/controller/gstlfocontrolsourceprivate.h:
API: Add GstLFOControlSource, a control source that gives values
for specific timestamps based on several periodic waveforms.
Fixes #459717.
* tests/check/libs/controller.c: (GST_START_TEST),
(gst_controller_suite):
* docs/libs/gstreamer-libs-docs.sgml:
* docs/libs/gstreamer-libs-sections.txt:
* docs/libs/gstreamer-libs.types:
Add documentation and unit tests for GstLFOControlSource.
2007-08-03 15:47:17 +00:00
|
|
|
}
|
2010-10-08 08:34:47 +00:00
|
|
|
|
|
|
|
return (GType) gtype;
|
libs/gst/controller/: API: Add GstLFOControlSource, a control source that gives values for specific timestamps based ...
Original commit message from CVS:
reviewed by: Stefan Kost <ensonic@users.sf.net>
* libs/gst/controller/Makefile.am:
* libs/gst/controller/gstlfocontrolsource.c: (_calculate_pos),
(gst_lfo_waveform_get_type), (gst_lfo_control_source_reset),
(gst_lfo_control_source_new),
(gst_lfo_control_source_set_waveform),
(gst_lfo_control_source_bind), (gst_lfo_control_source_init),
(gst_lfo_control_source_finalize),
(gst_lfo_control_source_dispose),
(gst_lfo_control_source_set_property),
(gst_lfo_control_source_get_property),
(gst_lfo_control_source_class_init):
* libs/gst/controller/gstlfocontrolsource.h:
* libs/gst/controller/gstlfocontrolsourceprivate.h:
API: Add GstLFOControlSource, a control source that gives values
for specific timestamps based on several periodic waveforms.
Fixes #459717.
* tests/check/libs/controller.c: (GST_START_TEST),
(gst_controller_suite):
* docs/libs/gstreamer-libs-docs.sgml:
* docs/libs/gstreamer-libs-sections.txt:
* docs/libs/gstreamer-libs.types:
Add documentation and unit tests for GstLFOControlSource.
2007-08-03 15:47:17 +00:00
|
|
|
}
|
|
|
|
|
2011-11-04 10:34:11 +00:00
|
|
|
#define _do_init \
|
|
|
|
GST_DEBUG_CATEGORY_INIT (GST_CAT_DEFAULT, "lfo control source", 0, "low frequency oscillator control source")
|
|
|
|
|
|
|
|
G_DEFINE_TYPE_WITH_CODE (GstLFOControlSource, gst_lfo_control_source,
|
|
|
|
GST_TYPE_CONTROL_SOURCE, _do_init);
|
libs/gst/controller/: API: Add GstLFOControlSource, a control source that gives values for specific timestamps based ...
Original commit message from CVS:
reviewed by: Stefan Kost <ensonic@users.sf.net>
* libs/gst/controller/Makefile.am:
* libs/gst/controller/gstlfocontrolsource.c: (_calculate_pos),
(gst_lfo_waveform_get_type), (gst_lfo_control_source_reset),
(gst_lfo_control_source_new),
(gst_lfo_control_source_set_waveform),
(gst_lfo_control_source_bind), (gst_lfo_control_source_init),
(gst_lfo_control_source_finalize),
(gst_lfo_control_source_dispose),
(gst_lfo_control_source_set_property),
(gst_lfo_control_source_get_property),
(gst_lfo_control_source_class_init):
* libs/gst/controller/gstlfocontrolsource.h:
* libs/gst/controller/gstlfocontrolsourceprivate.h:
API: Add GstLFOControlSource, a control source that gives values
for specific timestamps based on several periodic waveforms.
Fixes #459717.
* tests/check/libs/controller.c: (GST_START_TEST),
(gst_controller_suite):
* docs/libs/gstreamer-libs-docs.sgml:
* docs/libs/gstreamer-libs-sections.txt:
* docs/libs/gstreamer-libs.types:
Add documentation and unit tests for GstLFOControlSource.
2007-08-03 15:47:17 +00:00
|
|
|
|
|
|
|
static void
|
|
|
|
gst_lfo_control_source_reset (GstLFOControlSource * self)
|
|
|
|
{
|
|
|
|
GstControlSource *csource = GST_CONTROL_SOURCE (self);
|
|
|
|
|
|
|
|
csource->get_value = NULL;
|
|
|
|
csource->get_value_array = NULL;
|
|
|
|
|
|
|
|
self->priv->type = self->priv->base = G_TYPE_INVALID;
|
|
|
|
|
|
|
|
if (G_IS_VALUE (&self->priv->minimum_value))
|
|
|
|
g_value_unset (&self->priv->minimum_value);
|
|
|
|
if (G_IS_VALUE (&self->priv->maximum_value))
|
|
|
|
g_value_unset (&self->priv->maximum_value);
|
|
|
|
|
|
|
|
if (G_IS_VALUE (&self->priv->amplitude))
|
|
|
|
g_value_unset (&self->priv->amplitude);
|
|
|
|
if (G_IS_VALUE (&self->priv->offset))
|
|
|
|
g_value_unset (&self->priv->offset);
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* gst_lfo_control_source_new:
|
|
|
|
*
|
|
|
|
* This returns a new, unbound #GstLFOControlSource.
|
|
|
|
*
|
|
|
|
* Returns: a new, unbound #GstLFOControlSource.
|
|
|
|
*/
|
|
|
|
GstLFOControlSource *
|
Correct all relevant warnings found by the sparse semantic code analyzer. This include marking several symbols static...
Original commit message from CVS:
* gst/gstconfig.h.in:
* libs/gst/base/gstcollectpads.c: (gst_collect_pads_read_buffer):
* libs/gst/check/gstcheck.c: (gst_check_log_message_func),
(gst_check_log_critical_func), (gst_check_drop_buffers),
(gst_check_element_push_buffer_list):
* libs/gst/controller/gstcontroller.c: (gst_controller_get),
(gst_controller_get_type):
* libs/gst/controller/gsthelper.c: (gst_object_control_properties),
(gst_object_get_controller), (gst_object_get_control_source):
* libs/gst/controller/gstinterpolationcontrolsource.c:
(gst_interpolation_control_source_new):
* libs/gst/controller/gstlfocontrolsource.c:
(gst_lfo_control_source_new):
* libs/gst/dataprotocol/dataprotocol.c:
(gst_dp_event_from_packet_0_2):
* plugins/elements/gstfdsrc.c:
* plugins/elements/gstmultiqueue.c:
* plugins/elements/gsttee.c:
* plugins/elements/gsttypefindelement.c:
* plugins/indexers/gstfileindex.c: (_file_index_id_save_xml),
(gst_file_index_add_association):
* plugins/indexers/gstmemindex.c:
* tests/benchmarks/gstpollstress.c: (mess_some_more):
* tests/check/elements/queue.c: (setup_queue):
* tests/check/gst/gstpipeline.c:
* tests/check/libs/collectpads.c: (setup), (teardown),
(gst_collect_pads_suite):
* tests/examples/adapter/adapter_test.c:
* tests/examples/metadata/read-metadata.c: (make_pipeline):
* tests/examples/xml/createxml.c:
* tests/examples/xml/runxml.c:
* tools/gst-inspect.c:
* tools/gst-run.c:
Correct all relevant warnings found by the sparse semantic code
analyzer. This include marking several symbols static, using
NULL instead of 0 for pointers, not using variable sized arrays
on the stack, moving variable declarations to the beginning of
a block and using "foo (void)" instead of "foo ()" for declarations.
2008-02-29 12:41:33 +00:00
|
|
|
gst_lfo_control_source_new (void)
|
libs/gst/controller/: API: Add GstLFOControlSource, a control source that gives values for specific timestamps based ...
Original commit message from CVS:
reviewed by: Stefan Kost <ensonic@users.sf.net>
* libs/gst/controller/Makefile.am:
* libs/gst/controller/gstlfocontrolsource.c: (_calculate_pos),
(gst_lfo_waveform_get_type), (gst_lfo_control_source_reset),
(gst_lfo_control_source_new),
(gst_lfo_control_source_set_waveform),
(gst_lfo_control_source_bind), (gst_lfo_control_source_init),
(gst_lfo_control_source_finalize),
(gst_lfo_control_source_dispose),
(gst_lfo_control_source_set_property),
(gst_lfo_control_source_get_property),
(gst_lfo_control_source_class_init):
* libs/gst/controller/gstlfocontrolsource.h:
* libs/gst/controller/gstlfocontrolsourceprivate.h:
API: Add GstLFOControlSource, a control source that gives values
for specific timestamps based on several periodic waveforms.
Fixes #459717.
* tests/check/libs/controller.c: (GST_START_TEST),
(gst_controller_suite):
* docs/libs/gstreamer-libs-docs.sgml:
* docs/libs/gstreamer-libs-sections.txt:
* docs/libs/gstreamer-libs.types:
Add documentation and unit tests for GstLFOControlSource.
2007-08-03 15:47:17 +00:00
|
|
|
{
|
2009-10-28 08:26:32 +00:00
|
|
|
return g_object_newv (GST_TYPE_LFO_CONTROL_SOURCE, 0, NULL);
|
libs/gst/controller/: API: Add GstLFOControlSource, a control source that gives values for specific timestamps based ...
Original commit message from CVS:
reviewed by: Stefan Kost <ensonic@users.sf.net>
* libs/gst/controller/Makefile.am:
* libs/gst/controller/gstlfocontrolsource.c: (_calculate_pos),
(gst_lfo_waveform_get_type), (gst_lfo_control_source_reset),
(gst_lfo_control_source_new),
(gst_lfo_control_source_set_waveform),
(gst_lfo_control_source_bind), (gst_lfo_control_source_init),
(gst_lfo_control_source_finalize),
(gst_lfo_control_source_dispose),
(gst_lfo_control_source_set_property),
(gst_lfo_control_source_get_property),
(gst_lfo_control_source_class_init):
* libs/gst/controller/gstlfocontrolsource.h:
* libs/gst/controller/gstlfocontrolsourceprivate.h:
API: Add GstLFOControlSource, a control source that gives values
for specific timestamps based on several periodic waveforms.
Fixes #459717.
* tests/check/libs/controller.c: (GST_START_TEST),
(gst_controller_suite):
* docs/libs/gstreamer-libs-docs.sgml:
* docs/libs/gstreamer-libs-sections.txt:
* docs/libs/gstreamer-libs.types:
Add documentation and unit tests for GstLFOControlSource.
2007-08-03 15:47:17 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static gboolean
|
|
|
|
gst_lfo_control_source_set_waveform (GstLFOControlSource * self,
|
|
|
|
GstLFOWaveform waveform)
|
|
|
|
{
|
|
|
|
GstControlSource *csource = GST_CONTROL_SOURCE (self);
|
|
|
|
gboolean ret = TRUE;
|
|
|
|
|
2011-09-13 22:04:09 +00:00
|
|
|
if (waveform >= num_waveforms || (int) waveform < 0) {
|
libs/gst/controller/: API: Add GstLFOControlSource, a control source that gives values for specific timestamps based ...
Original commit message from CVS:
reviewed by: Stefan Kost <ensonic@users.sf.net>
* libs/gst/controller/Makefile.am:
* libs/gst/controller/gstlfocontrolsource.c: (_calculate_pos),
(gst_lfo_waveform_get_type), (gst_lfo_control_source_reset),
(gst_lfo_control_source_new),
(gst_lfo_control_source_set_waveform),
(gst_lfo_control_source_bind), (gst_lfo_control_source_init),
(gst_lfo_control_source_finalize),
(gst_lfo_control_source_dispose),
(gst_lfo_control_source_set_property),
(gst_lfo_control_source_get_property),
(gst_lfo_control_source_class_init):
* libs/gst/controller/gstlfocontrolsource.h:
* libs/gst/controller/gstlfocontrolsourceprivate.h:
API: Add GstLFOControlSource, a control source that gives values
for specific timestamps based on several periodic waveforms.
Fixes #459717.
* tests/check/libs/controller.c: (GST_START_TEST),
(gst_controller_suite):
* docs/libs/gstreamer-libs-docs.sgml:
* docs/libs/gstreamer-libs-sections.txt:
* docs/libs/gstreamer-libs.types:
Add documentation and unit tests for GstLFOControlSource.
2007-08-03 15:47:17 +00:00
|
|
|
GST_WARNING ("waveform %d invalid or not implemented yet", waveform);
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (self->priv->base == G_TYPE_INVALID) {
|
|
|
|
GST_WARNING ("not bound to a property yet");
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
|
|
|
switch (self->priv->base) {
|
|
|
|
case G_TYPE_INT:
|
|
|
|
csource->get_value = waveforms[waveform]->get_int;
|
|
|
|
csource->get_value_array = waveforms[waveform]->get_int_value_array;
|
|
|
|
break;
|
|
|
|
case G_TYPE_UINT:{
|
|
|
|
csource->get_value = waveforms[waveform]->get_uint;
|
|
|
|
csource->get_value_array = waveforms[waveform]->get_uint_value_array;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
case G_TYPE_LONG:{
|
|
|
|
csource->get_value = waveforms[waveform]->get_long;
|
|
|
|
csource->get_value_array = waveforms[waveform]->get_long_value_array;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
case G_TYPE_ULONG:{
|
|
|
|
csource->get_value = waveforms[waveform]->get_ulong;
|
|
|
|
csource->get_value_array = waveforms[waveform]->get_ulong_value_array;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
case G_TYPE_INT64:{
|
|
|
|
csource->get_value = waveforms[waveform]->get_int64;
|
|
|
|
csource->get_value_array = waveforms[waveform]->get_int64_value_array;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
case G_TYPE_UINT64:{
|
|
|
|
csource->get_value = waveforms[waveform]->get_uint64;
|
|
|
|
csource->get_value_array = waveforms[waveform]->get_uint64_value_array;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
case G_TYPE_FLOAT:{
|
|
|
|
csource->get_value = waveforms[waveform]->get_float;
|
|
|
|
csource->get_value_array = waveforms[waveform]->get_float_value_array;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
case G_TYPE_DOUBLE:{
|
|
|
|
csource->get_value = waveforms[waveform]->get_double;
|
|
|
|
csource->get_value_array = waveforms[waveform]->get_double_value_array;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
default:
|
|
|
|
ret = FALSE;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (ret)
|
|
|
|
self->priv->waveform = waveform;
|
|
|
|
else
|
2007-08-10 10:30:22 +00:00
|
|
|
GST_WARNING ("incomplete implementation for type '%s'",
|
|
|
|
GST_STR_NULL (g_type_name (self->priv->type)));
|
libs/gst/controller/: API: Add GstLFOControlSource, a control source that gives values for specific timestamps based ...
Original commit message from CVS:
reviewed by: Stefan Kost <ensonic@users.sf.net>
* libs/gst/controller/Makefile.am:
* libs/gst/controller/gstlfocontrolsource.c: (_calculate_pos),
(gst_lfo_waveform_get_type), (gst_lfo_control_source_reset),
(gst_lfo_control_source_new),
(gst_lfo_control_source_set_waveform),
(gst_lfo_control_source_bind), (gst_lfo_control_source_init),
(gst_lfo_control_source_finalize),
(gst_lfo_control_source_dispose),
(gst_lfo_control_source_set_property),
(gst_lfo_control_source_get_property),
(gst_lfo_control_source_class_init):
* libs/gst/controller/gstlfocontrolsource.h:
* libs/gst/controller/gstlfocontrolsourceprivate.h:
API: Add GstLFOControlSource, a control source that gives values
for specific timestamps based on several periodic waveforms.
Fixes #459717.
* tests/check/libs/controller.c: (GST_START_TEST),
(gst_controller_suite):
* docs/libs/gstreamer-libs-docs.sgml:
* docs/libs/gstreamer-libs-sections.txt:
* docs/libs/gstreamer-libs.types:
Add documentation and unit tests for GstLFOControlSource.
2007-08-03 15:47:17 +00:00
|
|
|
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
|
|
|
static gboolean
|
|
|
|
gst_lfo_control_source_bind (GstControlSource * source, GParamSpec * pspec)
|
|
|
|
{
|
|
|
|
GType type, base;
|
|
|
|
GstLFOControlSource *self = GST_LFO_CONTROL_SOURCE (source);
|
|
|
|
gboolean ret = TRUE;
|
|
|
|
|
|
|
|
/* get the fundamental base type */
|
|
|
|
self->priv->type = base = type = G_PARAM_SPEC_VALUE_TYPE (pspec);
|
|
|
|
while ((type = g_type_parent (type)))
|
|
|
|
base = type;
|
|
|
|
|
|
|
|
self->priv->base = base;
|
|
|
|
/* restore type */
|
|
|
|
type = self->priv->type;
|
|
|
|
|
|
|
|
switch (base) {
|
|
|
|
case G_TYPE_INT:{
|
|
|
|
GParamSpecInt *tpspec = G_PARAM_SPEC_INT (pspec);
|
|
|
|
|
|
|
|
g_value_init (&self->priv->minimum_value, type);
|
|
|
|
g_value_set_int (&self->priv->minimum_value, tpspec->minimum);
|
|
|
|
g_value_init (&self->priv->maximum_value, type);
|
|
|
|
g_value_set_int (&self->priv->maximum_value, tpspec->maximum);
|
|
|
|
|
|
|
|
if (!G_IS_VALUE (&self->priv->amplitude)) {
|
|
|
|
g_value_init (&self->priv->amplitude, type);
|
|
|
|
g_value_set_int (&self->priv->amplitude, 0);
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!G_IS_VALUE (&self->priv->offset)) {
|
|
|
|
g_value_init (&self->priv->offset, type);
|
|
|
|
g_value_set_int (&self->priv->offset, tpspec->default_value);
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
case G_TYPE_UINT:{
|
|
|
|
GParamSpecUInt *tpspec = G_PARAM_SPEC_UINT (pspec);
|
|
|
|
|
|
|
|
g_value_init (&self->priv->minimum_value, type);
|
|
|
|
g_value_set_uint (&self->priv->minimum_value, tpspec->minimum);
|
|
|
|
g_value_init (&self->priv->maximum_value, type);
|
|
|
|
g_value_set_uint (&self->priv->maximum_value, tpspec->maximum);
|
|
|
|
|
|
|
|
if (!G_IS_VALUE (&self->priv->amplitude)) {
|
|
|
|
g_value_init (&self->priv->amplitude, type);
|
|
|
|
g_value_set_uint (&self->priv->amplitude, 0);
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!G_IS_VALUE (&self->priv->offset)) {
|
|
|
|
g_value_init (&self->priv->offset, type);
|
|
|
|
g_value_set_uint (&self->priv->offset, tpspec->default_value);
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
case G_TYPE_LONG:{
|
|
|
|
GParamSpecLong *tpspec = G_PARAM_SPEC_LONG (pspec);
|
|
|
|
|
|
|
|
g_value_init (&self->priv->minimum_value, type);
|
|
|
|
g_value_set_long (&self->priv->minimum_value, tpspec->minimum);
|
|
|
|
g_value_init (&self->priv->maximum_value, type);
|
|
|
|
g_value_set_long (&self->priv->maximum_value, tpspec->maximum);
|
|
|
|
if (!G_IS_VALUE (&self->priv->amplitude)) {
|
|
|
|
g_value_init (&self->priv->amplitude, type);
|
|
|
|
g_value_set_long (&self->priv->amplitude, 0);
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!G_IS_VALUE (&self->priv->offset)) {
|
|
|
|
g_value_init (&self->priv->offset, type);
|
|
|
|
g_value_set_long (&self->priv->offset, tpspec->default_value);
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
case G_TYPE_ULONG:{
|
|
|
|
GParamSpecULong *tpspec = G_PARAM_SPEC_ULONG (pspec);
|
|
|
|
|
|
|
|
g_value_init (&self->priv->minimum_value, type);
|
|
|
|
g_value_set_ulong (&self->priv->minimum_value, tpspec->minimum);
|
|
|
|
g_value_init (&self->priv->maximum_value, type);
|
|
|
|
g_value_set_ulong (&self->priv->maximum_value, tpspec->maximum);
|
|
|
|
if (!G_IS_VALUE (&self->priv->amplitude)) {
|
|
|
|
g_value_init (&self->priv->amplitude, type);
|
|
|
|
g_value_set_ulong (&self->priv->amplitude, 0);
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!G_IS_VALUE (&self->priv->offset)) {
|
|
|
|
g_value_init (&self->priv->offset, type);
|
|
|
|
g_value_set_ulong (&self->priv->offset, tpspec->default_value);
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
case G_TYPE_INT64:{
|
|
|
|
GParamSpecInt64 *tpspec = G_PARAM_SPEC_INT64 (pspec);
|
|
|
|
|
|
|
|
g_value_init (&self->priv->minimum_value, type);
|
|
|
|
g_value_set_int64 (&self->priv->minimum_value, tpspec->minimum);
|
|
|
|
g_value_init (&self->priv->maximum_value, type);
|
|
|
|
g_value_set_int64 (&self->priv->maximum_value, tpspec->maximum);
|
|
|
|
if (!G_IS_VALUE (&self->priv->amplitude)) {
|
|
|
|
g_value_init (&self->priv->amplitude, type);
|
|
|
|
g_value_set_int64 (&self->priv->amplitude, 0);
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!G_IS_VALUE (&self->priv->offset)) {
|
|
|
|
g_value_init (&self->priv->offset, type);
|
|
|
|
g_value_set_int64 (&self->priv->offset, tpspec->default_value);
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
case G_TYPE_UINT64:{
|
|
|
|
GParamSpecUInt64 *tpspec = G_PARAM_SPEC_UINT64 (pspec);
|
|
|
|
|
|
|
|
g_value_init (&self->priv->minimum_value, type);
|
|
|
|
g_value_set_uint64 (&self->priv->minimum_value, tpspec->minimum);
|
|
|
|
g_value_init (&self->priv->maximum_value, type);
|
|
|
|
g_value_set_uint64 (&self->priv->maximum_value, tpspec->maximum);
|
|
|
|
if (!G_IS_VALUE (&self->priv->amplitude)) {
|
|
|
|
g_value_init (&self->priv->amplitude, type);
|
|
|
|
g_value_set_uint64 (&self->priv->amplitude, 0);
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!G_IS_VALUE (&self->priv->offset)) {
|
|
|
|
g_value_init (&self->priv->offset, type);
|
|
|
|
g_value_set_uint64 (&self->priv->offset, tpspec->default_value);
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
case G_TYPE_FLOAT:{
|
|
|
|
GParamSpecFloat *tpspec = G_PARAM_SPEC_FLOAT (pspec);
|
|
|
|
|
|
|
|
g_value_init (&self->priv->minimum_value, type);
|
|
|
|
g_value_set_float (&self->priv->minimum_value, tpspec->minimum);
|
|
|
|
g_value_init (&self->priv->maximum_value, type);
|
|
|
|
g_value_set_float (&self->priv->maximum_value, tpspec->maximum);
|
|
|
|
if (!G_IS_VALUE (&self->priv->amplitude)) {
|
|
|
|
g_value_init (&self->priv->amplitude, type);
|
|
|
|
g_value_set_float (&self->priv->amplitude, 0.0);
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!G_IS_VALUE (&self->priv->offset)) {
|
|
|
|
g_value_init (&self->priv->offset, type);
|
|
|
|
g_value_set_float (&self->priv->offset, tpspec->default_value);
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
case G_TYPE_DOUBLE:{
|
|
|
|
GParamSpecDouble *tpspec = G_PARAM_SPEC_DOUBLE (pspec);
|
|
|
|
|
|
|
|
g_value_init (&self->priv->minimum_value, type);
|
|
|
|
g_value_set_double (&self->priv->minimum_value, tpspec->minimum);
|
|
|
|
g_value_init (&self->priv->maximum_value, type);
|
|
|
|
g_value_set_double (&self->priv->maximum_value, tpspec->maximum);
|
|
|
|
if (!G_IS_VALUE (&self->priv->amplitude)) {
|
|
|
|
g_value_init (&self->priv->amplitude, type);
|
2010-04-15 20:05:38 +00:00
|
|
|
g_value_set_double (&self->priv->amplitude, 0.0);
|
libs/gst/controller/: API: Add GstLFOControlSource, a control source that gives values for specific timestamps based ...
Original commit message from CVS:
reviewed by: Stefan Kost <ensonic@users.sf.net>
* libs/gst/controller/Makefile.am:
* libs/gst/controller/gstlfocontrolsource.c: (_calculate_pos),
(gst_lfo_waveform_get_type), (gst_lfo_control_source_reset),
(gst_lfo_control_source_new),
(gst_lfo_control_source_set_waveform),
(gst_lfo_control_source_bind), (gst_lfo_control_source_init),
(gst_lfo_control_source_finalize),
(gst_lfo_control_source_dispose),
(gst_lfo_control_source_set_property),
(gst_lfo_control_source_get_property),
(gst_lfo_control_source_class_init):
* libs/gst/controller/gstlfocontrolsource.h:
* libs/gst/controller/gstlfocontrolsourceprivate.h:
API: Add GstLFOControlSource, a control source that gives values
for specific timestamps based on several periodic waveforms.
Fixes #459717.
* tests/check/libs/controller.c: (GST_START_TEST),
(gst_controller_suite):
* docs/libs/gstreamer-libs-docs.sgml:
* docs/libs/gstreamer-libs-sections.txt:
* docs/libs/gstreamer-libs.types:
Add documentation and unit tests for GstLFOControlSource.
2007-08-03 15:47:17 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
if (!G_IS_VALUE (&self->priv->offset)) {
|
|
|
|
g_value_init (&self->priv->offset, type);
|
2010-04-15 20:05:38 +00:00
|
|
|
g_value_set_double (&self->priv->offset, tpspec->default_value);
|
libs/gst/controller/: API: Add GstLFOControlSource, a control source that gives values for specific timestamps based ...
Original commit message from CVS:
reviewed by: Stefan Kost <ensonic@users.sf.net>
* libs/gst/controller/Makefile.am:
* libs/gst/controller/gstlfocontrolsource.c: (_calculate_pos),
(gst_lfo_waveform_get_type), (gst_lfo_control_source_reset),
(gst_lfo_control_source_new),
(gst_lfo_control_source_set_waveform),
(gst_lfo_control_source_bind), (gst_lfo_control_source_init),
(gst_lfo_control_source_finalize),
(gst_lfo_control_source_dispose),
(gst_lfo_control_source_set_property),
(gst_lfo_control_source_get_property),
(gst_lfo_control_source_class_init):
* libs/gst/controller/gstlfocontrolsource.h:
* libs/gst/controller/gstlfocontrolsourceprivate.h:
API: Add GstLFOControlSource, a control source that gives values
for specific timestamps based on several periodic waveforms.
Fixes #459717.
* tests/check/libs/controller.c: (GST_START_TEST),
(gst_controller_suite):
* docs/libs/gstreamer-libs-docs.sgml:
* docs/libs/gstreamer-libs-sections.txt:
* docs/libs/gstreamer-libs.types:
Add documentation and unit tests for GstLFOControlSource.
2007-08-03 15:47:17 +00:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
default:
|
|
|
|
GST_WARNING ("incomplete implementation for paramspec type '%s'",
|
|
|
|
G_PARAM_SPEC_TYPE_NAME (pspec));
|
|
|
|
ret = FALSE;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (ret) {
|
|
|
|
GValue amp = { 0, }
|
|
|
|
, off = {
|
|
|
|
0,};
|
|
|
|
|
|
|
|
/* This should never fail unless the user already set amplitude or offset
|
|
|
|
* with an incompatible type before _bind () */
|
|
|
|
if (!g_value_type_transformable (G_VALUE_TYPE (&self->priv->amplitude),
|
|
|
|
base)
|
|
|
|
|| !g_value_type_transformable (G_VALUE_TYPE (&self->priv->offset),
|
|
|
|
base)) {
|
|
|
|
GST_WARNING ("incompatible types for amplitude or offset");
|
|
|
|
gst_lfo_control_source_reset (self);
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Generate copies and transform to the correct type */
|
|
|
|
g_value_init (&, base);
|
|
|
|
g_value_transform (&self->priv->amplitude, &);
|
|
|
|
g_value_init (&off, base);
|
|
|
|
g_value_transform (&self->priv->offset, &off);
|
|
|
|
|
|
|
|
ret = gst_lfo_control_source_set_waveform (self, self->priv->waveform);
|
|
|
|
|
|
|
|
g_value_unset (&self->priv->amplitude);
|
|
|
|
g_value_init (&self->priv->amplitude, self->priv->base);
|
|
|
|
g_value_transform (&, &self->priv->amplitude);
|
|
|
|
|
|
|
|
g_value_unset (&self->priv->offset);
|
|
|
|
g_value_init (&self->priv->offset, self->priv->base);
|
|
|
|
g_value_transform (&off, &self->priv->offset);
|
|
|
|
|
|
|
|
g_value_unset (&);
|
|
|
|
g_value_unset (&off);
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!ret)
|
|
|
|
gst_lfo_control_source_reset (self);
|
|
|
|
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
gst_lfo_control_source_init (GstLFOControlSource * self)
|
|
|
|
{
|
|
|
|
self->priv =
|
|
|
|
G_TYPE_INSTANCE_GET_PRIVATE (self, GST_TYPE_LFO_CONTROL_SOURCE,
|
|
|
|
GstLFOControlSourcePrivate);
|
|
|
|
self->priv->waveform = GST_LFO_WAVEFORM_SINE;
|
|
|
|
self->priv->frequency = 1.0;
|
|
|
|
self->priv->period = GST_SECOND / self->priv->frequency;
|
|
|
|
self->priv->timeshift = 0;
|
|
|
|
|
|
|
|
self->lock = g_mutex_new ();
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
gst_lfo_control_source_finalize (GObject * obj)
|
|
|
|
{
|
|
|
|
GstLFOControlSource *self = GST_LFO_CONTROL_SOURCE (obj);
|
|
|
|
|
|
|
|
gst_lfo_control_source_reset (self);
|
2011-12-19 21:01:02 +00:00
|
|
|
g_mutex_free (self->lock);
|
libs/gst/controller/: API: Add GstLFOControlSource, a control source that gives values for specific timestamps based ...
Original commit message from CVS:
reviewed by: Stefan Kost <ensonic@users.sf.net>
* libs/gst/controller/Makefile.am:
* libs/gst/controller/gstlfocontrolsource.c: (_calculate_pos),
(gst_lfo_waveform_get_type), (gst_lfo_control_source_reset),
(gst_lfo_control_source_new),
(gst_lfo_control_source_set_waveform),
(gst_lfo_control_source_bind), (gst_lfo_control_source_init),
(gst_lfo_control_source_finalize),
(gst_lfo_control_source_dispose),
(gst_lfo_control_source_set_property),
(gst_lfo_control_source_get_property),
(gst_lfo_control_source_class_init):
* libs/gst/controller/gstlfocontrolsource.h:
* libs/gst/controller/gstlfocontrolsourceprivate.h:
API: Add GstLFOControlSource, a control source that gives values
for specific timestamps based on several periodic waveforms.
Fixes #459717.
* tests/check/libs/controller.c: (GST_START_TEST),
(gst_controller_suite):
* docs/libs/gstreamer-libs-docs.sgml:
* docs/libs/gstreamer-libs-sections.txt:
* docs/libs/gstreamer-libs.types:
Add documentation and unit tests for GstLFOControlSource.
2007-08-03 15:47:17 +00:00
|
|
|
|
2011-12-19 21:01:02 +00:00
|
|
|
G_OBJECT_CLASS (gst_lfo_control_source_parent_class)->finalize (obj);
|
libs/gst/controller/: API: Add GstLFOControlSource, a control source that gives values for specific timestamps based ...
Original commit message from CVS:
reviewed by: Stefan Kost <ensonic@users.sf.net>
* libs/gst/controller/Makefile.am:
* libs/gst/controller/gstlfocontrolsource.c: (_calculate_pos),
(gst_lfo_waveform_get_type), (gst_lfo_control_source_reset),
(gst_lfo_control_source_new),
(gst_lfo_control_source_set_waveform),
(gst_lfo_control_source_bind), (gst_lfo_control_source_init),
(gst_lfo_control_source_finalize),
(gst_lfo_control_source_dispose),
(gst_lfo_control_source_set_property),
(gst_lfo_control_source_get_property),
(gst_lfo_control_source_class_init):
* libs/gst/controller/gstlfocontrolsource.h:
* libs/gst/controller/gstlfocontrolsourceprivate.h:
API: Add GstLFOControlSource, a control source that gives values
for specific timestamps based on several periodic waveforms.
Fixes #459717.
* tests/check/libs/controller.c: (GST_START_TEST),
(gst_controller_suite):
* docs/libs/gstreamer-libs-docs.sgml:
* docs/libs/gstreamer-libs-sections.txt:
* docs/libs/gstreamer-libs.types:
Add documentation and unit tests for GstLFOControlSource.
2007-08-03 15:47:17 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
gst_lfo_control_source_set_property (GObject * object, guint prop_id,
|
|
|
|
const GValue * value, GParamSpec * pspec)
|
|
|
|
{
|
|
|
|
GstLFOControlSource *self = GST_LFO_CONTROL_SOURCE (object);
|
|
|
|
|
|
|
|
switch (prop_id) {
|
|
|
|
case PROP_WAVEFORM:
|
|
|
|
g_mutex_lock (self->lock);
|
2011-08-25 21:53:58 +00:00
|
|
|
gst_lfo_control_source_set_waveform (self,
|
|
|
|
(GstLFOWaveform) g_value_get_enum (value));
|
libs/gst/controller/: API: Add GstLFOControlSource, a control source that gives values for specific timestamps based ...
Original commit message from CVS:
reviewed by: Stefan Kost <ensonic@users.sf.net>
* libs/gst/controller/Makefile.am:
* libs/gst/controller/gstlfocontrolsource.c: (_calculate_pos),
(gst_lfo_waveform_get_type), (gst_lfo_control_source_reset),
(gst_lfo_control_source_new),
(gst_lfo_control_source_set_waveform),
(gst_lfo_control_source_bind), (gst_lfo_control_source_init),
(gst_lfo_control_source_finalize),
(gst_lfo_control_source_dispose),
(gst_lfo_control_source_set_property),
(gst_lfo_control_source_get_property),
(gst_lfo_control_source_class_init):
* libs/gst/controller/gstlfocontrolsource.h:
* libs/gst/controller/gstlfocontrolsourceprivate.h:
API: Add GstLFOControlSource, a control source that gives values
for specific timestamps based on several periodic waveforms.
Fixes #459717.
* tests/check/libs/controller.c: (GST_START_TEST),
(gst_controller_suite):
* docs/libs/gstreamer-libs-docs.sgml:
* docs/libs/gstreamer-libs-sections.txt:
* docs/libs/gstreamer-libs.types:
Add documentation and unit tests for GstLFOControlSource.
2007-08-03 15:47:17 +00:00
|
|
|
g_mutex_unlock (self->lock);
|
|
|
|
break;
|
|
|
|
case PROP_FREQUENCY:{
|
|
|
|
gdouble frequency = g_value_get_double (value);
|
|
|
|
|
|
|
|
g_return_if_fail (frequency > 0
|
|
|
|
|| ((GstClockTime) (GST_SECOND / frequency)) != 0);
|
|
|
|
|
|
|
|
g_mutex_lock (self->lock);
|
|
|
|
self->priv->frequency = frequency;
|
|
|
|
self->priv->period = GST_SECOND / frequency;
|
|
|
|
g_mutex_unlock (self->lock);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
case PROP_TIMESHIFT:
|
|
|
|
g_mutex_lock (self->lock);
|
|
|
|
self->priv->timeshift = g_value_get_uint64 (value);
|
|
|
|
g_mutex_unlock (self->lock);
|
|
|
|
break;
|
|
|
|
case PROP_AMPLITUDE:{
|
|
|
|
GValue *val = g_value_get_boxed (value);
|
|
|
|
|
|
|
|
if (self->priv->type != G_TYPE_INVALID) {
|
|
|
|
g_return_if_fail (g_value_type_transformable (self->priv->type,
|
|
|
|
G_VALUE_TYPE (val)));
|
|
|
|
|
|
|
|
g_mutex_lock (self->lock);
|
|
|
|
if (G_IS_VALUE (&self->priv->amplitude))
|
|
|
|
g_value_unset (&self->priv->amplitude);
|
|
|
|
|
|
|
|
g_value_init (&self->priv->amplitude, self->priv->type);
|
|
|
|
g_value_transform (val, &self->priv->amplitude);
|
|
|
|
g_mutex_unlock (self->lock);
|
|
|
|
} else {
|
|
|
|
g_mutex_lock (self->lock);
|
|
|
|
if (G_IS_VALUE (&self->priv->amplitude))
|
|
|
|
g_value_unset (&self->priv->amplitude);
|
|
|
|
|
|
|
|
g_value_init (&self->priv->amplitude, G_VALUE_TYPE (val));
|
|
|
|
g_value_copy (val, &self->priv->amplitude);
|
|
|
|
g_mutex_unlock (self->lock);
|
|
|
|
}
|
|
|
|
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
case PROP_OFFSET:{
|
|
|
|
GValue *val = g_value_get_boxed (value);
|
|
|
|
|
|
|
|
if (self->priv->type != G_TYPE_INVALID) {
|
|
|
|
g_return_if_fail (g_value_type_transformable (self->priv->type,
|
|
|
|
G_VALUE_TYPE (val)));
|
|
|
|
|
|
|
|
g_mutex_lock (self->lock);
|
|
|
|
if (G_IS_VALUE (&self->priv->offset))
|
|
|
|
g_value_unset (&self->priv->offset);
|
|
|
|
|
|
|
|
g_value_init (&self->priv->offset, self->priv->type);
|
|
|
|
g_value_transform (val, &self->priv->offset);
|
|
|
|
g_mutex_unlock (self->lock);
|
|
|
|
} else {
|
|
|
|
g_mutex_lock (self->lock);
|
|
|
|
if (G_IS_VALUE (&self->priv->offset))
|
|
|
|
g_value_unset (&self->priv->offset);
|
|
|
|
|
|
|
|
g_value_init (&self->priv->offset, G_VALUE_TYPE (val));
|
|
|
|
g_value_copy (val, &self->priv->offset);
|
|
|
|
g_mutex_unlock (self->lock);
|
|
|
|
}
|
|
|
|
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
default:
|
|
|
|
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
gst_lfo_control_source_get_property (GObject * object, guint prop_id,
|
|
|
|
GValue * value, GParamSpec * pspec)
|
|
|
|
{
|
|
|
|
GstLFOControlSource *self = GST_LFO_CONTROL_SOURCE (object);
|
|
|
|
|
|
|
|
switch (prop_id) {
|
|
|
|
case PROP_WAVEFORM:
|
|
|
|
g_value_set_enum (value, self->priv->waveform);
|
|
|
|
break;
|
|
|
|
case PROP_FREQUENCY:
|
|
|
|
g_value_set_double (value, self->priv->frequency);
|
|
|
|
break;
|
|
|
|
case PROP_TIMESHIFT:
|
|
|
|
g_value_set_uint64 (value, self->priv->timeshift);
|
|
|
|
break;
|
|
|
|
case PROP_AMPLITUDE:
|
|
|
|
g_value_set_boxed (value, &self->priv->amplitude);
|
|
|
|
break;
|
|
|
|
case PROP_OFFSET:
|
|
|
|
g_value_set_boxed (value, &self->priv->offset);
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
gst_lfo_control_source_class_init (GstLFOControlSourceClass * klass)
|
|
|
|
{
|
|
|
|
GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
|
|
|
|
GstControlSourceClass *csource_class = GST_CONTROL_SOURCE_CLASS (klass);
|
|
|
|
|
|
|
|
g_type_class_add_private (klass, sizeof (GstLFOControlSourcePrivate));
|
|
|
|
|
|
|
|
gobject_class->finalize = gst_lfo_control_source_finalize;
|
|
|
|
gobject_class->set_property = gst_lfo_control_source_set_property;
|
|
|
|
gobject_class->get_property = gst_lfo_control_source_get_property;
|
|
|
|
|
|
|
|
csource_class->bind = gst_lfo_control_source_bind;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* GstLFOControlSource:waveform
|
|
|
|
*
|
|
|
|
* Specifies the waveform that should be used for this #GstLFOControlSource.
|
|
|
|
*
|
|
|
|
**/
|
|
|
|
g_object_class_install_property (gobject_class, PROP_WAVEFORM,
|
|
|
|
g_param_spec_enum ("waveform", "Waveform", "Waveform",
|
2008-03-22 14:56:17 +00:00
|
|
|
GST_TYPE_LFO_WAVEFORM, GST_LFO_WAVEFORM_SINE,
|
|
|
|
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
|
libs/gst/controller/: API: Add GstLFOControlSource, a control source that gives values for specific timestamps based ...
Original commit message from CVS:
reviewed by: Stefan Kost <ensonic@users.sf.net>
* libs/gst/controller/Makefile.am:
* libs/gst/controller/gstlfocontrolsource.c: (_calculate_pos),
(gst_lfo_waveform_get_type), (gst_lfo_control_source_reset),
(gst_lfo_control_source_new),
(gst_lfo_control_source_set_waveform),
(gst_lfo_control_source_bind), (gst_lfo_control_source_init),
(gst_lfo_control_source_finalize),
(gst_lfo_control_source_dispose),
(gst_lfo_control_source_set_property),
(gst_lfo_control_source_get_property),
(gst_lfo_control_source_class_init):
* libs/gst/controller/gstlfocontrolsource.h:
* libs/gst/controller/gstlfocontrolsourceprivate.h:
API: Add GstLFOControlSource, a control source that gives values
for specific timestamps based on several periodic waveforms.
Fixes #459717.
* tests/check/libs/controller.c: (GST_START_TEST),
(gst_controller_suite):
* docs/libs/gstreamer-libs-docs.sgml:
* docs/libs/gstreamer-libs-sections.txt:
* docs/libs/gstreamer-libs.types:
Add documentation and unit tests for GstLFOControlSource.
2007-08-03 15:47:17 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* GstLFOControlSource:frequency
|
|
|
|
*
|
|
|
|
* Specifies the frequency that should be used for the waveform
|
|
|
|
* of this #GstLFOControlSource. It should be large enough
|
|
|
|
* so that the period is longer than one nanosecond.
|
|
|
|
*
|
|
|
|
**/
|
|
|
|
g_object_class_install_property (gobject_class, PROP_FREQUENCY,
|
|
|
|
g_param_spec_double ("frequency", "Frequency",
|
|
|
|
"Frequency of the waveform", 0.0, G_MAXDOUBLE, 1.0,
|
2008-03-22 14:56:17 +00:00
|
|
|
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
|
libs/gst/controller/: API: Add GstLFOControlSource, a control source that gives values for specific timestamps based ...
Original commit message from CVS:
reviewed by: Stefan Kost <ensonic@users.sf.net>
* libs/gst/controller/Makefile.am:
* libs/gst/controller/gstlfocontrolsource.c: (_calculate_pos),
(gst_lfo_waveform_get_type), (gst_lfo_control_source_reset),
(gst_lfo_control_source_new),
(gst_lfo_control_source_set_waveform),
(gst_lfo_control_source_bind), (gst_lfo_control_source_init),
(gst_lfo_control_source_finalize),
(gst_lfo_control_source_dispose),
(gst_lfo_control_source_set_property),
(gst_lfo_control_source_get_property),
(gst_lfo_control_source_class_init):
* libs/gst/controller/gstlfocontrolsource.h:
* libs/gst/controller/gstlfocontrolsourceprivate.h:
API: Add GstLFOControlSource, a control source that gives values
for specific timestamps based on several periodic waveforms.
Fixes #459717.
* tests/check/libs/controller.c: (GST_START_TEST),
(gst_controller_suite):
* docs/libs/gstreamer-libs-docs.sgml:
* docs/libs/gstreamer-libs-sections.txt:
* docs/libs/gstreamer-libs.types:
Add documentation and unit tests for GstLFOControlSource.
2007-08-03 15:47:17 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* GstLFOControlSource:timeshift
|
|
|
|
*
|
|
|
|
* Specifies the timeshift to the right that should be used for the waveform
|
|
|
|
* of this #GstLFOControlSource in nanoseconds.
|
|
|
|
*
|
|
|
|
* To get a n nanosecond shift to the left use
|
|
|
|
* "(GST_SECOND / frequency) - n".
|
|
|
|
*
|
|
|
|
**/
|
|
|
|
g_object_class_install_property (gobject_class, PROP_TIMESHIFT,
|
|
|
|
g_param_spec_uint64 ("timeshift", "Timeshift",
|
|
|
|
"Timeshift of the waveform to the right", 0, G_MAXUINT64, 0,
|
2008-03-22 14:56:17 +00:00
|
|
|
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
|
libs/gst/controller/: API: Add GstLFOControlSource, a control source that gives values for specific timestamps based ...
Original commit message from CVS:
reviewed by: Stefan Kost <ensonic@users.sf.net>
* libs/gst/controller/Makefile.am:
* libs/gst/controller/gstlfocontrolsource.c: (_calculate_pos),
(gst_lfo_waveform_get_type), (gst_lfo_control_source_reset),
(gst_lfo_control_source_new),
(gst_lfo_control_source_set_waveform),
(gst_lfo_control_source_bind), (gst_lfo_control_source_init),
(gst_lfo_control_source_finalize),
(gst_lfo_control_source_dispose),
(gst_lfo_control_source_set_property),
(gst_lfo_control_source_get_property),
(gst_lfo_control_source_class_init):
* libs/gst/controller/gstlfocontrolsource.h:
* libs/gst/controller/gstlfocontrolsourceprivate.h:
API: Add GstLFOControlSource, a control source that gives values
for specific timestamps based on several periodic waveforms.
Fixes #459717.
* tests/check/libs/controller.c: (GST_START_TEST),
(gst_controller_suite):
* docs/libs/gstreamer-libs-docs.sgml:
* docs/libs/gstreamer-libs-sections.txt:
* docs/libs/gstreamer-libs.types:
Add documentation and unit tests for GstLFOControlSource.
2007-08-03 15:47:17 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* GstLFOControlSource:amplitude
|
|
|
|
*
|
|
|
|
* Specifies the amplitude for the waveform of this #GstLFOControlSource.
|
|
|
|
*
|
|
|
|
* It should be given as a #GValue with a type that can be transformed
|
|
|
|
* to the type of the bound property.
|
|
|
|
**/
|
|
|
|
g_object_class_install_property (gobject_class, PROP_AMPLITUDE,
|
|
|
|
g_param_spec_boxed ("amplitude", "Amplitude", "Amplitude of the waveform",
|
2008-03-22 14:56:17 +00:00
|
|
|
G_TYPE_VALUE, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
|
libs/gst/controller/: API: Add GstLFOControlSource, a control source that gives values for specific timestamps based ...
Original commit message from CVS:
reviewed by: Stefan Kost <ensonic@users.sf.net>
* libs/gst/controller/Makefile.am:
* libs/gst/controller/gstlfocontrolsource.c: (_calculate_pos),
(gst_lfo_waveform_get_type), (gst_lfo_control_source_reset),
(gst_lfo_control_source_new),
(gst_lfo_control_source_set_waveform),
(gst_lfo_control_source_bind), (gst_lfo_control_source_init),
(gst_lfo_control_source_finalize),
(gst_lfo_control_source_dispose),
(gst_lfo_control_source_set_property),
(gst_lfo_control_source_get_property),
(gst_lfo_control_source_class_init):
* libs/gst/controller/gstlfocontrolsource.h:
* libs/gst/controller/gstlfocontrolsourceprivate.h:
API: Add GstLFOControlSource, a control source that gives values
for specific timestamps based on several periodic waveforms.
Fixes #459717.
* tests/check/libs/controller.c: (GST_START_TEST),
(gst_controller_suite):
* docs/libs/gstreamer-libs-docs.sgml:
* docs/libs/gstreamer-libs-sections.txt:
* docs/libs/gstreamer-libs.types:
Add documentation and unit tests for GstLFOControlSource.
2007-08-03 15:47:17 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* GstLFOControlSource:offset
|
|
|
|
*
|
|
|
|
* Specifies the offset for the waveform of this #GstLFOControlSource.
|
|
|
|
*
|
|
|
|
* It should be given as a #GValue with a type that can be transformed
|
|
|
|
* to the type of the bound property.
|
|
|
|
**/
|
|
|
|
g_object_class_install_property (gobject_class, PROP_OFFSET,
|
|
|
|
g_param_spec_boxed ("offset", "Offset", "Offset of the waveform",
|
2008-03-22 14:56:17 +00:00
|
|
|
G_TYPE_VALUE, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
|
libs/gst/controller/: API: Add GstLFOControlSource, a control source that gives values for specific timestamps based ...
Original commit message from CVS:
reviewed by: Stefan Kost <ensonic@users.sf.net>
* libs/gst/controller/Makefile.am:
* libs/gst/controller/gstlfocontrolsource.c: (_calculate_pos),
(gst_lfo_waveform_get_type), (gst_lfo_control_source_reset),
(gst_lfo_control_source_new),
(gst_lfo_control_source_set_waveform),
(gst_lfo_control_source_bind), (gst_lfo_control_source_init),
(gst_lfo_control_source_finalize),
(gst_lfo_control_source_dispose),
(gst_lfo_control_source_set_property),
(gst_lfo_control_source_get_property),
(gst_lfo_control_source_class_init):
* libs/gst/controller/gstlfocontrolsource.h:
* libs/gst/controller/gstlfocontrolsourceprivate.h:
API: Add GstLFOControlSource, a control source that gives values
for specific timestamps based on several periodic waveforms.
Fixes #459717.
* tests/check/libs/controller.c: (GST_START_TEST),
(gst_controller_suite):
* docs/libs/gstreamer-libs-docs.sgml:
* docs/libs/gstreamer-libs-sections.txt:
* docs/libs/gstreamer-libs.types:
Add documentation and unit tests for GstLFOControlSource.
2007-08-03 15:47:17 +00:00
|
|
|
}
|