|
@@ -47,7 +47,7 @@ enum FileType { |
|
|
FileMIDI, |
|
|
FileMIDI, |
|
|
}; |
|
|
}; |
|
|
|
|
|
|
|
|
template <FileType FileType> |
|
|
|
|
|
|
|
|
template <FileType fileType> |
|
|
struct NativePluginPresetManager { |
|
|
struct NativePluginPresetManager { |
|
|
StringArray filenames; |
|
|
StringArray filenames; |
|
|
|
|
|
|
|
@@ -79,11 +79,11 @@ struct NativePluginPresetManager { |
|
|
// ----------------------------------------------------------------------- |
|
|
// ----------------------------------------------------------------------- |
|
|
// Native Plugin with MIDI programs class |
|
|
// Native Plugin with MIDI programs class |
|
|
|
|
|
|
|
|
template <FileType FileType> |
|
|
|
|
|
|
|
|
template <FileType fileType> |
|
|
class NativePluginWithMidiPrograms : public NativePluginClass |
|
|
class NativePluginWithMidiPrograms : public NativePluginClass |
|
|
{ |
|
|
{ |
|
|
public: |
|
|
public: |
|
|
typedef SharedResourcePointer<NativePluginPresetManager<FileType>> NativeMidiPrograms; |
|
|
|
|
|
|
|
|
typedef SharedResourcePointer<NativePluginPresetManager<fileType>> NativeMidiPrograms; |
|
|
|
|
|
|
|
|
NativePluginWithMidiPrograms(const NativeHostDescriptor* const host, |
|
|
NativePluginWithMidiPrograms(const NativeHostDescriptor* const host, |
|
|
const NativeMidiPrograms& programs, |
|
|
const NativeMidiPrograms& programs, |
|
@@ -109,7 +109,7 @@ protected: |
|
|
|
|
|
|
|
|
uint32_t getMidiProgramCount() const override |
|
|
uint32_t getMidiProgramCount() const override |
|
|
{ |
|
|
{ |
|
|
const NativePluginPresetManager<FileType>& pm(kPrograms.get()); |
|
|
|
|
|
|
|
|
const NativePluginPresetManager<fileType>& pm(kPrograms.get()); |
|
|
return static_cast<uint32_t>(pm.filenames.size()); |
|
|
return static_cast<uint32_t>(pm.filenames.size()); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
@@ -117,7 +117,7 @@ protected: |
|
|
{ |
|
|
{ |
|
|
const int index = static_cast<int>(uindex); |
|
|
const int index = static_cast<int>(uindex); |
|
|
|
|
|
|
|
|
const NativePluginPresetManager<FileType>& pm(kPrograms.get()); |
|
|
|
|
|
|
|
|
const NativePluginPresetManager<fileType>& pm(kPrograms.get()); |
|
|
CARLA_SAFE_ASSERT_RETURN(index < pm.filenames.size(), nullptr); |
|
|
CARLA_SAFE_ASSERT_RETURN(index < pm.filenames.size(), nullptr); |
|
|
|
|
|
|
|
|
fRetMidiProgramName = File(pm.filenames.strings.getUnchecked(index)).getFileNameWithoutExtension(); |
|
|
fRetMidiProgramName = File(pm.filenames.strings.getUnchecked(index)).getFileNameWithoutExtension(); |
|
@@ -136,7 +136,7 @@ protected: |
|
|
{ |
|
|
{ |
|
|
const int iprogram = static_cast<int>(program); |
|
|
const int iprogram = static_cast<int>(program); |
|
|
|
|
|
|
|
|
const NativePluginPresetManager<FileType>& pm(kPrograms.get()); |
|
|
|
|
|
|
|
|
const NativePluginPresetManager<fileType>& pm(kPrograms.get()); |
|
|
CARLA_SAFE_ASSERT_RETURN(iprogram < pm.filenames.size(),); |
|
|
CARLA_SAFE_ASSERT_RETURN(iprogram < pm.filenames.size(),); |
|
|
|
|
|
|
|
|
const char* const filename(pm.filenames.strings.getUnchecked(iprogram).toRawUTF8()); |
|
|
const char* const filename(pm.filenames.strings.getUnchecked(iprogram).toRawUTF8()); |
|
|