mirror of
https://github.com/xiaoyifang/goldendict-ng.git
synced 2024-11-27 15:24:05 +00:00
b5349478cf
The next commit will add `.git-blame-ignore-revs` https://docs.github.com/en/repositories/working-with-files/using-files/viewing-a-file#ignore-commits-in-the-blame-view
46 lines
859 B
C++
46 lines
859 B
C++
/* This file is (c) 2018 Igor Kushnir <igorkuo@gmail.com>
|
|
* Part of GoldenDict. Licensed under GPLv3 or later, see the LICENSE file */
|
|
|
|
#ifndef FFMPEGAUDIOPLAYER_HH_INCLUDED
|
|
#define FFMPEGAUDIOPLAYER_HH_INCLUDED
|
|
|
|
#include "audioplayerinterface.hh"
|
|
#include "ffmpegaudio.hh"
|
|
|
|
#ifdef MAKE_FFMPEG_PLAYER
|
|
|
|
namespace Ffmpeg {
|
|
|
|
class AudioPlayer: public AudioPlayerInterface
|
|
{
|
|
Q_OBJECT
|
|
|
|
public:
|
|
AudioPlayer()
|
|
{
|
|
connect( &AudioService::instance(), &AudioService::error, this, &AudioPlayerInterface::error );
|
|
}
|
|
|
|
~AudioPlayer()
|
|
{
|
|
stop();
|
|
}
|
|
|
|
virtual QString play( const char * data, int size )
|
|
{
|
|
AudioService::instance().playMemory( data, size );
|
|
return QString();
|
|
}
|
|
|
|
virtual void stop()
|
|
{
|
|
AudioService::instance().stop();
|
|
}
|
|
};
|
|
|
|
} // namespace Ffmpeg
|
|
|
|
#endif // MAKE_FFMPEG_PLAYER
|
|
|
|
#endif // FFMPEGAUDIOPLAYER_HH_INCLUDED
|