summary refs log tree commit diff stats
path: root/src/muxer.h
blob: b1a5b26303292f10ead0a97990c51e76ceae5324 (plain) (blame)
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
38
39
40
41
42
43
44
45
46
47
#ifndef MUXER_H_3146C802
#define MUXER_H_3146C802

#include <memory>
#include <string>
#include <fmod_studio_common.h>
#include <fmod_studio.hpp>

class fmod_system_deleter {
public:
  void operator()(FMOD::Studio::System* val) {
    val->release();
  }
};

using fmod_system_ptr = std::unique_ptr<FMOD::Studio::System, fmod_system_deleter>;

enum class TransitionState {
  Pre,
  Transition,
  Post,
  Stopped
};

class Muxer {
public:
  Muxer();

  void setPlayerLoc(int x, int y);

  void playSoundAtPosition(std::string name, float x, float y);

  void setMusicLevel(int level);

  void stopMusic();

  void update();

private:
  fmod_system_ptr system_;
  FMOD::Studio::EventInstance* exploration_event_;
  FMOD::Studio::EventInstance* transition_event_;
  FMOD::Studio::EventInstance* the_world_event_;
  TransitionState transition_state_ = TransitionState::Pre;
};

#endif /* end of include guard: MUXER_H_3146C802 */