mirror of
https://github.com/xiaoyifang/goldendict-ng.git
synced 2024-11-24 00:14:06 +00:00
e5045860ef
* 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.
25 lines
650 B
C++
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
|