Toast Engine
Loading...
Searching...
No Matches
audio_events.hpp
Go to the documentation of this file.
1
8#pragma once
9#include <string>
10#include <toast/events/event.hpp>
11#include <toast/export.hpp>
12
13namespace event {
14
15// TODO: refactor when we have the message system
16
20struct TOAST_API MusicBeat : Event<MusicBeat> {
21 int bar;
22 int beat;
23 int position_ms;
24 float tempo;
27
28 MusicBeat(int bar, int beat, int position_ms, float tempo, int upper, int lower)
29 : bar(bar),
30 beat(beat),
31 position_ms(position_ms),
32 tempo(tempo),
33 time_sig_upper(upper),
34 time_sig_lower(lower) { }
35};
36
40struct TOAST_API MusicMarker : Event<MusicMarker> {
41 std::string name;
42 int position_ms;
43
44 MusicMarker(std::string name, int position_ms) : name(std::move(name)), position_ms(position_ms) { }
45};
46
50struct TOAST_API MusicStopped : Event<MusicStopped> {
51 // TODO: refactor when we have the message system
52};
53
54}
int time_sig_lower
denominator of the time signature
Definition audio_events.hpp:26
int beat
0-based beat within the bar
Definition audio_events.hpp:22
int time_sig_upper
numerator of the time signature
Definition audio_events.hpp:25
int bar
0-based bar number
Definition audio_events.hpp:21
Fired when a track finishes playing.
Definition audio_events.hpp:50