Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UI misc #1156

Merged
merged 4 commits into from
Apr 13, 2023
Merged

UI misc #1156

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions plugins/common/plugin/InstrumentDescription.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ std::string getDescriptionBlob(sfizz_synth_t* handle)
synth.sendMessage(*client, 0, "/num_samples", "", nullptr);
synth.sendMessage(*client, 0, "/root_path", "", nullptr);
synth.sendMessage(*client, 0, "/image", "", nullptr);
synth.sendMessage(*client, 0, "/image_controls", "", nullptr);
synth.sendMessage(*client, 0, "/key/slots", "", nullptr);
synth.sendMessage(*client, 0, "/sw/last/slots", "", nullptr);
synth.sendMessage(*client, 0, "/cc/slots", "", nullptr);
Expand Down Expand Up @@ -149,6 +150,8 @@ InstrumentDescription parseDescriptionBlob(absl::string_view blob)
desc.rootPath = args[0].s;
else if (Messages::matchOSC("/image", path, indices) && !strcmp(sig, "s"))
desc.image = args[0].s;
else if (Messages::matchOSC("/image_controls", path, indices) && !strcmp(sig, "s"))
desc.image_controls = args[0].s;
else if (Messages::matchOSC("/key/slots", path, indices) && !strcmp(sig, "b"))
copyArgToBitSpan(args[0], desc.keyUsed.span());
else if (Messages::matchOSC("/sw/last/slots", path, indices) && !strcmp(sig, "b"))
Expand Down Expand Up @@ -187,6 +190,7 @@ std::ostream& operator<<(std::ostream& os, const InstrumentDescription& desc)

os << " root_path: " << desc.rootPath << "\n";
os << " image: " << desc.image << "\n";
os << " image_controls: " << desc.image_controls << "\n";

os << " keys:\n";
for (unsigned i = 0; i < 128; ++i) {
Expand Down
1 change: 1 addition & 0 deletions plugins/common/plugin/InstrumentDescription.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ struct InstrumentDescription {
uint32_t numSamples {};
std::string rootPath;
std::string image;
std::string image_controls;
BitArray<128> keyUsed {};
BitArray<128> keyswitchUsed {};
BitArray<128> sustainOrSostenuto {};
Expand Down
15 changes: 12 additions & 3 deletions plugins/editor/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,12 @@ set(EDITOR_RESOURCES
Fonts/Roboto-Regular.ttf
Themes/Default/theme.xml
Themes/Dark/theme.xml
PARENT_SCOPE)

PARENT_SCOPE
)
set(UI_RESOURCES
resources/Themes/Default/theme.xml
resources/Themes/Dark/theme.xml
)
function(copy_editor_resources TARGET SOURCE_DIR DESTINATION_DIR)
set(_deps)
foreach(res ${EDITOR_RESOURCES})
Expand All @@ -51,6 +55,7 @@ endfunction()

set(UI_FILES layout/main.fl layout/about.fl)
source_group("Editor UI" FILES ${UI_FILES})
source_group("Editor Resources" FILES ${UI_RESOURCES})

# editor
add_library(sfizz_editor STATIC EXCLUDE_FROM_ALL
Expand All @@ -63,6 +68,8 @@ add_library(sfizz_editor STATIC EXCLUDE_FROM_ALL
src/editor/EditorController.h
src/editor/GUIComponents.h
src/editor/GUIComponents.cpp
src/editor/GUIDefs.h
src/editor/GUIDefs.cpp
src/editor/GUIHelpers.h
src/editor/GUIHelpers.cpp
src/editor/GUIPiano.h
Expand All @@ -83,7 +90,9 @@ add_library(sfizz_editor STATIC EXCLUDE_FROM_ALL
src/editor/layout/about.hpp
src/editor/utility/vstgui_after.h
src/editor/utility/vstgui_before.h
${UI_FILES})
${UI_FILES}
${UI_RESOURCES}
)
add_library(sfizz::editor ALIAS sfizz_editor)
target_include_directories(sfizz_editor PUBLIC "src")
target_link_libraries(sfizz_editor PUBLIC sfizz::messaging sfizz::plugins-common)
Expand Down
Loading