![]() |
Open FFBoard
Open source force feedback firmware
|
#include <MidiMain.h>
Public Member Functions | |
| MidiMain () | |
| virtual | ~MidiMain () |
| const ClassIdentifier | getInfo () |
| CommandStatus | command (const ParsedCommand &cmd, std::vector< CommandReply > &replies) |
| void | usbInit () |
| void | update () |
| void | noteOn (uint8_t chan, uint8_t note, uint8_t velocity) |
| void | noteOff (uint8_t chan, uint8_t note, uint8_t velocity) |
| void | controlChange (uint8_t chan, uint8_t c, uint8_t val) |
| void | pitchBend (uint8_t chan, int16_t val) |
| void | timerElapsed (TIM_HandleTypeDef *htim) |
| virtual std::string | getHelpstring () |
| void | play () |
Public Member Functions inherited from FFBoardMain | |
| const ClassType | getClassType () override |
| returns the used classchooser selection id of this instance | |
| FFBoardMain () | |
| virtual | ~FFBoardMain () |
| virtual void | cdcRcv (char *Buf, uint32_t *Len) |
| virtual void | cdcRcvReady (uint8_t itf) |
| virtual void | usbSuspend () |
| virtual void | usbResume () |
Public Member Functions inherited from ChoosableClass | |
| virtual | ~ChoosableClass () |
| uint16_t | getSelectionID () |
Public Member Functions inherited from CommandHandler | |
| CommandHandler (const char *clsname, uint16_t clsid, uint8_t instance=0) | |
| virtual | ~CommandHandler () |
| virtual bool | hasCommands () |
| virtual void | setCommandsEnabled (bool enable) |
| void | registerCommands () |
| virtual CommandStatus | internalCommand (const ParsedCommand &cmd, std::vector< CommandReply > &replies) |
| virtual std::string | getCommandsHelpstring () |
| virtual std::string | getCsvHelpstring () |
| virtual uint8_t | getCommandHandlerInstance () |
| void | broadcastCommandReply (CommandReply reply, uint32_t cmdId, CMDtype type) |
| void | sendCommandReplyAsync (CommandReply reply, uint32_t cmdId, CMDtype type, CommandInterface *interface=nullptr) |
| virtual uint16_t | getCommandHandlerID () |
| virtual CmdHandlerInfo * | getCommandHandlerInfo () |
| virtual bool | isValidCommandId (uint32_t cmdid, uint32_t ignoredFlags=0, uint32_t requiredFlag=0) |
| virtual CmdHandlerCommanddef * | getCommandFromName (const std::string &cmd, uint32_t ignoredFlags=0) |
| virtual CmdHandlerCommanddef * | getCommandFromId (const uint32_t id, uint32_t ignoredFlags=0) |
| template<typename ID> | |
| void | registerCommand (const char *cmd, const ID cmdid, const char *help=nullptr, uint32_t flags=0) |
Public Member Functions inherited from MidiHandler | |
| MidiHandler () | |
| virtual | ~MidiHandler () |
| virtual void | midiRx (uint8_t itf, uint8_t packet[4]) |
| virtual void | programChange (uint8_t chan, uint8_t val) |
| virtual void | midiTick () |
| virtual void | otherPacket (uint8_t packet[4]) |
Static Public Member Functions | |
| static bool | isCreatable () |
Static Public Member Functions inherited from FFBoardMain | |
| static bool | isCreatable () |
Static Public Member Functions inherited from ChoosableClass | |
| static bool | isCreatable () |
Static Public Member Functions inherited from CommandHandler | |
| static void | logSerial (std::string string) |
| Send a log formatted sequence. | |
| static void | logSerialDebug (std::string string) |
| Send a log formatted sequence if debug is on. | |
| static bool | logsEnabled () |
| static void | setLogsEnabled (bool enabled) |
| static uint32_t | getClassIdFromName (const char *name) |
| static const char * | getClassNameFromId (const uint32_t id) |
| static CommandHandler * | getHandlerFromHandlerId (const uint16_t cmdhandlerID) |
| static CommandHandler * | getHandlerFromId (const uint16_t id, const uint8_t instance=0xFF) |
| static CommandHandler * | getHandlerFromClassName (const char *name, const uint8_t instance=0xFF) |
| static std::vector< CommandHandler * > | getHandlersFromClassName (const char *name) |
| static std::vector< CommandHandler * > | getHandlersFromId (const uint16_t id) |
| static bool | isInHandlerList (CommandHandler *handler) |
| static std::string | getAllHelpstrings () |
| static std::vector< CommandHandler * > & | getCommandHandlers () |
| template<typename TVal> | |
| static CommandStatus | handleGetSet (const ParsedCommand &cmd, std::vector< CommandReply > &replies, TVal &value) |
| template<typename TVal, class cls, class cls1> | |
| static CommandStatus | handleGetSetFunc (const ParsedCommand &cmd, std::vector< CommandReply > &replies, TVal &value, void(cls1::*setfunc)(TVal), cls *obj) |
| template<typename TVal, class cls, class cls1, class cls2> | |
| static CommandStatus | handleGetFuncSetFunc (const ParsedCommand &cmd, std::vector< CommandReply > &replies, TVal(cls1::*getfunc)(), void(cls2::*setfunc)(TVal), cls *obj) |
| template<typename TVal, class cls, class cls1> | |
| static CommandStatus | handleGetFuncSet (const ParsedCommand &cmd, std::vector< CommandReply > &replies, TVal &value, TVal(cls1::*getfunc)(), cls *obj) |
Public Attributes | |
| TIM_HandleTypeDef * | timer_update |
| std::unique_ptr< TMC4671 > | drv |
| uint32_t | movementrange = 0x3fff |
Public Attributes inherited from FFBoardMain | |
| std::unique_ptr< FFBoardMainCommandThread > | commandThread |
| std::unique_ptr< CDC_CommandInterface > | cdcCmdInterface = std::make_unique<CDC_CommandInterface>() |
| ErrorPrinter | errorPrinter |
| SystemCommands | systemCommands |
| System command handler. | |
| std::unique_ptr< UART_CommandInterface > | uartCmdInterface = std::make_unique<UART_CommandInterface>(115200) |
Static Public Attributes | |
| static ClassIdentifier | info |
Static Public Attributes inherited from FFBoardMain | |
| static ClassIdentifier | info ={.name = "Basic (Failsafe)" ,.id=0} |
Static Public Attributes inherited from ChoosableClass | |
| static ClassIdentifier | info |
Static Public Attributes inherited from CommandHandler | |
| static bool | logEnabled = true |
Static Public Attributes inherited from MidiHandler | |
| static uint8_t | buf [4] = {0} |
Private Types | |
| enum class | MidiMain_commands : uint32_t { power , range } |
Private Attributes | |
| volatile bool | updateflag = false |
| float | noteToFreq [128] = {0} |
| std::vector< MidiNote > | notes [16] |
| bool | active [16] = {false} |
| uint32_t | power = 2500 |
| const uint16_t | period = 100 |
| float | periodf = period / 1000000.0 |
Additional Inherited Members | |
Protected Member Functions inherited from CommandHandler | |
| void | setInstance (uint8_t instance) |
| virtual void | addCommandHandler () |
| virtual void | removeCommandHandler () |
Static Protected Member Functions inherited from CommandHandler | |
| static std::vector< uint16_t > & | getCommandHandlerIds () |
Protected Attributes inherited from FFBoardMain | |
| std::unique_ptr< USBdevice > | usbdev |
Protected Attributes inherited from ChoosableClass | |
| uint16_t | selectionId |
| Should only be written by ClassChooser during creation. | |
Protected Attributes inherited from CommandHandler | |
| bool | commandsEnabled = true |
| std::vector< CmdHandlerCommanddef > | registeredCommands |
| CmdHandlerInfo | cmdHandlerInfo |
Protected Attributes inherited from MidiHandler | |
| bool | sysexState = false |
Static Protected Attributes inherited from FFBoardMain | |
| static char | cdcbuf [] |
Private Member Functions inherited from TimerHandler | |
| TimerHandler () | |
| virtual | ~TimerHandler () |
Static Private Attributes inherited from TimerHandler | |
| static std::vector< TimerHandler * > | timerHandlers |
Definition at line 29 of file MidiMain.h.
|
strongprivate |
| Enumerator | |
|---|---|
| power | |
| range | |
Definition at line 31 of file MidiMain.h.
| MidiMain::MidiMain | ( | ) |
Definition at line 28 of file MidiMain.cpp.
|
virtual |
Definition at line 73 of file MidiMain.cpp.
|
virtual |
| [in] | cmd | The parsed command to be executed. |
| [out] | replies | A vector to return one or multiple reply objects into. Replies to the interface will be generated based on the reply objects. A string reply may not contain start, end and separation markers: [,],| Other characters are allowed. |
Reimplemented from FFBoardMain.
Definition at line 156 of file MidiMain.cpp.
|
virtual |
Reimplemented from MidiHandler.
Definition at line 143 of file MidiMain.cpp.
|
inlinevirtual |
Returns a description of this class
Reimplemented from FFBoardMain.
Definition at line 55 of file MidiMain.h.
|
virtual |
Reimplemented from FFBoardMain.
Definition at line 23 of file MidiMain.cpp.
|
inlinestatic |
Definition at line 43 of file MidiMain.h.
|
virtual |
Implements MidiHandler.
Definition at line 133 of file MidiMain.cpp.
|
virtual |
Implements MidiHandler.
Definition at line 122 of file MidiMain.cpp.
|
virtual |
Reimplemented from MidiHandler.
Definition at line 148 of file MidiMain.cpp.
| void MidiMain::play | ( | ) |
Definition at line 91 of file MidiMain.cpp.
|
virtual |
Reimplemented from TimerHandler.
Definition at line 85 of file MidiMain.cpp.
|
virtual |
Called in the default thread with no delay Can be reimplemented by custom main classes but should not block
Reimplemented from FFBoardMain.
Definition at line 78 of file MidiMain.cpp.
|
virtual |
Called during the startup Should initialize a USBdevice and call registerUsb()
Reimplemented from FFBoardMain.
Definition at line 175 of file MidiMain.cpp.
|
private |
Definition at line 70 of file MidiMain.h.
| std::unique_ptr<TMC4671> MidiMain::drv |
Definition at line 61 of file MidiMain.h.
|
static |
Definition at line 17 of file MidiMain.h.
| uint32_t MidiMain::movementrange = 0x3fff |
Definition at line 63 of file MidiMain.h.
|
private |
Definition at line 69 of file MidiMain.h.
|
private |
Definition at line 68 of file MidiMain.h.
|
private |
Definition at line 73 of file MidiMain.h.
|
private |
Definition at line 74 of file MidiMain.h.
|
private |
Definition at line 71 of file MidiMain.h.
| TIM_HandleTypeDef* MidiMain::timer_update |
Definition at line 39 of file MidiMain.h.
|
private |
Definition at line 67 of file MidiMain.h.