push relevant struct fields into AudioTransition

This commit is contained in:
Brandon Lewis 2010-06-18 15:21:02 +02:00 committed by Edward Hervey
parent 50edd65265
commit 6574f0146f
4 changed files with 59 additions and 49 deletions

View file

@ -75,11 +75,36 @@ ges_track_audio_transition_class_init (GESTrackAudioTransitionClass * klass)
static void
ges_track_audio_transition_init (GESTrackAudioTransition * self)
{
self->a_controller = NULL;
self->a_control_source = NULL;
self->b_controller = NULL;
self->b_control_source = NULL;
}
static void
ges_track_audio_transition_dispose (GObject * object)
{
GESTrackAudioTransition *self;
self = GES_TRACK_AUDIO_TRANSITION (object);
if (self->a_controller) {
g_object_unref (self->a_controller);
self->a_controller = NULL;
if (self->a_control_source)
gst_object_unref (self->a_control_source);
self->a_control_source = NULL;
}
if (self->b_controller) {
g_object_unref (self->b_controller);
self->b_controller = NULL;
if (self->b_control_source)
gst_object_unref (self->b_control_source);
self->b_control_source = NULL;
}
G_OBJECT_CLASS (ges_track_audio_transition_parent_class)->dispose (object);
}
@ -122,9 +147,10 @@ link_element_to_mixer_with_volume (GstBin * bin, GstElement * element,
}
static GstElement *
ges_track_audio_transition_create_element (GESTrackTransition * self,
ges_track_audio_transition_create_element (GESTrackTransition * object,
GESTrack * unded)
{
GESTrackAudioTransition *self;
GstElement *topbin, *iconva, *iconvb, *oconv;
GObject *atarget, *btarget = NULL;
const gchar *propname = "volume";
@ -133,6 +159,8 @@ ges_track_audio_transition_create_element (GESTrackTransition * self,
GstController *acontroller, *bcontroller;
GstInterpolationControlSource *acontrol_source, *bcontrol_source;
self = GES_TRACK_AUDIO_TRANSITION (object);
GST_LOG ("creating an audio bin");
@ -192,29 +220,33 @@ ges_track_audio_transition_create_element (GESTrackTransition * self,
gst_interpolation_control_source_set_interpolation_mode (bcontrol_source,
GST_INTERPOLATE_LINEAR);
self->a_acontroller = acontroller;
self->a_bcontroller = bcontroller;
self->a_acontrol_source = acontrol_source;
self->a_bcontrol_source = bcontrol_source;
self->a_controller = acontroller;
self->b_controller = bcontroller;
self->a_control_source = acontrol_source;
self->b_control_source = bcontrol_source;
return topbin;
}
static void
ges_track_audio_transition_duration_changed (GESTrackTransition * self,
ges_track_audio_transition_duration_changed (GESTrackTransition * object,
GstElement * gnlobj)
{
GESTrackAudioTransition *self;
guint64 duration;
GValue zero = { 0, };
GValue one = { 0, };
self = GES_TRACK_AUDIO_TRANSITION (object);
GST_LOG ("updating controller: gnlobj (%p) acontroller(%p) bcontroller(%p)",
gnlobj, self->a_acontroller, self->a_bcontroller);
gnlobj, self->a_controller, self->b_controller);
if (!gnlobj)
return;
if (!(self->a_acontroller) || !(self->a_bcontroller))
if (!(self->a_controller) || !(self->b_controller))
return;
GST_LOG ("getting properties");
@ -228,21 +260,20 @@ ges_track_audio_transition_duration_changed (GESTrackTransition * self,
GST_LOG ("setting values on controller");
g_assert (GST_IS_CONTROLLER (self->a_acontroller));
g_assert (GST_IS_CONTROL_SOURCE (self->a_acontrol_source));
g_assert (GST_IS_CONTROLLER (self->a_controller));
g_assert (GST_IS_CONTROL_SOURCE (self->a_control_source));
g_assert (GST_IS_CONTROLLER (self->a_bcontroller));
g_assert (GST_IS_CONTROL_SOURCE (self->a_bcontrol_source));
g_assert (GST_IS_CONTROLLER (self->b_controller));
g_assert (GST_IS_CONTROL_SOURCE (self->b_control_source));
gst_interpolation_control_source_unset_all (self->a_acontrol_source);
gst_interpolation_control_source_set (self->a_acontrol_source, 0, &one);
gst_interpolation_control_source_set (self->a_acontrol_source,
gst_interpolation_control_source_unset_all (self->a_control_source);
gst_interpolation_control_source_set (self->a_control_source, 0, &one);
gst_interpolation_control_source_set (self->a_control_source,
duration, &zero);
gst_interpolation_control_source_unset_all (self->a_bcontrol_source);
gst_interpolation_control_source_set (self->a_bcontrol_source, 0, &zero);
gst_interpolation_control_source_set (self->a_bcontrol_source,
duration, &one);
gst_interpolation_control_source_unset_all (self->b_control_source);
gst_interpolation_control_source_set (self->b_control_source, 0, &zero);
gst_interpolation_control_source_set (self->b_control_source, duration, &one);
GST_LOG ("done updating controller");
}

View file

@ -53,6 +53,15 @@ G_BEGIN_DECLS
struct _GESTrackAudioTransition {
GESTrackTransition parent;
/*< private >*/
/* these enable volume interpolation. Unlike video, both inputs are adjusted
* simultaneously */
GstController *a_controller;
GstInterpolationControlSource *a_control_source;
GstController *b_controller;
GstInterpolationControlSource *b_control_source;
/*< public >*/
};

View file

@ -134,22 +134,6 @@ ges_track_transition_dispose (GObject * object)
self->vcontrol_source = NULL;
}
if (self->a_acontroller) {
g_object_unref (self->a_acontroller);
self->a_acontroller = NULL;
if (self->a_acontrol_source)
gst_object_unref (self->a_acontrol_source);
self->a_acontrol_source = NULL;
}
if (self->a_bcontroller) {
g_object_unref (self->a_bcontroller);
self->a_bcontroller = NULL;
if (self->a_bcontrol_source)
gst_object_unref (self->a_bcontrol_source);
self->a_bcontrol_source = NULL;
}
if (self->vmixer && self->sinka && self->sinkb) {
GST_DEBUG ("releasing request pads for vmixer");
gst_element_release_request_pad (self->vmixer, self->sinka);
@ -351,12 +335,6 @@ ges_track_transition_init (GESTrackTransition * self)
self->vtype = 0;
self->vstart_value = 0.0;
self->vend_value = 0.0;
self->a_acontroller = NULL;
self->a_acontrol_source = NULL;
self->a_bcontroller = NULL;
self->a_bcontrol_source = NULL;
}
void

View file

@ -84,14 +84,6 @@ struct _GESTrackTransition
* is used */
gdouble vstart_value;
gdouble vend_value;
/* these enable volume interpolation. Unlike video, both inputs are adjusted
* simultaneously */
GstController *a_acontroller;
GstInterpolationControlSource *a_acontrol_source;
GstController *a_bcontroller;
GstInterpolationControlSource *a_bcontrol_source;
};
/**