1
0
mirror of https://github.com/tomahawk-player/tomahawk.git synced 2025-07-31 11:20:22 +02:00

* Defines in headers are just evil.

This commit is contained in:
Christian Muehlhaeuser
2012-05-24 07:50:20 +02:00
parent 41d0c9b153
commit 606fb9cae5
2 changed files with 21 additions and 8 deletions

View File

@@ -1,6 +1,6 @@
/* === This file is part of Tomahawk Player - <http://tomahawk-player.org> === /* === This file is part of Tomahawk Player - <http://tomahawk-player.org> ===
* *
* Copyright 2010-2011, Christian Muehlhaeuser <muesli@tomahawk-player.org> * Copyright 2010-2012, Christian Muehlhaeuser <muesli@tomahawk-player.org>
* Copyright 2010-2012, Jeff Mitchell <jeff@tomahawk-player.org> * Copyright 2010-2012, Jeff Mitchell <jeff@tomahawk-player.org>
* *
* Tomahawk is free software: you can redistribute it and/or modify * Tomahawk is free software: you can redistribute it and/or modify
@@ -39,13 +39,14 @@
#include "utils/Logger.h" #include "utils/Logger.h"
using namespace Tomahawk; using namespace Tomahawk;
AudioEngine* AudioEngine::s_instance = 0; #define AUDIO_VOLUME_STEP 5
static QString s_aeInfoIdentifier = QString( "AUDIOENGINE" ); static QString s_aeInfoIdentifier = QString( "AUDIOENGINE" );
AudioEngine* AudioEngine::s_instance = 0;
AudioEngine* AudioEngine*
AudioEngine::instance() 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 void
AudioEngine::mute() AudioEngine::mute()
{ {

View File

@@ -1,6 +1,6 @@
/* === This file is part of Tomahawk Player - <http://tomahawk-player.org> === /* === This file is part of Tomahawk Player - <http://tomahawk-player.org> ===
* *
* Copyright 2010-2011, Christian Muehlhaeuser <muesli@tomahawk-player.org> * Copyright 2010-2012, Christian Muehlhaeuser <muesli@tomahawk-player.org>
* Copyright 2010-2012, Jeff Mitchell <jeff@tomahawk-player.org> * Copyright 2010-2012, Jeff Mitchell <jeff@tomahawk-player.org>
* *
* Tomahawk is free software: you can redistribute it and/or modify * Tomahawk is free software: you can redistribute it and/or modify
@@ -35,8 +35,6 @@
#include "DllMacro.h" #include "DllMacro.h"
#define AUDIO_VOLUME_STEP 5
class DLLEXPORT AudioEngine : public QObject class DLLEXPORT AudioEngine : public QObject
{ {
@@ -88,8 +86,8 @@ public slots:
void seek( qint64 ms ); void seek( qint64 ms );
void seek( int ms ); // for compatibility with seekbar in audiocontrols void seek( int ms ); // for compatibility with seekbar in audiocontrols
void setVolume( int percentage ); void setVolume( int percentage );
void lowerVolume() { setVolume( volume() - AUDIO_VOLUME_STEP ); } void lowerVolume();
void raiseVolume() { setVolume( volume() + AUDIO_VOLUME_STEP ); } void raiseVolume();
void mute(); void mute();
void playItem( Tomahawk::playlistinterface_ptr playlist, const Tomahawk::result_ptr& result ); void playItem( Tomahawk::playlistinterface_ptr playlist, const Tomahawk::result_ptr& result );