2018-03-21 17:49:34 +00:00
|
|
|
/* 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"
|
|
|
|
|
2018-03-29 17:00:53 +00:00
|
|
|
#ifdef MAKE_FFMPEG_PLAYER
|
2018-03-21 17:49:34 +00:00
|
|
|
|
|
|
|
namespace Ffmpeg
|
|
|
|
{
|
|
|
|
|
|
|
|
class AudioPlayer : public AudioPlayerInterface
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
public:
|
2022-12-26 02:08:17 +00:00
|
|
|
AudioPlayer() { connect( &AudioService::instance(), &AudioService::error, this, &AudioPlayerInterface::error ); }
|
2018-03-21 17:49:34 +00:00
|
|
|
|
2022-12-26 02:08:17 +00:00
|
|
|
~AudioPlayer() { stop(); }
|
2018-04-01 12:15:07 +00:00
|
|
|
|
2022-12-26 02:08:17 +00:00
|
|
|
virtual QString play( const char * data, int size )
|
|
|
|
{
|
|
|
|
AudioService::instance().playMemory( data, size );
|
|
|
|
return QString();
|
2018-03-21 17:49:34 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
virtual void stop()
|
|
|
|
{
|
|
|
|
AudioService::instance().stop();
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
}
|
|
|
|
|
2018-03-29 17:00:53 +00:00
|
|
|
#endif // MAKE_FFMPEG_PLAYER
|
2018-03-21 17:49:34 +00:00
|
|
|
|
|
|
|
#endif // FFMPEGAUDIOPLAYER_HH_INCLUDED
|