mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-23 08:46:40 +00:00
add routines to AudioTestSource to set freq and volume
This commit is contained in:
parent
dcc0413945
commit
fd7f9ac12f
3 changed files with 40 additions and 3 deletions
|
@ -449,6 +449,8 @@ GESTrackAudioTestSource
|
|||
GESTrackAudioTestSourceClass
|
||||
ges_track_audio_test_source_new
|
||||
ges_track_audio_test_source_get_type
|
||||
ges_track_audio_test_source_set_freq
|
||||
ges_track_audio_test_source_set_volume
|
||||
<SUBSECTION Standard>
|
||||
GES_TRACK_AUDIO_TEST_SOURCE
|
||||
GES_TRACK_AUDIO_TEST_SOURCE_CLASS
|
||||
|
|
|
@ -72,6 +72,8 @@ ges_track_audio_test_source_class_init (GESTrackAudioTestSourceClass * klass)
|
|||
static void
|
||||
ges_track_audio_test_source_init (GESTrackAudioTestSource * self)
|
||||
{
|
||||
self->freq = 440;
|
||||
self->volume = 0;
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -107,14 +109,39 @@ ges_track_audio_test_source_set_property (GObject * object,
|
|||
}
|
||||
|
||||
static GstElement *
|
||||
ges_track_audio_test_source_create_element (GESTrackSource * self)
|
||||
ges_track_audio_test_source_create_element (GESTrackSource * trksrc)
|
||||
{
|
||||
GESTrackAudioTestSource *self;
|
||||
GstElement *ret;
|
||||
self = (GESTrackAudioTestSource *) trksrc;
|
||||
ret = gst_element_factory_make ("audiotestsrc", NULL);
|
||||
g_object_set (ret, "volume", (gdouble) 0, NULL);
|
||||
g_object_set (ret, "volume", (gdouble) self->volume, "freq", (gdouble)
|
||||
self->freq, NULL);
|
||||
return ret;
|
||||
}
|
||||
|
||||
void
|
||||
ges_track_audio_test_source_set_freq (GESTrackAudioTestSource * self,
|
||||
gdouble freq)
|
||||
{
|
||||
GstElement *element;
|
||||
self->freq = freq;
|
||||
element = ((GESTrackSource *) self)->element;
|
||||
if (element)
|
||||
g_object_set (element, "freq", (gdouble) freq, NULL);
|
||||
}
|
||||
|
||||
void
|
||||
ges_track_audio_test_source_set_volume (GESTrackAudioTestSource * self,
|
||||
gdouble volume)
|
||||
{
|
||||
GstElement *element;
|
||||
self->volume = volume;
|
||||
element = ((GESTrackSource *) self)->element;
|
||||
if (element)
|
||||
g_object_set (element, "freq", (gdouble) volume, NULL);
|
||||
}
|
||||
|
||||
GESTrackAudioTestSource *
|
||||
ges_track_audio_test_source_new (void)
|
||||
{
|
||||
|
|
|
@ -53,7 +53,9 @@ G_BEGIN_DECLS
|
|||
struct _GESTrackAudioTestSource {
|
||||
GESTrackSource parent;
|
||||
|
||||
/*< public >*/
|
||||
/*< private >*/
|
||||
gdouble freq;
|
||||
gdouble volume;
|
||||
};
|
||||
|
||||
/**
|
||||
|
@ -72,6 +74,12 @@ GType ges_track_audio_test_source_get_type (void);
|
|||
|
||||
GESTrackAudioTestSource* ges_track_audio_test_source_new (void);
|
||||
|
||||
void ges_track_audio_test_source_set_freq(GESTrackAudioTestSource *self,
|
||||
gdouble freq);
|
||||
|
||||
void ges_track_audio_test_source_set_volume(GESTrackAudioTestSource *self,
|
||||
gdouble volume);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
#endif /* _GES_TRACK_AUDIO_TEST_SOURCE */
|
||||
|
|
Loading…
Reference in a new issue