AwesomeStudioPedal
A programmable, multi-profile foot controller for DAWs, score readers, and studio automation
Loading...
Searching...
No Matches
profile.cpp
Go to the documentation of this file.
1#include "profile.h"
2
8Profile::Profile(std::string name) : name(std::move(name)) {}
9
15void Profile::addAction(uint8_t button, std::unique_ptr<Action> action)
16{
17 if (button < MAX_BUTTONS)
18 {
19 actions[button] = std::move(action);
20 }
21}
22
28Action* Profile::getAction(uint8_t button) const
29{
30 if (button < MAX_BUTTONS && actions[button])
31 {
32 return actions[button].get();
33 }
34 return nullptr;
35}
36
42const std::string& Profile::getName() const { return name; }
43
49const std::string& Profile::getDescription() const { return description; }
50
56void Profile::setDescription(const std::string& description) { this->description = description; }
Base class for all pedal actions.
Definition action.h:12
void addAction(uint8_t button, std::unique_ptr< Action > action)
Adds an action to a specific button in this profile.
Definition profile.cpp:15
const std::string & getDescription() const
Gets the description of this profile.
Definition profile.cpp:49
void setDescription(const std::string &description)
Sets the description of this profile.
Definition profile.cpp:56
Action * getAction(uint8_t button) const
Gets the action associated with a button in this profile.
Definition profile.cpp:28
static constexpr uint8_t MAX_BUTTONS
Maximum buttons per profile (A–Z)
Definition profile.h:17
Profile(std::string name)
Constructs a Profile with a name.
Definition profile.cpp:8
const std::string & getName() const
Gets the name of this profile.
Definition profile.cpp:42