Browse Source

Cadence: Implement JACK2 "Switch Master" support, hurray!

tags/v0.9.0
falkTX 13 years ago
parent
commit
1814f5d97a
4 changed files with 94 additions and 45 deletions
  1. +1
    -0
      doc/Carla-TODO
  2. +4
    -0
      doc/TODO
  3. +72
    -45
      resources/ui/cadence.ui
  4. +17
    -0
      src/cadence.py

+ 1
- 0
doc/Carla-TODO View File

@@ -18,6 +18,7 @@ ENGINE:
- implement Haiku Media support (based from JACK?)
- implement latency in continuous-rack mode
- DSSI/LV2/VST version (needs add-new support on control side)
- Handle sample-rate changes in JACK (made possible by switch-master)

LADSPA:



+ 4
- 0
doc/TODO View File

@@ -12,8 +12,12 @@ GUI:
-------------------
- APPS -

Catia:
- Handle sample-rate changes in JACK (made possible by switch-master)

Claudia:
- Cleanup DB
- Handle sample-rate changes in JACK (made possible by switch-master)

-------------------
- MODULES -


+ 72
- 45
resources/ui/cadence.ui View File

@@ -6,8 +6,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>753</width>
<height>579</height>
<width>739</width>
<height>549</height>
</rect>
</property>
<property name="windowTitle">
@@ -24,7 +24,7 @@
<attribute name="title">
<string>System</string>
</attribute>
<layout class="QGridLayout" name="gridLayout_4">
<layout class="QGridLayout" name="gridLayout_8">
<item row="0" column="0" colspan="3">
<widget class="QLabel" name="label_welcome">
<property name="font">
@@ -42,7 +42,21 @@
</property>
</widget>
</item>
<item row="2" column="0">
<item row="1" column="0" rowspan="2" colspan="3">
<widget class="Line" name="line_welcome">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
</widget>
</item>
<item row="2" column="1" rowspan="2">
<widget class="Line" name="line">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
</widget>
</item>
<item row="3" column="0">
<layout class="QVBoxLayout" name="verticalLayout_10">
<item>
<widget class="QGroupBox" name="groupBox_info">
@@ -183,7 +197,7 @@
</item>
</layout>
</item>
<item row="2" column="2">
<item row="3" column="2">
<layout class="QVBoxLayout" name="verticalLayout_12">
<item>
<widget class="QGroupBox" name="groupBox_jack">
@@ -401,60 +415,66 @@
</widget>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_5">
<item>
<layout class="QGridLayout" name="gridLayout_4">
<item row="0" column="0">
<widget class="QPushButton" name="b_jack_start">
<property name="text">
<string>Start</string>
</property>
</widget>
</item>
<item>
<item row="0" column="1" colspan="2">
<widget class="QPushButton" name="b_jack_stop">
<property name="text">
<string>Stop</string>
</property>
</widget>
</item>
<item>
<item row="0" column="3">
<widget class="QPushButton" name="b_jack_restart">
<property name="text">
<string>Force Restart</string>
</property>
</widget>
</item>
<item>
<item row="0" column="4" colspan="2">
<widget class="QPushButton" name="b_jack_configure">
<property name="text">
<string>Configure</string>
</property>
</widget>
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_6">
<item>
<item row="1" column="0">
<widget class="QPushButton" name="b_jack_switchmaster">
<property name="text">
<string>Switch Master!</string>
</property>
</widget>
</item>
<item row="1" column="1">
<spacer name="horizontalSpacer_4">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Preferred</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<width>38</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<item row="1" column="2" colspan="3">
<widget class="QCheckBox" name="cb_jack_autostart">
<property name="text">
<string>Auto-start JACK or LADISH at login</string>
</property>
</widget>
</item>
<item>
<item row="1" column="5">
<widget class="QToolButton" name="tb_jack_options">
<property name="text">
<string>...</string>
@@ -468,6 +488,12 @@
</item>
<item>
<widget class="QGroupBox" name="groupBox_bridges">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="MinimumExpanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="title">
<string>JACK Bridges</string>
</property>
@@ -477,13 +503,19 @@
</property>
<item row="0" column="0">
<widget class="QToolBox" name="toolBox_2">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="MinimumExpanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<widget class="QWidget" name="toolBox_alsaaudio">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>351</width>
<height>117</height>
<width>366</width>
<height>120</height>
</rect>
</property>
<attribute name="label">
@@ -612,10 +644,13 @@
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Preferred</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
<height>20</height>
</size>
</property>
</spacer>
@@ -627,8 +662,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>290</width>
<height>77</height>
<width>366</width>
<height>117</height>
</rect>
</property>
<attribute name="label">
@@ -750,10 +785,13 @@
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Preferred</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
<height>20</height>
</size>
</property>
</spacer>
@@ -765,8 +803,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>204</width>
<height>77</height>
<width>366</width>
<height>117</height>
</rect>
</property>
<attribute name="label">
@@ -881,10 +919,13 @@
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Preferred</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
<height>20</height>
</size>
</property>
</spacer>
@@ -914,20 +955,6 @@
</item>
</layout>
</item>
<item row="2" column="1">
<widget class="Line" name="line">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
</widget>
</item>
<item row="1" column="0" colspan="3">
<widget class="Line" name="line_welcome">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
</widget>
</item>
</layout>
</widget>
<widget class="QWidget" name="tab_tools">
@@ -1484,7 +1511,7 @@
<rect>
<x>0</x>
<y>0</y>
<width>94</width>
<width>76</width>
<height>76</height>
</rect>
</property>
@@ -1502,7 +1529,7 @@
<rect>
<x>0</x>
<y>0</y>
<width>94</width>
<width>89</width>
<height>76</height>
</rect>
</property>
@@ -1520,7 +1547,7 @@
<rect>
<x>0</x>
<y>0</y>
<width>94</width>
<width>89</width>
<height>76</height>
</rect>
</property>
@@ -1538,7 +1565,7 @@
<rect>
<x>0</x>
<y>0</y>
<width>94</width>
<width>89</width>
<height>76</height>
</rect>
</property>


+ 17
- 0
src/cadence.py View File

@@ -702,6 +702,9 @@ class CadenceMainW(QMainWindow, ui_cadence.Ui_CadenceMainW):

self.m_lastAlsaIndexType = -2 # invalid

if not jacklib.JACK2:
self.b_jack_switchmaster.setEnabled(False)

# -------------------------------------------------------------
# Set-up GUI (System Information)

@@ -997,6 +1000,7 @@ class CadenceMainW(QMainWindow, ui_cadence.Ui_CadenceMainW):
self.connect(self.b_jack_stop, SIGNAL("clicked()"), SLOT("slot_JackServerStop()"))
self.connect(self.b_jack_restart, SIGNAL("clicked()"), SLOT("slot_JackServerForceRestart()"))
self.connect(self.b_jack_configure, SIGNAL("clicked()"), SLOT("slot_JackServerConfigure()"))
self.connect(self.b_jack_switchmaster, SIGNAL("clicked()"), SLOT("slot_JackServerSwitchMaster()"))
self.connect(self.tb_jack_options, SIGNAL("clicked()"), SLOT("slot_JackOptions()"))

self.connect(self.b_alsa_start, SIGNAL("clicked()"), SLOT("slot_AlsaBridgeStart()"))
@@ -1127,6 +1131,7 @@ class CadenceMainW(QMainWindow, ui_cadence.Ui_CadenceMainW):
self.b_jack_stop.setEnabled(False)
self.b_jack_restart.setEnabled(False)
self.b_jack_configure.setEnabled(False)
self.b_jack_switchmaster.setEnabled(False)
self.groupBox_bridges.setEnabled(False)

if DBus.a2j:
@@ -1182,6 +1187,7 @@ class CadenceMainW(QMainWindow, ui_cadence.Ui_CadenceMainW):

self.b_jack_start.setEnabled(False)
self.b_jack_stop.setEnabled(True)
self.b_jack_switchmaster.setEnabled(True)
self.systray.setActionEnabled("jack_start", False)
self.systray.setActionEnabled("jack_stop", True)

@@ -1221,6 +1227,7 @@ class CadenceMainW(QMainWindow, ui_cadence.Ui_CadenceMainW):

self.b_jack_start.setEnabled(True)
self.b_jack_stop.setEnabled(False)
self.b_jack_switchmaster.setEnabled(False)

if haveDBus:
self.systray.setActionEnabled("jack_start", True)
@@ -1468,6 +1475,16 @@ class CadenceMainW(QMainWindow, ui_cadence.Ui_CadenceMainW):
jacksettingsW.exec_()
del jacksettingsW

@pyqtSlot()
def slot_JackServerSwitchMaster(self):
try:
DBus.jack.SwitchMaster()
except:
QMessageBox.warning(self, self.tr("Warning"), self.tr("Failed to switch JACK master, please check the logs for more information."))
return

self.jackStarted()

@pyqtSlot()
def slot_JackOptions(self):
ToolBarJackDialog(self).exec_()


Loading…
Cancel
Save