[rygel-gst-0-10-fullscreen-renderer] Simplify property implementation a bit
- From: Jens Georg <jensgeorg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [rygel-gst-0-10-fullscreen-renderer] Simplify property implementation a bit
- Date: Sun, 24 Nov 2013 16:04:29 +0000 (UTC)
commit 6a382e05b39e7073935b96c69cb2148b7baf09d1
Author: Jens Georg <mail jensge org>
Date: Sun Nov 24 16:54:43 2013 +0100
Simplify property implementation a bit
src/rygel-playbin-player.c | 99 ++++++++++++++++++++------------------------
1 files changed, 45 insertions(+), 54 deletions(-)
---
diff --git a/src/rygel-playbin-player.c b/src/rygel-playbin-player.c
index 6fa4e53..e7b186e 100644
--- a/src/rygel-playbin-player.c
+++ b/src/rygel-playbin-player.c
@@ -909,72 +909,63 @@ rygel_playbin_player_get_supported_profiles (RygelPlaybinPlayer *self) {
static void rygel_playbin_player_class_init (RygelPlaybinPlayerClass *klass) {
+ GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
+
rygel_playbin_player_parent_class = g_type_class_peek_parent (klass);
g_type_class_add_private (klass, sizeof (RygelPlaybinPlayerPrivate));
- G_OBJECT_CLASS (klass)->get_property = _vala_rygel_playbin_player_get_property;
- G_OBJECT_CLASS (klass)->set_property = _vala_rygel_playbin_player_set_property;
- G_OBJECT_CLASS (klass)->finalize = rygel_playbin_player_finalize;
+ gobject_class->get_property = _vala_rygel_playbin_player_get_property;
+ gobject_class->set_property = _vala_rygel_playbin_player_set_property;
+ gobject_class->finalize = rygel_playbin_player_finalize;
- g_object_class_install_property (G_OBJECT_CLASS (klass),
+ g_object_class_install_property (gobject_class,
RYGEL_PLAYBIN_PLAYER_PLAYBIN,
g_param_spec_object ("playbin", "playbin", "playbin", GST_TYPE_ELEMENT,
G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE));
- g_object_class_install_property (G_OBJECT_CLASS (klass),
- RYGEL_PLAYBIN_PLAYER_PLAYBACK_STATE,
- g_param_spec_string ("playback-state", "playback-state", "playback-state", NULL,
- G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE |
G_PARAM_WRITABLE));
-
- g_object_class_install_property (G_OBJECT_CLASS (klass),
- RYGEL_PLAYBIN_PLAYER_ALLOWED_PLAYBACK_SPEEDS,
- g_param_spec_boxed ("allowed-playback-speeds", "allowed-playback-speeds", "allowed-playback-speeds",
- G_TYPE_STRV, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE));
-
- g_object_class_install_property (G_OBJECT_CLASS (klass),
- RYGEL_PLAYBIN_PLAYER_PLAYBACK_SPEED,
- g_param_spec_string ("playback-speed", "playback-speed", "playback-speed", NULL,
- G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE |
G_PARAM_WRITABLE));
-
- g_object_class_install_property (G_OBJECT_CLASS (klass),
- RYGEL_PLAYBIN_PLAYER_URI,
- g_param_spec_string ("uri", "uri", "uri", NULL,
- G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE |
G_PARAM_WRITABLE));
-
- g_object_class_install_property (G_OBJECT_CLASS (klass),
- RYGEL_PLAYBIN_PLAYER_MIME_TYPE,
- g_param_spec_string ("mime-type", "mime-type", "mime-type", NULL,
- G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE |
G_PARAM_WRITABLE));
-
- g_object_class_install_property (G_OBJECT_CLASS (klass),
- RYGEL_PLAYBIN_PLAYER_METADATA,
- g_param_spec_string ("metadata", "metadata", "metadata", NULL,
- G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE |
G_PARAM_WRITABLE));
-
- g_object_class_install_property (G_OBJECT_CLASS (klass),
- RYGEL_PLAYBIN_PLAYER_CAN_SEEK,
- g_param_spec_boolean ("can-seek", "can-seek", "can-seek", FALSE,
- G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE));
+ g_object_class_override_property (gobject_class,
+ RYGEL_PLAYBIN_PLAYER_PLAYBACK_STATE,
+ "playback-state");
- g_object_class_install_property (G_OBJECT_CLASS (klass),
- RYGEL_PLAYBIN_PLAYER_CONTENT_FEATURES,
- g_param_spec_string ("content-features", "content-features", "content-features", NULL,
- G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE |
G_PARAM_WRITABLE));
+ g_object_class_override_property (gobject_class,
+ RYGEL_PLAYBIN_PLAYER_URI,
+ "uri");
- g_object_class_install_property (G_OBJECT_CLASS (klass),
- RYGEL_PLAYBIN_PLAYER_VOLUME,
- g_param_spec_double ("volume", "volume", "volume", -G_MAXDOUBLE, G_MAXDOUBLE, 0.0,
- G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE |
G_PARAM_WRITABLE));
+ g_object_class_override_property (gobject_class,
+ RYGEL_PLAYBIN_PLAYER_MIME_TYPE,
+ "mime-type");
- g_object_class_install_property (G_OBJECT_CLASS (klass),
- RYGEL_PLAYBIN_PLAYER_DURATION,
- g_param_spec_int64 ("duration", "duration", "duration", G_MININT64, G_MAXINT64, 0,
- G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE));
+ g_object_class_override_property (gobject_class,
+ RYGEL_PLAYBIN_PLAYER_METADATA,
+ "metadata");
- g_object_class_install_property (G_OBJECT_CLASS (klass),
- RYGEL_PLAYBIN_PLAYER_POSITION,
- g_param_spec_int64 ("position", "position", "position", G_MININT64, G_MAXINT64, 0,
- G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE));
+ g_object_class_override_property (gobject_class,
+ RYGEL_PLAYBIN_PLAYER_CAN_SEEK,
+ "can-seek");
+
+ g_object_class_override_property (gobject_class,
+ RYGEL_PLAYBIN_PLAYER_CONTENT_FEATURES,
+ "content-features");
+
+ g_object_class_override_property (gobject_class,
+ RYGEL_PLAYBIN_PLAYER_VOLUME,
+ "volume");
+
+ g_object_class_override_property (gobject_class,
+ RYGEL_PLAYBIN_PLAYER_DURATION,
+ "duration");
+
+ g_object_class_override_property (gobject_class,
+ RYGEL_PLAYBIN_PLAYER_POSITION,
+ "position");
+
+ g_object_class_override_property (gobject_class,
+ RYGEL_PLAYBIN_PLAYER_PLAYBACK_SPEED,
+ "playback-speed");
+
+ g_object_class_override_property (gobject_class,
+ RYGEL_PLAYBIN_PLAYER_ALLOWED_PLAYBACK_SPEEDS,
+ "allowed-playback-speeds");
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]