Commit 10c935ba authored by Jean-Paul Saman's avatar Jean-Paul Saman

Slider functionality for Familiar interface.

parent 1be74338
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* callbacks.c : Callbacks for the Familiar Linux Gtk+ plugin. * callbacks.c : Callbacks for the Familiar Linux Gtk+ plugin.
***************************************************************************** *****************************************************************************
* Copyright (C) 2000, 2001 VideoLAN * Copyright (C) 2000, 2001 VideoLAN
* $Id: callbacks.c,v 1.19 2002/12/22 21:46:50 jpsaman Exp $ * $Id: callbacks.c,v 1.20 2003/01/03 20:55:00 jpsaman Exp $
* *
* Authors: Jean-Paul Saman <jpsaman@wxs.nl> * Authors: Jean-Paul Saman <jpsaman@wxs.nl>
* *
...@@ -497,3 +497,34 @@ on_familiar_delete_event (GtkWidget *widget, ...@@ -497,3 +497,34 @@ on_familiar_delete_event (GtkWidget *widget,
return TRUE; return TRUE;
} }
/* Slider Management */
gboolean
FamiliarSliderRelease (GtkWidget *widget,
GdkEventButton *event,
gpointer user_data)
{
intf_thread_t *p_intf = GtkGetIntf( widget );
vlc_mutex_lock( &p_intf->change_lock );
p_intf->p_sys->b_slider_free = 1;
vlc_mutex_unlock( &p_intf->change_lock );
return FALSE;
}
gboolean
FamiliarSliderPress (GtkWidget *widget,
GdkEventButton *event,
gpointer user_data)
{
intf_thread_t *p_intf = GtkGetIntf( widget );
vlc_mutex_lock( &p_intf->change_lock );
p_intf->p_sys->b_slider_free = 0;
vlc_mutex_unlock( &p_intf->change_lock );
return FALSE;
}
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* callbacks.h : familiar plugin for vlc * callbacks.h : familiar plugin for vlc
***************************************************************************** *****************************************************************************
* Copyright (C) 2002 VideoLAN * Copyright (C) 2002 VideoLAN
* $Id: callbacks.h,v 1.7 2002/09/30 11:05:38 sam Exp $ * $Id: callbacks.h,v 1.8 2003/01/03 20:55:00 jpsaman Exp $
* *
* Authors: Jean-Paul Saman <jpsaman@wxs.nl> * Authors: Jean-Paul Saman <jpsaman@wxs.nl>
* *
...@@ -85,3 +85,13 @@ gboolean ...@@ -85,3 +85,13 @@ gboolean
on_familiar_delete_event (GtkWidget *widget, on_familiar_delete_event (GtkWidget *widget,
GdkEvent *event, GdkEvent *event,
gpointer user_data); gpointer user_data);
gboolean
FamiliarSliderRelease (GtkWidget *widget,
GdkEventButton *event,
gpointer user_data);
gboolean
FamiliarSliderPress (GtkWidget *widget,
GdkEventButton *event,
gpointer user_data);
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* familiar.c : familiar plugin for vlc * familiar.c : familiar plugin for vlc
***************************************************************************** *****************************************************************************
* Copyright (C) 2002 VideoLAN * Copyright (C) 2002 VideoLAN
* $Id: familiar.c,v 1.21 2002/12/22 23:23:45 jpsaman Exp $ * $Id: familiar.c,v 1.22 2003/01/03 20:55:00 jpsaman Exp $
* *
* Authors: Jean-Paul Saman <jpsaman@wxs.nl> * Authors: Jean-Paul Saman <jpsaman@wxs.nl>
* *
...@@ -52,6 +52,8 @@ static void Run ( intf_thread_t * ); ...@@ -52,6 +52,8 @@ static void Run ( intf_thread_t * );
void GtkAutoPlayFile ( vlc_object_t * ); void GtkAutoPlayFile ( vlc_object_t * );
static int Manage ( intf_thread_t *p_intf ); static int Manage ( intf_thread_t *p_intf );
void E_(GtkDisplayDate) ( GtkAdjustment *p_adj );
gint E_(GtkModeManage) ( intf_thread_t * p_intf );
/***************************************************************************** /*****************************************************************************
* Module descriptor * Module descriptor
...@@ -100,6 +102,9 @@ static int Open( vlc_object_t *p_this ) ...@@ -100,6 +102,9 @@ static int Open( vlc_object_t *p_this )
p_intf->p_sys->p_input = NULL; p_intf->p_sys->p_input = NULL;
p_intf->p_sys->b_autoplayfile = 1; p_intf->p_sys->b_autoplayfile = 1;
p_intf->p_sys->b_playing = 0;
p_intf->p_sys->b_slider_free = 1;
p_intf->pf_run = Run; p_intf->pf_run = Run;
return VLC_SUCCESS; return VLC_SUCCESS;
...@@ -178,9 +183,21 @@ static void Run( intf_thread_t *p_intf ) ...@@ -178,9 +183,21 @@ static void Run( intf_thread_t *p_intf )
p_intf->p_sys->p_notebook = GTK_NOTEBOOK( gtk_object_get_data( p_intf->p_sys->p_notebook = GTK_NOTEBOOK( gtk_object_get_data(
GTK_OBJECT( p_intf->p_sys->p_window ), "notebook" ) ); GTK_OBJECT( p_intf->p_sys->p_window ), "notebook" ) );
p_intf->p_sys->p_progess = GTK_PROGRESS_BAR( gtk_object_get_data( /* Get the slider object */
GTK_OBJECT( p_intf->p_sys->p_window ), "progress" ) ); p_intf->p_sys->p_slider = GTK_HSCALE( gtk_object_get_data(
gtk_widget_hide( GTK_WIDGET(p_intf->p_sys->p_progess) ); GTK_OBJECT( p_intf->p_sys->p_window ), "slider" ) );
p_intf->p_sys->p_slider_label = GTK_LABEL( gtk_object_get_data(
GTK_OBJECT( p_intf->p_sys->p_window ), "slider_label" ) );
/* Connect the date display to the slider */
#define P_SLIDER GTK_RANGE( gtk_object_get_data( \
GTK_OBJECT( p_intf->p_sys->p_window ), "slider" ) )
p_intf->p_sys->p_adj = gtk_range_get_adjustment( P_SLIDER );
gtk_signal_connect ( GTK_OBJECT( p_intf->p_sys->p_adj ), "value_changed",
GTK_SIGNAL_FUNC( E_(GtkDisplayDate) ), NULL );
p_intf->p_sys->f_adj_oldvalue = 0;
#undef P_SLIDER
p_intf->p_sys->p_clist = GTK_CLIST( gtk_object_get_data( p_intf->p_sys->p_clist = GTK_CLIST( gtk_object_get_data(
GTK_OBJECT( p_intf->p_sys->p_window ), "clistmedia" ) ); GTK_OBJECT( p_intf->p_sys->p_window ), "clistmedia" ) );
...@@ -192,6 +209,9 @@ static void Run( intf_thread_t *p_intf ) ...@@ -192,6 +209,9 @@ static void Run( intf_thread_t *p_intf )
/* Store p_intf to keep an eye on it */ /* Store p_intf to keep an eye on it */
gtk_object_set_data( GTK_OBJECT(p_intf->p_sys->p_window), gtk_object_set_data( GTK_OBJECT(p_intf->p_sys->p_window),
"p_intf", p_intf ); "p_intf", p_intf );
gtk_object_set_data( GTK_OBJECT(p_intf->p_sys->p_adj),
"p_intf", p_intf );
/* Show the control window */ /* Show the control window */
gtk_widget_show( p_intf->p_sys->p_window ); gtk_widget_show( p_intf->p_sys->p_window );
ReadDirectory(p_intf->p_sys->p_clist, "/mnt"); ReadDirectory(p_intf->p_sys->p_clist, "/mnt");
...@@ -212,8 +232,7 @@ static void Run( intf_thread_t *p_intf ) ...@@ -212,8 +232,7 @@ static void Run( intf_thread_t *p_intf )
msg_Dbg( p_intf, "Manage GTK keyboard events using timeouts" ); msg_Dbg( p_intf, "Manage GTK keyboard events using timeouts" );
/* Sleep to avoid using all CPU - since some interfaces needs to access /* Sleep to avoid using all CPU - since some interfaces needs to access
* keyboard events, a 100ms delay is a good compromise */ * keyboard events, a 100ms delay is a good compromise */
i_dummy = gtk_timeout_add( INTF_IDLE_SLEEP / 1000, (GtkFunction)Manage, i_dummy = gtk_timeout_add( INTF_IDLE_SLEEP / 1000, (GtkFunction)Manage, p_intf );
p_intf );
/* Enter Gtk mode */ /* Enter Gtk mode */
gtk_main(); gtk_main();
...@@ -222,7 +241,6 @@ static void Run( intf_thread_t *p_intf ) ...@@ -222,7 +241,6 @@ static void Run( intf_thread_t *p_intf )
#endif #endif
gtk_object_destroy( GTK_OBJECT(p_intf->p_sys->p_window) ); gtk_object_destroy( GTK_OBJECT(p_intf->p_sys->p_window) );
#ifdef NEED_GTK_MAIN #ifdef NEED_GTK_MAIN
gdk_threads_leave(); gdk_threads_leave();
#else #else
...@@ -238,8 +256,7 @@ void GtkAutoPlayFile( vlc_object_t *p_this ) ...@@ -238,8 +256,7 @@ void GtkAutoPlayFile( vlc_object_t *p_this )
GtkWidget *cbautoplay; GtkWidget *cbautoplay;
intf_thread_t *p_intf; intf_thread_t *p_intf;
int i_index; int i_index;
vlc_list_t list = vlc_list_find( p_this, VLC_OBJECT_INTF, vlc_list_t list = vlc_list_find( p_this, VLC_OBJECT_INTF, FIND_ANYWHERE );
FIND_ANYWHERE );
for( i_index = 0; i_index < list.i_count; i_index++ ) for( i_index = 0; i_index < list.i_count; i_index++ )
{ {
...@@ -249,7 +266,6 @@ void GtkAutoPlayFile( vlc_object_t *p_this ) ...@@ -249,7 +266,6 @@ void GtkAutoPlayFile( vlc_object_t *p_this )
{ {
continue; continue;
} }
cbautoplay = GTK_WIDGET( gtk_object_get_data( cbautoplay = GTK_WIDGET( gtk_object_get_data(
GTK_OBJECT( p_intf->p_sys->p_window ), GTK_OBJECT( p_intf->p_sys->p_window ),
"cbautoplay" ) ); "cbautoplay" ) );
...@@ -262,11 +278,9 @@ void GtkAutoPlayFile( vlc_object_t *p_this ) ...@@ -262,11 +278,9 @@ void GtkAutoPlayFile( vlc_object_t *p_this )
{ {
p_intf->p_sys->b_autoplayfile = VLC_TRUE; p_intf->p_sys->b_autoplayfile = VLC_TRUE;
} }
gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( cbautoplay ), gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( cbautoplay ),
p_intf->p_sys->b_autoplayfile ); p_intf->p_sys->b_autoplayfile );
} }
vlc_list_release( &list ); vlc_list_release( &list );
} }
...@@ -294,6 +308,63 @@ static int Manage( intf_thread_t *p_intf ) ...@@ -294,6 +308,63 @@ static int Manage( intf_thread_t *p_intf )
p_intf->p_sys->p_input = NULL; p_intf->p_sys->p_input = NULL;
} }
if( p_intf->p_sys->p_input )
{
input_thread_t *p_input = p_intf->p_sys->p_input;
vlc_mutex_lock( &p_input->stream.stream_lock );
if( !p_input->b_die )
{
/* New input or stream map change */
if( p_input->stream.b_changed )
{
E_(GtkModeManage)( p_intf );
p_intf->p_sys->b_playing = 1;
}
/* Manage the slider */
if( p_input->stream.b_seekable && p_intf->p_sys->b_playing )
{
float newvalue = p_intf->p_sys->p_adj->value;
#define p_area p_input->stream.p_selected_area
/* If the user hasn't touched the slider since the last time,
* then the input can safely change it */
if( newvalue == p_intf->p_sys->f_adj_oldvalue )
{
/* Update the value */
p_intf->p_sys->p_adj->value =
p_intf->p_sys->f_adj_oldvalue =
( 100. * p_area->i_tell ) / p_area->i_size;
gtk_signal_emit_by_name( GTK_OBJECT( p_intf->p_sys->p_adj ),
"value_changed" );
}
/* Otherwise, send message to the input if the user has
* finished dragging the slider */
else if( p_intf->p_sys->b_slider_free )
{
off_t i_seek = ( newvalue * p_area->i_size ) / 100;
/* release the lock to be able to seek */
vlc_mutex_unlock( &p_input->stream.stream_lock );
input_Seek( p_input, i_seek, INPUT_SEEK_SET );
vlc_mutex_lock( &p_input->stream.stream_lock );
/* Update the old value */
p_intf->p_sys->f_adj_oldvalue = newvalue;
}
#undef p_area
}
}
vlc_mutex_unlock( &p_input->stream.stream_lock );
}
else if( p_intf->p_sys->b_playing && !p_intf->b_die )
{
E_(GtkModeManage)( p_intf );
p_intf->p_sys->b_playing = 0;
}
#ifndef NEED_GTK_MAIN #ifndef NEED_GTK_MAIN
if( p_intf->b_die ) if( p_intf->b_die )
{ {
...@@ -310,3 +381,78 @@ static int Manage( intf_thread_t *p_intf ) ...@@ -310,3 +381,78 @@ static int Manage( intf_thread_t *p_intf )
return TRUE; return TRUE;
} }
/*****************************************************************************
* GtkDisplayDate: display stream date
*****************************************************************************
* This function displays the current date related to the position in
* the stream. It is called whenever the slider changes its value.
* The lock has to be taken before you call the function.
*****************************************************************************/
void E_(GtkDisplayDate)( GtkAdjustment *p_adj )
{
intf_thread_t *p_intf;
p_intf = gtk_object_get_data( GTK_OBJECT( p_adj ), "p_intf" );
if( p_intf->p_sys->p_input )
{
#define p_area p_intf->p_sys->p_input->stream.p_selected_area
char psz_time[ OFFSETTOTIME_MAX_SIZE ];
gtk_label_set_text( GTK_LABEL( p_intf->p_sys->p_slider_label ),
input_OffsetToTime( p_intf->p_sys->p_input, psz_time,
( p_area->i_size * p_adj->value ) / 100 ) );
#undef p_area
}
}
/*****************************************************************************
* GtkModeManage: actualize the aspect of the interface whenever the input
* changes.
*****************************************************************************
* The lock has to be taken before you call the function.
*****************************************************************************/
gint E_(GtkModeManage)( intf_thread_t * p_intf )
{
GtkWidget * p_slider;
vlc_bool_t b_control;
#define GETWIDGET( ptr, name ) GTK_WIDGET( gtk_object_get_data( GTK_OBJECT( \
p_intf->p_sys->ptr ) , ( name ) ) )
/* hide slider */
p_slider = GTK_WIDGET( gtk_object_get_data( GTK_OBJECT(
p_intf->p_sys->p_window ), "slider" ) );
gtk_widget_hide( GTK_WIDGET( p_slider ) );
/* controls unavailable */
b_control = 0;
/* show the box related to current input mode */
if( p_intf->p_sys->p_input )
{
/* initialize and show slider for seekable streams */
if( p_intf->p_sys->p_input->stream.b_seekable )
{
p_intf->p_sys->p_adj->value = p_intf->p_sys->f_adj_oldvalue = 0;
gtk_signal_emit_by_name( GTK_OBJECT( p_intf->p_sys->p_adj ),
"value_changed" );
gtk_widget_show( GTK_WIDGET( p_slider ) );
}
/* control buttons for free pace streams */
b_control = p_intf->p_sys->p_input->stream.b_pace_control;
p_intf->p_sys->p_input->stream.b_changed = 0;
msg_Dbg( p_intf, "stream has changed, refreshing interface" );
}
/* set control items */
gtk_widget_set_sensitive( GETWIDGET(p_window, "toolbar_rewind"), b_control );
gtk_widget_set_sensitive( GETWIDGET(p_window, "toolbar_pause"), b_control );
gtk_widget_set_sensitive( GETWIDGET(p_window, "toolbar_forward"), b_control );
#undef GETWIDGET
return TRUE;
}
...@@ -173,24 +173,50 @@ ...@@ -173,24 +173,50 @@
<new_group>True</new_group> <new_group>True</new_group>
</child> </child>
</widget> </widget>
<widget>
<class>GtkLabel</class>
<name>slider_label</name>
<label>0:00:00</label>
<justify>GTK_JUSTIFY_CENTER</justify>
<wrap>False</wrap>
<xalign>0.5</xalign>
<yalign>0.5</yalign>
<xpad>0</xpad>
<ypad>0</ypad>
<child>
<new_group>True</new_group>
</child>
</widget>
</widget> </widget>
<widget> <widget>
<class>GtkProgressBar</class> <class>GtkHScale</class>
<name>progress</name> <name>slider</name>
<can_focus>True</can_focus>
<signal>
<name>button_release_event</name>
<handler>FamiliarSliderRelease</handler>
<last_modification_time>Fri, 03 Jan 2003 12:33:38 GMT</last_modification_time>
</signal>
<signal>
<name>button_press_event</name>
<handler>FamiliarSliderPress</handler>
<last_modification_time>Fri, 03 Jan 2003 12:33:54 GMT</last_modification_time>
</signal>
<draw_value>False</draw_value>
<value_pos>GTK_POS_RIGHT</value_pos>
<digits>3</digits>
<policy>GTK_UPDATE_CONTINUOUS</policy>
<value>0</value> <value>0</value>
<lower>0</lower> <lower>0</lower>
<upper>100</upper> <upper>100</upper>
<bar_style>GTK_PROGRESS_CONTINUOUS</bar_style> <step>1</step>
<orientation>GTK_PROGRESS_LEFT_TO_RIGHT</orientation> <page>6.25</page>
<activity_mode>True</activity_mode> <page_size>0</page_size>
<show_text>False</show_text>
<format>%P %%</format>
<text_xalign>0.5</text_xalign>
<text_yalign>0.5</text_yalign>
<child> <child>
<padding>0</padding> <padding>0</padding>
<expand>False</expand> <expand>True</expand>
<fill>False</fill> <fill>False</fill>
</child> </child>
</widget> </widget>
...@@ -232,42 +258,6 @@ ...@@ -232,42 +258,6 @@
<ypad>0</ypad> <ypad>0</ypad>
</widget> </widget>
<widget>
<class>GtkCombo</class>
<name>comboURL</name>
<x>40</x>
<y>4</y>
<width>185</width>
<height>24</height>
<value_in_list>False</value_in_list>
<ok_if_empty>True</ok_if_empty>
<case_sensitive>False</case_sensitive>
<use_arrows>True</use_arrows>
<use_arrows_always>False</use_arrows_always>
<items>file://
ftp://
http://
udp://:1234
udpstream://@:1234
</items>
<widget>
<class>GtkEntry</class>
<child_name>GtkCombo:entry</child_name>
<name>comboURL-entry</name>
<can_focus>True</can_focus>
<signal>
<name>changed</name>
<handler>on_comboURL-entry_changed</handler>
<last_modification_time>Thu, 01 Aug 2002 19:37:06 GMT</last_modification_time>
</signal>
<editable>True</editable>
<text_visible>True</text_visible>
<text_max_length>0</text_max_length>
<text>file://</text>
</widget>
</widget>
<widget> <widget>
<class>GtkScrolledWindow</class> <class>GtkScrolledWindow</class>
<name>scrolledwindow1</name> <name>scrolledwindow1</name>
...@@ -366,6 +356,44 @@ udpstream://@:1234 ...@@ -366,6 +356,44 @@ udpstream://@:1234
</widget> </widget>
</widget> </widget>
</widget> </widget>
<widget>
<class>GtkCombo</class>
<name>comboURL</name>
<x>40</x>
<y>4</y>
<width>185</width>
<height>24</height>
<value_in_list>False</value_in_list>
<ok_if_empty>True</ok_if_empty>
<case_sensitive>False</case_sensitive>
<use_arrows>True</use_arrows>
<use_arrows_always>False</use_arrows_always>
<items>file://
ftp://
http://
udp://:1234
udp6://:1234
rtp://:1234
rtp6://:1234
</items>
<widget>
<class>GtkEntry</class>
<child_name>GtkCombo:entry</child_name>
<name>comboURL-entry</name>
<can_focus>True</can_focus>
<signal>
<name>changed</name>
<handler>on_comboURL-entry_changed</handler>
<last_modification_time>Thu, 01 Aug 2002 19:37:06 GMT</last_modification_time>
</signal>
<editable>True</editable>
<text_visible>True</text_visible>
<text_max_length>0</text_max_length>
<text>file://</text>
</widget>
</widget>
</widget> </widget>
<widget> <widget>
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* familiar.h: private Gtk+ interface description * familiar.h: private Gtk+ interface description
***************************************************************************** *****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN * Copyright (C) 1999, 2000 VideoLAN
* $Id: familiar.h,v 1.9 2002/12/16 22:06:59 jpsaman Exp $ * $Id: familiar.h,v 1.10 2003/01/03 20:55:01 jpsaman Exp $
* *
* Authors: Jean-Paul Saman <jpsaman@wxs.nl> * Authors: Jean-Paul Saman <jpsaman@wxs.nl>
* *
...@@ -34,13 +34,22 @@ struct intf_sys_t ...@@ -34,13 +34,22 @@ struct intf_sys_t
/* windows and widgets */ /* windows and widgets */
GtkWidget * p_window; /* main window */ GtkWidget * p_window; /* main window */
GtkNotebook * p_notebook; GtkNotebook * p_notebook;
GtkProgressBar * p_progess; GtkHScale * p_slider;
// GtkWidget * p_notebook_about;
// GtkWidget * p_notebook_open;
// GtkWidget * p_notebook_preferences;
GtkCList * p_clist; GtkCList * p_clist;
/* slider */
GtkLabel * p_slider_label;
GtkAdjustment * p_adj; /* slider adjustment object */
float f_adj_oldvalue; /* previous value */
/* special actions */
vlc_bool_t b_playing;
vlc_bool_t b_window_changed; /* window display toggled ? */
vlc_bool_t b_slider_free; /* slider status */
/* Preference settings */
vlc_bool_t b_autoplayfile; vlc_bool_t b_autoplayfile;
/* The input thread */ /* The input thread */
input_thread_t * p_input; input_thread_t * p_input;
}; };
......
...@@ -33,13 +33,11 @@ create_familiar (void) ...@@ -33,13 +33,11 @@ create_familiar (void)
GtkWidget *toolbar_stop; GtkWidget *toolbar_stop;
GtkWidget *toolbar_forward; GtkWidget *toolbar_forward;
GtkWidget *toolbar_about; GtkWidget *toolbar_about;
GtkWidget *progress; GtkWidget *slider_label;
GtkWidget *slider;
GtkWidget *notebook; GtkWidget *notebook;
GtkWidget *fixedMedia; GtkWidget *fixedMedia;
GtkWidget *labelUrl; GtkWidget *labelUrl;
GtkWidget *comboURL;
GList *comboURL_items = NULL;
GtkWidget *comboURL_entry;
GtkWidget *scrolledwindow1; GtkWidget *scrolledwindow1;
GtkWidget *clistmedia; GtkWidget *clistmedia;
GtkWidget *labelname; GtkWidget *labelname;
...@@ -47,6 +45,9 @@ create_familiar (void) ...@@ -47,6 +45,9 @@ create_familiar (void)
GtkWidget *labelsize; GtkWidget *labelsize;
GtkWidget *labeluid; GtkWidget *labeluid;
GtkWidget *labelgid; GtkWidget *labelgid;
GtkWidget *comboURL;
GList *comboURL_items = NULL;
GtkWidget *comboURL_entry;
GtkWidget *media; GtkWidget *media;
GtkWidget *fixedPreferences; GtkWidget *fixedPreferences;
GtkWidget *buttonSave; GtkWidget *buttonSave;
...@@ -194,14 +195,26 @@ create_familiar (void) ...@@ -194,14 +195,26 @@ create_familiar (void)
(GtkDestroyNotify) gtk_widget_unref); (GtkDestroyNotify) gtk_widget_unref);
gtk_widget_show (toolbar_about); gtk_widget_show (toolbar_about);
progress = gtk_progress_bar_new (); slider_label = gtk_label_new (_("0:00:00"));
gtk_widget_set_name (progress, "progress"); gtk_widget_set_name (slider_label, "slider_label");
gtk_widget_ref (progress); gtk_widget_ref (slider_label);
gtk_object_set_data_full (GTK_OBJECT (familiar), "progress", progress, gtk_object_set_data_full (GTK_OBJECT (familiar), "slider_label", slider_label,
(GtkDestroyNotify) gtk_widget_unref);
gtk_widget_show (slider_label);
gtk_toolbar_append_space (GTK_TOOLBAR (toolbar));
gtk_toolbar_append_widget (GTK_TOOLBAR (toolbar), slider_label, NULL, NULL);
slider = gtk_hscale_new (GTK_ADJUSTMENT (gtk_adjustment_new (0, 0, 100, 1, 6.25, 0)));
gtk_widget_set_name (slider, "slider");
gtk_widget_ref (slider);
gtk_object_set_data_full (GTK_OBJECT (familiar), "slider", slider,
(GtkDestroyNotify) gtk_widget_unref); (GtkDestroyNotify) gtk_widget_unref);
gtk_widget_show (progress); gtk_widget_show (slider);
gtk_box_pack_start (GTK_BOX (vbox), progress, FALSE, FALSE, 0); gtk_box_pack_start (GTK_BOX (vbox), slider, TRUE, FALSE, 0);
gtk_progress_set_activity_mode (GTK_PROGRESS (progress), TRUE); gtk_scale_set_draw_value (GTK_SCALE (slider), FALSE);
gtk_scale_set_value_pos (GTK_SCALE (slider), GTK_POS_RIGHT);
gtk_scale_set_digits (GTK_SCALE (slider), 3);
notebook = gtk_notebook_new (); notebook = gtk_notebook_new ();
gtk_widget_set_name (notebook, "notebook"); gtk_widget_set_name (notebook, "notebook");
...@@ -229,31 +242,6 @@ create_familiar (void) ...@@ -229,31 +242,6 @@ create_familiar (void)
gtk_widget_set_uposition (labelUrl, 4, 8); gtk_widget_set_uposition (labelUrl, 4, 8);
gtk_widget_set_usize (labelUrl, 38, 18); gtk_widget_set_usize (labelUrl, 38, 18);
comboURL = gtk_combo_new ();
gtk_widget_set_name (comboURL, "comboURL");
gtk_widget_ref (comboURL);
gtk_object_set_data_full (GTK_OBJECT (familiar), "comboURL", comboURL,
(GtkDestroyNotify) gtk_widget_unref);
gtk_widget_show (comboURL);
gtk_fixed_put (GTK_FIXED (fixedMedia), comboURL, 40, 4);
gtk_widget_set_uposition (comboURL, 40, 4);
gtk_widget_set_usize (comboURL, 185, 24);
comboURL_items = g_list_append (comboURL_items, (gpointer) _("file://"));
comboURL_items = g_list_append (comboURL_items, (gpointer) _("ftp://"));
comboURL_items = g_list_append (comboURL_items, (gpointer) _("http://"));
comboURL_items = g_list_append (comboURL_items, (gpointer) _("udp://:1234"));
comboURL_items = g_list_append (comboURL_items, (gpointer) _("udpstream://@:1234"));
gtk_combo_set_popdown_strings (GTK_COMBO (comboURL), comboURL_items);
g_list_free (comboURL_items);
comboURL_entry = GTK_COMBO (comboURL)->entry;
gtk_widget_set_name (comboURL_entry, "comboURL_entry");
gtk_widget_ref (comboURL_entry);
gtk_object_set_data_full (GTK_OBJECT (familiar), "comboURL_entry", comboURL_entry,
(GtkDestroyNotify) gtk_widget_unref);
gtk_widget_show (comboURL_entry);
gtk_entry_set_text (GTK_ENTRY (comboURL_entry), _("file://"));
scrolledwindow1 = gtk_scrolled_window_new (NULL, NULL); scrolledwindow1 = gtk_scrolled_window_new (NULL, NULL);
gtk_widget_set_name (scrolledwindow1, "scrolledwindow1"); gtk_widget_set_name (scrolledwindow1, "scrolledwindow1");
gtk_widget_ref (scrolledwindow1); gtk_widget_ref (scrolledwindow1);
...@@ -318,6 +306,33 @@ create_familiar (void) ...@@ -318,6 +306,33 @@ create_familiar (void)
gtk_widget_show (labelgid); gtk_widget_show (labelgid);
gtk_clist_set_column_widget (GTK_CLIST (clistmedia), 4, labelgid); gtk_clist_set_column_widget (GTK_CLIST (clistmedia), 4, labelgid);
comboURL = gtk_combo_new ();
gtk_widget_set_name (comboURL, "comboURL");
gtk_widget_ref (comboURL);
gtk_object_set_data_full (GTK_OBJECT (familiar), "comboURL", comboURL,
(GtkDestroyNotify) gtk_widget_unref);
gtk_widget_show (comboURL);
gtk_fixed_put (GTK_FIXED (fixedMedia), comboURL, 40, 4);
gtk_widget_set_uposition (comboURL, 40, 4);
gtk_widget_set_usize (comboURL, 185, 24);
comboURL_items = g_list_append (comboURL_items, (gpointer) _("file://"));
comboURL_items = g_list_append (comboURL_items, (gpointer) _("ftp://"));
comboURL_items = g_list_append (comboURL_items, (gpointer) _("http://"));
comboURL_items = g_list_append (comboURL_items, (gpointer) _("udp://:1234"));
comboURL_items = g_list_append (comboURL_items, (gpointer) _("udp6://:1234"));
comboURL_items = g_list_append (comboURL_items, (gpointer) _("rtp://:1234"));
comboURL_items = g_list_append (comboURL_items, (gpointer) _("rtp6://:1234"));
gtk_combo_set_popdown_strings (GTK_COMBO (comboURL), comboURL_items);
g_list_free (comboURL_items);
comboURL_entry = GTK_COMBO (comboURL)->entry;
gtk_widget_set_name (comboURL_entry, "comboURL_entry");
gtk_widget_ref (comboURL_entry);
gtk_object_set_data_full (GTK_OBJECT (familiar), "comboURL_entry", comboURL_entry,
(GtkDestroyNotify) gtk_widget_unref);
gtk_widget_show (comboURL_entry);
gtk_entry_set_text (GTK_ENTRY (comboURL_entry), _("file://"));
media = gtk_label_new (_("Media")); media = gtk_label_new (_("Media"));
gtk_widget_set_name (media, "media"); gtk_widget_set_name (media, "media");
gtk_widget_ref (media); gtk_widget_ref (media);
...@@ -480,8 +495,11 @@ create_familiar (void) ...@@ -480,8 +495,11 @@ create_familiar (void)
gtk_signal_connect (GTK_OBJECT (toolbar_about), "clicked", gtk_signal_connect (GTK_OBJECT (toolbar_about), "clicked",
GTK_SIGNAL_FUNC (on_toolbar_about_clicked), GTK_SIGNAL_FUNC (on_toolbar_about_clicked),
NULL); NULL);
gtk_signal_connect (GTK_OBJECT (comboURL_entry), "changed", gtk_signal_connect (GTK_OBJECT (slider), "button_release_event",
GTK_SIGNAL_FUNC (on_comboURL_entry_changed), GTK_SIGNAL_FUNC (FamiliarSliderRelease),
NULL);
gtk_signal_connect (GTK_OBJECT (slider), "button_press_event",
GTK_SIGNAL_FUNC (FamiliarSliderPress),
NULL); NULL);
gtk_signal_connect (GTK_OBJECT (clistmedia), "select_row", gtk_signal_connect (GTK_OBJECT (clistmedia), "select_row",
GTK_SIGNAL_FUNC (on_clistmedia_select_row), GTK_SIGNAL_FUNC (on_clistmedia_select_row),
...@@ -489,6 +507,9 @@ create_familiar (void) ...@@ -489,6 +507,9 @@ create_familiar (void)
gtk_signal_connect (GTK_OBJECT (clistmedia), "click_column", gtk_signal_connect (GTK_OBJECT (clistmedia), "click_column",
GTK_SIGNAL_FUNC (on_clistmedia_click_column), GTK_SIGNAL_FUNC (on_clistmedia_click_column),
NULL); NULL);
gtk_signal_connect (GTK_OBJECT (comboURL_entry), "changed",
GTK_SIGNAL_FUNC (on_comboURL_entry_changed),
NULL);
gtk_signal_connect (GTK_OBJECT (cbautoplay), "toggled", gtk_signal_connect (GTK_OBJECT (cbautoplay), "toggled",
GTK_SIGNAL_FUNC (on_cbautoplay_toggled), GTK_SIGNAL_FUNC (on_cbautoplay_toggled),
NULL); NULL);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment