Control Zooming disabled.

This commit is contained in:
Robin E. R. Davies
2025-07-19 13:26:53 -04:00
parent 6d7f79c6af
commit 71fc534a78
14 changed files with 109 additions and 33 deletions
+1
View File
@@ -537,6 +537,7 @@ JSON_MAP_BEGIN(Pedalboard)
JSON_MAP_REFERENCE(Pedalboard,nextInstanceId)
JSON_MAP_REFERENCE(Pedalboard,snapshots)
JSON_MAP_REFERENCE(Pedalboard,selectedSnapshot)
JSON_MAP_REFERENCE(Pedalboard,selectedPlugin)
JSON_MAP_END()
JSON_MAP_BEGIN(SnapshotValue)
+3
View File
@@ -197,6 +197,8 @@ class Pedalboard {
std::vector<std::shared_ptr<Snapshot>> snapshots_;
int64_t selectedSnapshot_ = -1;
int64_t selectedPlugin_ = -1;
public:
// deep copy, breaking shared pointers.
Pedalboard DeepCopy();
@@ -224,6 +226,7 @@ public:
GETTER_SETTER(output_volume_db)
GETTER_SETTER_VEC(snapshots)
GETTER_SETTER(selectedSnapshot)
GETTER_SETTER(selectedPlugin)
DECLARE_JSON_MAP(Pedalboard);
+12
View File
@@ -2595,6 +2595,16 @@ std::shared_ptr<Lv2Pedalboard> PiPedalModel::GetLv2Pedalboard()
}
return lv2Pedalboard;
}
void PiPedalModel::SetSelectedPedalboardPlugin(uint64_t clientId, uint64_t pedalboardId)
{
// Thinking on this:
// 1) do NOT mark the pedalboard as changed. This shouldn't set a change flag.
// 2) do NOT broadcast the change. Whoever set it last controls what happens when the plugin is reloaded. Meh.
// 3) Clients must be able to save a non-changed pedalboard.
pedalboard.selectedPlugin(pedalboardId);
}
bool PiPedalModel::LoadCurrentPedalboard()
{
if (previousPedalboardLoaded && pedalboard.IsStructureIdentical(previousPedalboard))
@@ -3075,3 +3085,5 @@ bool PiPedalModel::HasTone3000Auth() const
return storage.GetTone3000Auth() != "";
}
+2
View File
@@ -489,6 +489,8 @@ namespace pipedal
void SetTone3000Auth(const std::string &apiKey);
bool HasTone3000Auth() const;
void SetSelectedPedalboardPlugin(uint64_t clientId, uint64_t pedalboardId);
};
} // namespace pipedal.
+21
View File
@@ -472,6 +472,21 @@ JSON_MAP_REFERENCE(SetSnapshotsBody, snapshots)
JSON_MAP_REFERENCE(SetSnapshotsBody, selectedSnapshot)
JSON_MAP_END()
class SetSelectedPedalboardPluginBody
{
public:
uint64_t clientId_;
uint64_t pluginInstanceId_;
DECLARE_JSON_MAP(SetSelectedPedalboardPluginBody);
};
JSON_MAP_BEGIN(SetSelectedPedalboardPluginBody)
JSON_MAP_REFERENCE(SetSelectedPedalboardPluginBody, clientId)
JSON_MAP_REFERENCE(SetSelectedPedalboardPluginBody, pluginInstanceId)
JSON_MAP_END()
class SnapshotModifiedBody
{
public:
@@ -1300,6 +1315,12 @@ public:
int64_t result = this->model.SaveCurrentPresetAs(this->clientId, body.name_, body.saveAfterInstanceId_);
Reply(replyTo, "saveCurrentPresetsAs", result);
}
else if (message == "setSelectedPedalboardPlugin")
{
SetSelectedPedalboardPluginBody body;
pReader->read(&body);
this->model.SetSelectedPedalboardPlugin(body.clientId_,body.pluginInstanceId_);
}
else if (message == "savePluginPresetAs")
{
SavePluginPresetAsBody body;