aboutsummaryrefslogtreecommitdiff
path: root/src/aoblipplayer.h
blob: c33e08b3c1303bd7bdd16cd5acd3994c39837d6a (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
#pragma once

#include "bass.h"
#include "bassopus.h"

#include "aoapplication.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();
};