Browse Source

Use path.basename for new filebrowser plugins, fix max client name

tags/1.9.4
falkTX 11 years ago
parent
commit
fc1a114708
2 changed files with 16 additions and 7 deletions
  1. +2
    -2
      source/backend/engine/CarlaEngineJack.cpp
  2. +14
    -5
      source/carla.py

+ 2
- 2
source/backend/engine/CarlaEngineJack.cpp View File

@@ -534,7 +534,7 @@ public:
// -------------------------------------------------------------------
// Maximum values

unsigned int maxClientNameSize()
unsigned int maxClientNameSize() const
{
if (fOptions.processMode == PROCESS_MODE_SINGLE_CLIENT || fOptions.processMode == PROCESS_MODE_MULTIPLE_CLIENTS)
return static_cast<unsigned int>(jackbridge_client_name_size());
@@ -542,7 +542,7 @@ public:
return CarlaEngine::maxClientNameSize();
}

unsigned int maxPortNameSize()
unsigned int maxPortNameSize() const
{
if (fOptions.processMode == PROCESS_MODE_SINGLE_CLIENT || fOptions.processMode == PROCESS_MODE_MULTIPLE_CLIENTS)
return static_cast<unsigned int>(jackbridge_port_name_size());


+ 14
- 5
source/carla.py View File

@@ -711,35 +711,44 @@ class CarlaMainW(QMainWindow):
if not os.path.isfile(filename):
return

basename = os.path.basename(filename)
extension = filename.rsplit(".", 1)[-1].lower()

if extension == "carxp":
Carla.host.load_project(filename)

elif extension == "gig":
Carla.host.add_plugin(BINARY_NATIVE, PLUGIN_GIG, filename, None, os.path.basename(filename), None)
Carla.host.add_plugin(BINARY_NATIVE, PLUGIN_GIG, filename, None, basename, None)

elif extension == "sf2":
Carla.host.add_plugin(BINARY_NATIVE, PLUGIN_SF2, filename, None, os.path.basename(filename), None)
Carla.host.add_plugin(BINARY_NATIVE, PLUGIN_SF2, filename, None, basename, None)

elif extension == "sfz":
Carla.host.add_plugin(BINARY_NATIVE, PLUGIN_SFZ, filename, None, os.path.basename(filename), None)
Carla.host.add_plugin(BINARY_NATIVE, PLUGIN_SFZ, filename, None, basename, None)

elif extension in ("aac", "flac", "oga", "ogg", "mp3", "wav"):
self.fLastLoadedPluginId = -2
if Carla.host.add_plugin(BINARY_NATIVE, PLUGIN_INTERNAL, None, None, "audiofile", None):
if Carla.host.add_plugin(BINARY_NATIVE, PLUGIN_INTERNAL, None, basename, "audiofile", None):
while (self.fLastLoadedPluginId == -2): sleep(0.2)
idx = self.fLastLoadedPluginId
self.fLastLoadedPluginId = -1
Carla.host.set_custom_data(idx, CUSTOM_DATA_STRING, "file00", filename)
else:
self.fLastLoadedPluginId = -1
CustomMessageBox(self, QMessageBox.Critical, self.tr("Error"), self.tr("Failed to load plugin"),
cString(Carla.host.get_last_error()), QMessageBox.Ok, QMessageBox.Ok)

elif extension in ("mid", "midi"):
self.fLastLoadedPluginId = -2
if Carla.host.add_plugin(BINARY_NATIVE, PLUGIN_INTERNAL, None, None, "midifile", None):
if Carla.host.add_plugin(BINARY_NATIVE, PLUGIN_INTERNAL, None, basename, "midifile", None):
while (self.fLastLoadedPluginId == -2): sleep(0.2)
idx = self.fLastLoadedPluginId
self.fLastLoadedPluginId = -1
Carla.host.set_custom_data(idx, CUSTOM_DATA_STRING, "file", filename)
else:
self.fLastLoadedPluginId = -1
CustomMessageBox(self, QMessageBox.Critical, self.tr("Error"), self.tr("Failed to load plugin"),
cString(Carla.host.get_last_error()), QMessageBox.Ok, QMessageBox.Ok)

@pyqtSlot(float)
def slot_canvasScaleChanged(self, scale):


Loading…
Cancel
Save