File: audioplayerfactory.hh

package info (click to toggle)
goldendict 1.5.0~rc2%2Bgit20181207%2Bds-1
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 16,496 kB
  • sloc: cpp: 58,990; ansic: 11,311; xml: 488; makefile: 77; sh: 42
file content (33 lines) | stat: -rw-r--r-- 1,070 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
/* 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 ExternalAudioPlayer;

class AudioPlayerFactory
{
  Q_DISABLE_COPY( AudioPlayerFactory )
public:
  explicit AudioPlayerFactory( Config::Preferences const & );
  void setPreferences( Config::Preferences const & );
  /// The returned reference to a smart pointer is valid as long as this object
  /// exists. The pointer to the owned AudioPlayerInterface may change after the
  /// call to setPreferences(), but it is guaranteed to never be null.
  AudioPlayerPtr const & player() const { return playerPtr; }

private:
  void reset();
  void setAudioPlaybackProgram( ExternalAudioPlayer & externalPlayer );

  bool useInternalPlayer;
  Config::InternalPlayerBackend internalPlayerBackend;
  QString audioPlaybackProgram;
  AudioPlayerPtr playerPtr;
};

#endif // AUDIOPLAYERFACTORY_HH_INCLUDED