Commit 232fd7bb authored by Sam Hocevar's avatar Sam Hocevar

  * ./plugins/lirc/lirc.: various fixes, thanks to Sigmund Augdal.
  * ./plugins/text/logger.c: rewrote an ugly loop.
  * ./plugins/gtk/gtk.c: added a Gtk+ window containing all the log
    messages; updated in real time. To open it, go to "view"->"messages".
parent 730cc399
......@@ -2,7 +2,7 @@
* gtk.c : Gtk+ plugin for vlc
*****************************************************************************
* Copyright (C) 2000-2001 VideoLAN
* $Id: gtk.c,v 1.11 2002/02/15 13:32:53 sam Exp $
* $Id: gtk.c,v 1.12 2002/02/19 03:54:55 sam Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
*
......@@ -142,6 +142,8 @@ static int intf_Open( intf_thread_t *p_intf )
return( 1 );
}
p_intf->p_sys->p_sub = intf_MsgSub();
/* Initialize Gtk+ thread */
p_intf->p_sys->b_playing = 0;
p_intf->p_sys->b_popup_changed = 0;
......@@ -161,6 +163,8 @@ static int intf_Open( intf_thread_t *p_intf )
*****************************************************************************/
static void intf_Close( intf_thread_t *p_intf )
{
intf_MsgUnsub( p_intf->p_sys->p_sub );
/* Destroy structure */
free( p_intf->p_sys );
}
......@@ -197,6 +201,7 @@ static void intf_Run( intf_thread_t *p_intf )
p_intf->p_sys->p_window = create_intf_window( );
p_intf->p_sys->p_popup = create_intf_popup( );
p_intf->p_sys->p_playlist = create_intf_playlist();
p_intf->p_sys->p_messages = create_intf_messages();
/* Set the title of the main window */
gtk_window_set_title( GTK_WINDOW(p_intf->p_sys->p_window),
......@@ -213,10 +218,15 @@ static void intf_Run( intf_thread_t *p_intf )
GTK_DEST_DEFAULT_ALL, target_table,
1, GDK_ACTION_COPY );
/* Get the interface labels */
p_intf->p_sys->p_slider_frame = GTK_FRAME( gtk_object_get_data(
GTK_OBJECT(p_intf->p_sys->p_window ), "slider_frame" ) );
GTK_OBJECT( p_intf->p_sys->p_window ), "slider_frame" ) );
p_intf->p_sys->p_messages_text = GTK_TEXT( gtk_object_get_data(
GTK_OBJECT(p_intf->p_sys->p_messages ), "messages_textbox" ) );
gtk_text_set_line_wrap( p_intf->p_sys->p_messages_text, TRUE);
gtk_text_set_word_wrap( p_intf->p_sys->p_messages_text, TRUE);
/* Get the interface labels */
#define P_LABEL( name ) GTK_LABEL( gtk_object_get_data( \
GTK_OBJECT( p_intf->p_sys->p_window ), name ) )
p_intf->p_sys->p_label_title = P_LABEL( "title_label" );
......@@ -252,6 +262,9 @@ static void intf_Run( intf_thread_t *p_intf )
gtk_object_set_data( GTK_OBJECT( p_intf->p_sys->p_playlist ),
"p_intf", p_intf );
gtk_object_set_data( GTK_OBJECT( p_intf->p_sys->p_messages ),
"p_intf", p_intf );
gtk_object_set_data( GTK_OBJECT(p_intf->p_sys->p_adj),
"p_intf", p_intf );
......@@ -288,6 +301,7 @@ static void intf_Run( intf_thread_t *p_intf )
static gint GtkManage( gpointer p_data )
{
#define p_intf ((intf_thread_t *)p_data)
int i_start, i_stop;
vlc_mutex_lock( &p_intf->change_lock );
......@@ -305,7 +319,30 @@ static gint GtkManage( gpointer p_data )
p_intf->b_menu_change = 0;
}
/* update the playlist */
/* Update the log window */
vlc_mutex_lock( p_intf->p_sys->p_sub->p_lock );
i_stop = *p_intf->p_sys->p_sub->pi_stop;
vlc_mutex_unlock( p_intf->p_sys->p_sub->p_lock );
for( i_start = p_intf->p_sys->p_sub->i_start;
i_start != i_stop;
i_start = (i_start+1) % INTF_MSG_QSIZE )
{
/* Append all messages to log window */
gtk_text_insert( p_intf->p_sys->p_messages_text, NULL, NULL, NULL,
p_intf->p_sys->p_sub->p_msg[i_start].psz_msg, -1 );
gtk_text_insert( p_intf->p_sys->p_messages_text, NULL, NULL, NULL,
"\n", -1 );
}
vlc_mutex_lock( p_intf->p_sys->p_sub->p_lock );
p_intf->p_sys->p_sub->i_start = i_start;
vlc_mutex_unlock( p_intf->p_sys->p_sub->p_lock );
gtk_text_set_point( p_intf->p_sys->p_messages_text,
gtk_text_get_length( p_intf->p_sys->p_messages_text ) );
/* Update the playlist */
GtkPlayListManage( p_data );
if( p_input_bank->pp_input[0] != NULL )
......
......@@ -283,6 +283,20 @@
<label>_Modules...</label>
<right_justify>False</right_justify>
</widget>
<widget>
<class>GtkMenuItem</class>
<name>menubar_messages</name>
<tooltip>Open the messages window</tooltip>
<signal>
<name>activate</name>
<handler>GtkMessagesActivate</handler>
<data>&quot;intf_window&quot;</data>
<last_modification_time>Tue, 19 Feb 2002 02:03:47 GMT</last_modification_time>
</signal>
<label>Messages...</label>
<right_justify>False</right_justify>
</widget>
</widget>
</widget>
......@@ -4798,4 +4812,90 @@ alsa
</widget>
</widget>
<widget>
<class>GtkDialog</class>
<name>intf_messages</name>
<signal>
<name>delete_event</name>
<handler>GtkMessagesDelete</handler>
<data>&quot;intf_messages&quot;</data>
<last_modification_time>Tue, 19 Feb 2002 02:39:16 GMT</last_modification_time>
</signal>
<title>Messages</title>
<type>GTK_WINDOW_TOPLEVEL</type>
<position>GTK_WIN_POS_NONE</position>
<modal>False</modal>
<default_width>600</default_width>
<default_height>400</default_height>
<allow_shrink>True</allow_shrink>
<allow_grow>True</allow_grow>
<auto_shrink>False</auto_shrink>
<widget>
<class>GtkVBox</class>
<child_name>Dialog:vbox</child_name>
<name>dialog-vbox6</name>
<homogeneous>False</homogeneous>
<spacing>0</spacing>
<widget>
<class>GtkHBox</class>
<child_name>Dialog:action_area</child_name>
<name>dialog-action_area5</name>
<border_width>10</border_width>
<homogeneous>True</homogeneous>
<spacing>5</spacing>
<child>
<padding>0</padding>
<expand>False</expand>
<fill>True</fill>
<pack>GTK_PACK_END</pack>
</child>
<widget>
<class>GtkButton</class>
<name>messages_ok</name>
<can_default>True</can_default>
<has_default>True</has_default>
<can_focus>True</can_focus>
<signal>
<name>clicked</name>
<handler>GtkMessagesOk</handler>
<data>&quot;intf_messages&quot;</data>
<last_modification_time>Tue, 19 Feb 2002 02:07:37 GMT</last_modification_time>
</signal>
<label>OK</label>
<relief>GTK_RELIEF_NORMAL</relief>
<child>
<padding>0</padding>
<expand>False</expand>
<fill>True</fill>
</child>
</widget>
</widget>
<widget>
<class>GtkScrolledWindow</class>
<name>scrolledwindow2</name>
<hscrollbar_policy>GTK_POLICY_NEVER</hscrollbar_policy>
<vscrollbar_policy>GTK_POLICY_ALWAYS</vscrollbar_policy>
<hupdate_policy>GTK_UPDATE_CONTINUOUS</hupdate_policy>
<vupdate_policy>GTK_UPDATE_CONTINUOUS</vupdate_policy>
<child>
<padding>0</padding>
<expand>True</expand>
<fill>True</fill>
</child>
<widget>
<class>GtkText</class>
<name>messages_textbox</name>
<can_focus>True</can_focus>
<editable>False</editable>
<text></text>
</widget>
</widget>
</widget>
</widget>
</GTK-Interface>
......@@ -2,7 +2,7 @@
* gtk_callbacks.c : Callbacks for the Gtk+ plugin.
*****************************************************************************
* Copyright (C) 2000, 2001 VideoLAN
* $Id: gtk_callbacks.c,v 1.31 2002/01/09 02:01:14 sam Exp $
* $Id: gtk_callbacks.c,v 1.32 2002/02/19 03:54:55 sam Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
* Stphane Borel <stef@via.ecp.fr>
......@@ -468,6 +468,12 @@ void GtkJumpActivate( GtkMenuItem * menuitem, gpointer user_data )
}
void GtkMessagesActivate( GtkMenuItem * menuitem, gpointer user_data )
{
GtkMessagesShow( GTK_WIDGET( menuitem ), NULL, user_data );
}
/****************************************************************************
* Callbacks for disc ejection
****************************************************************************/
......@@ -515,7 +521,40 @@ gboolean GtkDiscEject ( GtkWidget *widget, GdkEventButton *event,
void GtkEjectDiscActivate ( GtkMenuItem *menuitem, gpointer user_data )
{
fprintf(stderr, "DEBUG: EJECT called from MENU !\n");
GtkDiscEject( GTK_WIDGET( menuitem ), NULL, user_data );
}
/****************************************************************************
* Messages window
****************************************************************************/
gboolean GtkMessagesShow( GtkWidget *widget,
GdkEventButton *event,
gpointer user_data)
{
intf_thread_t *p_intf = GetIntf( GTK_WIDGET(widget), (char*)user_data );
gtk_widget_show( p_intf->p_sys->p_messages );
gdk_window_raise( p_intf->p_sys->p_messages->window );
return TRUE;
}
void
GtkMessagesOk (GtkButton *button,
gpointer user_data)
{
intf_thread_t *p_intf = GetIntf( GTK_WIDGET(button), (char*)user_data );
gtk_widget_hide( p_intf->p_sys->p_messages );
}
gboolean
GtkMessagesDelete (GtkWidget *widget,
GdkEvent *event,
gpointer user_data)
{
intf_thread_t *p_intf = GetIntf( GTK_WIDGET(widget), (char*)user_data );
gtk_widget_hide( p_intf->p_sys->p_messages );
return TRUE;
}
......@@ -2,7 +2,7 @@
* gtk_callbacks.h : Callbacks for the gtk plugin.
*****************************************************************************
* Copyright (C) 2000, 2001 VideoLAN
* $Id: gtk_callbacks.h,v 1.16 2002/01/09 02:01:14 sam Exp $
* $Id: gtk_callbacks.h,v 1.17 2002/02/19 03:54:55 sam Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
* Stphane Borel <stef@via.ecp.fr>
......@@ -50,6 +50,7 @@ gboolean GtkSliderPress ( GtkWidget *, GdkEventButton *, gpointer );
gboolean GtkWindowDelete ( GtkWidget * widget, GdkEvent *, gpointer );
gboolean GtkJumpShow ( GtkWidget *, GdkEventButton *, gpointer );
gboolean GtkAboutShow ( GtkWidget *, GdkEventButton *, gpointer );
gboolean GtkMessagesShow ( GtkWidget *, GdkEventButton *, gpointer );
void GtkTitlePrev ( GtkButton * button, gpointer );
void GtkTitleNext ( GtkButton * button, gpointer );
void GtkChapterPrev ( GtkButton *, gpointer );
......@@ -79,3 +80,16 @@ gboolean
GtkDiscEject (GtkWidget *widget,
GdkEventButton *event,
gpointer user_data);
void
GtkMessagesActivate (GtkMenuItem *menuitem,
gpointer user_data);
void
GtkMessagesOk (GtkButton *button,
gpointer user_data);
gboolean
GtkMessagesDelete (GtkWidget *widget,
GdkEvent *event,
gpointer user_data);
......@@ -2,7 +2,7 @@
* gtk_common.h: private Gtk+ interface description
*****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN
* $Id: gtk_common.h,v 1.1 2001/12/30 07:09:55 sam Exp $
* $Id: gtk_common.h,v 1.2 2002/02/19 03:54:55 sam Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
*
......@@ -76,6 +76,11 @@ typedef struct intf_sys_s
GtkAdjustment * p_adj; /* slider adjustment object */
float f_adj_oldvalue; /* previous value */
/* The messages window */
GtkWidget * p_messages; /* messages window */
GtkText * p_messages_text; /* messages frame */
intf_subscription_t*p_sub; /* interface subscription */
/* Playlist management */
int i_playing; /* playlist selected item */
......
/* This file was created automatically by glade and fixed by fixfiles.sh */
/*
* DO NOT EDIT THIS FILE - it is generated by Glade.
*/
#include <videolan/vlc.h>
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
#include <sys/types.h>
#include <sys/stat.h>
......@@ -44,6 +48,7 @@ create_intf_window (void)
GtkWidget *separator11;
GtkWidget *menubar_playlist;
GtkWidget *menubar_modules;
GtkWidget *menubar_messages;
GtkWidget *menubar_settings;
GtkWidget *menubar_settings_menu;
GtkAccelGroup *menubar_settings_menu_accels;
......@@ -353,6 +358,14 @@ create_intf_window (void)
gtk_widget_set_sensitive (menubar_modules, FALSE);
gtk_tooltips_set_tip (tooltips, menubar_modules, _("Open the plugin manager"), NULL);
menubar_messages = gtk_menu_item_new_with_label (_("Messages..."));
gtk_widget_ref (menubar_messages);
gtk_object_set_data_full (GTK_OBJECT (intf_window), "menubar_messages", menubar_messages,
(GtkDestroyNotify) gtk_widget_unref);
gtk_widget_show (menubar_messages);
gtk_container_add (GTK_CONTAINER (menubar_view_menu), menubar_messages);
gtk_tooltips_set_tip (tooltips, menubar_messages, _("Open the messages window"), NULL);
menubar_settings = gtk_menu_item_new_with_label ("");
tmp_key = gtk_label_parse_uline (GTK_LABEL (GTK_BIN (menubar_settings)->child),
_("_Settings"));
......@@ -828,6 +841,9 @@ create_intf_window (void)
gtk_signal_connect (GTK_OBJECT (menubar_modules), "activate",
GTK_SIGNAL_FUNC (GtkModulesActivate),
"intf_window");
gtk_signal_connect (GTK_OBJECT (menubar_messages), "activate",
GTK_SIGNAL_FUNC (GtkMessagesActivate),
"intf_window");
gtk_signal_connect (GTK_OBJECT (menubar_preferences), "activate",
GTK_SIGNAL_FUNC (GtkPreferencesActivate),
"intf_window");
......@@ -1569,7 +1585,7 @@ create_intf_disc (void)
(GtkDestroyNotify) gtk_widget_unref);
gtk_widget_show (disc_name);
gtk_box_pack_start (GTK_BOX (hbox2), disc_name, TRUE, TRUE, 0);
gtk_entry_set_text (GTK_ENTRY (disc_name), DVD_DEVICE);
gtk_entry_set_text (GTK_ENTRY (disc_name), _("/dev/dvd"));
dialog_action_area1 = GTK_DIALOG (intf_disc)->action_area;
gtk_object_set_data (GTK_OBJECT (intf_disc), "dialog_action_area1", dialog_action_area1);
......@@ -2515,7 +2531,7 @@ create_intf_preferences (void)
gtk_table_attach (GTK_TABLE (preferences_disc_table), preferences_disc_dvd_combo, 1, 2, 0, 1,
(GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
(GtkAttachOptions) (GTK_EXPAND), 0, 0);
preferences_disc_dvd_combo_items = g_list_append (preferences_disc_dvd_combo_items, (gpointer) DVD_DEVICE);
preferences_disc_dvd_combo_items = g_list_append (preferences_disc_dvd_combo_items, (gpointer) _("/dev/dvd"));
gtk_combo_set_popdown_strings (GTK_COMBO (preferences_disc_dvd_combo), preferences_disc_dvd_combo_items);
g_list_free (preferences_disc_dvd_combo_items);
......@@ -2524,7 +2540,7 @@ create_intf_preferences (void)
gtk_object_set_data_full (GTK_OBJECT (intf_preferences), "preferences_disc_dvd_entry", preferences_disc_dvd_entry,
(GtkDestroyNotify) gtk_widget_unref);
gtk_widget_show (preferences_disc_dvd_entry);
gtk_entry_set_text (GTK_ENTRY (preferences_disc_dvd_entry), DVD_DEVICE);
gtk_entry_set_text (GTK_ENTRY (preferences_disc_dvd_entry), _("/dev/dvd"));
preferences_disc_vcd_combo = gtk_combo_new ();
gtk_widget_ref (preferences_disc_vcd_combo);
......@@ -3298,3 +3314,62 @@ create_intf_preferences (void)
return intf_preferences;
}
GtkWidget*
create_intf_messages (void)
{
GtkWidget *intf_messages;
GtkWidget *dialog_vbox6;
GtkWidget *scrolledwindow2;
GtkWidget *messages_textbox;
GtkWidget *dialog_action_area5;
GtkWidget *messages_ok;
intf_messages = gtk_dialog_new ();
gtk_object_set_data (GTK_OBJECT (intf_messages), "intf_messages", intf_messages);
gtk_window_set_title (GTK_WINDOW (intf_messages), _("Messages"));
gtk_window_set_default_size (GTK_WINDOW (intf_messages), 600, 400);
gtk_window_set_policy (GTK_WINDOW (intf_messages), TRUE, TRUE, FALSE);
dialog_vbox6 = GTK_DIALOG (intf_messages)->vbox;
gtk_object_set_data (GTK_OBJECT (intf_messages), "dialog_vbox6", dialog_vbox6);
gtk_widget_show (dialog_vbox6);
scrolledwindow2 = gtk_scrolled_window_new (NULL, NULL);
gtk_widget_ref (scrolledwindow2);
gtk_object_set_data_full (GTK_OBJECT (intf_messages), "scrolledwindow2", scrolledwindow2,
(GtkDestroyNotify) gtk_widget_unref);
gtk_widget_show (scrolledwindow2);
gtk_box_pack_start (GTK_BOX (dialog_vbox6), scrolledwindow2, TRUE, TRUE, 0);
gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrolledwindow2), GTK_POLICY_NEVER, GTK_POLICY_ALWAYS);
messages_textbox = gtk_text_new (NULL, NULL);
gtk_widget_ref (messages_textbox);
gtk_object_set_data_full (GTK_OBJECT (intf_messages), "messages_textbox", messages_textbox,
(GtkDestroyNotify) gtk_widget_unref);
gtk_widget_show (messages_textbox);
gtk_container_add (GTK_CONTAINER (scrolledwindow2), messages_textbox);
dialog_action_area5 = GTK_DIALOG (intf_messages)->action_area;
gtk_object_set_data (GTK_OBJECT (intf_messages), "dialog_action_area5", dialog_action_area5);
gtk_widget_show (dialog_action_area5);
gtk_container_set_border_width (GTK_CONTAINER (dialog_action_area5), 10);
messages_ok = gtk_button_new_with_label (_("OK"));
gtk_widget_ref (messages_ok);
gtk_object_set_data_full (GTK_OBJECT (intf_messages), "messages_ok", messages_ok,
(GtkDestroyNotify) gtk_widget_unref);
gtk_widget_show (messages_ok);
gtk_box_pack_start (GTK_BOX (dialog_action_area5), messages_ok, FALSE, TRUE, 0);
GTK_WIDGET_SET_FLAGS (messages_ok, GTK_CAN_DEFAULT);
gtk_signal_connect (GTK_OBJECT (intf_messages), "delete_event",
GTK_SIGNAL_FUNC (GtkMessagesDelete),
"intf_messages");
gtk_signal_connect (GTK_OBJECT (messages_ok), "clicked",
GTK_SIGNAL_FUNC (GtkMessagesOk),
"intf_messages");
gtk_widget_grab_default (messages_ok);
return intf_messages;
}
......@@ -11,3 +11,4 @@ GtkWidget* create_intf_network (void);
GtkWidget* create_intf_jump (void);
GtkWidget* create_intf_playlist (void);
GtkWidget* create_intf_preferences (void);
GtkWidget* create_intf_messages (void);
......@@ -139,7 +139,7 @@ create_pixmap (GtkWidget *widget,
}
/* This is an internally used function to check if a pixmap file exists. */
gchar*
static gchar*
check_file_exists (const gchar *directory,
const gchar *filename)
{
......
/*
* This file was created automatically by glade and fixed by fixfiles.sh
* DO NOT EDIT THIS FILE - it is generated by Glade.
*/
#ifdef HAVE_CONFIG_H
......@@ -11,7 +11,7 @@
/*
* Standard gettext macros.
*/
#if defined( ENABLE_NLS ) && defined ( HAVE_GETTEXT )
#ifdef ENABLE_NLS
# include <libintl.h>
# undef _
# define _(String) dgettext (PACKAGE, String)
......
......@@ -2,7 +2,7 @@
* lirc.c : lirc plugin for vlc
*****************************************************************************
* Copyright (C) 2002 VideoLAN
* $Id: lirc.c,v 1.3 2002/02/19 00:50:19 sam Exp $
* $Id: lirc.c,v 1.4 2002/02/19 03:54:55 sam Exp $
*
* Authors: Sigmund Augdal <sigmunau@idi.ntnu.no>
*
......@@ -117,6 +117,7 @@ static int intf_Open( intf_thread_t *p_intf )
free( p_intf->p_sys );
return 1;
}
return 0;
}
......@@ -131,36 +132,42 @@ static void intf_Close( intf_thread_t *p_intf )
free( p_intf->p_sys );
}
/*****************************************************************************
* intf_Run: main loop
*****************************************************************************/
static void intf_Run( intf_thread_t *p_intf )
{
intf_Msg("%i items in playlist", p_main->p_playlist->i_size);
while( !p_intf->b_die )
{
char *code;
char *c;
int ret;
/* Manage core vlc functions through the callback */
p_intf->pf_manage( p_intf );
while( !p_intf->b_die
&& lirc_nextcode(&code) == 0 )
while( !p_intf->b_die && lirc_nextcode(&code) == 0 )
{
if( code == NULL )
{
continue;
}
while( (ret = lirc_code2char(p_intf->p_sys->config,code,&c)) == 0
&& c != NULL
&& !p_intf->b_die )
while( !p_intf->b_die && c != NULL
&& lirc_code2char( p_intf->p_sys->config, code, &c ) == 0 )
{
if( !strcmp( c, "QUIT" ) )
{
p_intf->b_die = 1;
continue;
}
if( !strcmp( c, "FULLSCREEN" ) )
{
vlc_mutex_lock( &p_vout_bank->lock );
/* XXX: only fullscreen the first video output */
if( p_vout_bank->i_count )
{
intf_Msg("Got config \"%s\"",c);
//handle configstrings from .lircrc
p_vout_bank->pp_vout[0]->i_changes
|= VOUT_FULLSCREEN_CHANGE;
}
vlc_mutex_unlock( &p_vout_bank->lock );
continue;
}
vlc_mutex_lock( &p_input_bank->lock );
......@@ -168,7 +175,8 @@ static void intf_Run( intf_thread_t *p_intf )
{
if( p_input_bank->pp_input[0] != NULL )
{
input_SetStatus( p_input_bank->pp_input[0], INPUT_STATUS_PLAY );
input_SetStatus( p_input_bank->pp_input[0],
INPUT_STATUS_PLAY );
p_main->p_playlist->b_stopped = 0;
}
else
......@@ -183,39 +191,40 @@ static void intf_Run( intf_thread_t *p_intf )
intf_PlaylistJumpto( p_main->p_playlist,
p_main->p_playlist->i_index );
}
else
{
vlc_mutex_unlock( &p_main->p_playlist->change_lock );
}
}
else
{
vlc_mutex_unlock( &p_main->p_playlist->change_lock );
}
}
}
if( !strcmp( c, "PAUSE" ) && p_input_bank->pp_input[0] != NULL )
else if( p_input_bank->pp_input[0] != NULL )
{
if( !strcmp( c, "PAUSE" ) )
{
input_SetStatus( p_input_bank->pp_input[0], INPUT_STATUS_PAUSE );
input_SetStatus( p_input_bank->pp_input[0],
INPUT_STATUS_PAUSE );
vlc_mutex_lock( &p_main->p_playlist->change_lock );
p_main->p_playlist->b_stopped = 0;
vlc_mutex_unlock( &p_main->p_playlist->change_lock );
}
if( !strcmp( c, "NEXT" ) && p_input_bank->pp_input[0] != NULL )
else if( !strcmp( c, "NEXT" ) )
{
p_input_bank->pp_input[0]->b_eof = 1;
}
if( !strcmp( c, "LAST" ) && p_input_bank->pp_input[0] != NULL )
else if( !strcmp( c, "LAST" ) )
{
/* FIXME: temporary hack */
intf_PlaylistPrev( p_main->p_playlist );
intf_PlaylistPrev( p_main->p_playlist );
p_input_bank->pp_input[0]->b_eof = 1;
}
if( !strcmp( c, "STOP" ) && p_input_bank->pp_input[0] != NULL )
else if( !strcmp( c, "STOP" ) )
{
/* end playing item */
p_input_bank->pp_input[0]->b_eof = 1;
......@@ -228,47 +237,33 @@ static void intf_Run( intf_thread_t *p_intf )
vlc_mutex_unlock( &p_main->p_playlist->change_lock );
}
if( !strcmp( c, "QUIT" ) )
else if( !strcmp( c, "FAST" ) )
{
p_intf->b_die = 1;
}
if( !strcmp( c, "FULLSCREEN" ) )
{
vlc_mutex_lock( &p_vout_bank->lock );
/* XXX: only fullscreen the first video output */
if( p_vout_bank->i_count )
{
p_vout_bank->pp_vout[0]->i_changes
|= VOUT_FULLSCREEN_CHANGE;
}
vlc_mutex_unlock( &p_vout_bank->lock );
}
if( !strcmp( c, "FAST" ) && p_input_bank->pp_input[0] != NULL )
{
input_SetStatus( p_input_bank->pp_input[0], INPUT_STATUS_FASTER );
input_SetStatus( p_input_bank->pp_input[0],
INPUT_STATUS_FASTER );
vlc_mutex_lock( &p_main->p_playlist->change_lock );
p_main->p_playlist->b_stopped = 0;
vlc_mutex_unlock( &p_main->p_playlist->change_lock );
}
if( !strcmp( c, "SLOW" ) && p_input_bank->pp_input[0] != NULL )
else if( !strcmp( c, "SLOW" ) )
{
input_SetStatus( p_input_bank->pp_input[0], INPUT_STATUS_SLOWER );
input_SetStatus( p_input_bank->pp_input[0],
INPUT_STATUS_SLOWER );
vlc_mutex_lock( &p_main->p_playlist->change_lock );
p_main->p_playlist->b_stopped = 0;
vlc_mutex_unlock( &p_main->p_playlist->change_lock );
}
}
vlc_mutex_unlock( &p_input_bank->lock );
}
free( code );
}
/* Manage core vlc functions through the callback */
p_intf->pf_manage( p_intf );
}
}
......@@ -2,7 +2,7 @@
* logger.c : file logging plugin for vlc
*****************************************************************************
* Copyright (C) 2002 VideoLAN
* $Id: logger.c,v 1.1 2002/02/19 00:50:19 sam Exp $
* $Id: logger.c,v 1.2 2002/02/19 03:54:56 sam Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
*
......@@ -188,7 +188,9 @@ static void FlushQueue( intf_subscription_t *p_sub, FILE *p_file )
vlc_mutex_unlock( p_sub->p_lock );
/* Append all messages to log file */
for( i_start = p_sub->i_start; i_start < i_stop; i_start++ )
for( i_start = p_sub->i_start;
i_start != i_stop;
i_start = (i_start+1) % INTF_MSG_QSIZE )
{
psz_msg = p_sub->p_msg[i_start].psz_msg;
LOG_STRING( psz_msg, p_file );
......
......@@ -4,7 +4,7 @@
* interface, such as message output. See config.h for output configuration.
*****************************************************************************
* Copyright (C) 1998-2001 VideoLAN
* $Id: intf_msg.c,v 1.43 2002/02/19 00:50:19 sam Exp $
* $Id: intf_msg.c,v 1.44 2002/02/19 03:54:56 sam Exp $
*
* Authors: Vincent Seguin <seguin@via.ecp.fr>
*
......@@ -386,21 +386,9 @@ static void FlushLockedMsg ( void )
}
/* Free message data */
if( msg_bank.i_start <= i_stop )
{
i_index = msg_bank.i_start;
}
else
{
for( i_index = msg_bank.i_start; i_index < INTF_MSG_QSIZE; i_index++ )
{
free( msg_bank.msg[i_index].psz_msg );
}
i_index = 0;
}
for( ; i_index < i_stop; i_index++ )
for( i_index = msg_bank.i_start;
i_index != i_stop;
i_index = (i_index+1) % INTF_MSG_QSIZE )
{
free( msg_bank.msg[i_index].psz_msg );
}
......
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