[totem] Add an auto-resize property to BaconVideoWidget
- From: Philip Withnall <pwithnall src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [totem] Add an auto-resize property to BaconVideoWidget
- Date: Sat, 4 Sep 2010 15:46:10 +0000 (UTC)
commit c34e17ebf2621499954df1214f74dd60cebe2199
Author: Philip Withnall <philip tecnocode co uk>
Date: Wed Aug 18 00:22:45 2010 +0100
Add an auto-resize property to BaconVideoWidget
src/backend/bacon-video-widget-gst-0.10.c | 21 ++++++++++++++++++++-
1 files changed, 20 insertions(+), 1 deletions(-)
---
diff --git a/src/backend/bacon-video-widget-gst-0.10.c b/src/backend/bacon-video-widget-gst-0.10.c
index d3f5525..3db2624 100644
--- a/src/backend/bacon-video-widget-gst-0.10.c
+++ b/src/backend/bacon-video-widget-gst-0.10.c
@@ -134,7 +134,8 @@ enum
PROP_SHOW_VISUALS,
PROP_USER_AGENT,
PROP_VOLUME,
- PROP_DOWNLOAD_FILENAME
+ PROP_DOWNLOAD_FILENAME,
+ PROP_AUTO_RESIZE
};
static const gchar *video_props_str[4] = {
@@ -1143,6 +1144,17 @@ bacon_video_widget_class_init (BaconVideoWidgetClass * klass)
NULL,
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
+ /**
+ * BaconVideoWidget:auto-resize:
+ *
+ * Whether to automatically resize the video widget to the video size when loading a new video.
+ **/
+ g_object_class_install_property (object_class, PROP_AUTO_RESIZE,
+ g_param_spec_boolean ("auto-resize", NULL,
+ NULL, FALSE,
+ G_PARAM_READWRITE |
+ G_PARAM_STATIC_STRINGS));
+
/* Signals */
/**
* BaconVideoWidget::error:
@@ -2785,6 +2797,9 @@ bacon_video_widget_set_property (GObject * object, guint property_id,
case PROP_VOLUME:
bacon_video_widget_set_volume (bvw, g_value_get_double (value));
break;
+ case PROP_AUTO_RESIZE:
+ bacon_video_widget_set_auto_resize (bvw, g_value_get_boolean (value));
+ break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
break;
@@ -2835,6 +2850,9 @@ bacon_video_widget_get_property (GObject * object, guint property_id,
case PROP_DOWNLOAD_FILENAME:
g_value_set_string (value, bvw->priv->download_filename);
break;
+ case PROP_AUTO_RESIZE:
+ g_value_set_boolean (value, bvw->priv->auto_resize);
+ break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
break;
@@ -5104,6 +5122,7 @@ bacon_video_widget_set_auto_resize (BaconVideoWidget * bvw,
bvw->priv->auto_resize = auto_resize;
/* this will take effect when the next media file loads */
+ g_object_notify (G_OBJECT (bvw), "auto-resize");
}
/**
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]