goldendict-ng/audioplayerfactory.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
650 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 AUDIOPLAYERFACTORY_HH_INCLUDED
#define AUDIOPLAYERFACTORY_HH_INCLUDED
#include "audioplayerinterface.hh"
#include "config.hh"
class AudioPlayerFactory
{
Q_DISABLE_COPY( AudioPlayerFactory )
public:
explicit AudioPlayerFactory( Config::Preferences const & );
void setPreferences( Config::Preferences const & );
AudioPlayerPtr const & player() const { return playerPtr; }
private:
void reset();
bool useInternalPlayer;
AudioPlayerPtr playerPtr;
};
#endif // AUDIOPLAYERFACTORY_HH_INCLUDED