Commit bc118e19 authored by Stéphane Borel's avatar Stéphane Borel

*Much work on the gnome interface: added oct's playlist from gtk plugin,

tuned appearence, added preferences window (with no features yet), jump
window to go to specified time (not functionnal yet), and fixed some
bugs.

*moved b_fullscreen from p_vout->p_sys to p_vout and unified way of
toggling fullscreen in sdl in x11/xvideo output (using p_vout->i_ch
nges) so that an interface plugin can toogle fullscreen (implemented
in gnome)

*added p_input->stream.p_selected_area->i_tell in input TS so that the
slider work with ts files ( however, the time counter doesn't since we
have no mux_rate )

*improved ac3 spdif output ( and made it work again :)). It uses a true
blank frame now, and it allows to switch languages like a traditionnal
output. It doesn't support multiplexing though, neither can we switch
between spdif/analogical mode on-the-fly.

*beginning of the back port of gnome to gtk for those who do not have
gnome.
parent c8c99b21
......@@ -2,7 +2,7 @@
* audio_output.h : audio output thread interface
*****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN
* $Id: audio_output.h,v 1.34 2001/05/06 04:32:02 sam Exp $
* $Id: audio_output.h,v 1.35 2001/05/06 18:32:30 stef Exp $
*
* Authors: Michel Kaempf <maxx@via.ecp.fr>
*
......@@ -188,13 +188,15 @@ typedef struct aout_thread_s
#define AOUT_FMT_U16_BE 0x00000100 /* Big endian U16 */
#define AOUT_FMT_AC3 0x00000400 /* Dolby Digital AC3 */
#ifdef WORDS_BIGENDIAN
#define AOUT_FMT_S16_NE AOUT_FMT_S16_BE
#else
#define AOUT_FMT_S16_NE AOUT_FMT_S16_LE
#endif
/* Size of a frame for spdif output */
#define SPDIF_FRAME_SIZE 6144
/*****************************************************************************
* Prototypes
*****************************************************************************/
......
......@@ -123,6 +123,7 @@
/* Environment variable containing the display method */
#define INTF_METHOD_VAR "vlc_intf"
#define INTF_METHOD_DEFAULT "gtk"
/* Environment variable used to store startup script name and default value */
#define INTF_INIT_SCRIPT_VAR "vlcrc"
......@@ -142,12 +143,16 @@
/* Maximum number of channels */
#define INTF_MAX_CHANNELS 10
/* Default search path for interface file browser */
#define INTF_PATH_VAR "vlc_search_path"
/*****************************************************************************
* Input thread configuration
*****************************************************************************/
/* Environment variable containing the display method */
/* Environment variable containing the input method */
#define INPUT_METHOD_VAR "vlc_input"
#define INPUT_METHOD_DEFAULT "ps"
/* XXX?? */
#define INPUT_IDLE_SLEEP ((int)(0.100*CLOCK_FREQ))
......@@ -169,15 +174,22 @@
/* Maximum length of a hostname or source name */
#define INPUT_MAX_SOURCE_LENGTH 100
/* Default network protocol */
#define INPUT_NETWORK_PROTOCOL_VAR "vlc_network_protocol"
#define INPUT_NETWORK_PROTOCOL_DEFAULT "ts"
/* Default remote server */
#define INPUT_SERVER_VAR "vlc_server"
#define INPUT_SERVER_DEFAULT "138.195.143.220"
#define INPUT_BCAST_ADDR "138.195.143.255"
/* Default input port */
#define INPUT_PORT_VAR "vlc_server_port"
#define INPUT_PORT_DEFAULT 1234
/* Default broadcast address */
#define INPUT_BCAST_ADRR_VAR "vlc_broadcast_addr"
#define INPUT_BCAST_ADDR_DEFAULT "138.195.143.255"
/* Broadcast mode */
#define INPUT_BROADCAST_VAR "vlc_broadcast"
#define INPUT_BROADCAST_DEFAULT 0
......@@ -204,6 +216,7 @@
* mark it to be presented */
#define DEFAULT_PTS_DELAY (mtime_t)(.2*CLOCK_FREQ)
/* DVD defaults */
#define INPUT_DVD_DEVICE_VAR "vlc_dvd_device"
#define INPUT_DVD_DEVICE_DEFAULT "/dev/dvd"
......@@ -214,6 +227,10 @@
#define INPUT_CHANNEL_VAR "vlc_input_channel"
#define INPUT_SUBTITLE_VAR "vlc_input_subtitle"
/* VCD defaults */
#define INPUT_VVC_DEVICE_VAR "vlc_vcd_device"
#define INPUT_VCD_DEVICE_DEFAULT "/dev/cdrom"
/*****************************************************************************
* Audio configuration
*****************************************************************************/
......@@ -223,6 +240,7 @@
/* Environment variable containing the audio output method */
#define AOUT_METHOD_VAR "vlc_aout"
#define AOUT_METHOD_DEFAULT "dsp"
/* Environment variable used to store dsp device name, and default value */
#define AOUT_DSP_VAR "vlc_dsp"
......@@ -284,6 +302,7 @@
/* Environment variable containing the display method */
#define VOUT_METHOD_VAR "vlc_vout"
#define VOUT_METHOD_DEFAULT "x11"
/* Environment variable containing the motion compensation method */
#define MOTION_METHOD_VAR "vlc_motion"
......@@ -304,6 +323,15 @@
#define VOUT_WIDTH_DEFAULT 720
#define VOUT_HEIGHT_DEFAULT 576
#define VOUT_DEPTH_VAR "vlc_depth"
#define VOUT_DEPTH_DEFAULT 15
#define VOUT_FULLSCREEN_VAR "vlc_fullscreen"
#define VOUT_FULLSCREEN_DEFAULT 0
#define VOUT_FULLSCREEN_DEPTH_VAR "vlc_fullscreen_depth"
#define VOUT_FULLSCREEN_DEPTH_DEFAULT 32
/* Maximum width of a scaled source picture - this should be relatively high,
* since higher stream values will result in no display at all. */
#define VOUT_MAX_WIDTH 4096
......@@ -335,7 +363,8 @@
#define VOUT_OVERLAY_DEFAULT 0
/* Default gamma */
#define VOUT_GAMMA 0.
#define VOUT_GAMMA_VAR "vlc_gamma"
#define VOUT_GAMMA_DEFAULT 0.
/* Default fonts */
#define VOUT_DEFAULT_FONT "default8x9.psf"
......@@ -446,7 +475,7 @@
#define INTF_MSG_QSIZE 64
/* Interface warnig message level */
#define INTF_WARNING_VAR "warning_level"
#define INTF_WARNING_VAR "vlc_warning_level"
#define INTF_WARNING_DEFAULT 12
/* Define to enable messages queues - disabling messages queue can be useful
......@@ -473,3 +502,19 @@
/* Maximal number of commands which can be saved in history list */
#define INTF_CONSOLE_MAX_HISTORY 20
/****************************************************************************
* Playlist defaults
****************************************************************************/
/* Launch on start-up */
#define PLAYLIST_STARTUP_VAR "vlc_playlist_on_start_up"
#define PLAYLIST_STARTUP_DEFAULT 0
/* Enqueue drag'n dropped item */
#define PLAYLIST_ENQUEUE_VAR "vlc_playlist_enqueue"
#define PLAYLIST_ENQUEUE_DZFAULT 0
/* Loop on playlist end */
#define PLAYLIST_LOOP_VAR "vlc_playlist_loop"
#define PLAYLIST_LOOP_DEFAULT 0
......@@ -5,7 +5,7 @@
* thread, and destroy a previously oppenned video output thread.
*****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN
* $Id: video_output.h,v 1.59 2001/05/06 04:32:02 sam Exp $
* $Id: video_output.h,v 1.60 2001/05/06 18:32:30 stef Exp $
*
* Authors: Vincent Seguin <seguin@via.ecp.fr>
*
......@@ -210,6 +210,7 @@ typedef struct vout_thread_s
boolean_t b_info; /* print additional information */
boolean_t b_interface; /* render interface */
boolean_t b_scale; /* allow picture scaling */
boolean_t b_fullscreen; /* toogle fullscreen dusplay */
mtime_t render_time; /* last picture render time */
......
......@@ -10,7 +10,7 @@
* -dvd_udf to find files
*****************************************************************************
* Copyright (C) 1998-2001 VideoLAN
* $Id: input_dvd.c,v 1.54 2001/04/29 17:57:50 stef Exp $
* $Id: input_dvd.c,v 1.55 2001/05/06 18:32:30 stef Exp $
*
* Author: Stphane Borel <stef@via.ecp.fr>
*
......@@ -380,8 +380,8 @@ static void DVDInit( input_thread_t * p_input )
/* reading several block once seems to cause lock-up
* when using input_ToggleES
* who wrote thez damn buggy piece of shit ??? --stef */
p_dvd->i_block_once = 32;
p_input->i_read_once = 128;
p_dvd->i_block_once = 1;//32;
p_input->i_read_once = 8;//128;
i = CSSTest( p_input->i_handle );
......@@ -398,7 +398,7 @@ static void DVDInit( input_thread_t * p_input )
/* Reading structures initialisation */
p_input->p_method_data =
DVDNetlistInit( 8192, 16384, 2048, DVD_LB_SIZE, p_dvd->i_block_once );
DVDNetlistInit( 2048, 4096, 2048, DVD_LB_SIZE, p_dvd->i_block_once );
intf_WarnMsg( 2, "dvd info: netlist initialized" );
/* Ifo allocation & initialisation */
......@@ -1350,12 +1350,17 @@ static int DVDFindSector( thread_dvd_data_t * p_dvd )
}
/* Find start and end sectors of new cell */
#if 1
p_dvd->i_sector = MAX(
p_dvd->p_ifo->vts.cell_inf.p_cell_map[p_dvd->i_cell].i_start_sector,
title.p_cell_play[p_dvd->i_prg_cell].i_start_sector );
p_dvd->i_end_sector = MIN(
p_dvd->p_ifo->vts.cell_inf.p_cell_map[p_dvd->i_cell].i_end_sector,
title.p_cell_play[p_dvd->i_prg_cell].i_end_sector );
#else
p_dvd->i_sector = title.p_cell_play[p_dvd->i_prg_cell].i_start_sector;
p_dvd->i_end_sector = title.p_cell_play[p_dvd->i_prg_cell].i_end_sector;
#endif
/*
intf_WarnMsg( 1, "cell: %d sector1: 0x%x end1: 0x%x\n"
......
......@@ -7,7 +7,7 @@
# Objects
#
PLUGIN_GNOME = gnome.o intf_gnome.o gnome_callbacks.o gnome_interface.o gnome_support.o
PLUGIN_GNOME = gnome.o intf_gnome.o gnome_callbacks.o gnome_interface.o gnome_support.o gnome_playlist.o
BUILTIN_GNOME = $(PLUGIN_GNOME:%.o=BUILTIN_%.o)
ALL_OBJ = $(PLUGIN_GNOME) $(BUILTIN_GNOME)
......
......@@ -2,7 +2,7 @@
* gnome_callbacks.c : Callbacks for the Gnome plugin.
*****************************************************************************
* Copyright (C) 2000, 2001 VideoLAN
* $Id: gnome_callbacks.c,v 1.25 2001/05/01 04:18:18 sam Exp $
* $Id: gnome_callbacks.c,v 1.26 2001/05/06 18:32:30 stef Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
* Stphane Borel <stef@via.ecp.fr>
......@@ -44,23 +44,18 @@
#include "intf_playlist.h"
#include "intf_msg.h"
#include "video.h"
#include "video_output.h"
#include "audio_output.h"
#include "gnome_callbacks.h"
#include "gnome_playlist.h"
#include "gnome_interface.h"
#include "gnome_support.h"
#include "intf_gnome.h"
#include "main.h"
/*****************************************************************************
* Inline function to retrieve the interface structure
*****************************************************************************/
static __inline__ intf_thread_t * GetIntf( GtkWidget *item, char * psz_parent )
{
return( gtk_object_get_data( GTK_OBJECT( lookup_widget(item, psz_parent) ),
"p_intf" ) );
}
/*****************************************************************************
* Interface callbacks
*****************************************************************************
......@@ -118,6 +113,7 @@ on_intf_window_drag_data_received (GtkWidget *widget,
guint time,
gpointer user_data)
{
#if 0
char *psz_text = data->data;
int i_len = strlen( psz_text );
......@@ -157,6 +153,21 @@ on_intf_window_drag_data_received (GtkWidget *widget,
intf_ErrMsg( "intf error: unknown dropped type");
break;
}
#else
intf_thread_t * p_intf = GetIntf( GTK_WIDGET( widget ), "intf_window" );
int i_end = p_main->p_playlist->i_size;
GnomeDropDataReceived( p_intf, data, info, PLAYLIST_END );
if( p_intf->p_input != NULL )
{
/* FIXME: temporary hack */
p_intf->p_input->b_eof = 1;
}
intf_PlaylistJumpto( p_main->p_playlist, i_end - 1 );
#endif
}
......@@ -263,7 +274,7 @@ on_menubar_open_activate (GtkMenuItem *menuitem,
intf_thread_t *p_intf = GetIntf( GTK_WIDGET(menuitem), "intf_window" );
/* If we have never used the file selector, open it */
if( p_intf->p_sys->p_fileopen == NULL)
if( !GTK_IS_WIDGET( p_intf->p_sys->p_fileopen ) )
{
p_intf->p_sys->p_fileopen = create_intf_fileopen();
gtk_object_set_data( GTK_OBJECT( p_intf->p_sys->p_fileopen ),
......@@ -281,6 +292,14 @@ on_menubar_disc_activate (GtkMenuItem *menuitem,
{
intf_thread_t *p_intf = GetIntf( GTK_WIDGET(menuitem), "intf_window" );
/* If we have never used the file selector, open it */
if( !GTK_IS_WIDGET( p_intf->p_sys->p_disc ) )
{
p_intf->p_sys->p_disc = create_intf_disc();
gtk_object_set_data( GTK_OBJECT( p_intf->p_sys->p_disc ),
"p_intf", p_intf );
}
gtk_widget_show( p_intf->p_sys->p_disc );
gdk_window_raise( p_intf->p_sys->p_disc->window );
}
......@@ -292,6 +311,14 @@ on_menubar_network_activate (GtkMenuItem *menuitem,
{
intf_thread_t *p_intf = GetIntf( GTK_WIDGET(menuitem), "intf_window" );
/* If we have never used the file selector, open it */
if( !GTK_IS_WIDGET( p_intf->p_sys->p_network ) )
{
p_intf->p_sys->p_network = create_intf_network();
gtk_object_set_data( GTK_OBJECT( p_intf->p_sys->p_network ),
"p_intf", p_intf );
}
gtk_widget_show( p_intf->p_sys->p_network );
gdk_window_raise( p_intf->p_sys->p_network->window );
}
......@@ -313,7 +340,9 @@ void
on_menubar_playlist_activate (GtkMenuItem *menuitem,
gpointer user_data)
{
intf_thread_t *p_intf = GetIntf( GTK_WIDGET(menuitem), "intf_window" );
intf_thread_t * p_intf = GetIntf( GTK_WIDGET(menuitem), "intf_window" );
playlist_t * p_playlist ;
GtkCList * p_list;
if( !GTK_IS_WIDGET( p_intf->p_sys->p_playlist ) )
{
......@@ -321,6 +350,17 @@ on_menubar_playlist_activate (GtkMenuItem *menuitem,
gtk_object_set_data( GTK_OBJECT( p_intf->p_sys->p_playlist ),
"p_intf", p_intf );
}
vlc_mutex_lock( &p_main->p_playlist->change_lock );
if( p_main->p_playlist->i_size > 0 )
{
p_playlist = p_main->p_playlist;
p_list = GTK_CLIST( lookup_widget( p_intf->p_sys->p_playlist,
"playlist_clist" ) );
GnomeRebuildCList( p_list, p_playlist );
}
vlc_mutex_unlock( &p_main->p_playlist->change_lock );
gtk_widget_show( p_intf->p_sys->p_playlist );
gdk_window_raise( p_intf->p_sys->p_playlist->window );
}
......@@ -366,6 +406,22 @@ on_menubar_subtitle_toggle (GtkCheckMenuItem *menuitem,
}
void
on_menubar_fullscreen_activate (GtkMenuItem *menuitem,
gpointer user_data)
{
if( p_vout_bank->i_count )
{
vlc_mutex_lock( &p_vout_bank->pp_vout[0]->change_lock );
if( p_vout_bank->pp_vout[0]->b_fullscreen ==
!GTK_CHECK_MENU_ITEM( menuitem )->active )
p_vout_bank->pp_vout[0]->i_changes |= VOUT_FULLSCREEN_CHANGE;
vlc_mutex_unlock( &p_vout_bank->pp_vout[0]->change_lock );
}
}
void
on_menubar_title_toggle (GtkCheckMenuItem *menuitem,
gpointer user_data)
......@@ -374,8 +430,9 @@ on_menubar_title_toggle (GtkCheckMenuItem *menuitem,
if( menuitem->active && !p_intf->p_sys->b_title_update )
{
gint i_title = (gint)user_data;
p_intf->p_input->pf_set_area( p_intf->p_input,
(input_area_t*)user_data );
p_intf->p_input->stream.pp_areas[i_title] );
input_SetStatus( p_intf->p_input, INPUT_STATUS_PLAY );
......@@ -391,7 +448,7 @@ on_menubar_chapter_toggle (GtkCheckMenuItem *menuitem,
intf_thread_t * p_intf = GetIntf( GTK_WIDGET(menuitem), "intf_window" );
input_area_t * p_area = p_intf->p_input->stream.p_selected_area;
gint i_chapter = (gint)user_data;
char psz_chapter[3];
char psz_chapter[5];
if( menuitem->active && !p_intf->p_sys->b_chapter_update )
{
......@@ -448,7 +505,18 @@ void
on_menubar_preferences_activate (GtkMenuItem *menuitem,
gpointer user_data)
{
intf_thread_t *p_intf = GetIntf( GTK_WIDGET(menuitem), "intf_window" );
/* If we have never used the file selector, open it */
if( !GTK_IS_WIDGET( p_intf->p_sys->p_preferences ) )
{
p_intf->p_sys->p_preferences = create_intf_preferences();
gtk_object_set_data( GTK_OBJECT( p_intf->p_sys->p_preferences ),
"p_intf", p_intf );
}
gtk_widget_show( p_intf->p_sys->p_preferences );
gdk_window_raise( p_intf->p_sys->p_preferences->window );
}
......@@ -482,7 +550,7 @@ on_toolbar_open_clicked (GtkButton *button,
intf_thread_t *p_intf = GetIntf( GTK_WIDGET(button), "intf_window" );
/* If we have never used the file selector, open it */
if( p_intf->p_sys->p_fileopen == NULL)
if( !GTK_IS_WIDGET( p_intf->p_sys->p_fileopen ) )
{
p_intf->p_sys->p_fileopen = create_intf_fileopen();
gtk_object_set_data( GTK_OBJECT( p_intf->p_sys->p_fileopen ),
......@@ -500,6 +568,14 @@ on_toolbar_disc_clicked (GtkButton *button,
{
intf_thread_t *p_intf = GetIntf( GTK_WIDGET(button), "intf_window" );
/* If we have never used the file selector, open it */
if( !GTK_IS_WIDGET( p_intf->p_sys->p_disc ) )
{
p_intf->p_sys->p_disc = create_intf_disc();
gtk_object_set_data( GTK_OBJECT( p_intf->p_sys->p_disc ),
"p_intf", p_intf );
}
gtk_widget_show( p_intf->p_sys->p_disc );
gdk_window_raise( p_intf->p_sys->p_disc->window );
}
......@@ -511,6 +587,14 @@ on_toolbar_network_clicked (GtkButton *button,
{
intf_thread_t *p_intf = GetIntf( GTK_WIDGET(button), "intf_window" );
/* If we have never used the file selector, open it */
if( !GTK_IS_WIDGET( p_intf->p_sys->p_network ) )
{
p_intf->p_sys->p_network = create_intf_network();
gtk_object_set_data( GTK_OBJECT( p_intf->p_sys->p_network ),
"p_intf", p_intf );
}
gtk_widget_show( p_intf->p_sys->p_network );
gdk_window_raise( p_intf->p_sys->p_network->window );
}
......@@ -528,7 +612,14 @@ void
on_toolbar_stop_clicked (GtkButton *button,
gpointer user_data)
{
intf_thread_t *p_intf = GetIntf( GTK_WIDGET(button), "intf_window" );
if( p_intf->p_input != NULL )
{
p_vout_bank->pp_vout[0]->b_die = 1;
p_aout_bank->pp_aout[0]->b_die = 1;
p_intf->p_input->b_die = 1;
}
}
......@@ -596,8 +687,21 @@ on_toolbar_playlist_clicked (GtkButton *button,
gtk_object_set_data( GTK_OBJECT( p_intf->p_sys->p_playlist ),
"p_intf", p_intf );
}
gtk_widget_show( p_intf->p_sys->p_playlist );
gdk_window_raise( p_intf->p_sys->p_playlist->window );
if( GTK_WIDGET_VISIBLE( p_intf->p_sys->p_playlist ) )
{
gtk_widget_hide( p_intf->p_sys->p_playlist );
}
else
{
GtkCList * p_clist;
p_clist = GTK_CLIST( gtk_object_get_data(
GTK_OBJECT( p_intf->p_sys->p_playlist ), "playlist_clist" ) );
GnomeRebuildCList( p_clist , p_main->p_playlist );
gtk_widget_show( p_intf->p_sys->p_playlist );
gdk_window_raise( p_intf->p_sys->p_playlist->window );
}
}
......@@ -654,6 +758,14 @@ on_popup_play_activate (GtkMenuItem *menuitem,
}
void
on_popup_back_activate (GtkMenuItem *menuitem,
gpointer user_data)
{
}
void
on_popup_pause_activate (GtkMenuItem *menuitem,
gpointer user_data)
......@@ -693,6 +805,21 @@ on_popup_fast_activate (GtkMenuItem *menuitem,
}
void
on_popup_fullscreen_activate (GtkMenuItem *menuitem,
gpointer user_data)
{
if( p_vout_bank->i_count )
{
vlc_mutex_lock( &p_vout_bank->pp_vout[0]->change_lock );
if( p_vout_bank->pp_vout[0]->b_fullscreen ==
!GTK_CHECK_MENU_ITEM( menuitem )->active )
p_vout_bank->pp_vout[0]->i_changes |= VOUT_FULLSCREEN_CHANGE;
vlc_mutex_unlock( &p_vout_bank->pp_vout[0]->change_lock );
}
}
void
on_popup_audio_toggle (GtkCheckMenuItem *menuitem,
gpointer user_data)
......@@ -789,7 +916,7 @@ on_popup_open_activate (GtkMenuItem *menuitem,
intf_thread_t *p_intf = GetIntf( GTK_WIDGET(menuitem), "intf_popup" );
/* If we have never used the file selector, open it */
if( p_intf->p_sys->p_fileopen == NULL)
if( !GTK_IS_WIDGET( p_intf->p_sys->p_fileopen ) )
{
p_intf->p_sys->p_fileopen = create_intf_fileopen();
gtk_object_set_data( GTK_OBJECT( p_intf->p_sys->p_fileopen ),
......@@ -852,86 +979,120 @@ on_popup_exit_activate (GtkMenuItem *menuitem,
}
/*****************************************************************************
* Fileopen callbacks
*****************************************************************************
* The following callbacks are related to the file requester.
*****************************************************************************/
void
on_intf_fileopen_destroy (GtkObject *object,
on_popup_stop_activate (GtkMenuItem *menuitem,
gpointer user_data)
{
intf_thread_t *p_intf = GetIntf( GTK_WIDGET(object), "intf_fileopen" );
intf_thread_t *p_intf = GetIntf( GTK_WIDGET(menuitem), "intf_popup" );
p_intf->p_sys->p_fileopen = NULL;
if( p_intf->p_input != NULL )
{
p_intf->p_input->b_die = 1;
}
}
void
on_fileopen_ok_clicked (GtkButton *button,
on_popup_playlist_activate (GtkMenuItem *menuitem,
gpointer user_data)
{
intf_thread_t *p_intf = GetIntf( GTK_WIDGET(button), "intf_fileopen" );
intf_thread_t *p_intf = GetIntf( GTK_WIDGET(menuitem), "intf_window" );
GtkWidget *filesel;
gchar *filename;
if( !GTK_IS_WIDGET( p_intf->p_sys->p_playlist ) )
{
p_intf->p_sys->p_playlist = create_intf_playlist();
gtk_object_set_data( GTK_OBJECT( p_intf->p_sys->p_playlist ),
"p_intf", p_intf );
}
gtk_widget_show( p_intf->p_sys->p_playlist );
gdk_window_raise( p_intf->p_sys->p_playlist->window );
}
filesel = gtk_widget_get_toplevel (GTK_WIDGET (button));
gtk_widget_hide (filesel);
filename = gtk_file_selection_get_filename (GTK_FILE_SELECTION (filesel));
intf_PlaylistAdd( p_main->p_playlist, PLAYLIST_END, (char*)filename );
void
on_popup_jump_activate (GtkMenuItem *menuitem,
gpointer user_data)
{
intf_thread_t *p_intf = GetIntf( GTK_WIDGET(menuitem), "intf_popup" );
/* Select added item and switch to file interface */
if( p_intf->p_input != NULL )
p_intf->p_input->b_eof = 1;
if( !GTK_IS_WIDGET( p_intf->p_sys->p_jump ) )
{
p_intf->p_sys->p_jump = create_intf_jump();
gtk_object_set_data( GTK_OBJECT( p_intf->p_sys->p_jump ),
"p_intf", p_intf );
}
// p_intf->p_sys->b_mode_changed = 1;
gtk_widget_show( p_intf->p_sys->p_jump );
gdk_window_raise( p_intf->p_sys->p_jump->window );
}
void
on_fileopen_cancel_clicked (GtkButton *button,
on_popup_preferences_activate (GtkMenuItem *menuitem,
gpointer user_data)
{
gtk_widget_hide( gtk_widget_get_toplevel( GTK_WIDGET (button) ) );
intf_thread_t *p_intf = GetIntf( GTK_WIDGET(menuitem), "intf_popup" );
gtk_widget_show( p_intf->p_sys->p_preferences );
gdk_window_raise( p_intf->p_sys->p_preferences->window );
}
/*****************************************************************************
* Playlist callbacks
* Fileopen callbacks
*****************************************************************************
* The following callbacks are related to the playlist.
* The following callbacks are related to the file requester.
*****************************************************************************/
void
on_intf_playlist_destroy (GtkObject *object,
on_intf_fileopen_destroy (GtkObject *object,
gpointer user_data)
{
intf_thread_t *p_intf = GetIntf( GTK_WIDGET(object), "intf_playlist" );
p_intf->p_sys->p_playlist = NULL;
gtk_widget_hide( GTK_WIDGET( object ) );
}
void
on_playlist_ok_clicked (GtkButton *button,
on_fileopen_ok_clicked (GtkButton *button,
gpointer user_data)
{
intf_thread_t *p_intf = GetIntf( GTK_WIDGET(button), "intf_playlist" );
intf_thread_t * p_intf = GetIntf( GTK_WIDGET(button), "intf_fileopen" );
GtkCList * p_playlist_clist;
GtkWidget * p_filesel;
gchar * psz_filename;
int i_end = p_main->p_playlist->i_size;
p_filesel = gtk_widget_get_toplevel( GTK_WIDGET(button) );
gtk_widget_hide( p_filesel );
psz_filename =
gtk_file_selection_get_filename( GTK_FILE_SELECTION( p_filesel ) );
intf_PlaylistAdd( p_main->p_playlist, PLAYLIST_END, (char*)psz_filename );
/* catch the GTK CList */
p_playlist_clist = GTK_CLIST( gtk_object_get_data(
GTK_OBJECT( p_intf->p_sys->p_playlist ), "playlist_clist" ) );
/* update the display */
GnomeRebuildCList( p_playlist_clist, p_main->p_playlist );
/* Select added item and switch to file interface */
if( p_intf->p_input != NULL )
{
p_intf->p_input->b_eof = 1;
}
gtk_widget_hide( p_intf->p_sys->p_playlist );
intf_PlaylistJumpto( p_main->p_playlist, i_end - 1 );
}
void
on_playlist_close_clicked (GtkButton *button,
on_fileopen_cancel_clicked (GtkButton *button,
gpointer user_data)
{
gtk_widget_hide( gtk_widget_get_toplevel( GTK_WIDGET (button) ) );
}
/*****************************************************************************
* Module manager callbacks
*****************************************************************************
......@@ -1004,9 +1165,12 @@ void
on_disc_ok_clicked (GtkButton *button,
gpointer user_data)
{
intf_thread_t *p_intf = GetIntf( GTK_WIDGET(button), "intf_disc" );
char *psz_device, *psz_source, *psz_method;
intf_thread_t * p_intf = GetIntf( GTK_WIDGET(button), "intf_disc" );
GtkCList * p_playlist_clist;
char * psz_device, *psz_source, *psz_method;
int i_end = p_main->p_playlist->i_size;
gtk_widget_hide( p_intf->p_sys->p_disc );
psz_device = gtk_entry_get_text( GTK_ENTRY( lookup_widget(
GTK_WIDGET(button), "disc_name" ) ) );
......@@ -1051,13 +1215,19 @@ on_disc_ok_clicked (GtkButton *button,
intf_PlaylistAdd( p_main->p_playlist, PLAYLIST_END, psz_source );
free( psz_source );
/* catch the GTK CList */
p_playlist_clist = GTK_CLIST( gtk_object_get_data(
GTK_OBJECT( p_intf->p_sys->p_playlist ), "playlist_clist" ) );
/* update the display */
GnomeRebuildCList( p_playlist_clist, p_main->p_playlist );