Commit edc9c954 authored by Cyril Deguet's avatar Cyril Deguet

* commands/cmd_*.hpp: use the DEFINE_COMMAND macro for simple commands

* commands/cmd_fullscreen.*, parser/interpreter.cpp: added a
  "vlc.fullscreen()" command
parent 1d07e63d
...@@ -7,6 +7,8 @@ SOURCES_skins2 = \ ...@@ -7,6 +7,8 @@ SOURCES_skins2 = \
commands/cmd_change_skin.cpp \ commands/cmd_change_skin.cpp \
commands/cmd_change_skin.hpp \ commands/cmd_change_skin.hpp \
commands/cmd_dialogs.hpp \ commands/cmd_dialogs.hpp \
commands/cmd_fullscreen.cpp \
commands/cmd_fullscreen.hpp \
commands/cmd_input.cpp \ commands/cmd_input.cpp \
commands/cmd_input.hpp \ commands/cmd_input.hpp \
commands/cmd_layout.cpp \ commands/cmd_layout.cpp \
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* cmd_dummy.hpp * cmd_dummy.hpp
***************************************************************************** *****************************************************************************
* Copyright (C) 2003 VideoLAN * Copyright (C) 2003 VideoLAN
* $Id: cmd_dummy.hpp,v 1.1 2004/01/03 23:31:33 asmax Exp $ * $Id: cmd_dummy.hpp,v 1.2 2004/01/05 22:17:32 asmax Exp $
* *
* Authors: Cyril Deguet <asmax@via.ecp.fr> * Authors: Cyril Deguet <asmax@via.ecp.fr>
* Olivier Teulire <ipkiss@via.ecp.fr> * Olivier Teulire <ipkiss@via.ecp.fr>
...@@ -29,17 +29,8 @@ ...@@ -29,17 +29,8 @@
/// Dummy command /// Dummy command
class CmdDummy: public CmdGeneric DEFINE_COMMAND( Dummy, "dummy" )
{
public:
CmdDummy( intf_thread_t *pIntf ): CmdGeneric( pIntf ) {}
virtual ~CmdDummy() {}
/// This method does the real job of the command void CmdDummy::execute() {}
virtual void execute() {}
/// Return the type of the command
virtual string getType() const { return "dummy"; }
};
#endif #endif
/*****************************************************************************
* cmd_fullscreen.cpp
*****************************************************************************
* Copyright (C) 2003 VideoLAN
* $Id: cmd_fullscreen.cpp,v 1.1 2004/01/05 22:17:32 asmax Exp $
*
* Authors: Cyril Deguet <asmax@via.ecp.fr>
* Olivier Teulire <ipkiss@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.
*****************************************************************************/
#include "cmd_fullscreen.hpp"
#include <vlc/vout.h>
void CmdFullscreen::execute()
{
vout_thread_t *pVout;
if( getIntf()->p_sys->p_input == NULL )
{
return;
}
pVout = (vout_thread_t *)vlc_object_find( getIntf()->p_sys->p_input,
VLC_OBJECT_VOUT, FIND_CHILD );
if( pVout )
{
// Switch to fullscreen
pVout->i_changes |= VOUT_FULLSCREEN_CHANGE;
vlc_object_release( pVout );
}
}
/*****************************************************************************
* cmd_fullscreen.hpp
*****************************************************************************
* Copyright (C) 2003 VideoLAN
* $Id: cmd_fullscreen.hpp,v 1.1 2004/01/05 22:17:32 asmax Exp $
*
* Authors: Cyril Deguet <asmax@via.ecp.fr>
* Olivier Teulire <ipkiss@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.
*****************************************************************************/
#ifndef CMD_FULLSCREEN_HPP
#define CMD_FULLSCREEN_HPP
#include "cmd_generic.hpp"
/// Command to switch the vout to fullscreen
DEFINE_COMMAND( Fullscreen, "fullscreen" )
#endif
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* cmd_notify_playlist.hpp * cmd_notify_playlist.hpp
***************************************************************************** *****************************************************************************
* Copyright (C) 2003 VideoLAN * Copyright (C) 2003 VideoLAN
* $Id: cmd_notify_playlist.hpp,v 1.1 2004/01/03 23:31:33 asmax Exp $ * $Id: cmd_notify_playlist.hpp,v 1.2 2004/01/05 22:17:32 asmax Exp $
* *
* Authors: Cyril Deguet <asmax@via.ecp.fr> * Authors: Cyril Deguet <asmax@via.ecp.fr>
* Olivier Teulire <ipkiss@via.ecp.fr> * Olivier Teulire <ipkiss@via.ecp.fr>
...@@ -29,17 +29,6 @@ ...@@ -29,17 +29,6 @@
/// Command to notify the playlist of a change /// Command to notify the playlist of a change
class CmdNotifyPlaylist: public CmdGeneric DEFINE_COMMAND( NotifyPlaylist, "notify playlist" )
{
public:
CmdNotifyPlaylist( intf_thread_t *pIntf ): CmdGeneric( pIntf ) {}
virtual ~CmdNotifyPlaylist() {}
/// This method does the real job of the command
virtual void execute();
/// Return the type of the command
virtual string getType() const { return "notify playlist"; }
};
#endif #endif
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* cmd_on_top.hpp * cmd_on_top.hpp
***************************************************************************** *****************************************************************************
* Copyright (C) 2003 VideoLAN * Copyright (C) 2003 VideoLAN
* $Id: cmd_on_top.hpp,v 1.1 2004/01/03 23:31:33 asmax Exp $ * $Id: cmd_on_top.hpp,v 1.2 2004/01/05 22:17:32 asmax Exp $
* *
* Authors: Cyril Deguet <asmax@via.ecp.fr> * Authors: Cyril Deguet <asmax@via.ecp.fr>
* Olivier Teulière <ipkiss@via.ecp.fr> * Olivier Teulière <ipkiss@via.ecp.fr>
...@@ -29,17 +29,6 @@ ...@@ -29,17 +29,6 @@
/// "Always on top" command /// "Always on top" command
class CmdOnTop: public CmdGeneric DEFINE_COMMAND( OnTop, "always on top" )
{
public:
CmdOnTop( intf_thread_t *pIntf ): CmdGeneric( pIntf ) {}
virtual ~CmdOnTop() {}
/// This method does the real job of the command
virtual void execute();
/// Return the type of the command
virtual string getType() const { return "always on top"; }
};
#endif #endif
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* cmd_quit.hpp * cmd_quit.hpp
***************************************************************************** *****************************************************************************
* Copyright (C) 2003 VideoLAN * Copyright (C) 2003 VideoLAN
* $Id: cmd_quit.hpp,v 1.1 2004/01/03 23:31:33 asmax Exp $ * $Id: cmd_quit.hpp,v 1.2 2004/01/05 22:17:32 asmax Exp $
* *
* Authors: Cyril Deguet <asmax@via.ecp.fr> * Authors: Cyril Deguet <asmax@via.ecp.fr>
* Olivier Teulire <ipkiss@via.ecp.fr> * Olivier Teulire <ipkiss@via.ecp.fr>
...@@ -29,17 +29,6 @@ ...@@ -29,17 +29,6 @@
/// "Quit" command /// "Quit" command
class CmdQuit: public CmdGeneric DEFINE_COMMAND( Quit, "quit" )
{
public:
CmdQuit( intf_thread_t *pIntf ): CmdGeneric( pIntf ) {}
virtual ~CmdQuit() {}
/// This method does the real job of the command
virtual void execute();
/// Return the type of the command
virtual string getType() const { return "quit"; }
};
#endif #endif
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* interpreter.cpp * interpreter.cpp
***************************************************************************** *****************************************************************************
* Copyright (C) 2003 VideoLAN * Copyright (C) 2003 VideoLAN
* $Id: interpreter.cpp,v 1.1 2004/01/03 23:31:33 asmax Exp $ * $Id: interpreter.cpp,v 1.2 2004/01/05 22:17:32 asmax Exp $
* *
* Authors: Cyril Deguet <asmax@via.ecp.fr> * Authors: Cyril Deguet <asmax@via.ecp.fr>
* Olivier Teulire <ipkiss@via.ecp.fr> * Olivier Teulire <ipkiss@via.ecp.fr>
...@@ -29,6 +29,7 @@ ...@@ -29,6 +29,7 @@
#include "../commands/cmd_layout.hpp" #include "../commands/cmd_layout.hpp"
#include "../commands/cmd_quit.hpp" #include "../commands/cmd_quit.hpp"
#include "../commands/cmd_input.hpp" #include "../commands/cmd_input.hpp"
#include "../commands/cmd_fullscreen.hpp"
#include "../src/theme.hpp" #include "../src/theme.hpp"
#include "../src/vlcproc.hpp" #include "../src/vlcproc.hpp"
#include "../vars/playlist.hpp" #include "../vars/playlist.hpp"
...@@ -107,6 +108,10 @@ CmdGeneric *Interpreter::parseAction( const string &rAction, Theme *pTheme ) ...@@ -107,6 +108,10 @@ CmdGeneric *Interpreter::parseAction( const string &rAction, Theme *pTheme )
{ {
pCommand = new CmdPlaylistSort( getIntf() ); pCommand = new CmdPlaylistSort( getIntf() );
} }
else if( rAction == "vlc.fullscreen()" )
{
pCommand = new CmdFullscreen( getIntf() );
}
else if( rAction == "vlc.quit()" ) else if( rAction == "vlc.quit()" )
{ {
pCommand = new CmdQuit( getIntf() ); pCommand = new CmdQuit( getIntf() );
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* playlist.cpp * playlist.cpp
***************************************************************************** *****************************************************************************
* Copyright (C) 2003 VideoLAN * Copyright (C) 2003 VideoLAN
* $Id: playlist.cpp,v 1.5 2004/01/05 20:02:21 gbazin Exp $ * $Id: playlist.cpp,v 1.6 2004/01/05 22:17:32 asmax Exp $
* *
* Authors: Cyril Deguet <asmax@via.ecp.fr> * Authors: Cyril Deguet <asmax@via.ecp.fr>
* *
...@@ -68,13 +68,6 @@ Playlist::~Playlist() ...@@ -68,13 +68,6 @@ Playlist::~Playlist()
} }
void Playlist::add( const UStringPtr &rcString )
{
VarList::add( rcString );
//XXX
}
void Playlist::delSelected() void Playlist::delSelected()
{ {
// Remove the items from the VLC playlist // Remove the items from the VLC playlist
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* playlist.hpp * playlist.hpp
***************************************************************************** *****************************************************************************
* Copyright (C) 2003 VideoLAN * Copyright (C) 2003 VideoLAN
* $Id: playlist.hpp,v 1.2 2004/01/04 22:38:49 gbazin Exp $ * $Id: playlist.hpp,v 1.3 2004/01/05 22:17:32 asmax Exp $
* *
* Authors: Cyril Deguet <asmax@via.ecp.fr> * Authors: Cyril Deguet <asmax@via.ecp.fr>
* Olivier Teulière <ipkiss@via.ecp.fr> * Olivier Teulière <ipkiss@via.ecp.fr>
...@@ -39,9 +39,6 @@ class Playlist: public VarList ...@@ -39,9 +39,6 @@ class Playlist: public VarList
Playlist( intf_thread_t *pIntf ); Playlist( intf_thread_t *pIntf );
virtual ~Playlist(); virtual ~Playlist();
/// Add a pointer on a string in the list
virtual void add( const UStringPtr &rcString );
/// Remove the selected elements from the list /// Remove the selected elements from the list
virtual void delSelected(); virtual void delSelected();
......
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