* intf.cpp: Qt interface
*****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN
- * $Id: intf.cpp,v 1.1 2002/08/04 17:23:43 sam Exp $
+ * $Id$
*
* Authors: Samuel Hocevar <sam@zoy.org>
*
#include <string.h> /* strerror() */
#include <stdio.h>
-#include <vlc/vlc.h>
-#include <vlc/intf.h>
-
-#include <qapplication.h>
-#include <qmainwindow.h>
-#include <qtoolbar.h>
-#include <qtoolbutton.h>
-#include <qwhatsthis.h>
-#include <qpushbutton.h>
-#include <qfiledialog.h>
-#include <qslider.h>
-#include <qlcdnumber.h>
-#include <qmenubar.h>
-#include <qstatusbar.h>
-#include <qmessagebox.h>
-#include <qlabel.h>
-#include <qtimer.h>
-#include <qiconset.h>
-
-#include <qvbox.h>
-#include <qhbox.h>
-
-/*****************************************************************************
- * Local Qt slider class
- *****************************************************************************/
-class IntfSlider : public QSlider
-{
- Q_OBJECT
-
-public:
- IntfSlider( intf_thread_t *, QWidget * ); /* Constructor and destructor */
- ~IntfSlider();
-
- bool b_free; /* Is the slider free ? */
-
- int oldvalue ( void ) { return i_oldvalue; };
- void setOldValue( int i_value ) { i_oldvalue = i_value; };
-
-private slots:
- void SlideStart ( void ) { b_free = FALSE; };
- void SlideStop ( void ) { b_free = TRUE; };
-
-private:
- intf_thread_t *p_intf;
- int i_oldvalue;
-};
-
-/*****************************************************************************
- * Local Qt interface window class
- *****************************************************************************/
-class IntfWindow : public QMainWindow
-{
- Q_OBJECT
-
-public:
- IntfWindow( intf_thread_t * );
- ~IntfWindow();
-
-private slots:
- void Manage ( void );
-
- void FileOpen ( void );
- void FileQuit ( void );
-
- void PlaybackPlay ( void );
- void PlaybackPause ( void );
- void PlaybackSlow ( void );
- void PlaybackFast ( void );
-
- void PlaylistPrev ( void );
- void PlaylistNext ( void );
-
- void DateDisplay ( int );
- void About ( void );
-
- void Unimplemented( void ) { msg_Warn( p_intf, "unimplemented" ); };
-
-private:
- intf_thread_t *p_intf;
-
- IntfSlider *p_slider;
-
- QToolBar *p_toolbar;
- QPopupMenu *p_popup;
- QLabel *p_date;
-};
-
-#include "intf.moc"
+#include "intf.h"
#define SLIDER_MIN 0x00000
#define SLIDER_MAX 0x10000
QPopupMenu * p_tmpmenu = new QPopupMenu( this );
-#define instmp( x, y... ) p_tmpmenu->insertItem( x, this, ## y )
+#define instmp0( x, y ) p_tmpmenu->insertItem( x, this, y )
+#define instmp1( x, y, a ) p_tmpmenu->insertItem( x, this, y, a )
menuBar()->insertItem( "&File", p_tmpmenu );
- instmp( "&Open File...", SLOT(FileOpen()), Key_F3 );
- instmp( "Open &Disc...", SLOT(Unimplemented()), Key_F4 );
- instmp( "&Network Stream...", SLOT(Unimplemented()), Key_F5 );
+ instmp1( "&Open File...", SLOT(FileOpen()), Key_F3 );
+ instmp1( "Open &Disc...", SLOT(Unimplemented()), Key_F4 );
+ instmp1( "&Network Stream...", SLOT(Unimplemented()), Key_F5 );
p_tmpmenu->insertSeparator();
- instmp( "&Exit", SLOT(FileQuit()), CTRL+Key_Q );
+ instmp1( "&Exit", SLOT(FileQuit()), CTRL+Key_Q );
p_tmpmenu = new QPopupMenu( this );
menuBar()->insertItem( "&View", p_tmpmenu );
- instmp( "&Playlist...", SLOT(Unimplemented()) );
- instmp( "&Modules...", SLOT(Unimplemented()) );
+ instmp0( "&Playlist...", SLOT(Unimplemented()) );
+ instmp0( "&Modules...", SLOT(Unimplemented()) );
p_tmpmenu = new QPopupMenu( this );
menuBar()->insertItem( "&Settings", p_tmpmenu );
- instmp( "&Preferences...", SLOT(Unimplemented()) );
+ instmp0( "&Preferences...", SLOT(Unimplemented()) );
p_tmpmenu = new QPopupMenu( this );
menuBar()->insertItem( "&Help", p_tmpmenu );
- instmp( "&About...", SLOT(About()) );
-#undef instmp
+ instmp0( "&About...", SLOT(About()) );
/*
* Create the popup menu
p_popup = new QPopupMenu( /* floating menu */ );
-#define inspop( x, y... ) p_popup->insertItem( x, this, ## y )
- inspop( "&Play", SLOT(PlaybackPlay()) );
- inspop( "Pause", SLOT(PlaybackPause()) );
- inspop( "&Slow", SLOT(PlaybackSlow()) );
- inspop( "&Fast", SLOT(PlaybackFast()) );
+#define inspop0( x, y ) p_popup->insertItem( x, this, y )
+#define inspop1( x, y, a ) p_popup->insertItem( x, this, y, a )
+ inspop0( "&Play", SLOT(PlaybackPlay()) );
+ inspop0( "Pause", SLOT(PlaybackPause()) );
+ inspop0( "&Slow", SLOT(PlaybackSlow()) );
+ inspop0( "&Fast", SLOT(PlaybackFast()) );
p_popup->insertSeparator();
- inspop( "&Open File...", SLOT(FileOpen()), Key_F3 );
- inspop( "Open &Disc...", SLOT(Unimplemented()), Key_F4 );
- inspop( "&Network Stream...", SLOT(Unimplemented()), Key_F5 );
+ inspop1( "&Open File...", SLOT(FileOpen()), Key_F3 );
+ inspop1( "Open &Disc...", SLOT(Unimplemented()), Key_F4 );
+ inspop1( "&Network Stream...", SLOT(Unimplemented()), Key_F5 );
p_popup->insertSeparator();
- inspop( "&About...", SLOT(About()) );
- inspop( "&Exit", SLOT(FileQuit()) );
-#undef inspop
+ inspop0( "&About...", SLOT(About()) );
+ inspop0( "&Exit", SLOT(FileQuit()) );
/* Activate the statusbar */
statusBar();
{
if( p_intf->p_sys->p_input )
{
- char psz_time[ OFFSETTOTIME_MAX_SIZE ];
+ char psz_time[ MSTRTIME_MAX_SIZE ];
vlc_mutex_lock( &p_intf->p_sys->p_input->stream.stream_lock );
p_date->setText( input_OffsetToTime( p_intf->p_sys->p_input, psz_time,
return;
}
- playlist_Add( p_playlist, file.latin1(),
+ playlist_Add( p_playlist, file.latin1(), file.latin1(),
PLAYLIST_APPEND | PLAYLIST_GO, PLAYLIST_END );
vlc_object_release( p_playlist );
}
void IntfWindow::About( void )
{
QMessageBox::about( this, "About",
- "VideoLAN Client\n"
- "(C) 1996, 1997, 1998, 1999, 2000, 2001, 2002 - the VideoLAN Team\n"
+ "VLC media player\n"
+ "(C) 1996 - 2004 - the VideoLAN Team\n"
"\n"
- "This is the VideoLAN client, a DVD and MPEG player.\n"
+ "This is the VLC media player, a DVD and MPEG player.\n"
"It can play MPEG and MPEG 2 files from a file "
"or from a network source.\n"
"\n"