/*****************************************************************************
* gtk_callbacks.c : Callbacks for the Gtk+ plugin.
*****************************************************************************
- * Copyright (C) 2000, 2001 VideoLAN
- * $Id: gtk_callbacks.c,v 1.10 2003/01/26 14:49:09 fenrir Exp $
+ * Copyright (C) 2000, 2001, 2003 VideoLAN
+ * $Id$
*
- * Authors: Samuel Hocevar <sam@zoy.org>
+ * Authors: Sam Hocevar <sam@zoy.org>
* Stéphane Borel <stef@via.ecp.fr>
* Julien BLACHE <jb@technologeek.org>
*
#include "common.h"
-#include "netutils.h"
+#ifdef HAVE_CDDAX
+#define CDDA_MRL "cddax://"
+#else
+#define CDDA_MRL "cdda://"
+#endif
+
+#ifdef HAVE_VCDX
+#define VCD_MRL "vcdx://"
+#else
+#define VCD_MRL "vcdx://"
+#endif
/*****************************************************************************
* Useful function to retrieve p_intf
/* Otherwise, the parent widget has it */
widget = gtk_menu_get_attach_widget( GTK_MENU( widget ) );
+ p_data = gtk_object_get_data( GTK_OBJECT( widget ), "p_intf" );
+ if( p_data )
+ {
+ return p_data;
+ }
}
/* We look for the top widget */
widget = gtk_widget_get_toplevel( GTK_WIDGET( widget ) );
-
p_data = gtk_object_get_data( GTK_OBJECT( widget ), "p_intf" );
return p_data;
intf_thread_t *p_intf = GtkGetIntf( widget );
vout_thread_t *p_vout;
+ if( p_intf->p_sys->p_input == NULL )
+ {
+ return FALSE;
+ }
+
p_vout = vlc_object_find( p_intf->p_sys->p_input,
VLC_OBJECT_VOUT, FIND_CHILD );
if( p_vout == NULL )
vlc_mutex_unlock( &p_intf->p_sys->p_input->stream.stream_lock );
input_ChangeArea( p_intf->p_sys->p_input, p_area );
- input_SetStatus( p_intf->p_sys->p_input, INPUT_STATUS_PLAY );
+ var_SetInteger( p_intf->p_sys->p_input, PLAYING_S );
p_intf->p_sys->b_title_update = VLC_TRUE;
vlc_mutex_lock( &p_intf->p_sys->p_input->stream.stream_lock );
vlc_mutex_unlock( &p_intf->p_sys->p_input->stream.stream_lock );
input_ChangeArea( p_intf->p_sys->p_input, p_area );
- input_SetStatus( p_intf->p_sys->p_input, INPUT_STATUS_PLAY );
+ var_SetInteger( p_intf->p_sys->p_input, PLAYING_S );
p_intf->p_sys->b_title_update = VLC_TRUE;
vlc_mutex_lock( &p_intf->p_sys->p_input->stream.stream_lock );
vlc_mutex_unlock( &p_intf->p_sys->p_input->stream.stream_lock );
input_ChangeArea( p_intf->p_sys->p_input, p_area );
- input_SetStatus( p_intf->p_sys->p_input, INPUT_STATUS_PLAY );
+ var_SetInteger( p_intf->p_sys->p_input, PLAYING_S );
p_intf->p_sys->b_chapter_update = VLC_TRUE;
vlc_mutex_lock( &p_intf->p_sys->p_input->stream.stream_lock );
vlc_mutex_unlock( &p_intf->p_sys->p_input->stream.stream_lock );
input_ChangeArea( p_intf->p_sys->p_input, p_area );
- input_SetStatus( p_intf->p_sys->p_input, INPUT_STATUS_PLAY );
+ var_SetInteger( p_intf->p_sys->p_input, PLAYING_S );
p_intf->p_sys->b_chapter_update = VLC_TRUE;
vlc_mutex_lock( &p_intf->p_sys->p_input->stream.stream_lock );
vlc_mutex_unlock( &p_intf->p_sys->p_input->stream.stream_lock );
}
-/****************************************************************************
- * Network specific items
- ****************************************************************************/
-void GtkNetworkJoin( GtkEditable * editable, gpointer user_data )
-{
- int i_channel;
-
- i_channel = gtk_spin_button_get_value_as_int( GTK_SPIN_BUTTON( editable ) );
-#if 0
- msg_Dbg( "intf info: joining channel %d", i_channel );
-
- network_ChannelJoin( i_channel );
-#endif
-}
-
-void GtkChannelGo( GtkButton * button, gpointer user_data )
-{
- GtkWidget * window;
- GtkWidget * spin;
- int i_channel;
-
- intf_thread_t *p_intf = GtkGetIntf( button );
-
- window = gtk_widget_get_toplevel( GTK_WIDGET (button) );
- spin = GTK_WIDGET( gtk_object_get_data( GTK_OBJECT( window ),
- "network_channel_spinbutton" ) );
-
- i_channel = gtk_spin_button_get_value_as_int( GTK_SPIN_BUTTON( spin ) );
- msg_Dbg( p_intf, "joining channel %d", i_channel );
-
- vlc_mutex_lock( &p_intf->change_lock );
- network_ChannelJoin( p_intf, i_channel );
- vlc_mutex_unlock( &p_intf->change_lock );
-
-/* input_SetStatus( p_intf->p_sys->p_input, INPUT_STATUS_PLAY ); */
-}
-
-
/****************************************************************************
* About box
****************************************************************************/
i_seconds = GET_VALUE( "jump_second_spinbutton" );
#undef GET_VALUE
- input_Seek( p_intf->p_sys->p_input,
- i_seconds + 60 * i_minutes + 3600 * i_hours,
- INPUT_SEEK_SECONDS | INPUT_SEEK_SET );
+ var_SetTime( p_intf->p_sys->p_input, "time",
+ (int64_t)(i_seconds+60*i_minutes+3600*i_hours)*I64C(1000000));
gtk_widget_hide( gtk_widget_get_toplevel( GTK_WIDGET (button) ) );
}
return FALSE;
}
- psz_current = p_playlist->pp_items[ p_playlist->i_index ]->psz_name;
+ psz_current = p_playlist->pp_items[ p_playlist->i_index ]->input.psz_name;
/*
* Get the active input
if( psz_current != NULL )
{
- if( !strncmp(psz_current, "dvd:", 4) )
+ if( !strncmp(psz_current, "dvd://", 4) )
{
- switch( psz_current[4] )
+ switch( psz_current[strlen("dvd://")] )
{
case '\0':
case '@':
psz_device = config_GetPsz( p_intf, "dvd" );
break;
default:
- /* Omit the first 4 characters */
- psz_device = strdup( psz_current + 4 );
+ /* Omit the first MRL-selector characters */
+ psz_device = strdup( psz_current + strlen("dvd://" ) );
+ break;
+ }
+ }
+ else if( !strncmp(psz_current, "vcd:", strlen("vcd:")) )
+ {
+ switch( psz_current[strlen("vcd:")] )
+ {
+ case '\0':
+ case '@':
+ psz_device = config_GetPsz( p_intf, VCD_MRL );
+ break;
+ default:
+ /* Omit the beginning MRL-selector characters */
+ psz_device = strdup( psz_current + strlen(VCD_MRL) );
break;
}
}
- else if( !strncmp(psz_current, "vcd:", 4) )
+ else if( !strncmp(psz_current, CDDA_MRL, strlen(CDDA_MRL) ) )
{
- switch( psz_current[4] )
+ switch( psz_current[strlen(CDDA_MRL)] )
{
case '\0':
case '@':
- psz_device = config_GetPsz( p_intf, "vcd" );
+ psz_device = config_GetPsz( p_intf, "cd-audio" );
break;
default:
- /* Omit the first 4 characters */
- psz_device = strdup( psz_current + 4 );
+ /* Omit the beginning MRL-selector characters */
+ psz_device = strdup( psz_current + strlen(CDDA_MRL) );
break;
}
}
gpointer user_data )
{
intf_thread_t *p_intf = GtkGetIntf( menuitem );
- aout_instance_t *p_aout;
+ audio_volume_t i_volume;
- p_aout = vlc_object_find( p_intf, VLC_OBJECT_AOUT, FIND_ANYWHERE );
- if( p_aout != NULL )
- {
- if( p_intf->p_sys->b_mute )
- {
- audio_volume_t i_volume;
-
- aout_VolumeMute( p_aout, &i_volume );
- p_intf->p_sys->b_mute = ( i_volume == 0 ) ? 1 : 0;
-
- }
- aout_VolumeUp( p_aout, 1, NULL );
- vlc_object_release( (vlc_object_t *)p_aout );
- }
+ aout_VolumeUp( p_intf, 1, &i_volume );
+ p_intf->p_sys->b_mute = ( i_volume == 0 ) ? 1 : 0;
}
gpointer user_data )
{
intf_thread_t *p_intf = GtkGetIntf( menuitem );
- aout_instance_t *p_aout;
+ audio_volume_t i_volume;
- p_aout = vlc_object_find( p_intf, VLC_OBJECT_AOUT, FIND_ANYWHERE );
- if( p_aout != NULL )
- {
- if( p_intf->p_sys->b_mute )
- {
- audio_volume_t i_volume;
-
- aout_VolumeMute( p_aout, &i_volume );
- p_intf->p_sys->b_mute = ( i_volume == 0 ) ? 1 : 0;
- }
- aout_VolumeDown( p_aout, 1, NULL );
- vlc_object_release( (vlc_object_t *)p_aout );
- }
+ aout_VolumeDown( p_intf, 1, &i_volume );
+ p_intf->p_sys->b_mute = ( i_volume == 0 ) ? 1 : 0;
}
gpointer user_data )
{
intf_thread_t *p_intf = GtkGetIntf( menuitem );
- aout_instance_t *p_aout;
audio_volume_t i_volume;
- p_aout = vlc_object_find( p_intf, VLC_OBJECT_AOUT, FIND_ANYWHERE );
-
- if( p_aout != NULL )
- {
- aout_VolumeMute( p_aout, &i_volume );
-
- p_intf->p_sys->b_mute = ( i_volume == 0 ) ? 1 : 0;
-
- vlc_object_release( (vlc_object_t *)p_aout );
- }
+ aout_VolumeMute( p_intf, &i_volume );
+ p_intf->p_sys->b_mute = ( i_volume == 0 ) ? 1 : 0;
}
void
if( p_intf )
msg_Dbg( p_intf, "GtkMenubarDeinterlace" );
-
-
}