Browse Source

Catia: Enable ALSA-MIDI via GUI (EXPERIMENTAL); Carla misc changes

tags/v0.9.0
falkTX 13 years ago
parent
commit
579a103821
6 changed files with 97 additions and 64 deletions
  1. +2
    -0
      c++/carla-native/zynaddsubfx.cpp
  2. +24
    -17
      c++/carla-plugin/ladspa.cpp
  3. +4
    -2
      c++/carla-utils/carla_utils.hpp
  4. +0
    -3
      doc/TODO
  5. +46
    -37
      resources/ui/catia.ui
  6. +21
    -5
      src/catia.py

+ 2
- 0
c++/carla-native/zynaddsubfx.cpp View File

@@ -71,6 +71,8 @@ public:
qDebug("ZynAddSubFxPlugin::~ZynAddSubFxPlugin(), s_instanceCount=%i", s_instanceCount);

m_programs.clear();

delete m_master;
}

protected:


+ 24
- 17
c++/carla-plugin/ladspa.cpp View File

@@ -412,11 +412,12 @@ public:
paramBuffers = new float[params];
}

const int portNameSize = x_engine->maxPortNameSize() - 2;
char portName[portNameSize];
bool needsCtrlIn = false;
bool needsCtrlOut = false;

const int portNameSize = x_engine->maxPortNameSize() - 3;
CarlaString portName;

for (unsigned long i=0; i < portCount; i++)
{
const LADSPA_PortDescriptor portType = descriptor->PortDescriptors[i];
@@ -425,16 +426,18 @@ public:

if (LADSPA_IS_PORT_AUDIO(portType))
{
portName.clear();

#ifndef BUILD_BRIDGE
if (x_engine->processMode() == PROCESS_MODE_SINGLE_CLIENT)
{
strcpy(portName, m_name);
strcat(portName, ":");
strncat(portName, descriptor->PortNames[i], portNameSize/2);
portName = m_name;
portName += ":";
}
else
#endif
strncpy(portName, descriptor->PortNames[i], portNameSize);

portName += descriptor->PortNames[i];
portName.truncate(portNameSize);

if (LADSPA_IS_PORT_INPUT(portType))
{
@@ -444,7 +447,7 @@ public:

if (forcedStereoIn)
{
strcat(portName, "_");
portName += "_2";
aIn.ports[1] = (CarlaEngineAudioPort*)x_client->addPort(CarlaEnginePortTypeAudio, portName, true);
aIn.rindexes[1] = i;
}
@@ -458,7 +461,7 @@ public:

if (forcedStereoOut)
{
strcat(portName, "_");
portName += "_2";
aOut.ports[1] = (CarlaEngineAudioPort*)x_client->addPort(CarlaEnginePortTypeAudio, portName, false);
aOut.rindexes[1] = i;
}
@@ -618,30 +621,34 @@ public:

if (needsCtrlIn)
{
portName.clear();

#ifndef BUILD_BRIDGE
if (x_engine->processMode() == PROCESS_MODE_SINGLE_CLIENT)
{
strcpy(portName, m_name);
strcat(portName, ":control-in");
portName = m_name;
portName += ":";
}
else
#endif
strcpy(portName, "control-in");
portName += "control-in";
portName.truncate(portNameSize);

param.portCin = (CarlaEngineControlPort*)x_client->addPort(CarlaEnginePortTypeControl, portName, true);
}

if (needsCtrlOut)
{
portName.clear();

#ifndef BUILD_BRIDGE
if (x_engine->processMode() == PROCESS_MODE_SINGLE_CLIENT)
{
strcpy(portName, m_name);
strcat(portName, ":control-out");
portName = m_name;
portName += ":";
}
else
#endif
strcpy(portName, "control-out");
portName += "control-out";
portName.truncate(portNameSize);

param.portCout = (CarlaEngineControlPort*)x_client->addPort(CarlaEnginePortTypeControl, portName, false);
}


+ 4
- 2
c++/carla-utils/carla_utils.hpp View File

@@ -269,8 +269,10 @@ public:

void clear()
{
for (size_t i=0, len = ::strlen(buffer); i < len; i++)
buffer[i] = 0;
if (::strcmp(buffer, "") == 0)
return;

buffer = ::strdup("");
}

void replace(char before, char after)


+ 0
- 3
doc/TODO View File

@@ -12,9 +12,6 @@ GUI:
-------------------
- APPS -

Catia:
- Add ALSA-MIDI option via settings, label it experimental

Claudia:
- Cleanup DB
- Auto-recover crashes


+ 46
- 37
resources/ui/catia.ui View File

@@ -45,7 +45,7 @@
<string/>
</property>
<property name="icon">
<iconset resource="../../resources/resources.qrc">
<iconset resource="../resources.qrc">
<normaloff>:/16x16/media-playback-start.png</normaloff>:/16x16/media-playback-start.png</iconset>
</property>
<property name="checkable">
@@ -68,7 +68,7 @@
<string/>
</property>
<property name="icon">
<iconset resource="../../resources/resources.qrc">
<iconset resource="../resources.qrc">
<normaloff>:/16x16/media-playback-stop.png</normaloff>:/16x16/media-playback-stop.png</iconset>
</property>
</widget>
@@ -88,7 +88,7 @@
<string/>
</property>
<property name="icon">
<iconset resource="../../resources/resources.qrc">
<iconset resource="../resources.qrc">
<normaloff>:/16x16/media-seek-backward.png</normaloff>:/16x16/media-seek-backward.png</iconset>
</property>
<property name="autoRepeat">
@@ -111,7 +111,7 @@
<string/>
</property>
<property name="icon">
<iconset resource="../../resources/resources.qrc">
<iconset resource="../resources.qrc">
<normaloff>:/16x16/media-seek-forward.png</normaloff>:/16x16/media-seek-forward.png</iconset>
</property>
<property name="autoRepeat">
@@ -197,7 +197,7 @@
<string/>
</property>
<property name="icon">
<iconset resource="../../resources/resources.qrc">
<iconset resource="../resources.qrc">
<normaloff>:/16x16/zoom-fit-best.png</normaloff>:/16x16/zoom-fit-best.png</iconset>
</property>
</widget>
@@ -217,7 +217,7 @@
<string/>
</property>
<property name="icon">
<iconset resource="../../resources/resources.qrc">
<iconset resource="../resources.qrc">
<normaloff>:/16x16/zoom-in.png</normaloff>:/16x16/zoom-in.png</iconset>
</property>
</widget>
@@ -237,7 +237,7 @@
<string/>
</property>
<property name="icon">
<iconset resource="../../resources/resources.qrc">
<iconset resource="../resources.qrc">
<normaloff>:/16x16/zoom-out.png</normaloff>:/16x16/zoom-out.png</iconset>
</property>
</widget>
@@ -257,7 +257,7 @@
<string/>
</property>
<property name="icon">
<iconset resource="../../resources/resources.qrc">
<iconset resource="../resources.qrc">
<normaloff>:/16x16/zoom-original.png</normaloff>:/16x16/zoom-original.png</iconset>
</property>
</widget>
@@ -286,7 +286,7 @@
<string/>
</property>
<property name="icon">
<iconset resource="../../resources/resources.qrc">
<iconset resource="../resources.qrc">
<normaloff>:/16x16/edit-clear.png</normaloff>:/16x16/edit-clear.png</iconset>
</property>
</widget>
@@ -306,7 +306,7 @@
<string/>
</property>
<property name="icon">
<iconset resource="../../resources/resources.qrc">
<iconset resource="../resources.qrc">
<normaloff>:/16x16/configure.png</normaloff>:/16x16/configure.png</iconset>
</property>
</widget>
@@ -326,7 +326,7 @@
<string/>
</property>
<property name="icon">
<iconset resource="../../resources/resources.qrc">
<iconset resource="../resources.qrc">
<normaloff>:/16x16/media-record.png</normaloff>:/16x16/media-record.png</iconset>
</property>
</widget>
@@ -553,6 +553,7 @@
<property name="title">
<string>S&amp;ettings</string>
</property>
<addaction name="act_settings_show_alsa"/>
<addaction name="act_settings_show_toolbar"/>
<addaction name="act_settings_show_statusbar"/>
<addaction name="separator"/>
@@ -567,7 +568,7 @@
</widget>
<action name="act_quit">
<property name="icon">
<iconset resource="../../resources/resources.qrc">
<iconset resource="../resources.qrc">
<normaloff>:/16x16/application-exit.png</normaloff>:/16x16/application-exit.png</iconset>
</property>
<property name="text">
@@ -579,7 +580,7 @@
</action>
<action name="act_session_new">
<property name="icon">
<iconset resource="../../resources/resources.qrc">
<iconset resource="../resources.qrc">
<normaloff>:/16x16/document-new.png</normaloff>:/16x16/document-new.png</iconset>
</property>
<property name="text">
@@ -591,7 +592,7 @@
</action>
<action name="act_session_open">
<property name="icon">
<iconset resource="../../resources/resources.qrc">
<iconset resource="../resources.qrc">
<normaloff>:/16x16/document-open.png</normaloff>:/16x16/document-open.png</iconset>
</property>
<property name="text">
@@ -603,7 +604,7 @@
</action>
<action name="act_session_save">
<property name="icon">
<iconset resource="../../resources/resources.qrc">
<iconset resource="../resources.qrc">
<normaloff>:/16x16/document-save.png</normaloff>:/16x16/document-save.png</iconset>
</property>
<property name="text">
@@ -615,7 +616,7 @@
</action>
<action name="act_session_save_as">
<property name="icon">
<iconset resource="../../resources/resources.qrc">
<iconset resource="../resources.qrc">
<normaloff>:/16x16/document-save-as.png</normaloff>:/16x16/document-save-as.png</iconset>
</property>
<property name="text">
@@ -640,7 +641,7 @@
<bool>true</bool>
</property>
<property name="icon">
<iconset resource="../../resources/resources.qrc">
<iconset resource="../resources.qrc">
<normaloff>:/16x16/media-playback-start.png</normaloff>:/16x16/media-playback-start.png</iconset>
</property>
<property name="text">
@@ -652,7 +653,7 @@
</action>
<action name="act_transport_stop">
<property name="icon">
<iconset resource="../../resources/resources.qrc">
<iconset resource="../resources.qrc">
<normaloff>:/16x16/media-playback-stop.png</normaloff>:/16x16/media-playback-stop.png</iconset>
</property>
<property name="text">
@@ -664,7 +665,7 @@
</action>
<action name="act_transport_backwards">
<property name="icon">
<iconset resource="../../resources/resources.qrc">
<iconset resource="../resources.qrc">
<normaloff>:/16x16/media-seek-backward.png</normaloff>:/16x16/media-seek-backward.png</iconset>
</property>
<property name="text">
@@ -676,7 +677,7 @@
</action>
<action name="act_transport_forwards">
<property name="icon">
<iconset resource="../../resources/resources.qrc">
<iconset resource="../resources.qrc">
<normaloff>:/16x16/media-seek-forward.png</normaloff>:/16x16/media-seek-forward.png</iconset>
</property>
<property name="text">
@@ -688,7 +689,7 @@
</action>
<action name="act_canvas_refresh">
<property name="icon">
<iconset resource="../../resources/resources.qrc">
<iconset resource="../resources.qrc">
<normaloff>:/16x16/view-refresh.png</normaloff>:/16x16/view-refresh.png</iconset>
</property>
<property name="text">
@@ -700,7 +701,7 @@
</action>
<action name="act_canvas_arrange">
<property name="icon">
<iconset resource="../../resources/resources.qrc">
<iconset resource="../resources.qrc">
<normaloff>:/16x16/view-sort-ascending.png</normaloff>:/16x16/view-sort-ascending.png</iconset>
</property>
<property name="text">
@@ -712,7 +713,7 @@
</action>
<action name="act_canvas_zoom_fit">
<property name="icon">
<iconset resource="../../resources/resources.qrc">
<iconset resource="../resources.qrc">
<normaloff>:/16x16/zoom-fit-best.png</normaloff>:/16x16/zoom-fit-best.png</iconset>
</property>
<property name="text">
@@ -721,7 +722,7 @@
</action>
<action name="act_canvas_zoom_in">
<property name="icon">
<iconset resource="../../resources/resources.qrc">
<iconset resource="../resources.qrc">
<normaloff>:/16x16/zoom-in.png</normaloff>:/16x16/zoom-in.png</iconset>
</property>
<property name="text">
@@ -733,7 +734,7 @@
</action>
<action name="act_canvas_zoom_out">
<property name="icon">
<iconset resource="../../resources/resources.qrc">
<iconset resource="../resources.qrc">
<normaloff>:/16x16/zoom-out.png</normaloff>:/16x16/zoom-out.png</iconset>
</property>
<property name="text">
@@ -745,7 +746,7 @@
</action>
<action name="act_canvas_zoom_100">
<property name="icon">
<iconset resource="../../resources/resources.qrc">
<iconset resource="../resources.qrc">
<normaloff>:/16x16/zoom-original.png</normaloff>:/16x16/zoom-original.png</iconset>
</property>
<property name="text">
@@ -757,7 +758,7 @@
</action>
<action name="act_jack_clear_xruns">
<property name="icon">
<iconset resource="../../resources/resources.qrc">
<iconset resource="../resources.qrc">
<normaloff>:/16x16/edit-clear.png</normaloff>:/16x16/edit-clear.png</iconset>
</property>
<property name="text">
@@ -766,7 +767,7 @@
</action>
<action name="act_jack_configure">
<property name="icon">
<iconset resource="../../resources/resources.qrc">
<iconset resource="../resources.qrc">
<normaloff>:/16x16/configure.png</normaloff>:/16x16/configure.png</iconset>
</property>
<property name="text">
@@ -796,7 +797,7 @@
</action>
<action name="act_configure">
<property name="icon">
<iconset resource="../../resources/resources.qrc">
<iconset resource="../resources.qrc">
<normaloff>:/16x16/configure.png</normaloff>:/16x16/configure.png</iconset>
</property>
<property name="text">
@@ -808,7 +809,7 @@
</action>
<action name="act_tools_jack_start">
<property name="icon">
<iconset resource="../../resources/resources.qrc">
<iconset resource="../resources.qrc">
<normaloff>:/16x16/media-playback-start.png</normaloff>:/16x16/media-playback-start.png</iconset>
</property>
<property name="text">
@@ -820,7 +821,7 @@
</action>
<action name="act_tools_jack_stop">
<property name="icon">
<iconset resource="../../resources/resources.qrc">
<iconset resource="../resources.qrc">
<normaloff>:/16x16/media-playback-stop.png</normaloff>:/16x16/media-playback-stop.png</iconset>
</property>
<property name="text">
@@ -904,7 +905,7 @@
</action>
<action name="act_tools_a2j_start">
<property name="icon">
<iconset resource="../../resources/resources.qrc">
<iconset resource="../resources.qrc">
<normaloff>:/16x16/media-playback-start.png</normaloff>:/16x16/media-playback-start.png</iconset>
</property>
<property name="text">
@@ -916,7 +917,7 @@
</action>
<action name="act_tools_a2j_stop">
<property name="icon">
<iconset resource="../../resources/resources.qrc">
<iconset resource="../resources.qrc">
<normaloff>:/16x16/media-playback-stop.png</normaloff>:/16x16/media-playback-stop.png</iconset>
</property>
<property name="text">
@@ -938,7 +939,7 @@
</action>
<action name="act_canvas_print">
<property name="icon">
<iconset resource="../../resources/resources.qrc">
<iconset resource="../resources.qrc">
<normaloff>:/16x16/document-print.png</normaloff>:/16x16/document-print.png</iconset>
</property>
<property name="text">
@@ -975,7 +976,7 @@
</action>
<action name="act_canvas_configure">
<property name="icon">
<iconset resource="../../resources/resources.qrc">
<iconset resource="../resources.qrc">
<normaloff>:/16x16/configure.png</normaloff>:/16x16/configure.png</iconset>
</property>
<property name="text">
@@ -997,7 +998,7 @@
</action>
<action name="act_jack_render">
<property name="icon">
<iconset resource="../../resources/resources.qrc">
<iconset resource="../resources.qrc">
<normaloff>:/16x16/media-record.png</normaloff>:/16x16/media-record.png</iconset>
</property>
<property name="text">
@@ -1017,9 +1018,17 @@
<string>16</string>
</property>
</action>
<action name="act_settings_show_alsa">
<property name="checkable">
<bool>true</bool>
</property>
<property name="text">
<string>Show ALSA-MIDI (EXPERIMENTAL)</string>
</property>
</action>
</widget>
<resources>
<include location="../../resources/resources.qrc"/>
<include location="../resources.qrc"/>
</resources>
<connections>
<connection>


+ 21
- 5
src/catia.py View File

@@ -40,12 +40,13 @@ except:
haveDBus = False

# Disabled for Beta
if LINUX and False:
if LINUX:
for iPATH in PATH:
if os.path.exists(os.path.join(iPATH, "aconnect")):
from subprocess import getoutput
haveALSA = True
print("Using experimental ALSA-MIDI support")
if DEBUG:
print("Using experimental ALSA-MIDI support")
break
else:
haveALSA = False
@@ -86,6 +87,9 @@ class CatiaMainW(QMainWindow, ui_catia.Ui_CatiaMainW):
self.act_quit.setIcon(getIcon("application-exit"))
self.act_configure.setIcon(getIcon("configure"))

if not haveALSA:
self.act_settings_show_alsa.setEnabled(False)

self.m_group_list = []
self.m_group_split_list = []
self.m_port_list = []
@@ -189,6 +193,7 @@ class CatiaMainW(QMainWindow, ui_catia.Ui_CatiaMainW):
self.connect(self.act_tools_a2j_stop, SIGNAL("triggered()"), SLOT("slot_A2JBridgeStop()"))
self.connect(self.act_tools_a2j_export_hw, SIGNAL("triggered()"), SLOT("slot_A2JBridgeExportHW()"))

self.connect(self.act_settings_show_alsa, SIGNAL("triggered(bool)"), SLOT("slot_showAlsaMIDI(bool)"))
self.connect(self.act_configure, SIGNAL("triggered()"), SLOT("slot_configureCatia()"))

self.connect(self.act_help_about, SIGNAL("triggered()"), SLOT("slot_aboutCatia()"))
@@ -506,7 +511,7 @@ class CatiaMainW(QMainWindow, ui_catia.Ui_CatiaMainW):
self.canvas_connect_ports_by_name(port_name, port_con_name)

def init_alsa_ports(self):
if not haveALSA:
if not (haveALSA and self.act_settings_show_alsa.isChecked()):
return

# Get ALSA MIDI ports (outputs)
@@ -1040,6 +1045,12 @@ class CatiaMainW(QMainWindow, ui_catia.Ui_CatiaMainW):
self.emit(SIGNAL("ShutdownCallback()"))
return 0

@pyqtSlot(bool)
def slot_showAlsaMIDI(self, yesNo):
# refresh canvas (remove jack ports)
patchcanvas.clear()
self.init_ports()

@pyqtSlot()
def slot_JackServerStart(self):
if DBus.jack:
@@ -1239,6 +1250,7 @@ class CatiaMainW(QMainWindow, ui_catia.Ui_CatiaMainW):

def saveSettings(self):
self.settings.setValue("Geometry", self.saveGeometry())
self.settings.setValue("ShowAlsaMIDI", self.act_settings_show_alsa.isChecked())
self.settings.setValue("ShowToolbar", self.frame_toolbar.isVisible())
self.settings.setValue("ShowStatusbar", self.frame_statusbar.isVisible())
self.settings.setValue("TransportView", self.m_selected_transport_view)
@@ -1247,6 +1259,9 @@ class CatiaMainW(QMainWindow, ui_catia.Ui_CatiaMainW):
if geometry:
self.restoreGeometry(self.settings.value("Geometry", ""))

show_alsamidi = self.settings.value("ShowAlsaMIDI", False, type=bool)
self.act_settings_show_alsa.setChecked(show_alsamidi)

show_toolbar = self.settings.value("ShowToolbar", True, type=bool)
self.act_settings_show_toolbar.setChecked(show_toolbar)
self.frame_toolbar.setVisible(show_toolbar)
@@ -1312,7 +1327,7 @@ if __name__ == '__main__':
DBus.a2j = None
a2j_client_name = None

if DBus.jack or DBus.a2j:
if DEBUG and (DBus.jack or DBus.a2j):
string = "Using DBus for "
if DBus.jack:
string += "JACK"
@@ -1326,7 +1341,8 @@ if __name__ == '__main__':
DBus.jack = None
DBus.a2j = None
a2j_client_name = None
print("Not using DBus")
if DEBUG:
print("Not using DBus")

# Show GUI
gui = CatiaMainW()


Loading…
Cancel
Save