unleashed-firmware/lib/music_worker/music_worker.h
あく acc39a4bc0
Api Symbols: replace asserts with checks (#3507)
* Api Symbols: replace asserts with checks
* Api Symbols: replace asserts with checks part 2
* Update no args function signatures with void, to help compiler to track incorrect usage
* More unavoidable void
* Update PVS config and code to make it happy
* Format sources
* nfc: fix checks
* dead code cleanup & include fixes

Co-authored-by: gornekich <n.gorbadey@gmail.com>
Co-authored-by: hedger <hedger@users.noreply.github.com>
Co-authored-by: hedger <hedger@nanode.su>
2024-03-19 23:43:52 +09:00

37 lines
1,022 B
C

#pragma once
#include <stdbool.h>
#include <stdint.h>
typedef void (*MusicWorkerCallback)(
uint8_t semitone,
uint8_t dots,
uint8_t duration,
float position,
void* context);
typedef struct MusicWorker MusicWorker;
MusicWorker* music_worker_alloc(void);
void music_worker_clear(MusicWorker* instance);
void music_worker_free(MusicWorker* instance);
bool music_worker_load(MusicWorker* instance, const char* file_path);
bool music_worker_load_fmf_from_file(MusicWorker* instance, const char* file_path);
bool music_worker_load_rtttl_from_file(MusicWorker* instance, const char* file_path);
bool music_worker_load_rtttl_from_string(MusicWorker* instance, const char* string);
void music_worker_set_callback(MusicWorker* instance, MusicWorkerCallback callback, void* context);
void music_worker_set_volume(MusicWorker* instance, float volume);
void music_worker_start(MusicWorker* instance);
void music_worker_stop(MusicWorker* instance);
bool music_worker_is_playing(MusicWorker* instance);