diff --git a/src/libtomahawk/audio/AudioEngine.cpp b/src/libtomahawk/audio/AudioEngine.cpp index 57b22ac2b..c13815534 100644 --- a/src/libtomahawk/audio/AudioEngine.cpp +++ b/src/libtomahawk/audio/AudioEngine.cpp @@ -1,6 +1,6 @@ /* === This file is part of Tomahawk Player - === * - * Copyright 2010-2011, Christian Muehlhaeuser + * Copyright 2010-2012, Christian Muehlhaeuser * Copyright 2010-2012, Jeff Mitchell * * Tomahawk is free software: you can redistribute it and/or modify @@ -39,13 +39,14 @@ #include "utils/Logger.h" - using namespace Tomahawk; -AudioEngine* AudioEngine::s_instance = 0; +#define AUDIO_VOLUME_STEP 5 static QString s_aeInfoIdentifier = QString( "AUDIOENGINE" ); +AudioEngine* AudioEngine::s_instance = 0; + AudioEngine* AudioEngine::instance() @@ -302,6 +303,20 @@ AudioEngine::setVolume( int percentage ) } +void +AudioEngine::lowerVolume() +{ + setVolume( volume() - AUDIO_VOLUME_STEP ); +} + + +void +AudioEngine::raiseVolume() +{ + setVolume( volume() + AUDIO_VOLUME_STEP ); +} + + void AudioEngine::mute() { diff --git a/src/libtomahawk/audio/AudioEngine.h b/src/libtomahawk/audio/AudioEngine.h index c5e3aeac8..ac1c2ded4 100644 --- a/src/libtomahawk/audio/AudioEngine.h +++ b/src/libtomahawk/audio/AudioEngine.h @@ -1,6 +1,6 @@ /* === This file is part of Tomahawk Player - === * - * Copyright 2010-2011, Christian Muehlhaeuser + * Copyright 2010-2012, Christian Muehlhaeuser * Copyright 2010-2012, Jeff Mitchell * * Tomahawk is free software: you can redistribute it and/or modify @@ -35,8 +35,6 @@ #include "DllMacro.h" -#define AUDIO_VOLUME_STEP 5 - class DLLEXPORT AudioEngine : public QObject { @@ -88,8 +86,8 @@ public slots: void seek( qint64 ms ); void seek( int ms ); // for compatibility with seekbar in audiocontrols void setVolume( int percentage ); - void lowerVolume() { setVolume( volume() - AUDIO_VOLUME_STEP ); } - void raiseVolume() { setVolume( volume() + AUDIO_VOLUME_STEP ); } + void lowerVolume(); + void raiseVolume(); void mute(); void playItem( Tomahawk::playlistinterface_ptr playlist, const Tomahawk::result_ptr& result );