goldendict-ng/src/multimediaaudioplayer.hh

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

41 lines
951 B
C++
Raw Normal View History

/* This file is (c) 2018 Igor Kushnir <igorkuo@gmail.com>
* Part of GoldenDict. Licensed under GPLv3 or later, see the LICENSE file */
#ifndef MULTIMEDIAAUDIOPLAYER_HH_INCLUDED
#define MULTIMEDIAAUDIOPLAYER_HH_INCLUDED
#ifdef MAKE_QTMULTIMEDIA_PLAYER
#include <QBuffer>
#include <QMediaPlayer>
#include "audioplayerinterface.hh"
2022-02-27 05:17:37 +00:00
#if ( QT_VERSION >= QT_VERSION_CHECK( 6, 0, 0 ) )
#include <QAudioOutput>
#endif
#include <QPointer>
class MultimediaAudioPlayer: public AudioPlayerInterface
{
Q_OBJECT
public:
MultimediaAudioPlayer();
virtual QString play( const char * data, int size );
virtual void stop();
private slots:
void onMediaPlayerError();
private:
QPointer< QBuffer > audioBuffer;
QMediaPlayer player; ///< Depends on audioBuffer.
2022-02-27 05:17:37 +00:00
#if ( QT_VERSION >= QT_VERSION_CHECK( 6, 0, 0 ) )
QAudioOutput audioOutput;
#endif
};
#endif // MAKE_QTMULTIMEDIA_PLAYER
#endif // MULTIMEDIAAUDIOPLAYER_HH_INCLUDED