Browse Source

Update for async API breaking change, adding default filename

Signed-off-by: falkTX <falktx@falktx.com>
tags/22.07
falkTX 3 months ago
parent
commit
4c326f5f39
23 changed files with 96 additions and 34 deletions
  1. +1
    -1
      Makefile
  2. +1
    -1
      carla
  3. +1
    -1
      dpf
  4. +1
    -1
      include/common.hpp
  5. +1
    -1
      plugins/AmalgamatedHarmonics
  6. +1
    -1
      plugins/Bidoo
  7. +1
    -1
      plugins/Cardinal/src/AudioFile.cpp
  8. +1
    -1
      plugins/Cardinal/src/TextEditor.cpp
  9. +1
    -1
      plugins/ChowDSP
  10. +1
    -1
      plugins/Fundamental
  11. +1
    -1
      plugins/LilacLoop
  12. +1
    -1
      plugins/LomasModules
  13. +51
    -8
      plugins/Makefile
  14. +1
    -1
      plugins/MindMeldModular
  15. +1
    -1
      plugins/Prism
  16. +1
    -1
      plugins/ValleyAudio
  17. +1
    -1
      plugins/cf
  18. +1
    -1
      plugins/repelzen
  19. +1
    -1
      plugins/voxglitch
  20. +6
    -3
      src/CardinalCommon.cpp
  21. +9
    -3
      src/CardinalModuleWidget.cpp
  22. +11
    -0
      src/CardinalUI.cpp
  23. +1
    -2
      src/Makefile.cardinal.mk

+ 1
- 1
Makefile View File

@@ -64,7 +64,7 @@ DGL_EXTRA_ARGS = \
NVG_DISABLE_SKIPPING_WHITESPACE=true \
NVG_FONT_TEXTURE_FLAGS=NVG_IMAGE_NEAREST \
USE_NANOVG_FBO=true \
ASM_EXCEPTIONS=true \
WASM_EXCEPTIONS=true \
WINDOWS_ICON_ID=401

# --------------------------------------------------------------


+ 1
- 1
carla

@@ -1 +1 @@
Subproject commit 1ee091f4cc42fcf25d5064e6b9ebd569038684fe
Subproject commit 93d3fff123f7630be1a28912c029b9775ffd0feb

+ 1
- 1
dpf

@@ -1 +1 @@
Subproject commit 5e77ebb317d5fd7209386ce8eb367682896d02b2
Subproject commit ee94ba0caeabe25e2ecff1039d321e8edb5acedd

+ 1
- 1
include/common.hpp View File

@@ -68,7 +68,7 @@

// opens a file browser, startDir and title can be null
// action is always triggered on close (path can be null), must be freed if not null
void async_dialog_filebrowser(bool saving, const char* startDir, const char* title,
void async_dialog_filebrowser(bool saving, const char* defaultName, const char* startDir, const char* title,
std::function<void(char* path)> action);

// opens a message dialog with only an "ok" button


+ 1
- 1
plugins/AmalgamatedHarmonics

@@ -1 +1 @@
Subproject commit ab362486d556255f64a35ee3f71a3da87fe94ce8
Subproject commit 97700c06af7df4d8fcf173ae3670b7907a682627

+ 1
- 1
plugins/Bidoo

@@ -1 +1 @@
Subproject commit 9440a7f2bcd6a3f8678b013d2274d2061088833b
Subproject commit 7579f13bffc11548c857393408f3c2e030ee2483

+ 1
- 1
plugins/Cardinal/src/AudioFile.cpp View File

@@ -662,7 +662,7 @@ struct AudioFileWidget : ModuleWidgetWithSideScrews<23> {
void onAction(const event::Action&) override
{
CarlaInternalPluginModule* const module = this->module;
async_dialog_filebrowser(false, nullptr, text.c_str(), [module](char* path)
async_dialog_filebrowser(false, nullptr, nullptr, text.c_str(), [module](char* path)
{
if (path == nullptr)
return;


+ 1
- 1
plugins/Cardinal/src/TextEditor.cpp View File

@@ -236,7 +236,7 @@ struct TextEditorLoadFileItem : MenuItem {
TextEditorModule* const module = this->module;;
WeakPtr<ImGuiTextEditor> widget = this->widget;

async_dialog_filebrowser(false, nullptr, text.c_str(), [module, widget](char* path)
async_dialog_filebrowser(false, nullptr, nullptr, text.c_str(), [module, widget](char* path)
{
if (path)
{


+ 1
- 1
plugins/ChowDSP

@@ -1 +1 @@
Subproject commit 58d4679ef9678a2d5e58a7f05b9a20da3efa0329
Subproject commit 871f712f3eb95ada1c34bf3d8170690eb4aec8d0

+ 1
- 1
plugins/Fundamental

@@ -1 +1 @@
Subproject commit 19c706bded88a79ad348bf5abe837ec56d4c0e5a
Subproject commit 9ac0cdb93938c3f01aba58ec01fdd01257abf353

+ 1
- 1
plugins/LilacLoop

@@ -1 +1 @@
Subproject commit bc9d468cccb0031e74166a5fc53479fcdc1c9f95
Subproject commit cf9bb5cfa5fd41ecfc9976bb106c2f4a7667c9d7

+ 1
- 1
plugins/LomasModules

@@ -1 +1 @@
Subproject commit a4b802ae1ac12415cbeaeaef5f949dd8d38dfc5c
Subproject commit b714cdb0c662503bc6cf60c06765b426a4caa17f

+ 51
- 8
plugins/Makefile View File

@@ -10,6 +10,7 @@
DISTRHO_NAMESPACE = CardinalDISTRHO
DGL_NAMESPACE = CardinalDGL
USE_NANOVG_FBO = true
WASM_EXCEPTIONS = true
include ../dpf/Makefile.base.mk

# --------------------------------------------------------------
@@ -25,8 +26,8 @@ endif
# List of drwav functions, used in several modules

DRWAV = drwav
DRWAV += drwav__on_seek
DRWAV += drwav__on_read
DRWAV += drwav__on_seek
DRWAV += drwav__read_and_close_f32
DRWAV += drwav__read_and_close_s16
DRWAV += drwav__read_and_close_s32
@@ -34,6 +35,13 @@ DRWAV += drwav_alaw_to_f32
DRWAV += drwav_alaw_to_s16
DRWAV += drwav_alaw_to_s16
DRWAV += drwav_alaw_to_s32
DRWAV += drwav_bytes_to_f32
DRWAV += drwav_bytes_to_s16
DRWAV += drwav_bytes_to_s32
DRWAV += drwav_bytes_to_s64
DRWAV += drwav_bytes_to_u16
DRWAV += drwav_bytes_to_u32
DRWAV += drwav_bytes_to_u64
DRWAV += drwav_close
DRWAV += drwav_close
DRWAV += drwav_container
@@ -46,29 +54,47 @@ DRWAV += drwav_f64_to_f32
DRWAV += drwav_f64_to_s16
DRWAV += drwav_f64_to_s16
DRWAV += drwav_f64_to_s32
DRWAV += drwav_fmt_get_format
DRWAV += drwav_fopen
DRWAV += drwav_fourcc_equal
DRWAV += drwav_free
DRWAV += drwav_get_cursor_in_pcm_frames
DRWAV += drwav_get_length_in_pcm_frames
DRWAV += drwav_guid_equal
DRWAV += drwav_init
DRWAV += drwav_init_ex
DRWAV += drwav_init_file
DRWAV += drwav_init_file_ex
DRWAV += drwav_init_file_ex_w
DRWAV += drwav_init_file_w
DRWAV += drwav_init_file_with_metadata
DRWAV += drwav_init_file_with_metadata_w
DRWAV += drwav_init_file_write
DRWAV += drwav_init_file_write
DRWAV += drwav_init_file_write__internal
DRWAV += drwav_init_file_write__internal
DRWAV += drwav_init_file_write_sequential
DRWAV += drwav_init_file_write_sequential
DRWAV += drwav_init_file_write_sequential_pcm_frames
DRWAV += drwav_init_file_write_sequential_pcm_frames_w
DRWAV += drwav_init_file_write_sequential_w
DRWAV += drwav_init_file_write_w
DRWAV += drwav_init_memory
DRWAV += drwav_init_memory_ex
DRWAV += drwav_init_memory_with_metadata
DRWAV += drwav_init_memory_write
DRWAV += drwav_init_memory_write
DRWAV += drwav_init_memory_write__internal
DRWAV += drwav_init_memory_write__internal
DRWAV += drwav_init_memory_write_sequential
DRWAV += drwav_init_memory_write_sequential_pcm_frames
DRWAV += drwav_init_with_metadata
DRWAV += drwav_init_write
DRWAV += drwav_init_write
DRWAV += drwav_init_write__internal
DRWAV += drwav_init_write_sequential
DRWAV += drwav_init_write_sequential_pcm_frames
DRWAV += drwav_init_write_with_metadata
DRWAV += drwav_mulaw_to_f32
DRWAV += drwav_mulaw_to_s16
DRWAV += drwav_mulaw_to_s16
@@ -90,8 +116,11 @@ DRWAV += drwav_open_ex
DRWAV += drwav_open_file
DRWAV += drwav_open_file_and_read_f32
DRWAV += drwav_open_file_and_read_pcm_frames_f32
DRWAV += drwav_open_file_and_read_pcm_frames_f32_w
DRWAV += drwav_open_file_and_read_pcm_frames_s16
DRWAV += drwav_open_file_and_read_pcm_frames_s16_w
DRWAV += drwav_open_file_and_read_pcm_frames_s32
DRWAV += drwav_open_file_and_read_pcm_frames_s32_w
DRWAV += drwav_open_file_and_read_s16
DRWAV += drwav_open_file_and_read_s32
DRWAV += drwav_open_file_ex
@@ -133,9 +162,17 @@ DRWAV += drwav_read_f32__mulaw
DRWAV += drwav_read_f32__pcm
DRWAV += drwav_read_f32__pcm
DRWAV += drwav_read_pcm_frames
DRWAV += drwav_read_pcm_frames_be
DRWAV += drwav_read_pcm_frames_f32
DRWAV += drwav_read_pcm_frames_f32be
DRWAV += drwav_read_pcm_frames_f32le
DRWAV += drwav_read_pcm_frames_le
DRWAV += drwav_read_pcm_frames_s16
DRWAV += drwav_read_pcm_frames_s16be
DRWAV += drwav_read_pcm_frames_s16le
DRWAV += drwav_read_pcm_frames_s32
DRWAV += drwav_read_pcm_frames_s32be
DRWAV += drwav_read_pcm_frames_s32le
DRWAV += drwav_read_raw
DRWAV += drwav_read_s16
DRWAV += drwav_read_s16__alaw
@@ -173,14 +210,20 @@ DRWAV += drwav_seek_to_sample
DRWAV += drwav_seek_to_sample
DRWAV += drwav_smpl
DRWAV += drwav_smpl_loop
DRWAV += drwav_take_ownership_of_metadata
DRWAV += drwav_target_write_size_bytes
DRWAV += drwav_u8_to_f32
DRWAV += drwav_u8_to_s16
DRWAV += drwav_u8_to_s16
DRWAV += drwav_u8_to_s32
DRWAV += drwav_uninit
DRWAV += drwav_version
DRWAV += drwav_version_string
DRWAV += drwav_write
DRWAV += drwav_write
DRWAV += drwav_write_pcm_frames
DRWAV += drwav_write_pcm_frames_be
DRWAV += drwav_write_pcm_frames_le
DRWAV += drwav_write_raw

# --------------------------------------------------------------
@@ -1496,13 +1539,6 @@ $(BUILD_DIR)/FehlerFabrik/%.cpp.o: FehlerFabrik/%.cpp
$(foreach m,$(FEHLERFABRIK_CUSTOM),$(call custom_module_names,$(m),FehlerFabrik)) \
-DpluginInstance=pluginInstance__FehlerFabrik

$(BUILD_DIR)/Fundamental/%.c.o: Fundamental/%.c
-@mkdir -p "$(shell dirname $(BUILD_DIR)/$<)"
@echo "Compiling $<"
$(SILENT)$(CC) $< $(BUILD_C_FLAGS) -c -o $@ \
$(foreach m,$(FUNDAMENTAL_CUSTOM),$(call custom_module_names,$(m),Fundamental)) \
-DpluginInstance=pluginInstance__Fundamental

$(BUILD_DIR)/forsitan-modulare/%.cpp.o: forsitan-modulare/%.cpp
-@mkdir -p "$(shell dirname $(BUILD_DIR)/$<)"
@echo "Compiling $<"
@@ -1510,6 +1546,13 @@ $(BUILD_DIR)/forsitan-modulare/%.cpp.o: forsitan-modulare/%.cpp
$(foreach m,$(GLUETHEGIANT_CUSTOM),$(call custom_module_names,$(m),forsitan)) \
-DpluginInstance=pluginInstance__forsitan

$(BUILD_DIR)/Fundamental/%.c.o: Fundamental/%.c
-@mkdir -p "$(shell dirname $(BUILD_DIR)/$<)"
@echo "Compiling $<"
$(SILENT)$(CC) $< $(BUILD_C_FLAGS) -c -o $@ \
$(foreach m,$(FUNDAMENTAL_CUSTOM),$(call custom_module_names,$(m),Fundamental)) \
-DpluginInstance=pluginInstance__Fundamental

$(BUILD_DIR)/Fundamental/%.cpp.o: Fundamental/%.cpp
-@mkdir -p "$(shell dirname $(BUILD_DIR)/$<)"
@echo "Compiling $<"


+ 1
- 1
plugins/MindMeldModular

@@ -1 +1 @@
Subproject commit 12e235b969530e9ba29b767265483fe6a770e9d4
Subproject commit cd71f9a4c4a23bdec5666cc78c5bc8b3f936d175

+ 1
- 1
plugins/Prism

@@ -1 +1 @@
Subproject commit 12db31e801907bf60f70d27fa133e72903415304
Subproject commit 4d95ace8b073e9e8e30b8671ecdb04101d943905

+ 1
- 1
plugins/ValleyAudio

@@ -1 +1 @@
Subproject commit 5abc2bd7d249aa386aeddd951db39d02c8b0ddc0
Subproject commit 4507aa7e1b0efc68e33e0ce1530ebd8ac7b7763c

+ 1
- 1
plugins/cf

@@ -1 +1 @@
Subproject commit 16470fb91bc14a7bb1aa8e646b6461af82f81275
Subproject commit b6c4a66ffc153d78c7efa00fa886657eb182b15d

+ 1
- 1
plugins/repelzen

@@ -1 +1 @@
Subproject commit 78b1765eb9ccb9e4e2a1967ee02f4126b1846806
Subproject commit 428f76c3509e4d71489daf075c48ae4b995a0786

+ 1
- 1
plugins/voxglitch

@@ -1 +1 @@
Subproject commit 49b6b3cc688fd6a5a6be2f73c4841a543234e21c
Subproject commit e856cfb4dbc255165d22294e80e13957241d2c80

+ 6
- 3
src/CardinalCommon.cpp View File

@@ -147,8 +147,8 @@ void loadDialog()
DISTRHO_SAFE_ASSERT_RETURN(ui != nullptr,);

DISTRHO_NAMESPACE::FileBrowserOptions opts;
opts.startDir = dir.c_str();
opts.saving = ui->saving = false;
opts.startDir = dir.c_str();
opts.title = "Open patch";
ui->openFileBrowser(opts);
});
@@ -177,7 +177,7 @@ void loadSelectionDialog()
std::string selectionDir = asset::user("selections");
system::createDirectories(selectionDir);

async_dialog_filebrowser(false, selectionDir.c_str(), "Import selection", [w](char* pathC) {
async_dialog_filebrowser(false, nullptr, selectionDir.c_str(), "Import selection", [w](char* pathC) {
if (!pathC) {
// No path selected
return;
@@ -250,8 +250,9 @@ static void saveAsDialog(const bool uncompressed)
DISTRHO_SAFE_ASSERT_RETURN(ui != nullptr,);

DISTRHO_NAMESPACE::FileBrowserOptions opts;
opts.startDir = dir.c_str();
opts.saving = ui->saving = true;
opts.defaultName = "patch.vcv";
opts.startDir = dir.c_str();
opts.title = "Save patch";
ui->savingUncompressed = uncompressed;
ui->openFileBrowser(opts);
@@ -286,6 +287,7 @@ void openBrowser(const std::string& url)
}

void async_dialog_filebrowser(const bool saving,
const char* const defaultName,
const char* const startDir,
const char* const title,
const std::function<void(char* path)> action)
@@ -302,6 +304,7 @@ void async_dialog_filebrowser(const bool saving,

DISTRHO_NAMESPACE::FileBrowserOptions opts;
opts.saving = saving;
opts.defaultName = defaultName;
opts.startDir = startDir;
opts.title = title;



+ 9
- 3
src/CardinalModuleWidget.cpp View File

@@ -65,7 +65,7 @@ static void CardinalModuleWidget__loadDialog(ModuleWidget* const w)

WeakPtr<ModuleWidget> weakThis = w;

async_dialog_filebrowser(false, presetDir.c_str(), "Load preset", [=](char* pathC) {
async_dialog_filebrowser(false, nullptr, presetDir.c_str(), "Load preset", [=](char* pathC) {
// Delete directories if empty
DEFER({
try {
@@ -100,7 +100,7 @@ void CardinalModuleWidget__saveDialog(ModuleWidget* const w)

WeakPtr<ModuleWidget> weakThis = w;

async_dialog_filebrowser(true, presetDir.c_str(), "Save preset", [=](char* pathC) {
async_dialog_filebrowser(true, "preset.vcvm", presetDir.c_str(), "Save preset", [=](char* pathC) {
// Delete directories if empty
DEFER({
try {
@@ -281,7 +281,13 @@ static void CardinalModuleWidget__saveSelectionDialog(RackWidget* const w)
std::string selectionDir = asset::user("selections");
system::createDirectories(selectionDir);

async_dialog_filebrowser(true, selectionDir.c_str(), "Save selection as", [w](char* pathC) {
async_dialog_filebrowser(true, "selection.vcvs", selectionDir.c_str(),
#ifdef DISTRHO_OS_WASM
"Save selection",
#else
"Save selection as...",
#endif
[w](char* pathC) {
if (!pathC) {
// No path selected
return;


+ 11
- 0
src/CardinalUI.cpp View File

@@ -182,6 +182,17 @@ public:
}
}

#ifdef DISTRHO_OS_WASM
asyncDialog::create("Welcome!\n"
"This is a special web-assembly version of Cardinal, "
"allowing you to enjoy eurorack-style modules directly in your browser.\n"
"\n"
"This is still very much a work in progress, "
"minor issues and occasional crashes are expected.\n"
"\n"
"Proceed with caution and have fun!");
#endif

context->window->step();

rack::contextSet(nullptr);


+ 1
- 2
src/Makefile.cardinal.mk View File

@@ -208,9 +208,8 @@ ifeq ($(WASM),true)
LINK_FLAGS += --preload-file=./jsfx
LINK_FLAGS += --preload-file=./resources
LINK_FLAGS += -sALLOW_MEMORY_GROWTH
LINK_FLAGS += -sEXPORTED_RUNTIME_METHODS=FS,cwrap
LINK_FLAGS += -sINITIAL_MEMORY=64Mb
# LINK_FLAGS += -sLZ4=1
LINK_FLAGS += -sLZ4=1
LINK_FLAGS += --shell-file=../emscripten/shell.html
else ifeq ($(HAIKU),true)
LINK_FLAGS += -lpthread


Loading…
Cancel
Save