atrooney-online-2/include/aomusicplayer.h
Salanto b8b6d3cbb3 Add musclist streaming support
Attempt Nr. 2 - Based on #548 and #501

+ Allows client to use a remote source as a last resort if the file can't be found locally.
+ Adds a check if the target file is missing.

This implementation assumed the streaming source to be structured like a webao content respository
2021-05-05 00:42:48 +02:00

48 lines
1014 B
C++

#ifndef AOMUSICPLAYER_H
#define AOMUSICPLAYER_H
#include "file_functions.h"
#include "bass.h"
#include "bassopus.h"
#include "aoapplication.h"
#include <QDebug>
#include <QWidget>
#include <string.h>
class AOMusicPlayer {
public:
AOMusicPlayer(QWidget *parent, AOApplication *p_ao_app);
virtual ~AOMusicPlayer();
void set_volume(int p_value, int channel = -1);
void set_looping(bool toggle, int channel = 0);
const int m_channelmax = 4;
// These have to be public for the stupid sync thing
int loop_start[4] = {0, 0, 0, 0};
int loop_end[4] = {0, 0, 0, 0};
public slots:
int play(QString p_song, int channel = 0, bool loop = false,
int effect_flags = 0);
void stop(int channel = 0);
private:
QWidget *m_parent;
AOApplication *ao_app;
bool m_looping = false;
int m_volume[4] = {0, 0, 0, 0};
// Channel 0 = music
// Channel 1 = ambience
// Channel 2 = extra
// Channel 3 = extra
HSTREAM m_stream_list[4];
HSYNC loop_sync[4];
};
#endif // AOMUSICPLAYER_H