Browse Source

Save MIDI file as data, in case the file goes missing later

tags/1.9.6
falkTX 10 years ago
parent
commit
05d0d2ac86
2 changed files with 17 additions and 1 deletions
  1. +3
    -1
      source/native-plugins/midi-base.hpp
  2. +14
    -0
      source/native-plugins/midi-file.cpp

+ 3
- 1
source/native-plugins/midi-base.hpp View File

@@ -351,7 +351,9 @@ public:
{
// get time
needle = std::strchr(dataRead, ':');
CARLA_SAFE_ASSERT_RETURN(needle != nullptr,);

if (needle == nullptr)
return;

tmpSize = needle - dataRead;
CARLA_SAFE_ASSERT_RETURN(tmpSize > 0 && tmpSize < 24,);


+ 14
- 0
source/native-plugins/midi-file.cpp View File

@@ -96,6 +96,19 @@ protected:
uiClosed();
}

// -------------------------------------------------------------------
// Plugin state calls

char* getState() const override
{
return fMidiOut.getState();
}

void setState(const char* const data) override
{
fMidiOut.setState(data);
}

// -------------------------------------------------------------------
// AbstractMidiPlayer calls

@@ -200,6 +213,7 @@ static const NativePluginDescriptor midifileDesc = {
/* hints */ static_cast<NativePluginHints>(NATIVE_PLUGIN_IS_RTSAFE
|NATIVE_PLUGIN_HAS_UI
|NATIVE_PLUGIN_NEEDS_UI_OPEN_SAVE
|NATIVE_PLUGIN_USES_STATE
|NATIVE_PLUGIN_USES_TIME),
/* supports */ static_cast<NativePluginSupports>(0x0),
/* audioIns */ 0,


Loading…
Cancel
Save