mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-08-06 22:26:32 +02:00
Fix indentation
This commit is contained in:
@@ -46,43 +46,44 @@ Api_v1_5::ping( QxtWebRequestEvent* event )
|
|||||||
m_service->postEvent( e );
|
m_service->postEvent( e );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
Api_v1_5::playback( QxtWebRequestEvent* event, const QString& command )
|
Api_v1_5::playback( QxtWebRequestEvent* event, const QString& command )
|
||||||
{
|
{
|
||||||
if ( command == "next")
|
if ( command == "next")
|
||||||
{
|
{
|
||||||
JSON_REPLY( QMetaObject::invokeMethod( AudioEngine::instance(), "next", Qt::QueuedConnection ) , "Skipping to the next track failed." );
|
JSON_REPLY( QMetaObject::invokeMethod( AudioEngine::instance(), "next", Qt::QueuedConnection ) , "Skipping to the next track failed." );
|
||||||
}
|
}
|
||||||
else if ( command == "previous" )
|
else if ( command == "previous" )
|
||||||
{
|
{
|
||||||
JSON_REPLY( QMetaObject::invokeMethod( AudioEngine::instance(), "previous", Qt::QueuedConnection ), "Rewinding to the previous track failed." );
|
JSON_REPLY( QMetaObject::invokeMethod( AudioEngine::instance(), "previous", Qt::QueuedConnection ), "Rewinding to the previous track failed." );
|
||||||
}
|
}
|
||||||
else if ( command == "playpause" )
|
else if ( command == "playpause" )
|
||||||
{
|
{
|
||||||
JSON_REPLY( QMetaObject::invokeMethod( AudioEngine::instance(), "playPause", Qt::QueuedConnection ), "Play/Pause failed." );
|
JSON_REPLY( QMetaObject::invokeMethod( AudioEngine::instance(), "playPause", Qt::QueuedConnection ), "Play/Pause failed." );
|
||||||
}
|
}
|
||||||
else if ( command == "play" )
|
else if ( command == "play" )
|
||||||
{
|
{
|
||||||
JSON_REPLY( QMetaObject::invokeMethod( AudioEngine::instance(), "play", Qt::QueuedConnection ), "Starting the playback failed." );
|
JSON_REPLY( QMetaObject::invokeMethod( AudioEngine::instance(), "play", Qt::QueuedConnection ), "Starting the playback failed." );
|
||||||
}
|
}
|
||||||
else if ( command == "pause" )
|
else if ( command == "pause" )
|
||||||
{
|
{
|
||||||
JSON_REPLY( QMetaObject::invokeMethod( AudioEngine::instance(), "pause", Qt::QueuedConnection ), "Pausing the current track failed." );
|
JSON_REPLY( QMetaObject::invokeMethod( AudioEngine::instance(), "pause", Qt::QueuedConnection ), "Pausing the current track failed." );
|
||||||
}
|
}
|
||||||
else if ( command == "stop" )
|
else if ( command == "stop" )
|
||||||
{
|
{
|
||||||
JSON_REPLY( QMetaObject::invokeMethod( AudioEngine::instance(), "stop", Qt::QueuedConnection ), "Stopping the current track failed." );
|
JSON_REPLY( QMetaObject::invokeMethod( AudioEngine::instance(), "stop", Qt::QueuedConnection ), "Stopping the current track failed." );
|
||||||
}
|
}
|
||||||
else if ( command == "lowervolume" )
|
else if ( command == "lowervolume" )
|
||||||
{
|
{
|
||||||
JSON_REPLY( QMetaObject::invokeMethod( AudioEngine::instance(), "lowerVolume", Qt::QueuedConnection ), "Lowering volume failed." );
|
JSON_REPLY( QMetaObject::invokeMethod( AudioEngine::instance(), "lowerVolume", Qt::QueuedConnection ), "Lowering volume failed." );
|
||||||
}
|
}
|
||||||
else if ( command == "raisevolume" )
|
else if ( command == "raisevolume" )
|
||||||
{
|
{
|
||||||
JSON_REPLY( QMetaObject::invokeMethod( AudioEngine::instance(), "raiseVolume", Qt::QueuedConnection ), "Raising volume failed." );
|
JSON_REPLY( QMetaObject::invokeMethod( AudioEngine::instance(), "raiseVolume", Qt::QueuedConnection ), "Raising volume failed." );
|
||||||
}
|
}
|
||||||
else if ( command == "currenttrack" )
|
else if ( command == "currenttrack" )
|
||||||
{
|
{
|
||||||
QByteArray json;
|
QByteArray json;
|
||||||
Tomahawk::result_ptr currentTrack = AudioEngine::instance()->currentTrack();
|
Tomahawk::result_ptr currentTrack = AudioEngine::instance()->currentTrack();
|
||||||
|
|
||||||
@@ -113,24 +114,25 @@ Api_v1_5::playback( QxtWebRequestEvent* event, const QString& command )
|
|||||||
e->headers.insert( "Access-Control-Allow-Origin", "*" );
|
e->headers.insert( "Access-Control-Allow-Origin", "*" );
|
||||||
e->contentType = "application/json";
|
e->contentType = "application/json";
|
||||||
m_service->postEvent( e );
|
m_service->postEvent( e );
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
m_service->sendJsonError( event, "No such playback command." );
|
m_service->sendJsonError( event, "No such playback command." );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
Api_v1_5::jsonReply( QxtWebRequestEvent* event, const char* funcInfo, const QString& errorMessage, bool isError )
|
Api_v1_5::jsonReply( QxtWebRequestEvent* event, const char* funcInfo, const QString& errorMessage, bool isError )
|
||||||
{
|
{
|
||||||
if ( isError )
|
if ( isError )
|
||||||
{
|
{
|
||||||
tLog( LOGVERBOSE ) << funcInfo << errorMessage;
|
tLog( LOGVERBOSE ) << funcInfo << errorMessage;
|
||||||
m_service->sendJsonError( event, errorMessage );
|
m_service->sendJsonError( event, errorMessage );
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
m_service->sendJsonOk( event );
|
m_service->sendJsonOk( event );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user