Loading...
Searching...
No Matches
music_worker.h
1#pragma once
2
3#include <stdbool.h>
4#include <stdint.h>
5
6typedef void (*MusicWorkerCallback)(
7 uint8_t semitone,
8 uint8_t dots,
9 uint8_t duration,
10 float position,
11 void* context);
12
13typedef struct MusicWorker MusicWorker;
14
15MusicWorker* music_worker_alloc(void);
16
17void music_worker_clear(MusicWorker* instance);
18
19void music_worker_free(MusicWorker* instance);
20
21bool music_worker_load(MusicWorker* instance, const char* file_path);
22
23bool music_worker_load_fmf_from_file(MusicWorker* instance, const char* file_path);
24
25bool music_worker_load_rtttl_from_file(MusicWorker* instance, const char* file_path);
26
27bool music_worker_load_rtttl_from_string(MusicWorker* instance, const char* string);
28
29void music_worker_set_callback(MusicWorker* instance, MusicWorkerCallback callback, void* context);
30
31void music_worker_set_volume(MusicWorker* instance, float volume);
32
33void music_worker_start(MusicWorker* instance);
34
35void music_worker_stop(MusicWorker* instance);
36
37bool music_worker_is_playing(MusicWorker* instance);
Definition music_worker.c:31