Skip to content

Commit

Permalink
An experiment with porting an importer from ConvertWithMOSS (#1174)
Browse files Browse the repository at this point in the history
This is an experiment which we may not finish for 1.0 with
porting an importer from ConvertWithMoss, in this case the
EXS importer. It kinda shows the approach but it doesn't
work very well right now since

1. I don't pick apart the structure carefully and
2. Logic has expanded the format ahead of CWM some and
3. It's just a lot of fiddly work

So I'll commit this and perhaps nuke it from the code base
later ,but I didn't want to abandon the couple of hours of work
so merge it for now.
  • Loading branch information
baconpaul authored Aug 24, 2024
1 parent 29c8142 commit cb8630a
Show file tree
Hide file tree
Showing 5 changed files with 682 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ add_library(${PROJECT_NAME} STATIC
sample/loaders/load_flac.cpp
sample/loaders/load_mp3.cpp

sample/exs_support/exs_import.cpp
sample/multisample_support/multisample_import.cpp
sample/sfz_support/sfz_parse.cpp
sample/sfz_support/sfz_import.cpp
Expand Down
1 change: 1 addition & 0 deletions src/browser/browser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ const std::vector<std::string> Browser::LoadableFile::singleSample{".wav", ".fla
".aiff"};

const std::vector<std::string> Browser::LoadableFile::multiSample{".sf2", ".sfz", ".multisample"};
// ".exs"};
const std::vector<std::string> Browser::LoadableFile::shortcircuitFormats{".scm", ".scp"};

bool Browser::isLoadableFile(const fs::path &p)
Expand Down
14 changes: 14 additions & 0 deletions src/engine/engine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
#include "messaging/audio/audio_messages.h"
#include "selection/selection_manager.h"
#include "sample/sfz_support/sfz_import.h"
#include "sample/exs_support/exs_import.h"
#include "sample/multisample_support/multisample_import.h"
#include "infrastructure/user_defaults.h"
#include "infrastructure/md5support.h"
Expand Down Expand Up @@ -548,6 +549,19 @@ void Engine::loadSampleIntoSelectedPartAndGroup(const fs::path &p, int16_t rootK
});
return;
}
else if (extensionMatches(p, ".exs"))
{
// TODO ok this refresh and restart is a bit unsatisfactory
messageController->stopAudioThreadThenRunOnSerial([this, p](const auto &) {
auto res = exs_support::importEXS(p, *this);
if (!res)
messageController->reportErrorToClient("EXS Import Failed", "Dunno why");
messageController->restartAudioThreadFromSerial();
serializationSendToClient(messaging::client::s2c_send_pgz_structure,
getPartGroupZoneStructure(), *messageController);
});
return;
}
else if (extensionMatches(p, ".multisample"))
{
messageController->stopAudioThreadThenRunOnSerial([this, p](const auto &) {
Expand Down
Loading

0 comments on commit cb8630a

Please sign in to comment.