GESTimeleinePipeline: Create a flag type instead of a simple enum

Make it binding friendly
This commit is contained in:
Thibault Saunier 2011-04-25 19:12:38 -04:00 committed by Thibault Saunier
parent 9237a997cb
commit 1efbf1ceec
3 changed files with 48 additions and 18 deletions

View file

@ -46,6 +46,31 @@ ges_track_type_get_type (void)
return id;
}
static void
register_ges_pipeline_flags (GType * id)
{
static const GFlagsValue values[] = {
{C_ENUM (TIMELINE_MODE_PREVIEW_AUDIO), "TIMELINE_MODE_PREVIEW_AUDIO", "audio_preview"},
{C_ENUM (TIMELINE_MODE_PREVIEW_VIDEO), "TIMELINE_MODE_PREVIEW_VIDEO", "video_preview"},
{C_ENUM (TIMELINE_MODE_PREVIEW), "TIMELINE_MODE_PREVIEW", "full_preview"},
{C_ENUM (TIMELINE_MODE_RENDER), "TIMELINE_MODE_RENDER", "render"},
{C_ENUM (TIMELINE_MODE_SMART_RENDER), "TIMELINE_MODE_SMART_RENDER", "smart_render"},
{0, NULL, NULL}
};
*id = g_flags_register_static ("GESPipelineFlags", values);
}
GType
ges_pipeline_flags_get_type (void)
{
static GType id;
static GOnce once = G_ONCE_INIT;
g_once (&once, (GThreadFunc) register_ges_pipeline_flags, &id);
return id;
}
static GEnumValue transition_types[] = {
{
0,

View file

@ -300,6 +300,29 @@ typedef enum {
GType ges_video_test_pattern_get_type (void);
/**
* GESPipelineFlags:
* @TIMELINE_MODE_PREVIEW_AUDIO: output audio to the soundcard
* @TIMELINE_MODE_PREVIEW_VIDEO: output video to the screen
* @TIMELINE_MODE_PREVIEW: output audio/video to soundcard/screen (default)
* @TIMELINE_MODE_RENDER: render timeline (forces decoding)
* @TIMELINE_MODE_SMART_RENDER: render timeline (tries to avoid decoding/reencoding)
*
* The various modes the #GESTimelinePipeline can be configured to.
*/
typedef enum {
TIMELINE_MODE_PREVIEW_AUDIO = 1 << 0,
TIMELINE_MODE_PREVIEW_VIDEO = 1 << 1,
TIMELINE_MODE_PREVIEW = TIMELINE_MODE_PREVIEW_AUDIO | TIMELINE_MODE_PREVIEW_VIDEO,
TIMELINE_MODE_RENDER = 1 << 2,
TIMELINE_MODE_SMART_RENDER = 1 << 3
} GESPipelineFlags;
#define GES_TYPE_PIPELINE_FLAGS\
ges_pipeline_flags_get_type()
GType ges_pipeline_flags_get_type (void);
G_END_DECLS
#endif /* __GES_ENUMS_H__ */

View file

@ -46,24 +46,6 @@ G_BEGIN_DECLS
typedef struct _GESTimelinePipelinePrivate GESTimelinePipelinePrivate;
/**
* GESPipelineFlags:
* @TIMELINE_MODE_PREVIEW_AUDIO: output audio to the soundcard
* @TIMELINE_MODE_PREVIEW_VIDEO: output video to the screen
* @TIMELINE_MODE_PREVIEW: output audio/video to soundcard/screen (default)
* @TIMELINE_MODE_RENDER: render timeline (forces decoding)
* @TIMELINE_MODE_SMART_RENDER: render timeline (tries to avoid decoding/reencoding)
*
* The various modes the #GESTimelinePipeline can be configured to.
*/
typedef enum {
TIMELINE_MODE_PREVIEW_AUDIO = 1 << 0,
TIMELINE_MODE_PREVIEW_VIDEO = 1 << 1,
TIMELINE_MODE_PREVIEW = TIMELINE_MODE_PREVIEW_AUDIO | TIMELINE_MODE_PREVIEW_VIDEO,
TIMELINE_MODE_RENDER = 1 << 2,
TIMELINE_MODE_SMART_RENDER = 1 << 3
} GESPipelineFlags;
/**
* GESTimelinePipeline:
*