Commit 82e866f0 authored by JP Dinger's avatar JP Dinger

Skins2: Cosmetics and the occasional duplicate call elimintation.

parent c2e98900
......@@ -41,18 +41,9 @@ void CmdAddItem::execute()
if( !psz_uri )
return;
if( m_playNow )
{
// Enqueue and play the item
playlist_Add( pPlaylist, psz_uri, NULL,
PLAYLIST_APPEND | PLAYLIST_GO, PLAYLIST_END, true,
false );
}
else
{
// Enqueue the item only
playlist_Add( pPlaylist, psz_uri, NULL,
PLAYLIST_APPEND, PLAYLIST_END, true, false );
}
m_playNow ? PLAYLIST_APPEND | PLAYLIST_GO : PLAYLIST_APPEND,
PLAYLIST_END, true, false );
free( psz_uri );
}
......@@ -32,9 +32,7 @@ void CmdPlay::execute()
{
playlist_t *pPlaylist = getIntf()->p_sys->p_playlist;
if( pPlaylist == NULL )
{
return;
}
playlist_Lock( pPlaylist );
const bool b_empty = playlist_IsEmpty( pPlaylist );
......@@ -47,8 +45,7 @@ void CmdPlay::execute()
else
{
// If the playlist is empty, open a file requester instead
CmdDlgFile cmd( getIntf() );
cmd.execute();
CmdDlgFile( getIntf() ).execute();
}
}
......@@ -56,11 +53,7 @@ void CmdPlay::execute()
void CmdPause::execute()
{
playlist_t *pPlaylist = getIntf()->p_sys->p_playlist;
if( pPlaylist == NULL )
{
return;
}
if( pPlaylist != NULL )
playlist_Pause( pPlaylist );
}
......@@ -68,11 +61,7 @@ void CmdPause::execute()
void CmdStop::execute()
{
playlist_t *pPlaylist = getIntf()->p_sys->p_playlist;
if( pPlaylist == NULL )
{
return;
}
if( pPlaylist != NULL )
playlist_Stop( pPlaylist );
}
......@@ -105,24 +94,18 @@ void CmdFaster::execute()
void CmdMute::execute()
{
playlist_t *pPlaylist = getIntf()->p_sys->p_playlist;
aout_ToggleMute( pPlaylist, NULL );
aout_ToggleMute( getIntf()->p_sys->p_playlist, NULL );
}
void CmdVolumeUp::execute()
{
playlist_t *pPlaylist = getIntf()->p_sys->p_playlist;
aout_VolumeUp( pPlaylist, 1, NULL );
aout_VolumeUp( getIntf()->p_sys->p_playlist, 1, NULL );
}
void CmdVolumeDown::execute()
{
playlist_t *pPlaylist = getIntf()->p_sys->p_playlist;
aout_VolumeDown( pPlaylist, 1, NULL );
aout_VolumeDown( getIntf()->p_sys->p_playlist, 1, NULL );
}
......@@ -17,9 +17,9 @@
* 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., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
* 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.,
* 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
#include "cmd_layout.hpp"
......@@ -29,18 +29,13 @@
CmdLayout::CmdLayout( intf_thread_t *pIntf, TopWindow &rWindow,
GenericLayout &rLayout ):
CmdGeneric( pIntf ), m_rWindow( rWindow ), m_rLayout( rLayout )
{
}
GenericLayout &rLayout )
: CmdGeneric( pIntf ), m_rWindow( rWindow ), m_rLayout( rLayout ) { }
void CmdLayout::execute()
{
if( !getIntf()->p_sys->p_theme )
{
return;
}
getIntf()->p_sys->p_theme->getWindowManager().setActiveLayout( m_rWindow,
m_rLayout );
Theme *p_theme = getIntf()->p_sys->p_theme;
if( p_theme )
p_theme->getWindowManager().setActiveLayout( m_rWindow, m_rLayout );
}
......@@ -17,9 +17,9 @@
* 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., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
* 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.,
* 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
#include "cmd_minimize.hpp"
......@@ -29,27 +29,20 @@
void CmdMinimize::execute()
{
// Get the instance of OSFactory
OSFactory *pOsFactory = OSFactory::instance( getIntf() );
pOsFactory->minimize();
OSFactory::instance( getIntf() )->minimize();
}
void CmdRestore::execute()
{
// Get the instance of OSFactory
OSFactory *pOsFactory = OSFactory::instance( getIntf() );
pOsFactory->restore();
OSFactory::instance( getIntf() )->restore();
}
CmdMaximize::CmdMaximize( intf_thread_t *pIntf,
WindowManager &rWindowManager,
TopWindow &rWindow ):
CmdGeneric( pIntf ), m_rWindowManager( rWindowManager ),
m_rWindow( rWindow )
{
}
CmdMaximize::CmdMaximize( intf_thread_t *pIntf, WindowManager &rWindowManager,
TopWindow &rWindow )
: CmdGeneric( pIntf ), m_rWindowManager( rWindowManager ),
m_rWindow( rWindow ) { }
void CmdMaximize::execute()
......@@ -61,11 +54,9 @@ void CmdMaximize::execute()
CmdUnmaximize::CmdUnmaximize( intf_thread_t *pIntf,
WindowManager &rWindowManager,
TopWindow &rWindow ):
CmdGeneric( pIntf ), m_rWindowManager( rWindowManager ),
m_rWindow( rWindow )
{
}
TopWindow &rWindow )
: CmdGeneric( pIntf ), m_rWindowManager( rWindowManager ),
m_rWindow( rWindow ) { }
void CmdUnmaximize::execute()
......@@ -77,32 +68,24 @@ void CmdUnmaximize::execute()
void CmdAddInTray::execute()
{
// Get the instance of OSFactory
OSFactory *pOsFactory = OSFactory::instance( getIntf() );
pOsFactory->addInTray();
OSFactory::instance( getIntf() )->addInTray();
}
void CmdRemoveFromTray::execute()
{
// Get the instance of OSFactory
OSFactory *pOsFactory = OSFactory::instance( getIntf() );
pOsFactory->removeFromTray();
OSFactory::instance( getIntf() )->removeFromTray();
}
void CmdAddInTaskBar::execute()
{
// Get the instance of OSFactory
OSFactory *pOsFactory = OSFactory::instance( getIntf() );
pOsFactory->addInTaskBar();
OSFactory::instance( getIntf() )->addInTaskBar();
}
void CmdRemoveFromTaskBar::execute()
{
// Get the instance of OSFactory
OSFactory *pOsFactory = OSFactory::instance( getIntf() );
pOsFactory->removeFromTaskBar();
OSFactory::instance( getIntf() )->removeFromTaskBar();
}
......@@ -16,9 +16,9 @@
* 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., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
* 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.,
* 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
#include "cmd_muxer.hpp"
......@@ -28,7 +28,5 @@ void CmdMuxer::execute()
{
cmdList_t::const_iterator it;
for( it = m_list.begin(); it != m_list.end(); ++it )
{
(*it)->execute();
}
}
......@@ -32,8 +32,8 @@
class CmdMuxer: public CmdGeneric
{
public:
CmdMuxer( intf_thread_t *pIntf, const list<CmdGeneric*> &rList ):
CmdGeneric( pIntf ), m_list( rList ) { }
CmdMuxer( intf_thread_t *pIntf, const list<CmdGeneric*> &rList )
: CmdGeneric( pIntf ), m_list( rList ) { }
virtual ~CmdMuxer() { }
virtual void execute();
virtual string getType() const { return "muxer"; }
......
......@@ -17,9 +17,9 @@
* 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., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
* 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.,
* 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
#include "cmd_playlist.hpp"
......@@ -36,9 +36,7 @@ void CmdPlaylistNext::execute()
{
playlist_t *pPlaylist = getIntf()->p_sys->p_playlist;
if( pPlaylist != NULL )
{
playlist_Next( pPlaylist );
}
}
......@@ -46,9 +44,7 @@ void CmdPlaylistPrevious::execute()
{
playlist_t *pPlaylist = getIntf()->p_sys->p_playlist;
if( pPlaylist != NULL )
{
playlist_Prev( pPlaylist );
}
}
......@@ -89,29 +85,25 @@ void CmdPlaylistSave::execute()
playlist_t *pPlaylist = getIntf()->p_sys->p_playlist;
if( pPlaylist != NULL )
{
static const char psz_xspf[] = "export-xspf",
psz_m3u[] = "export-m3u",
psz_html[] = "export-html";
const char *psz_module;
if( m_file.find( ".xsp", 0 ) != string::npos )
psz_module = psz_xspf;
psz_module = "export-xspf";
else if( m_file.find( "m3u", 0 ) != string::npos )
psz_module = psz_m3u;
psz_module = "export-m3u";
else if( m_file.find( "html", 0 ) != string::npos )
psz_module = psz_html;
psz_module = "export-html";
else
{
msg_Err( getIntf(), "Impossible to recognise the file type" );
msg_Err(getIntf(),"Did not recognise playlist export file type");
return;
}
playlist_Export( pPlaylist, m_file.c_str(), pPlaylist->p_local_category, psz_module );
playlist_Export( pPlaylist, m_file.c_str(),
pPlaylist->p_local_category, psz_module );
}
}
void CmdPlaylistFirst::execute()
{
playlist_t *pPlaylist = getIntf()->p_sys->p_playlist;
playlist_Control( pPlaylist, PLAYLIST_PLAY, pl_Unlocked );
playlist_Control(getIntf()->p_sys->p_playlist,PLAYLIST_PLAY,pl_Unlocked);
}
......@@ -17,9 +17,9 @@
* 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., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
* 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.,
* 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
#include "cmd_playtree.hpp"
......@@ -43,6 +43,5 @@ void CmdPlaytreeSort::execute()
PL_UNLOCK;
// Ask for rebuild
Playtree &rVar = VlcProc::instance( getIntf() )->getPlaytreeVar();
rVar.onChange();
VlcProc::instance( getIntf() )->getPlaytreeVar().onChange();
}
......@@ -17,9 +17,9 @@
* 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., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
* 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.,
* 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
#include "cmd_resize.hpp"
......@@ -31,11 +31,9 @@
CmdResize::CmdResize( intf_thread_t *pIntf, const WindowManager &rWindowManager,
GenericLayout &rLayout, int width, int height ):
CmdGeneric( pIntf ), m_rWindowManager( rWindowManager ),
m_rLayout( rLayout ), m_width( width ), m_height( height )
{
}
GenericLayout &rLayout, int width, int height )
: CmdGeneric( pIntf ), m_rWindowManager( rWindowManager ),
m_rLayout( rLayout ), m_width( width ), m_height( height ) { }
void CmdResize::execute()
......@@ -48,9 +46,7 @@ void CmdResize::execute()
CmdResizeInnerVout::CmdResizeInnerVout( intf_thread_t *pIntf,
CtrlVideo* pCtrlVideo )
: CmdGeneric( pIntf ), m_pCtrlVideo( pCtrlVideo )
{
}
: CmdGeneric( pIntf ), m_pCtrlVideo( pCtrlVideo ) { }
void CmdResizeInnerVout::execute()
......@@ -61,30 +57,23 @@ void CmdResizeInnerVout::execute()
CmdResizeVout::CmdResizeVout( intf_thread_t *pIntf, vout_window_t* pWnd,
int width, int height )
: CmdGeneric( pIntf ), m_pWnd( pWnd ), m_width( width ), m_height( height )
{
}
: CmdGeneric( pIntf ), m_pWnd( pWnd ), m_width( width ),
m_height( height ) { }
void CmdResizeVout::execute()
{
VoutManager* p_VoutManager = getIntf()->p_sys->p_voutManager;
p_VoutManager->setSizeWnd( m_pWnd, m_width, m_height );
getIntf()->p_sys->p_voutManager->setSizeWnd( m_pWnd, m_width, m_height );
}
CmdSetFullscreen::CmdSetFullscreen( intf_thread_t *pIntf,
vout_window_t * pWnd, bool fullscreen )
: CmdGeneric( pIntf ), m_pWnd( pWnd ), m_bFullscreen( fullscreen )
{
}
: CmdGeneric( pIntf ), m_pWnd( pWnd ), m_bFullscreen( fullscreen ) { }
void CmdSetFullscreen::execute()
{
VoutManager* p_VoutManager = getIntf()->p_sys->p_voutManager;
p_VoutManager->setFullscreenWnd( m_pWnd, m_bFullscreen );
getIntf()->p_sys->p_voutManager->setFullscreenWnd( m_pWnd, m_bFullscreen );
}
......@@ -16,9 +16,9 @@
* 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., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
* 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.,
* 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
#include "cmd_snapshot.hpp"
......@@ -43,9 +43,7 @@ void CmdSnapshot::execute()
void CmdToggleRecord::execute()
{
input_thread_t* pInput = getIntf()->p_sys->p_input;
if( !pInput )
return;
if( pInput )
var_ToggleBool( pInput, "record" );
}
......@@ -53,9 +51,7 @@ void CmdToggleRecord::execute()
void CmdNextFrame::execute()
{
input_thread_t* pInput = getIntf()->p_sys->p_input;
if( !pInput )
return;
if( pInput )
var_TriggerCallback( pInput, "frame-next" );
}
......
......@@ -16,9 +16,9 @@
* 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., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
* 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.,
* 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
#include "cmd_vars.hpp"
......@@ -30,60 +30,45 @@
void CmdPlaytreeChanged::execute()
{
// Notify the playtree variable
Playtree &rVar = VlcProc::instance( getIntf() )->getPlaytreeVar();
rVar.onChange();
VlcProc::instance( getIntf() )->getPlaytreeVar().onChange();
}
void CmdPlaytreeUpdate::execute()
{
// Notify the playtree variable
Playtree &rVar = VlcProc::instance( getIntf() )->getPlaytreeVar();
rVar.onUpdateItem( m_id );
VlcProc::instance( getIntf() )->getPlaytreeVar().onUpdateItem( m_id );
}
bool CmdPlaytreeUpdate::checkRemove( CmdGeneric *pQueuedCommand ) const
{
// We don't use RTTI - Use C-style cast
CmdPlaytreeUpdate *pUpdateCommand = (CmdPlaytreeUpdate *)(pQueuedCommand);
if( m_id == pUpdateCommand->m_id )
{
return true;
}
return false;
return m_id == pUpdateCommand->m_id;
}
void CmdPlaytreeAppend::execute()
{
// Notify the playtree variable
Playtree &rVar = VlcProc::instance( getIntf() )->getPlaytreeVar();
rVar.onAppend( m_pAdd );
VlcProc::instance( getIntf() )->getPlaytreeVar().onAppend( m_pAdd );
}
void CmdPlaytreeDelete::execute()
{
// Notify the playtree variable
Playtree &rVar = VlcProc::instance( getIntf() )->getPlaytreeVar();
rVar.onDelete( m_id );
VlcProc::instance( getIntf() )->getPlaytreeVar().onDelete( m_id );
}
void CmdSetText::execute()
{
// Change the text variable
m_rText.set( m_value );
}
void CmdSetEqBands::execute()
{
// Change the equalizer bands
m_rEqBands.set( m_value );
}
void CmdSetEqPreamp::execute()
{
// Change the preamp variable
m_rPreamp.set( m_value, false );
}
......@@ -16,9 +16,9 @@
* 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., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
* 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.,
* 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
#include "cmd_voutwindow.hpp"
......@@ -27,46 +27,39 @@
CmdNewVoutWindow::CmdNewVoutWindow( intf_thread_t *pIntf, vout_window_t* pWnd )
: CmdGeneric( pIntf ), m_pWnd( pWnd )
{
}
: CmdGeneric( pIntf ), m_pWnd( pWnd ) { }
void CmdNewVoutWindow::execute()
{
vlc_mutex_lock( &getIntf()->p_sys->vout_lock );
VoutManager* p_VoutManager = getIntf()->p_sys->p_voutManager;
intf_sys_t *p_sys = getIntf()->p_sys;
void* handle = p_VoutManager->acceptWnd( m_pWnd );
vlc_mutex_lock( &p_sys->vout_lock );
getIntf()->p_sys->handle = handle;
getIntf()->p_sys->b_vout_ready = true;
vlc_cond_signal( &getIntf()->p_sys->vout_wait );
p_sys->handle = p_sys->p_voutManager->acceptWnd( m_pWnd );
p_sys->b_vout_ready = true;
vlc_cond_signal( &p_sys->vout_wait );
vlc_mutex_unlock( &getIntf()->p_sys->vout_lock );
vlc_mutex_unlock( &p_sys->vout_lock );
}
CmdReleaseVoutWindow::CmdReleaseVoutWindow( intf_thread_t *pIntf,
vout_window_t* pWnd )
: CmdGeneric( pIntf ), m_pWnd( pWnd )
{
}
: CmdGeneric( pIntf ), m_pWnd( pWnd ) { }
void CmdReleaseVoutWindow::execute()
{
vlc_mutex_lock( &getIntf()->p_sys->vout_lock );
VoutManager* p_VoutManager = getIntf()->p_sys->p_voutManager;
intf_sys_t *p_sys = getIntf()->p_sys;
p_VoutManager->releaseWnd( m_pWnd );
vlc_mutex_lock( &p_sys->vout_lock );
getIntf()->p_sys->b_vout_ready = true;
vlc_cond_signal( &getIntf()->p_sys->vout_wait );
p_sys->p_voutManager->releaseWnd( m_pWnd );
p_sys->b_vout_ready = true;
vlc_cond_signal( &p_sys->vout_wait );
vlc_mutex_unlock( &getIntf()->p_sys->vout_lock );
vlc_mutex_unlock( &p_sys->vout_lock );
}
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