Пример #1
0
void
TomahawkApp::instanceStarted( KDSingleApplicationGuard::Instance instance )
{
    tDebug( LOGINFO ) << "Instance started!" << instance.pid() << instance.arguments();
    const QStringList arguments = instance.arguments();

    if ( arguments.size() < 2 )
        return;

    QString arg1 = arguments[ 1 ];
    if ( loadUrl( arg1 ) )
    {
        activate();
        return;
    }

    if ( arguments.contains( "--next" ) )
        AudioEngine::instance()->next();
    else if ( arguments.contains( "--prev" ) )
        AudioEngine::instance()->previous();
    else if ( arguments.contains( "--playpause" ) )
        AudioEngine::instance()->playPause();
    else if ( arguments.contains( "--play" ) )
        AudioEngine::instance()->play();
    else if ( arguments.contains( "--pause" ) )
        AudioEngine::instance()->pause();
    else if ( arguments.contains( "--stop" ) )
        AudioEngine::instance()->stop();
}
Пример #2
0
void
TomahawkApp::instanceStarted( KDSingleApplicationGuard::Instance instance )
{
    tDebug( LOGINFO ) << "Instance started!" << instance.pid() << instance.arguments();
    const QStringList arguments = instance.arguments();

    if ( arguments.count() > 1 )
    {
        if ( loadUrl( arguments.last() ) )
        {
            activate();
        }
        else if ( arguments.contains( "--next" ) )
            AudioEngine::instance()->next();
        else if ( arguments.contains( "--prev" ) )
            AudioEngine::instance()->previous();
        else if ( arguments.contains( "--playpause" ) )
            AudioEngine::instance()->playPause();
        else if ( arguments.contains( "--play" ) )
            AudioEngine::instance()->play();
        else if ( arguments.contains( "--pause" ) )
            AudioEngine::instance()->pause();
        else if ( arguments.contains( "--stop" ) )
            AudioEngine::instance()->stop();
        else if ( arguments.contains( "--voldown" ) )
            AudioEngine::instance()->lowerVolume();
        else if ( arguments.contains( "--volup" ) )
            AudioEngine::instance()->raiseVolume();
        else
            activate();
    }
    else
        activate();
}