mirror of
https://github.com/RetroShare/RetroShare.git
synced 2024-12-27 08:29:26 -05:00
reverted commit for phonon since phonon is deprecated. Will be replaced by qtmultimedia in the next commit
This commit is contained in:
parent
7488ba19ff
commit
9999742ec7
@ -37,14 +37,6 @@
|
||||
#define GROUP_ENABLE "Enable"
|
||||
#define GROUP_SOUNDFILE "SoundFilePath"
|
||||
|
||||
#ifdef UBUNTU
|
||||
#include <phonon/audiooutput.h>
|
||||
#include <phonon/mediaobject.h>
|
||||
#include <phonon/mediasource.h>
|
||||
|
||||
Phonon::MediaObject *SoundManager::mediaObject = NULL ;
|
||||
#endif
|
||||
|
||||
SoundManager *soundManager = NULL;
|
||||
|
||||
SoundEvents::SoundEvents()
|
||||
@ -243,23 +235,11 @@ void SoundManager::playFile(const QString &filename)
|
||||
|
||||
QString playFilename = realFilename(filename);
|
||||
|
||||
#ifdef UBUNTU
|
||||
// The media object is only deleted before being used, so as to avoid a memory leak. We cannot delete it after calling play() because the
|
||||
// playing is asynchronous. The way to do this properly would be to connect the finish() signal of the player to some slot that delete it,
|
||||
// assuming it's not done in a static method like now.
|
||||
|
||||
if(mediaObject != NULL)
|
||||
delete mediaObject ;
|
||||
|
||||
mediaObject = Phonon::createPlayer(Phonon::NotificationCategory, Phonon::MediaSource(QUrl::fromLocalFile(filename)));
|
||||
mediaObject->play();
|
||||
#else
|
||||
|
||||
#if QT_VERSION >= QT_VERSION_CHECK (5, 0, 0)
|
||||
if (!QAudioDeviceInfo::availableDevices(QAudio::AudioOutput).isEmpty())
|
||||
#else
|
||||
if (QSound::isAvailable())
|
||||
#endif
|
||||
QSound::play(playFilename);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
@ -30,10 +30,6 @@
|
||||
#define SOUND_MESSAGE_ARRIVED "MessageArrived"
|
||||
#define SOUND_DOWNLOAD_COMPLETE "DownloadComplete"
|
||||
|
||||
#ifdef UBUNTU
|
||||
#include <phonon/mediaobject.h>
|
||||
#endif
|
||||
|
||||
class SoundEvents
|
||||
{
|
||||
public:
|
||||
@ -91,9 +87,6 @@ public:
|
||||
|
||||
private:
|
||||
SoundManager();
|
||||
#ifdef UBUNTU
|
||||
static Phonon::MediaObject *mediaObject ;
|
||||
#endif
|
||||
};
|
||||
|
||||
extern SoundManager *soundManager;
|
||||
|
@ -66,7 +66,6 @@ linux-* {
|
||||
|
||||
PKGCONFIG *= x11 xscrnsaver
|
||||
|
||||
LIBS *= -lphonon
|
||||
LIBS *= -rdynamic
|
||||
DEFINES *= HAVE_XSS # for idle time, libx screensaver extensions
|
||||
DEFINES *= UBUNTU
|
||||
|
Loading…
Reference in New Issue
Block a user