goldendict-ng/src/audio/internalplayerbackend.hh
shenleban tongying 7eb06480e4
Some checks are pending
SonarCloud / Build and analyze (push) Waiting to run
refactor: default to Qt Multimedia and delete default player shenanigans
2024-11-25 19:54:31 -05:00

42 lines
925 B
C++

#pragma once
#include "audioplayerinterface.hh"
#include "ffmpegaudioplayer.hh"
#include "multimediaaudioplayer.hh"
#include <QScopedPointer>
#include <QStringList>
/// Overly engineered dummy/helper/wrapper "backend", which is not, to manage backends.
class InternalPlayerBackend
{
public:
/// Returns true if at least one backend is available.
static bool anyAvailable();
AudioPlayerInterface * getActualPlayer();
/// Returns the name list of supported backends.
/// The first one willl be the default one
static QStringList availableBackends();
QString const & getName() const
{
return name;
}
void setName( QString const & name_ )
{
name = name_;
}
bool operator==( InternalPlayerBackend const & other ) const
{
return name == other.name;
}
bool operator!=( InternalPlayerBackend const & other ) const
{
return !operator==( other );
}
private:
QString name;
};