Skip to content

Commit

Permalink
Renamed filename + check for extension
Browse files Browse the repository at this point in the history
- on Windows, compilation fails with space
- check if extension is missing and add it
- updated documentation to remove VST2 instructions
  • Loading branch information
ypujante committed Nov 29, 2024
1 parent 5cd8bf2 commit 9635f81
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 19 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@ set(test_case_sources

# Finally invoke jamba_add_vst_plugin
jamba_add_vst_plugin(
RELEASE_FILENAME "SAM-SPL 64"
RELEASE_FILENAME "SAM-SPL64"
ARCHIVE_ARCHITECTURE "${JAMBA_ARCHIVE_ARCHITECTURE}"
TARGETS_PREFIX "jmb_"
VST_SOURCES "${vst_sources}" "${vst2_sources}"
Expand Down
9 changes: 2 additions & 7 deletions archive/README-macOS_64bits.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,12 @@ copy it under $HOME/Library/Audio/Plug-ins (or /Library/Audio/Plug-ins)

Or if you prefer to install each file individually:

For VST2, copy VST/SAM SPL64.vst under
- $HOME/Library/Audio/Plug-ins/VST for a single user
- or /Library/Audio/Plug-ins/VST for all users (may require admin access)
- or any DAW specific path (64bits)

For VST3, copy VST3/SAM SPL64.vst3 under
For VST3, copy VST3/SAM-SPL64.vst3 under
- $HOME/Library/Audio/Plug-ins/VST3 for a single user
- or /Library/Audio/Plug-ins/VST3 for all users (may require admin access)
- or any DAW specific path (64bits)

For Audio Unit, copy Components/SAM SPL64.component under $HOME/Library/Audio/Plug-ins/Components
For Audio Unit, copy Components/SAM-SPL64.component under $HOME/Library/Audio/Plug-ins/Components
- $HOME/Library/Audio/Plug-ins/Components for a single user
- or /Library/Audio/Plug-ins/Components for all users (may require admin access)
- Note: you may have to reboot your computer for the Audio Unit to appear in Logic
Expand Down
6 changes: 1 addition & 5 deletions archive/README-win_64bits.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,7 @@ copy it under C:\Program Files

Or if you prefer to install each file individually:

For VST2, copy VstPlugins\SAM SPL64.dll under
- C:\Program Files\VstPlugins
- or any DAW specific path (64bits)

For VST3, copy Common Files\VST3\SAM SPL64.vst3 under
For VST3, copy Common Files\VST3\SAM-SPL64.vst3 under
- C:\Program Files\Common Files\VST3 (may require admin access)
- or any DAW specific path (64bits)

Expand Down
19 changes: 14 additions & 5 deletions src/cpp/GUI/SampleSaverView.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,18 +48,27 @@ class SampleSaverView : public Views::StateAwareView<Views::TextButtonView, Samp
auto selector = VSTGUI::owned(CNewFileSelector::create(getFrame(), CNewFileSelector::kSelectSaveFile));
if(selector)
{
auto const extension = fExportSampleMajorFormat == SampleFile::ESampleMajorFormat::kSampleFormatWAV ?
CFileExtension("WAVE", "wav", "audio/x-wav") :
CFileExtension("AIFF", "aif", "audio/x-aiff");
selector->setDefaultExtension(extension);
selector->setTitle("Save Sample To");
selector->setDefaultSaveName(UTF8String(Steinberg::String().printf("sample.%s",
fExportSampleMajorFormat == SampleFile::ESampleMajorFormat::kSampleFormatWAV ? "wav" : "aif")));
selector->setDefaultSaveName(UTF8String(Steinberg::String().printf("sample.%s", extension.getExtension().data())));
if(selector->runModal())
{
if(selector->getNumSelectedFiles() > 0)
{
auto filename = selector->getSelectedFile(0);
auto filename = std::string(selector->getSelectedFile(0));
auto expectedExtension = std::string(".") + extension.getExtension().getString();
if(filename.size() < expectedExtension.size() ||
filename.substr(filename.size() - expectedExtension.size()) != expectedExtension)
{
filename += expectedExtension;
}
if(!fState->fSampleMgr->save(filename, *fExportSampleMajorFormat, *fExportSampleMinorFormat))
DLOG_F(WARNING, "Could not save %s", filename);
DLOG_F(WARNING, "Could not save %s", filename.data());
else
DLOG_F(INFO, "Successfully saved %s", filename);
DLOG_F(INFO, "Successfully saved %s", filename.data());
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/cpp/SampleBuffers.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
#include <pongasoft/Utils/Disposable.h>

class SndfileHandle;
class ma_decoder;
struct ma_decoder;

namespace pongasoft::VST::SampleSplitter {

Expand Down

0 comments on commit 9635f81

Please sign in to comment.