goldendict-ng/audioplayerinterface.hh
Igor Kushnir e5045860ef Make adding new audio player implementations easy
* add a new interface class AudioPlayerInterface;
* inherit a new proxy class Ffmpeg::AudioPlayer from it;
* partially switch ArlticleView to using the interface;
* expose MainWindow's AudioPlayerInterface instance to all ArticleView
  instances;
* add a new AudioPlayerFactory class responsible for creating instances
  of concrete classes derived from AudioPlayerInterface depending on
  relevant Config::Preferences values;
* increase minimum supported Qt version from 4.5 to 4.6 in README
  in order to use QScopedPointer introduced in Qt 4.6.
2018-03-24 21:31:48 +02:00

25 lines
587 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 AUDIOPLAYERINTERFACE_HH_INCLUDED
#define AUDIOPLAYERINTERFACE_HH_INCLUDED
#include <QScopedPointer>
#include <QString>
#include <QObject>
class AudioPlayerInterface : public QObject
{
Q_OBJECT
public:
virtual void play( const char * data, int size ) = 0;
virtual void stop() = 0;
signals:
void error( QString message );
};
typedef QScopedPointer< AudioPlayerInterface > AudioPlayerPtr;
#endif // AUDIOPLAYERINTERFACE_HH_INCLUDED