AwesomeStudioPedal
A programmable, multi-profile foot controller for DAWs, score readers, and studio automation
Loading...
Searching...
No Matches
send_action.h
Go to the documentation of this file.
1#pragma once
2#include "action.h"
3#include "i_ble_keyboard.h"
4#include <string>
5
13class SendAction : public Action
14{
15public:
21 void execute() override { send(); }
22
28 bool isSendAction() const override { return true; }
29
35 virtual void send() = 0;
36 ~SendAction() override = default;
37
38protected:
47};
48
49// Forward declarations
51class SendCharAction;
52class SendKeyAction;
54
60{
61private:
62 char key;
64public:
70 Action::Type getType() const override { return Action::Type::SendChar; }
71
72#ifndef HOST_TEST_BUILD
73 void getJsonProperties(JsonObject& json) const override
74 {
75 json["value"] = "CHAR"; // Simplified for now
76 }
77#endif
78
84 char getKey() const { return key; }
88 void send() override;
89
97};
98
104{
105private:
106 std::string text;
108public:
114 Action::Type getType() const override { return Action::Type::SendString; }
115
116#ifndef HOST_TEST_BUILD
117 void getJsonProperties(JsonObject& json) const override { json["value"] = text.c_str(); }
118#endif
119
125 const std::string& getText() const { return text; }
129 void send() override;
130
138};
139
145{
146private:
147 uint8_t key;
149public:
155 Action::Type getType() const override { return Action::Type::SendKey; }
156
157#ifndef HOST_TEST_BUILD
158 void getJsonProperties(JsonObject& json) const override
159 {
160 json["value"] = "KEY"; // Simplified for now
161 }
162#endif
163
169 uint8_t getKey() const { return key; }
173 void send() override;
174
182};
183
189{
190private:
191 MediaKeyReport key{};
193public:
200
201#ifndef HOST_TEST_BUILD
202 void getJsonProperties(JsonObject& json) const override
203 {
204 json["value"] = "MEDIA_STOP"; // Simplified for now
205 }
206#endif
207
213 const MediaKeyReport& getKey() const { return key; }
217 void send() override;
218
226};
Base class for all pedal actions.
Definition action.h:12
virtual void getJsonProperties(JsonObject &json) const
Definition action.h:39
Interface for Bluetooth LE keyboard functionality.
Base class for all sendable actions.
Definition send_action.h:14
~SendAction() override=default
void execute() override
Executes the send action.
Definition send_action.h:21
bool isSendAction() const override
Checks if this action is a send action.
Definition send_action.h:28
IBleKeyboard * bleKeyboard
Pointer to BLE keyboard interface.
Definition send_action.h:39
virtual void send()=0
Executes the send action.
Sends a single character via BLE keyboard.
Definition send_action.h:60
Action::Type getType() const override
Gets the type of this action.
Definition send_action.h:70
void send() override
Executes the character send action.
char getKey() const
Gets the character to be sent.
Definition send_action.h:84
Sends a USB HID key code via BLE keyboard.
void send() override
Executes the key send action.
Action::Type getType() const override
Gets the type of this action.
uint8_t getKey() const
Gets the USB HID key code to be sent.
Sends a media key report via BLE keyboard.
const MediaKeyReport & getKey() const
Gets the media key report to be sent.
void send() override
Executes the media key send action.
Action::Type getType() const override
Gets the type of this action.
Sends a text string via BLE keyboard.
void send() override
Executes the string send action.
Action::Type getType() const override
Gets the type of this action.
const std::string & getText() const
Gets the text string to be sent.
uint8_t[2] MediaKeyReport
Type alias for media key reports.