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:
|
|
|
|
AudioPlayer()
|
|
|
|
{
|
|
|
|
connect( &AudioService::instance(), SIGNAL( error( QString ) ),
|
|
|
|
this, SIGNAL( error( QString ) ) );
|
|
|
|
}
|
|
|
|
|
2018-04-01 12:15:07 +00:00
|
|
|
~AudioPlayer()
|
|
|
|
{
|
|
|
|
stop();
|
|
|
|
}
|
|
|
|
|
2018-03-22 17:07:10 +00:00
|
|
|
virtual QString play( const char * data, int size )
|
2018-03-21 17:49:34 +00:00
|
|
|
{
|
|
|
|
AudioService::instance().playMemory( data, size );
|
2018-03-22 17:07:10 +00:00
|
|
|
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
|