diff options
Diffstat (limited to 'Swift')
-rw-r--r-- | Swift/Controllers/SoundPlayer.h | 1 | ||||
-rw-r--r-- | Swift/QtUI/QtSoundPlayer.cpp | 4 | ||||
-rw-r--r-- | Swift/QtUI/QtSoundPlayer.h | 1 |
3 files changed, 6 insertions, 0 deletions
diff --git a/Swift/Controllers/SoundPlayer.h b/Swift/Controllers/SoundPlayer.h index b71d759..1d7f94d 100644 --- a/Swift/Controllers/SoundPlayer.h +++ b/Swift/Controllers/SoundPlayer.h @@ -12,5 +12,6 @@ namespace Swift { virtual ~SoundPlayer() {}; enum SoundEffect{MessageReceived}; virtual void playSound(SoundEffect sound) = 0; + virtual bool isAvailable() const = 0; }; } diff --git a/Swift/QtUI/QtSoundPlayer.cpp b/Swift/QtUI/QtSoundPlayer.cpp index 7fd6564..9860bc2 100644 --- a/Swift/QtUI/QtSoundPlayer.cpp +++ b/Swift/QtUI/QtSoundPlayer.cpp @@ -34,4 +34,8 @@ void QtSoundPlayer::playSound(const String& soundResource) { } } +bool QtSoundPlayer::isAvailable() const { + return QSound::isAvailable(); +} + } diff --git a/Swift/QtUI/QtSoundPlayer.h b/Swift/QtUI/QtSoundPlayer.h index 21ad8bb..da6fdda 100644 --- a/Swift/QtUI/QtSoundPlayer.h +++ b/Swift/QtUI/QtSoundPlayer.h @@ -20,6 +20,7 @@ namespace Swift { QtSoundPlayer(ApplicationPathProvider* applicationPathProvider); void playSound(SoundEffect sound); + bool isAvailable() const; private: void playSound(const String& soundResource); |