aboutsummaryrefslogtreecommitdiff
path: root/src/aoblipplayer.h
blob: 92b43d297e9eea6bdc4259676db9bb307c2e2734 (plain)
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
34
35
36
37
#pragma once

#include "aoapplication.h"

#include <bass.h>
#include <bassopus.h>

#include <QDebug>
#include <QElapsedTimer>
#include <QWidget>

#include <string.h>

class AOBlipPlayer
{
public:
  static constexpr int STREAM_COUNT = 5;

  AOBlipPlayer(AOApplication *ao_app);

  void setVolume(int value);
  void setMuted(bool enabled);

  void setBlip(QString blip);

  void playBlip();

private:
  AOApplication *ao_app;

  int m_volume = 0;
  bool m_muted = false;
  HSTREAM m_stream[STREAM_COUNT]{};
  int m_cycle = 0;

  void updateInternalVolume();
};