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 );
- }
+ playlist_Add( pPlaylist, psz_uri, NULL,
+ m_playNow ? PLAYLIST_APPEND | PLAYLIST_GO : PLAYLIST_APPEND,
+ PLAYLIST_END, true, false );
+
free( psz_uri );
}
{
playlist_t *pPlaylist = getIntf()->p_sys->p_playlist;
if( pPlaylist == NULL )
- {
return;
- }
playlist_Lock( pPlaylist );
const bool b_empty = playlist_IsEmpty( pPlaylist );
else
{
// If the playlist is empty, open a file requester instead
- CmdDlgFile cmd( getIntf() );
- cmd.execute();
+ CmdDlgFile( getIntf() ).execute();
}
}
void CmdPause::execute()
{
playlist_t *pPlaylist = getIntf()->p_sys->p_playlist;
- if( pPlaylist == NULL )
- {
- return;
- }
-
- playlist_Pause( pPlaylist );
+ if( pPlaylist != NULL )
+ playlist_Pause( pPlaylist );
}
void CmdStop::execute()
{
playlist_t *pPlaylist = getIntf()->p_sys->p_playlist;
- if( pPlaylist == NULL )
- {
- return;
- }
-
- playlist_Stop( pPlaylist );
+ if( pPlaylist != NULL )
+ playlist_Stop( pPlaylist );
}
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 );
}
* 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"
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 );
}
* 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"
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()
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()
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();
}
* 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"
{
cmdList_t::const_iterator it;
for( it = m_list.begin(); it != m_list.end(); ++it )
- {
(*it)->execute();
- }
}
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"; }
* 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"
{
playlist_t *pPlaylist = getIntf()->p_sys->p_playlist;
if( pPlaylist != NULL )
- {
playlist_Next( pPlaylist );
- }
}
{
playlist_t *pPlaylist = getIntf()->p_sys->p_playlist;
if( pPlaylist != NULL )
- {
playlist_Prev( pPlaylist );
- }
}
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);
}
* 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"
PL_UNLOCK;
// Ask for rebuild
- Playtree &rVar = VlcProc::instance( getIntf() )->getPlaytreeVar();
- rVar.onChange();
+ VlcProc::instance( getIntf() )->getPlaytreeVar().onChange();
}
* 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"
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()
CmdResizeInnerVout::CmdResizeInnerVout( intf_thread_t *pIntf,
CtrlVideo* pCtrlVideo )
- : CmdGeneric( pIntf ), m_pCtrlVideo( pCtrlVideo )
-{
-}
+ : CmdGeneric( pIntf ), m_pCtrlVideo( pCtrlVideo ) { }
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 );
}
* 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"
void CmdToggleRecord::execute()
{
input_thread_t* pInput = getIntf()->p_sys->p_input;
- if( !pInput )
- return;
-
- var_ToggleBool( pInput, "record" );
+ if( pInput )
+ var_ToggleBool( pInput, "record" );
}
void CmdNextFrame::execute()
{
input_thread_t* pInput = getIntf()->p_sys->p_input;
- if( !pInput )
- return;
-
- var_TriggerCallback( pInput, "frame-next" );
+ if( pInput )
+ var_TriggerCallback( pInput, "frame-next" );
}
* 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"
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 );
}
* 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"
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 );
}