From 89a6830e1eb1d91d4f49e84c6de949a877b014d8 Mon Sep 17 00:00:00 2001 From: Jean Pierre Cimalando Date: Mon, 8 Feb 2021 20:07:43 +0100 Subject: [PATCH] Add controller edit IDs (not used yet) --- plugins/editor/src/editor/EditIds.h | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/plugins/editor/src/editor/EditIds.h b/plugins/editor/src/editor/EditIds.h index 1edec8b4..d9b43957 100644 --- a/plugins/editor/src/editor/EditIds.h +++ b/plugins/editor/src/editor/EditIds.h @@ -5,6 +5,7 @@ // If not, contact the sfizz maintainers at https://github.com/sfztools/sfizz #pragma once +#include "sfizz/Config.h" #include enum class EditId : int { @@ -19,6 +20,10 @@ enum class EditId : int { StretchTuning, CanEditUserFilesDir, UserFilesDir, + // + Controller0, + ControllerLast = Controller0 + sfz::config::numCCs - 1, + // UINumCurves, UINumMasters, UINumGroups, @@ -38,3 +43,17 @@ struct EditRange { float extent() const noexcept { return max - min; } static EditRange get(EditId id); }; + +inline EditId editIdForCC(int cc) +{ + return EditId(int(EditId::Controller0) + cc); +} +inline int ccForEditId(EditId id) +{ + return int(id) - int(EditId::Controller0); +} +inline bool editIdIsCC(EditId id) +{ + return int(id) >= int(EditId::Controller0) && + int(id) <= int(EditId::ControllerLast); +}