fix audio
This commit is contained in:
parent
cb1ed6d60d
commit
c8b11b398a
@ -6,6 +6,7 @@
|
|||||||
#elif defined(QTAUDIO)
|
#elif defined(QTAUDIO)
|
||||||
#include <QMediaPlayer>
|
#include <QMediaPlayer>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "aoapplication.h"
|
#include "aoapplication.h"
|
||||||
|
|
||||||
#include <QWidget>
|
#include <QWidget>
|
||||||
@ -14,12 +15,14 @@
|
|||||||
#include <QTimer>
|
#include <QTimer>
|
||||||
#include <QObject>
|
#include <QObject>
|
||||||
|
|
||||||
|
#if defined(BASSAUDIO)
|
||||||
class AOMusicPlayer : public QObject
|
class AOMusicPlayer : public QObject
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
AOMusicPlayer(QWidget *parent, AOApplication *p_ao_app);
|
AOMusicPlayer(QWidget *parent, AOApplication *p_ao_app);
|
||||||
virtual ~AOMusicPlayer();
|
virtual ~AOMusicPlayer();
|
||||||
|
|
||||||
void play(QString p_song);
|
void play(QString p_song);
|
||||||
void set_volume(int p_value);
|
void set_volume(int p_value);
|
||||||
|
|
||||||
@ -30,6 +33,7 @@ public:
|
|||||||
private:
|
private:
|
||||||
QWidget *m_parent;
|
QWidget *m_parent;
|
||||||
AOApplication *ao_app;
|
AOApplication *ao_app;
|
||||||
|
|
||||||
int m_volume = 0;
|
int m_volume = 0;
|
||||||
QString f_path;
|
QString f_path;
|
||||||
|
|
||||||
@ -46,12 +50,18 @@ public:
|
|||||||
void play(QString p_song);
|
void play(QString p_song);
|
||||||
void set_volume(int p_value);
|
void set_volume(int p_value);
|
||||||
|
|
||||||
|
void kill_loop();
|
||||||
|
QString get_path();
|
||||||
|
bool enable_looping = true;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QMediaPlayer m_player;
|
|
||||||
QWidget *m_parent;
|
QWidget *m_parent;
|
||||||
AOApplication *ao_app;
|
AOApplication *ao_app;
|
||||||
|
|
||||||
|
QMediaPlayer m_player;
|
||||||
|
|
||||||
int m_volume = 0;
|
int m_volume = 0;
|
||||||
|
QString f_path;
|
||||||
};
|
};
|
||||||
#else
|
#else
|
||||||
class AOMusicPlayer : public QObject
|
class AOMusicPlayer : public QObject
|
||||||
@ -63,9 +73,16 @@ public:
|
|||||||
void play(QString p_song);
|
void play(QString p_song);
|
||||||
void set_volume(int p_value);
|
void set_volume(int p_value);
|
||||||
|
|
||||||
|
void kill_loop();
|
||||||
|
QString get_path();
|
||||||
|
bool enable_looping = true;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QWidget *m_parent;
|
QWidget *m_parent;
|
||||||
AOApplication *ao_app;
|
AOApplication *ao_app;
|
||||||
|
|
||||||
|
int m_volume = 0;
|
||||||
|
QString f_path;
|
||||||
};
|
};
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user