1#ifndef RAYLIB_CPP_INCLUDE_AUTOMATIONEVENTLIST_HPP_
2#define RAYLIB_CPP_INCLUDE_AUTOMATIONEVENTLIST_HPP_
5#include "./raylib-cpp-utils.hpp"
6#include "./RaylibException.hpp"
17 set(automationEventList);
24 set(::LoadAutomationEventList(0));
28 std::span<AutomationEvent> events = {}) :
::AutomationEventList{capacity,
static_cast<unsigned int>(events.size()), events.data()} {
41 Load(fileName.data());
51 other.events =
nullptr;
54 ~AutomationEventList() {
58 GETTER(
unsigned int, Capacity, capacity)
59 GETTER(
unsigned int, Count, count)
60 GETTER(AutomationEvent*, Events, events)
79 other.events =
nullptr;
89 void Load(
const char* fileName) {
91 set(::LoadAutomationEventList(fileName));
102 void Load(
const std::string_view fileName) {
104 set(::LoadAutomationEventList(fileName.data()));
119 #if RAYLIB_VERSION_MAJOR == 5
120 #if RAYLIB_VERSION_MINOR == 0
121 ::UnloadAutomationEventList(
this);
122 #elif RAYLIB_VERSION_MINOR >= 1
123 ::UnloadAutomationEventList(*
this);
126 ::UnloadAutomationEventList(*
this);
131 return events !=
nullptr;
134 bool Export(
const char* fileName) {
135 return ::ExportAutomationEventList(*
this, fileName);
138 bool Export(
const std::string_view fileName) {
139 return ::ExportAutomationEventList(*
this, fileName.data());
143 ::SetAutomationEventList(
this);
146 void SetBaseFrame(
int frame) {
148 ::SetAutomationEventBaseFrame(frame);
151 void StartRecording() {
153 ::StartAutomationEventRecording();
156 void StopRecording() {
158 ::StopAutomationEventRecording();
161 void Play(
int index) {
162 if (index < 0 ||
static_cast<unsigned int>(index) >= this->count) {
167 ::PlayAutomationEvent(this->events[index]);
171 void set(const ::AutomationEventList& other) {
172 capacity = other.capacity;
174 events = other.events;
AutomationEventList management functions.
void Load(const char *fileName)
Load audio stream (to stream raw audio pcm data)
AutomationEventList(const char *fileName)
Load automation events list from file.
AutomationEventList()
Load an empty automation events list.
void Unload()
Update audio stream buffers with data.
void Load(const std::string_view fileName)
Load audio stream (to stream raw audio pcm data)
Exception used for most raylib-related exceptions.