resonance 1.0.1
Loading...
Searching...
No Matches
controllerconfig.h
Go to the documentation of this file.
1#pragma once
2
3#include <vector>
4
5#include "stream/ibstream.h"
6#include "stream/obstream.h"
7
25public:
42
50
65 void SetButton(int nRow, int nButtonIndex);
66
77 int ActionCode(int nSlot);
78
89 void Load(IBStream &stream);
90
99 int GetButtonIndex(int nRow);
100
109 int ButtonCode(int nButtonIndex);
110
121 int ButtonIndex(int nCode);
122
131 int ActionSlot(int nRow);
132
143 int RiffIndex(int nSlot);
144
152 void Save(OBStream &stream);
153
163
165 std::vector<int> mButtons;
166};
void Load(IBStream &stream)
Read the mapping back.
int RiffIndex(int nSlot)
Report which riff a pitch-riff slot belongs to.
int ActionSlot(int nRow)
Translate a configuration row into the slot it controls.
int ButtonCode(int nButtonIndex)
Translate a button index into its stored button code.
ControllerConfig()
Start with the default mapping.
std::vector< int > mButtons
The button code of each slot.
Definition controllerconfig.h:165
ControllerConfig & operator=(const ControllerConfig &other)
Copy another mapping.
Slot
The action slots, in mButtons order.
Definition controllerconfig.h:27
@ kSlotRotateLeft
Definition controllerconfig.h:29
@ kSlotPitchRiffFirst
Definition controllerconfig.h:32
@ kSlotAxisX
Definition controllerconfig.h:36
@ kSlotAxisFX
Definition controllerconfig.h:34
@ kSlotLoop
Definition controllerconfig.h:31
@ kSlotAxisRegister
Definition controllerconfig.h:35
@ kSlotButtonPow
Definition controllerconfig.h:38
@ kSlotRotateRight
Definition controllerconfig.h:28
@ kSlotErase
Definition controllerconfig.h:33
@ kSlotPlayback
Definition controllerconfig.h:39
@ kSlotAdvance
Definition controllerconfig.h:30
@ kSlotAxisY
Definition controllerconfig.h:37
@ kSlotCount
Definition controllerconfig.h:40
int ActionCode(int nSlot)
Report the four-character action code of one slot.
void SetButton(int nRow, int nButtonIndex)
Assign one button, by index, to the action one configuration row controls.
int ButtonIndex(int nCode)
Translate a stored button code into its button index.
void Save(OBStream &stream)
Write the record version 4, the slot count, and every button code.
int GetButtonIndex(int nRow)
Report the button index one configuration row is mapped to.
Input half of the byte stream interface.
Definition ibstream.h:36
Output half of the byte stream interface.
Definition obstream.h:25