mirror of
https://github.com/WarmUpTill/SceneSwitcher.git
synced 2026-09-12 03:26:08 -05:00
Add support to resolve variables on action queue add
This commit is contained in:
@@ -48,6 +48,21 @@ std::string MacroActionMidi::GetShortDesc() const
|
||||
return _device.Name();
|
||||
}
|
||||
|
||||
void MacroActionMidi::ResolveVariablesToFixedValues()
|
||||
{
|
||||
_message.ResolveVariables();
|
||||
}
|
||||
|
||||
std::shared_ptr<MacroAction> MacroActionMidi::Create(Macro *m)
|
||||
{
|
||||
return std::make_shared<MacroActionMidi>(m);
|
||||
}
|
||||
|
||||
std::shared_ptr<MacroAction> MacroActionMidi::Copy() const
|
||||
{
|
||||
return std::make_shared<MacroActionMidi>(*this);
|
||||
}
|
||||
|
||||
MacroActionMidiEdit::MacroActionMidiEdit(
|
||||
QWidget *parent, std::shared_ptr<MacroActionMidi> entryData)
|
||||
: QWidget(parent),
|
||||
|
||||
@@ -15,11 +15,10 @@ public:
|
||||
bool Save(obs_data_t *obj) const;
|
||||
bool Load(obs_data_t *obj);
|
||||
std::string GetShortDesc() const;
|
||||
void ResolveVariablesToFixedValues();
|
||||
std::string GetId() const { return id; };
|
||||
static std::shared_ptr<MacroAction> Create(Macro *m)
|
||||
{
|
||||
return std::make_shared<MacroActionMidi>(m);
|
||||
}
|
||||
static std::shared_ptr<MacroAction> Create(Macro *m);
|
||||
std::shared_ptr<MacroAction> Copy() const;
|
||||
|
||||
MidiDevice _device;
|
||||
MidiMessage _message;
|
||||
|
||||
@@ -91,6 +91,13 @@ std::string MidiMessage::ToString() const
|
||||
" Value: " + std::to_string(_value);
|
||||
}
|
||||
|
||||
void MidiMessage::ResolveVariables()
|
||||
{
|
||||
_channel.ResolveVariables();
|
||||
_note.ResolveVariables();
|
||||
_value.ResolveVariables();
|
||||
}
|
||||
|
||||
std::string MidiMessage::ToString(const libremidi::message &msg)
|
||||
{
|
||||
return "Type: " + GetMidiType(msg) +
|
||||
|
||||
@@ -38,6 +38,8 @@ public:
|
||||
int Note() const { return _note; }
|
||||
int Value() const { return _value; }
|
||||
|
||||
void ResolveVariables();
|
||||
|
||||
private:
|
||||
// Values which don't appear for channel, note, and value will be used
|
||||
// to indicate whether this part of the message is optional and can be
|
||||
|
||||
Reference in New Issue
Block a user