1#ifndef RAYLIB_CPP_INCLUDE_AUTOMATIONEVENTLIST_HPP_
2#define RAYLIB_CPP_INCLUDE_AUTOMATIONEVENTLIST_HPP_
4#include "./RaylibException.hpp"
25 std::span<AutomationEvent> events = {}) :
::AutomationEventList{capacity,
static_cast<unsigned int>(events.size()), events.data()} {
38 Load(fileName.data());
48 other.events =
nullptr;
51 ~AutomationEventList() {
Unload(); }
53 GETTER(
unsigned int, Capacity, capacity)
54 GETTER(
unsigned int, Count, count)
55 GETTER(AutomationEvent*, Events, events)
74 other.events =
nullptr;
84 void Load(
const char* fileName) {
86 set(::LoadAutomationEventList(fileName));
97 void Load(
const std::string_view fileName) {
99 set(::LoadAutomationEventList(fileName.data()));
114#if RAYLIB_VERSION_MAJOR == 5
115#if RAYLIB_VERSION_MINOR == 0
116 ::UnloadAutomationEventList(
this);
117#elif RAYLIB_VERSION_MINOR >= 1
118 ::UnloadAutomationEventList(*
this);
121 ::UnloadAutomationEventList(*
this);
125 bool IsValid() {
return events !=
nullptr; }
127 bool Export(
const char* fileName) { return ::ExportAutomationEventList(*
this, fileName); }
129 bool Export(
const std::string_view fileName) {
130 return ::ExportAutomationEventList(*
this, fileName.data());
134 ::SetAutomationEventList(
this);
137 void SetBaseFrame(
int frame) {
139 ::SetAutomationEventBaseFrame(frame);
142 void StartRecording() {
144 ::StartAutomationEventRecording();
147 void StopRecording() {
149 ::StopAutomationEventRecording();
152 void Play(
int index) {
153 if (index < 0 ||
static_cast<unsigned int>(index) >= this->count) {
158 ::PlayAutomationEvent(this->events[index]);
161 void set(const ::AutomationEventList& other) {
162 capacity = other.capacity;
164 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.
All raylib-cpp classes and functions appear in the raylib namespace.