[totem] Hide the slider when streaming
- From: Bastien Nocera <hadess src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [totem] Hide the slider when streaming
- Date: Wed, 1 Dec 2010 16:08:45 +0000 (UTC)
commit 994cf65023ec776573a6376faebba71300c0760a
Author: Bastien Nocera <hadess hadess net>
Date: Wed Nov 24 12:28:21 2010 +0000
Hide the slider when streaming
So that people are not confused by the slider getting stuck in
one location.
https://bugzilla.gnome.org/show_bug.cgi?id=549691
configure.in | 2 +-
data/totem.ui | 2 +-
src/totem-object.c | 29 ++++++++++++++++++++++++-----
3 files changed, 26 insertions(+), 7 deletions(-)
---
diff --git a/configure.in b/configure.in
index 7929c40..bde530e 100644
--- a/configure.in
+++ b/configure.in
@@ -43,7 +43,7 @@ AC_PATH_PROG([GLIB_MKENUMS],[glib-mkenums])
# Requirements
GLIB_REQS=2.25.11
GIO_REQS=2.25.0
-GTK_REQS=2.90.7
+GTK_REQS=2.91.6
TOTEM_PLPARSER_REQS=2.29.1
GNOMEICON_REQS=2.15.90
DBUS_REQS=0.82
diff --git a/data/totem.ui b/data/totem.ui
index 4d96945..75fdc44 100644
--- a/data/totem.ui
+++ b/data/totem.ui
@@ -654,7 +654,7 @@
<object class="GtkAdjustment" id="tmw_seek_adjustment">
<property name="lower">0</property>
- <property name="upper">65535</property>
+ <property name="upper">0</property>
<property name="step-increment">1</property>
<property name="page-increment">10</property>
<property name="page-size">0</property>
diff --git a/src/totem-object.c b/src/totem-object.c
index 7af92b5..5296a72 100644
--- a/src/totem-object.c
+++ b/src/totem-object.c
@@ -2504,7 +2504,7 @@ static void
on_got_metadata_event (BaconVideoWidget *bvw, TotemObject *totem)
{
char *name = NULL;
-
+
name = totem_get_nice_name_for_stream (totem);
if (name != NULL) {
@@ -2512,7 +2512,7 @@ on_got_metadata_event (BaconVideoWidget *bvw, TotemObject *totem)
(TOTEM_PLAYLIST (totem->playlist), name, FALSE);
g_free (name);
}
-
+
on_playlist_change_name (TOTEM_PLAYLIST (totem->playlist), totem);
}
@@ -2613,16 +2613,35 @@ update_seekable (TotemObject *totem)
}
static void
+update_slider_visibility (TotemObject *totem,
+ gint64 stream_length)
+{
+ if (totem->stream_length == stream_length)
+ return;
+ if (totem->stream_length > 0 &&
+ stream_length > 0)
+ return;
+ if (stream_length != 0) {
+ gtk_range_set_range (GTK_RANGE (totem->seek), 0., 65535.);
+ gtk_range_set_range (GTK_RANGE (totem->fs->seek), 0., 65535.);
+ } else {
+ gtk_range_set_range (GTK_RANGE (totem->seek), 0., 0.);
+ gtk_range_set_range (GTK_RANGE (totem->fs->seek), 0., 0.);
+ }
+}
+
+static void
update_current_time (BaconVideoWidget *bvw,
gint64 current_time,
gint64 stream_length,
double current_position,
gboolean seekable, TotemObject *totem)
{
- if (totem->seek_lock == FALSE)
- {
+ update_slider_visibility (totem, stream_length);
+
+ if (totem->seek_lock == FALSE) {
gtk_adjustment_set_value (totem->seekadj,
- current_position * 65535);
+ current_position * 65535);
if (stream_length == 0 && totem->mrl != NULL)
{
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]