GESTrackEffect: add private struct

This commit is contained in:
Thibault Saunier 2010-11-15 23:32:23 +01:00 committed by Edward Hervey
parent 3b33287b04
commit 6e5d16ac6d
4 changed files with 55 additions and 15 deletions

View file

@ -705,8 +705,6 @@ GESTrackEffect
GESTrackEffectClass
ges_track_effect_new
ges_track_effect_new_with_name
ges_track_effect_set_human_name
ges_track_effect_get_human_name
<SUBSECTION Standard>
GES_IS_TRACK_EFFECT
GES_IS_TRACK_EFFECT_CLASS

View file

@ -81,6 +81,8 @@ ges_track_effect_class_init (GESTrackEffectClass * klass)
g_type_class_add_private (klass, sizeof (GESTrackEffectPrivate));
g_type_class_add_private (klass, sizeof (GESTrackEffectPrivate));
object_class->get_property = ges_track_effect_get_property;
object_class->set_property = ges_track_effect_set_property;
object_class->dispose = ges_track_effect_dispose;

View file

@ -36,17 +36,20 @@ G_BEGIN_DECLS
(G_TYPE_CHECK_CLASS_TYPE ((klass), GES_TYPE_TRACK_EFFECT))
#define GES_TRACK_EFFECT_GET_CLASS(obj) \
(G_TYPE_INSTANCE_GET_CLASS ((obj), GES_TYPE_TRACK_EFFECT, GESTrackEffectClass))
typedef struct _GESTrackEffectPrivate GESTrackEffectPrivate;
/**
* GESTrackEffect:
*
*/
struct _GESTrackEffect
struct _GESTrackEffect
{
GESTrackOperation parent;
/*< private > */
gchar *bin_description;
gchar *human_name;
GESTrackEffectPrivate *priv;
};
/**
@ -63,13 +66,7 @@ struct _GESTrackEffectClass
GType ges_track_effect_get_type (void);
void ges_track_effect_set_human_name (GESTrackEffect * self,
const gchar * human_name);
gchar *ges_track_effect_get_human_name (GESTrackEffect * self);
GESTrackEffect *ges_track_effect_new (const gchar * bin_description);
GESTrackEffect *ges_track_effect_new_with_name (const gchar * bin_description,
const gchar * human_name);
G_END_DECLS
#endif /* _GES_TRACK_EFFECT */

View file

@ -11,7 +11,7 @@
* 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
* You should have received track_audio 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.
@ -30,10 +30,52 @@ GST_START_TEST (test_effect_basic)
effect = ges_track_effect_new ("identity");
fail_unless (effect != NULL);
g_object_unref (effect);
}
effect = ges_track_effect_new_with_name ("identity", "Identity effect");
fail_unless (effect != NULL);
g_object_unref (effect);
GST_END_TEST;
GST_START_TEST (test_add_effect_to_tl_object)
{
GESTimeline *timeline;
GESTimelineLayer *layer;
GESTrack *track_audio, *track_video;
GESTrackEffect *effect_track;
GESTimelineTestSource *source;
gboolean effect_added = FALSE;
ges_init ();
timeline = ges_timeline_new ();
layer = (GESTimelineLayer *) ges_simple_timeline_layer_new ();
track_audio = ges_track_audio_raw_new ();
track_video = ges_track_video_raw_new ();
ges_timeline_add_track (timeline, track_audio);
ges_timeline_add_track (timeline, track_video);
ges_timeline_add_layer (timeline, layer);
source = ges_timeline_test_source_new ();
g_object_set (source, "duration", 10 * GST_SECOND, NULL);
ges_simple_timeline_layer_add_object ((GESSimpleTimelineLayer *) (layer),
(GESTimelineObject *) source, 0);
GST_DEBUG ("Adding effect");
ges_timeline_object_add_effect (GES_TIMELINE_OBJECT (source),
"identity", track_video);
effect_track =
GES_TRACK_EFFECT (ges_timeline_object_find_track_object
(GES_TIMELINE_OBJECT (source), track_video, GES_TYPE_TRACK_EFFECT));
assert_equals_int (GES_TRACK_OBJECT (effect_track)->active, TRUE);
fail_unless (GES_IS_TRACK_EFFECT (effect_track));
ges_timeline_layer_remove_object (layer, (GESTimelineObject *) source);
g_object_unref (effect_track);
g_object_unref (timeline);
}
GST_END_TEST;
@ -47,6 +89,7 @@ ges_suite (void)
suite_add_tcase (s, tc_chain);
tcase_add_test (tc_chain, test_effect_basic);
tcase_add_test (tc_chain, test_add_effect_to_tl_object);
return s;
}