1
0
mirror of https://github.com/tomahawk-player/tomahawk.git synced 2025-01-19 15:37:01 +01:00

Merge pull request #76 from ubertaco/master

Initial support for TWK-595
This commit is contained in:
Christian Muehlhaeuser 2012-02-23 11:23:43 -08:00
commit a41b174851

View File

@ -139,6 +139,7 @@ TomahawkApp::init()
::exit( 0 );
}
qDebug() << "TomahawkApp thread:" << thread();
Logger::setupLogfile();
qsrand( QTime( 0, 0, 0 ).secsTo( QTime::currentTime() ) );
@ -349,6 +350,13 @@ TomahawkApp::printHelp()
echo( " --testdb Use a test database instead of real collection\n" );
echo( " --noupnp Disable UPnP\n" );
echo( " --nosip Disable SIP\n" );
echo( "Playback Controls:" );
echo( " --playpause Toggle playing/paused state" );
echo( " --play Start/resume playback" );
echo( " --pause Pause playback" );
echo( " --stop Stop playback" );
echo( " --next Advances to the next track (if available)" );
echo( " --prev Returns to the previous track (if available)" );
echo( "\nurl is a tomahawk:// command or alternatively a url that Tomahawk can recognize.\n" );
echo( "For more documentation, see http://wiki.tomahawk-player.org/mediawiki/index.php/Tomahawk://_Links\n" );
}
@ -604,4 +612,38 @@ TomahawkApp::instanceStarted( KDSingleApplicationGuard::Instance instance )
QString arg1 = instance.arguments[ 1 ];
loadUrl( arg1 );
if ( instance.arguments.contains( "--next" ) || instance.arguments.contains( "--prev" ) || instance.arguments.contains( "--playpause" ) || instance.arguments.contains( "--play" ) || instance.arguments.contains( "--pause" ) || instance.arguments.contains( "--stop" ) )
{
if ( instance.arguments.contains( "--next" ) )
{
AudioEngine::instance()->next();
}
if ( instance.arguments.contains( "--prev" ) )
{
AudioEngine::instance()->previous();
}
if ( instance.arguments.contains( "--playpause" ) )
{
AudioEngine::instance()->playPause();
}
if ( instance.arguments.contains( "--play" ) )
{
AudioEngine::instance()->play();
}
if ( instance.arguments.contains( "--pause" ) )
{
AudioEngine::instance()->pause();
}
if ( instance.arguments.contains( "--stop" ) )
{
AudioEngine::instance()->stop();
}
}
}