Commit 9530fc9f authored by Stéphane Borel's avatar Stéphane Borel

*initialization bugfixes in input_dvd

*added a b_stopped flag to interface playlist to have a stop function in
interface plugins. As a consequence, the playlist no longer loops on end
but wait for the user to press 'play' or to add another item (gtk/gnome
interface). I think that other plugins are broken but it shouldn't be
difficult to repair: just add a 'p_main->p_playlist->b_stopped = 0' in
play functions and 'p_main->p_playlist->b_stopped = 1' when you have to
stop.

*Updated gtk interface so that it has the same features as gnome. I
think I will merge the code so that we don't have to copy and paste each
change. Only the .glade file would be different.
parent db7b0421
......@@ -2,7 +2,7 @@
* intf_playlist.h : Playlist functions
*****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN
* $Id: intf_playlist.h,v 1.2 2001/03/21 13:42:33 sam Exp $
* $Id: intf_playlist.h,v 1.3 2001/05/15 01:01:44 stef Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
*
......@@ -45,6 +45,7 @@ typedef struct playlist_s
int i_mode; /* parse mode (random, forward, backward) */
int i_seed; /* seed used for random mode */
boolean_t b_stopped;
vlc_mutex_t change_lock;
......
......@@ -10,7 +10,7 @@
* -dvd_udf to find files
*****************************************************************************
* Copyright (C) 1998-2001 VideoLAN
* $Id: input_dvd.c,v 1.57 2001/05/07 04:42:42 sam Exp $
* $Id: input_dvd.c,v 1.58 2001/05/15 01:01:44 stef Exp $
*
* Author: Stphane Borel <stef@via.ecp.fr>
*
......@@ -562,6 +562,9 @@ static int DVDSetArea( input_thread_t * p_input, input_area_t * p_area )
vlc_mutex_lock( &p_input->stream.stream_lock );
/* we can't use the interface slider until initilization is complete */
p_input->stream.b_seekable = 0;
if( p_area != p_input->stream.p_selected_area )
{
......@@ -581,7 +584,7 @@ static int DVDSetArea( input_thread_t * p_input, input_area_t * p_area )
/* uodate title environnement variable so that we don't
* loop on the same title forever */
main_PutIntVariable( INPUT_TITLE_VAR, p_dvd->i_title + 1 );
// main_PutIntVariable( INPUT_TITLE_VAR, p_dvd->i_title + 1 );
/* ifo vts */
if( IfoTitleSet( p_dvd->p_ifo ) < 0 )
......@@ -947,7 +950,9 @@ static int DVDSetArea( input_thread_t * p_input, input_area_t * p_area )
}
/* warn interface that something has changed */
p_input->stream.b_seekable = 1;
p_input->stream.b_changed = 1;
intf_WarnMsg( 3, "Pos: %lld Size: %lld", p_input->stream.p_selected_area->i_tell,p_input->stream.p_selected_area->i_size );
vlc_mutex_unlock( &p_input->stream.stream_lock );
......@@ -1153,6 +1158,7 @@ static int DVDRead( input_thread_t * p_input,
if( b_eot )
{
intf_WarnMsg( 3, "dvd info: new title" );
p_dvd->i_title++;
DVDSetArea( p_input, p_area );
return 0;
......
......@@ -2,7 +2,7 @@
* gnome_callbacks.c : Callbacks for the Gnome plugin.
*****************************************************************************
* Copyright (C) 2000, 2001 VideoLAN
* $Id: gnome_callbacks.c,v 1.28 2001/05/10 06:47:31 sam Exp $
* $Id: gnome_callbacks.c,v 1.29 2001/05/15 01:01:44 stef Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
* Stphane Borel <stef@via.ecp.fr>
......@@ -113,47 +113,6 @@ 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 );
switch( info )
{
case DROP_ACCEPT_TEXT_PLAIN: /* FIXME: handle multiple files */
if( i_len < 1 )
{
return;
}
/* get rid of ' ' at the end */
*( psz_text + i_len - 1 ) = 0;
intf_WarnMsg( 3, "intf: dropped text/uri-list data `%s'", psz_text );
intf_PlaylistAdd( p_main->p_playlist, PLAYLIST_END, psz_text );
break;
case DROP_ACCEPT_TEXT_URI_LIST: /* FIXME: handle multiple files */
if( i_len < 2 )
{
return;
}
/* get rid of \r\n at the end */
*( psz_text + i_len - 2 ) = 0;
intf_WarnMsg( 3, "intf: dropped text/uri-list data `%s'", psz_text );
intf_PlaylistAdd( p_main->p_playlist, PLAYLIST_END, psz_text );
break;
default:
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;
......@@ -166,8 +125,7 @@ on_intf_window_drag_data_received (GtkWidget *widget,
}
intf_PlaylistJumpto( p_main->p_playlist, i_end - 1 );
#endif
p_main->p_playlist->b_stopped = 0;
}
......@@ -741,10 +699,10 @@ on_toolbar_stop_clicked (GtkButton *button,
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;
p_intf->p_input->b_eof = 1;
p_main->p_playlist->i_index--;
}
p_main->p_playlist->b_stopped = 1;
}
......@@ -758,6 +716,20 @@ on_toolbar_play_clicked (GtkButton *button,
{
input_SetStatus( p_intf->p_input, INPUT_STATUS_PLAY );
}
else if( p_main->p_playlist->b_stopped )
{
if( p_main->p_playlist->i_size )
{
intf_PlaylistJumpto( p_main->p_playlist,
p_main->p_playlist->i_index );
p_main->p_playlist->b_stopped = 0;
}
else
{
on_toolbar_open_clicked( button, user_data );
}
}
}
......@@ -879,6 +851,7 @@ on_popup_play_activate (GtkMenuItem *menuitem,
if( p_intf->p_input != NULL )
{
input_SetStatus( p_intf->p_input, INPUT_STATUS_PLAY );
p_main->p_playlist->b_stopped = 0;
}
}
......@@ -1210,6 +1183,7 @@ on_fileopen_ok_clicked (GtkButton *button,
}
intf_PlaylistJumpto( p_main->p_playlist, i_end - 1 );
p_main->p_playlist->b_stopped = 0;
}
......@@ -1356,6 +1330,7 @@ on_disc_ok_clicked (GtkButton *button,
}
intf_PlaylistJumpto( p_main->p_playlist, i_end - 1 );
p_main->p_playlist->b_stopped = 0;
}
......@@ -1468,6 +1443,7 @@ on_network_ok_clicked (GtkButton *button,
}
intf_PlaylistJumpto( p_main->p_playlist, i_end - 1 );
p_main->p_playlist->b_stopped = 0;
}
......@@ -1545,6 +1521,7 @@ on_jump_apply_clicked (GtkButton *button,
{
input_Seek( p_intf->p_input, i_seek );
}
p_main->p_playlist->b_stopped = 0;
#endif
}
......@@ -1687,4 +1664,3 @@ on_preferences_cancel_clicked (GtkButton *button,
{
gtk_widget_hide( gtk_widget_get_toplevel( GTK_WIDGET (button) ) );
}
......@@ -2,7 +2,7 @@
* gnome_callbacks.h : Callbacks for the Gnome plugin.
*****************************************************************************
* Copyright (C) 2000, 2001 VideoLAN
* $Id: gnome_callbacks.h,v 1.16 2001/05/06 18:32:30 stef Exp $
* $Id: gnome_callbacks.h,v 1.17 2001/05/15 01:01:44 stef Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
*
......@@ -426,3 +426,7 @@ on_playlist_cancel_clicked (GtkButton *button,
void
on_popup_back_activate (GtkMenuItem *menuitem,
gpointer user_data);
void
on_playlist_destroy (GtkObject *object,
gpointer user_data);
This diff is collapsed.
......@@ -2,7 +2,7 @@
* gnome_playlist.c : Interface for the playlist dialog
*****************************************************************************
* Copyright (C) 2001 VideoLAN
* $Id: gnome_playlist.c,v 1.2 2001/05/07 03:14:09 stef Exp $
* $Id: gnome_playlist.c,v 1.3 2001/05/15 01:01:44 stef Exp $
*
* Authors: Pierre Baillet <oct@zoy.org>
*
......@@ -68,7 +68,7 @@
* The following callbacks are related to the playlist.
*****************************************************************************/
void
on_intf_playlist_destroy (GtkObject *object,
on_playlist_destroy (GtkObject *object,
gpointer user_data)
{
gtk_widget_hide( GTK_WIDGET(object));
......@@ -314,6 +314,7 @@ on_playlist_clist_event (GtkWidget *widget,
p_intf->p_input->b_eof = 1;
}
intf_PlaylistJumpto( p_main->p_playlist, i_row - 1 );
p_main->p_playlist->b_stopped = 0;
}
return TRUE;
}
......@@ -337,6 +338,7 @@ on_playlist_clist_drag_data_received (GtkWidget *widget,
GtkCList * p_clist;
gint i_row;
gint i_col;
int i_end = p_main->p_playlist->i_size;
p_clist = GTK_CLIST( gtk_object_get_data( GTK_OBJECT(
p_intf->p_sys->p_playlist ), "playlist_clist" ) );
......@@ -351,6 +353,10 @@ on_playlist_clist_drag_data_received (GtkWidget *widget,
/* else, put that at the end of the playlist */
GnomeDropDataReceived( p_intf, data, info, PLAYLIST_END );
}
intf_PlaylistJumpto( p_main->p_playlist, i_end - 1 );
p_main->p_playlist->b_stopped = 0;
}
......@@ -506,6 +512,8 @@ void GnomeDropDataReceived( intf_thread_t * p_intf,
/* unlock the interface */
vlc_mutex_unlock( &p_intf->change_lock );
p_main->p_playlist->b_stopped = 0;
}
}
......
......@@ -2,7 +2,7 @@
* intf_gnome.c: Gnome interface
*****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN
* $Id: intf_gnome.c,v 1.38 2001/05/10 06:47:31 sam Exp $
* $Id: intf_gnome.c,v 1.39 2001/05/15 01:01:44 stef Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
* Stphane Borel <stef@via.ecp.fr>
......@@ -439,7 +439,7 @@ static gint GnomeRadioMenu( intf_thread_t * p_intf,
}
snprintf( psz_name, GNOME_MENU_LABEL_SIZE,
"Chapters %d to %d", i_item + 1, i_item + 10);
"%ss %d to %d", psz_item_name, i_item + 1, i_item + 10);
psz_name[ GNOME_MENU_LABEL_SIZE - 1 ] = '\0';
p_item_group = gtk_menu_item_new_with_label( psz_name );
gtk_widget_show( p_item_group );
......@@ -1121,14 +1121,14 @@ static gint GnomeModeManage( intf_thread_t * p_intf )
/* control buttons for free pace streams */
b_control = p_intf->p_input->stream.b_pace_control;
gtk_widget_set_sensitive( GETWIDGET(p_window, "toolbar_back"), FALSE );
gtk_widget_set_sensitive( GETWIDGET(p_window, "toolbar_stop"), FALSE );
gtk_widget_set_sensitive( GETWIDGET(p_window, "toolbar_play"), b_control );
gtk_widget_set_sensitive( GETWIDGET(p_window, "toolbar_stop"), b_control );
gtk_widget_set_sensitive( GETWIDGET(p_window, "toolbar_play"), TRUE );
gtk_widget_set_sensitive( GETWIDGET(p_window, "toolbar_pause"), b_control );
gtk_widget_set_sensitive( GETWIDGET(p_window, "toolbar_slow"), b_control );
gtk_widget_set_sensitive( GETWIDGET(p_window, "toolbar_fast"), b_control );
gtk_widget_set_sensitive( GETWIDGET(p_popup, "popup_back"), FALSE );
gtk_widget_set_sensitive( GETWIDGET(p_popup, "popup_stop"), FALSE );
gtk_widget_set_sensitive( GETWIDGET(p_popup, "popup_play"), b_control );
gtk_widget_set_sensitive( GETWIDGET(p_popup, "popup_play"), TRUE );
gtk_widget_set_sensitive( GETWIDGET(p_popup, "popup_pause"), b_control );
gtk_widget_set_sensitive( GETWIDGET(p_popup, "popup_slow"), b_control );
gtk_widget_set_sensitive( GETWIDGET(p_popup, "popup_fast"), b_control );
......
This diff is collapsed.
......@@ -7,7 +7,7 @@
# Objects
#
PLUGIN_C = gtk.o intf_gtk.o gtk_callbacks.o gtk_interface.o gtk_support.o gtk_playlist.o
PLUGIN_C = gtk.o intf_gtk.o gtk_callbacks.o gtk_interface.o gtk_support.o gtk_open.o gtk_control.o gtk_menu.o gtk_playlist.o gtk_modules.o gtk_preferences.o
BUILTIN_C = $(PLUGIN_C:%.o=BUILTIN_%.o)
ALL_OBJ = $(PLUGIN_C) $(BUILTIN_C)
......
This diff is collapsed.
This diff is collapsed.
/*****************************************************************************
* gtk_control.c : functions to handle stream control buttons.
*****************************************************************************
* Copyright (C) 2000, 2001 VideoLAN
* $Id: gtk_control.c,v 1.1 2001/05/15 01:01:44 stef Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
* Stphane Borel <stef@via.ecp.fr>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA.
*****************************************************************************/
#define MODULE_NAME gtk
#include "modules_inner.h"
/*****************************************************************************
* Preamble
*****************************************************************************/
#include "defs.h"
#include <sys/types.h> /* off_t */
#include <stdlib.h>
#include <gtk/gtk.h>
#include <string.h>
#include "config.h"
#include "common.h"
#include "threads.h"
#include "mtime.h"
#include "stream_control.h"
#include "input_ext-intf.h"
#include "interface.h"
#include "intf_playlist.h"
#include "intf_msg.h"
#include "gtk_callbacks.h"
#include "gtk_interface.h"
#include "gtk_support.h"
#include "gtk_playlist.h"
#include "intf_gtk.h"
#include "main.h"
/****************************************************************************
* Control functions: this is where the functions are defined
****************************************************************************
* These functions are button-items callbacks, and are used
* by other callbacks
****************************************************************************/
gboolean GtkControlBack( GtkWidget *widget,
GdkEventButton *event,
gpointer user_data )
{
return FALSE;
}
gboolean GtkControlStop( GtkWidget *widget,
GdkEventButton *event,
gpointer user_data )
{
intf_thread_t *p_intf = GetIntf( GTK_WIDGET(widget), (char*)user_data );
if( p_intf->p_input != NULL )
{
/* end playing item */
p_intf->p_input->b_eof = 1;
/* update playlist */
// vlc_mutex_lock( &p_main->p_playlist->change_lock );
p_main->p_playlist->i_index--;
p_main->p_playlist->b_stopped = 1;
// vlc_mutex_unlock( &p_main->p_playlist->change_lock );
}
return TRUE;
}
gboolean GtkControlPlay( GtkWidget *widget,
GdkEventButton *event,
gpointer user_data )
{
intf_thread_t *p_intf = GetIntf( GTK_WIDGET(widget), (char*)user_data );
if( p_intf->p_input != NULL )
{
input_SetStatus( p_intf->p_input, INPUT_STATUS_PLAY );
p_main->p_playlist->b_stopped = 0;
}
else
{
// vlc_mutex_lock( &p_main->p_playlist->change_lock );
if( p_main->p_playlist->b_stopped )
{
if( p_main->p_playlist->i_size )
{
intf_PlaylistJumpto( p_main->p_playlist,
p_main->p_playlist->i_index );
p_main->p_playlist->b_stopped = 0;
}
else
{
GtkFileOpenShow( widget, event, user_data );
}
}
// vlc_mutex_unlock( &p_main->p_playlist->change_lock );
}
return TRUE;
}
gboolean GtkControlPause( GtkWidget *widget,
GdkEventButton *event,
gpointer user_data )
{
intf_thread_t *p_intf = GetIntf( GTK_WIDGET(widget), (char*)user_data );
if( p_intf->p_input != NULL )
{
input_SetStatus( p_intf->p_input, INPUT_STATUS_PAUSE );
p_main->p_playlist->b_stopped = 0;
}
return TRUE;
}
gboolean GtkControlSlow( GtkWidget *widget,
GdkEventButton *event,
gpointer user_data )
{
intf_thread_t *p_intf = GetIntf( GTK_WIDGET(widget), (char*)user_data );
if( p_intf->p_input != NULL )
{
input_SetStatus( p_intf->p_input, INPUT_STATUS_SLOWER );
p_main->p_playlist->b_stopped = 0;
}
return TRUE;
}
gboolean GtkControlFast( GtkWidget *widget,
GdkEventButton *event,
gpointer user_data )
{
intf_thread_t *p_intf = GetIntf( GTK_WIDGET(widget), (char*)user_data );
if( p_intf->p_input != NULL )
{
input_SetStatus( p_intf->p_input, INPUT_STATUS_FASTER );
p_main->p_playlist->b_stopped = 0;
}
return TRUE;
}
/****************************************************************************
* Control callbacks for menuitems
****************************************************************************
* We have different callaback for menuitem since we must use the
* activate signal toi popdown the menu automatically
****************************************************************************/
void GtkPlayActivate( GtkMenuItem * menuitem, gpointer user_data )
{
GtkControlPlay( GTK_WIDGET( menuitem ), NULL, user_data );
}
void GtkPauseActivate( GtkMenuItem * menuitem, gpointer user_data )
{
GtkControlPause( GTK_WIDGET( menuitem ), NULL, user_data );
}
void
GtKStopActivate (GtkMenuItem *menuitem,
gpointer user_data)
{
GtkControlStop( GTK_WIDGET( menuitem ), NULL, user_data );
}
void
GtkBackActivate (GtkMenuItem *menuitem,
gpointer user_data)
{
GtkControlBack( GTK_WIDGET( menuitem ), NULL, user_data );
}
void
GtkSlowActivate (GtkMenuItem *menuitem,
gpointer user_data)
{
GtkControlSlow( GTK_WIDGET( menuitem ), NULL, user_data );
}
void
GtkFastActivate (GtkMenuItem *menuitem,
gpointer user_data)
{
GtkControlFast( GTK_WIDGET( menuitem ), NULL, user_data );
}
/*****************************************************************************
* gtk_control.h: prototypes for control functions
*****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN
* $Id: gtk_control.h,v 1.1 2001/05/15 01:01:44 stef Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
* Stphane Borel <stef@via.ecp.fr>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA.
*****************************************************************************/
gboolean GtkControlBack ( GtkWidget *, GdkEventButton *, gpointer );
gboolean GtkControlStop ( GtkWidget *, GdkEventButton *, gpointer );
gboolean GtkControlPlay ( GtkWidget *, GdkEventButton *, gpointer );
gboolean GtkControlPause( GtkWidget *, GdkEventButton *, gpointer );
gboolean GtkControlSlow ( GtkWidget *, GdkEventButton *, gpointer );
gboolean GtkControlFast ( GtkWidget *, GdkEventButton *, gpointer );
void GtkPlayActivate ( GtkMenuItem *, gpointer );
void GtkPauseActivate ( GtkMenuItem *, gpointer );
void GtKStopActivate ( GtkMenuItem *, gpointer );
void GtkBackActivate ( GtkMenuItem *, gpointer );
void GtkSlowActivate ( GtkMenuItem *, gpointer );
void GtkFastActivate ( GtkMenuItem *, gpointer );
This diff is collapsed.
......@@ -7,5 +7,7 @@ GtkWidget* create_intf_popup (void);
GtkWidget* create_intf_about (void);
GtkWidget* create_intf_fileopen (void);
GtkWidget* create_intf_disc (void);
GtkWidget* create_intf_playlist (void);
GtkWidget* create_intf_network (void);
GtkWidget* create_intf_jump (void);
GtkWidget* create_intf_playlist (void);
GtkWidget* create_intf_preferences (void);
This diff is collapsed.
/*****************************************************************************
* gtk_menu.h: prototypes for menu functions
*****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN
* $Id: gtk_menu.h,v 1.1 2001/05/15 01:01:44 stef Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
* Stphane Borel <stef@via.ecp.fr>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA.
*****************************************************************************/
#if 0
void GtkMenubarAudioToggle ( GtkCheckMenuItem *, gpointer );
void GtkPopupAudioToggle ( GtkCheckMenuItem *, gpointer );
void GtkMenubarSubtitleToggle ( GtkCheckMenuItem *, gpointer );
void GtkPopupSubtitleToggle ( GtkCheckMenuItem *, gpointer );
void GtkMenubarTitleToggle ( GtkCheckMenuItem *, gpointer );
void GtkPopupTitleToggle ( GtkCheckMenuItem *, gpointer );
void GtkMenubarChapterToggle ( GtkCheckMenuItem *, gpointer );
void GtkPopupChapterToggle ( GtkCheckMenuItem *, gpointer );
void GtkMenubarAngleToggle ( GtkCheckMenuItem *, gpointer );
void GtkPopupAngleToggle ( GtkCheckMenuItem *, gpointer );
#endif
/*****************************************************************************
* gtk_modules.c : functions to build modules configuration boxes.
*****************************************************************************
* Copyright (C) 2000, 2001 VideoLAN
* $Id: gtk_modules.c,v 1.1 2001/05/15 01:01:44 stef Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
* Stphane Borel <stef@via.ecp.fr>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA.
*****************************************************************************/
#define MODULE_NAME gtk
#include "modules_inner.h"
/*****************************************************************************
* Preamble
*****************************************************************************/
#include "defs.h"
#include <sys/types.h> /* off_t */
#include <stdlib.h>
#include <gtk/gtk.h>
#include <string.h>
#include "config.h"
#include "common.h"
#include "threads.h"
#include "mtime.h"
#include "stream_control.h"
#include "input_ext-intf.h"
#include "interface.h"
#include "intf_playlist.h"
#include "intf_msg.h"
#include "gtk_callbacks.h"
#include "gtk_interface.h"
#include "gtk_support.h"
#include "gtk_playlist.h"
#include "intf_gtk.h"
#include "main.h"
gboolean GtkModulesShow( GtkWidget *widget,
GdkEventButton *event,
gpointer user_data )
{
intf_thread_t *p_intf = GetIntf( GTK_WIDGET(widget), "intf_window" );
if( !GTK_IS_WIDGET( p_intf->p_sys->p_modules ) )
{
// p_intf->p_sys->p_modules = create_intf_modules();
gtk_object_set_data( GTK_OBJECT( p_intf->p_sys->p_modules ),
"p_intf", p_intf );
}
gtk_widget_show( p_intf->p_sys->p_modules );
gdk_window_raise( p_intf->p_sys->p_modules->window );
return FALSE;
}
void GtkModulesCancel( GtkButton * button, gpointer user_data )
{
intf_thread_t *p_intf = GetIntf( GTK_WIDGET(button), "intf_modules" );
gtk_widget_hide( p_intf->p_sys->p_modules );
}
/*****************************************************************************
* gtk_modules.h: prototypes for modules functions
*****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN
* $Id: gtk_modules.h,v 1.1 2001/05/15 01:01:44 stef Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
* Stéphane Borel <stef@via.ecp.fr>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA.
*****************************************************************************/
gboolean GtkModulesShow( GtkWidget *widget,
GdkEventButton *event,
gpointer user_data);
void GtkModulesCancel ( GtkButton * button, gpointer user_data );
This diff is collapsed.
/*****************************************************************************
* gtk_open.h: prototypes for open functions
*****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN
* $Id: gtk_open.h,v 1.1 2001/05/15 01:01:44 stef Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
* Stphane Borel <stef@via.ecp.fr>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA.
*****************************************************************************/
gboolean
GtkFileOpenShow (GtkWidget *widget,
GdkEventButton *event,
gpointer user_data);
void GtkFileOpenCancel( GtkButton * button, gpointer user_data);
void GtkFileOpenOk( GtkButton * button, gpointer user_data );
gboolean
GtkDiscOpenShow (GtkWidget *widget,
GdkEventButton *event,
gpointer user_data);
void GtkDiscOpenDvd( GtkToggleButton * togglebutton, gpointer user_data );
void GtkDiscOpenVcd( GtkToggleButton *togglebutton, gpointer user_data );
void GtkDiscOpenOk( GtkButton * button, gpointer user_data );
void GtkDiscOpenCancel( GtkButton * button, gpointer user_data);
gboolean
GtkNetworkOpenShow (GtkWidget *widget,
GdkEventButton *event,
gpointer user_data);
void GtkNetworkOpenOk( GtkButton *button, gpointer user_data );
void GtkNetworkOpenCancel( GtkButton * button, gpointer user_data);
void GtkNetworkOpenBroadcast( GtkToggleButton * togglebutton,
gpointer user_data );
This diff is collapsed.
void on_generic_drop_data_received( intf_thread_t * p_intf,
GtkSelectionData *data, guint info, int position);
void rebuildCList(GtkCList * clist, playlist_t * playlist_p);
int hasValidExtension(gchar * filename);
int intf_AppendList( playlist_t * p_playlist, int i_pos, GList * list );
void GtkPlayListManage( gpointer p_data );
void on_generic_drop_data_received( intf_thread_t * p_intf,
GtkSelectionData *data, guint info, int position);
gint compareItems(gconstpointer a, gconstpointer b);
GList * intf_readFiles(gchar * fsname );
/*****************************************************************************
* gtk_playlist.h : Playlist functions for the Gtk plugin.
*****************************************************************************
* Copyright (C) 2000, 2001 VideoLAN
* $Id: gtk_playlist.h,v 1.2 2001/05/15 01:01:44 stef Exp $
*
* Authors: Pierre Baillet <oct@zoy.org>
* Stphane Borel <stef@via.ecp.fr>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA.
*****************************************************************************/
void GtkPlaylistDeleteAll ( GtkMenuItem *, gpointer );
void GtkPlaylistDeleteSelected( GtkMenuItem *, gpointer );
void GtkPlaylistCrop ( GtkMenuItem *, gpointer );
void GtkPlaylistInvert ( GtkMenuItem *, gpointer );
void GtkPlaylistSelect ( GtkMenuItem *, gpointer );
void GtkPlaylistOk ( GtkButton *, gpointer );
void GtkPlaylistCancel ( GtkButton *, gpointer );
int GtkHasValidExtension ( gchar * );
gint GtkCompareItems ( gconstpointer, gconstpointer );
GList * GtkReadFiles ( gchar * );
gboolean GtkPlaylistShow ( GtkWidget *, GdkEventButton *, gpointer );
gboolean GtkPlaylistPrev ( GtkWidget *, GdkEventButton *, gpointer );
gboolean GtkPlaylistNext ( GtkWidget *, GdkEventButton *, gpointer );
gboolean GtkPlaylistDragMotion( GtkWidget *, GdkDragContext *,
gint, gint, uint, gpointer );
gboolean GtkPlaylistEvent ( GtkWidget *, GdkEvent *, gpointer );
void GtkPlaylistDragData ( GtkWidget *, GdkDragContext *,
gint, gint, GtkSelectionData *,
guint, guint, gpointer );
void GtkDeleteGListItem ( gpointer, gpointer );
This diff is collapsed.
/*****************************************************************************
* gtk_control.h: prototypes for control functions
*****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN
* $Id: gtk_preferences.h,v 1.1 2001/05/15 01:01:44 stef Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
* Stéphane Borel <stef@via.ecp.fr>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA.
*****************************************************************************/
gboolean GtkPreferencesShow ( GtkWidget *, GdkEventButton *, gpointer );
void GtkPreferencesOk ( GtkButton *, gpointer );
void GtkPreferencesApply ( GtkButton *, gpointer );
void GtkPreferencesCancel( GtkButton *, gpointer );
This diff is collapsed.
This diff is collapsed.
......@@ -2,7 +2,7 @@
* intf_gtk.h: private Gtk+ interface description
*****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN
* $Id: intf_gtk.h,v 1.3 2001/05/06 18:32:30 stef Exp $
* $Id: intf_gtk.h,v 1.4 2001/05/15 01:01:44 stef Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
*
......@@ -32,6 +32,13 @@
*****************************************************************************/
#define GTK_MENU_LABEL_SIZE 64
/*****************************************************************************
* Convert user_data structures to title and chapter information
*****************************************************************************/
#define DATA2TITLE( user_data ) ( (gint)(user_data) >> 16 )
#define DATA2CHAPTER( user_data ) ( (gint)(user_data) & 0xffff )
#define POS2DATA( title, chapter ) ( ((title) << 16) | ((chapter) & 0xffff) )
/*****************************************************************************
* Useful inline function
****************************************************************************/
......@@ -53,10 +60,13 @@ typedef struct intf_sys_s
boolean_t b_menus_update; /* menus have changed ? */
boolean_t b_slider_free; /* slider status */
int i_list_timeout;
/* Playlist selected item */
int i_playing;
/* menus handlers */
boolean_t b_title_update; /* do we need to update title menus */
boolean_t b_chapter_update; /* do we need to update
chapter menus */
boolean_t b_angle_update; /* do we need to update angle menus */
boolean_t b_audio_update; /* do we need to update audio menus */
boolean_t b_spu_update; /* do we need to update spu menus */
/* windows and widgets */
GtkWidget * p_window; /* main window */
......@@ -67,15 +77,43 @@ typedef struct intf_sys_s
GtkWidget * p_fileopen; /* file open window */
GtkWidget * p_disc; /* disc selection window */
GtkWidget * p_network; /* network stream window */
GtkWidget * p_preferences; /* preferences window */
GtkWidget * p_jump; /* jump window */
/* The slider */
GtkFrame * p_slider_frame;
GtkAdjustment * p_adj; /* slider adjustment object */
float f_adj_oldvalue; /* previous value */
/* Playlist management */
int i_playing; /* playlist selected item */
/* The window labels for DVD mode */
GtkLabel * p_label_title;
GtkLabel * p_label_chapter;
gint i_part; /* current chapter */
/* XXX: Ugly kludge, see intf_gnome.c */
void ( *pf_gtk_callback ) ( void );
void ( *pf_gdk_callback ) ( void );
} intf_sys_t;
/****************************************************************************
* Prototypes
****************************************************************************/
/*
* from gtk_menu.c
*/
gint GtkSetupMenu( intf_thread_t * );
/*
* from gtk_playlist.c
*/
void GtkDropDataReceived ( intf_thread_t *, GtkSelectionData *,
guint, int );
int GtkAppendList ( playlist_t *, int, GList * );
void GtkRebuildCList ( GtkCList *, playlist_t * );
void GtkPlayListManage ( intf_thread_t * );
......@@ -2,7 +2,7 @@
* aout_spdif: ac3 passthrough output
*****************************************************************************
* Copyright (C) 2001 VideoLAN
* $Id: aout_spdif.c,v 1.4 2001/05/07 03:14:09 stef Exp $
* $Id: aout_spdif.c,v 1.5 2001/05/15 01:01:44 stef Exp $
*
* Authors: Michel Kaempf <maxx@via.ecp.fr>
* Stphane Borel <stef@via.ecp.fr>
......@@ -98,7 +98,9 @@ void aout_SpdifThread( aout_thread_t * p_aout )
}
else if( !AOUT_FIFO_ISEMPTY( p_aout->fifo[i_fifo] ) )
{
vlc_mutex_unlock( &p_aout->fifo[i_fifo].data_lock );
// vlc_mutex_unlock( &p_aout->fifo[i_fifo].data_lock );
//fprintf(stderr, "delay %lld\n",p_aout->fifo[i_fifo].date[p_aout->fifo[i_fifo].l_start_frame] -mdate() );
/* play spdif frame to the external decoder */
p_aout->pf_play( p_aout,
p_aout->fifo[i_fifo].buffer +
......
......@@ -4,7 +4,7 @@
* interface, such as command line.
*****************************************************************************
* Copyright (C) 1998, 1999, 2000 VideoLAN
* $Id: interface.c,v 1.77 2001/05/07 03:14:09 stef Exp $
* $Id: interface.c,v 1.78 2001/05/15 01:01:44 stef Exp $
*
* Authors: Vincent Seguin <seguin@via.ecp.fr>
*
......@@ -153,23 +153,40 @@ static void intf_Manage( intf_thread_t *p_intf )
/* If no stream is being played, try to find one */
if( p_intf->p_input == NULL && !p_intf->b_die )
{
if( !p_main->p_playlist->b_stopped )
{
/* Select the next playlist item */
intf_PlaylistNext( p_main->p_playlist );
/* don't loop by default: stop at playlist end */
if( p_main->p_playlist->i_index == -1 )
{
/* FIXME: wait for user to add stuff to playlist ? */
#if 0
p_intf->b_die = 1;
#endif
p_main->p_playlist->b_stopped = 1;
}
else
{
p_main->p_playlist->b_stopped = 0;
p_intf->p_input =
input_CreateThread( &p_main->p_playlist->current, NULL );
}
}
else
{
/* playing has been stopped: we no longer need outputs */
if( p_aout_bank->i_count )
{
/* FIXME kludge that does not work with several outputs */
aout_DestroyThread( p_aout_bank->pp_aout[0], NULL );
p_aout_bank->i_count--;
}
if( p_vout_bank->i_count )
{
vout_DestroyThread( p_vout_bank->pp_vout[0], NULL );
p_vout_bank->i_count--;
}
}
}
}
/*****************************************************************************
......
This diff is collapsed.
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