Browse Source

Add show meters/keyboard menu actions

tags/1.9.4
falkTX 10 years ago
parent
commit
107f26f536
4 changed files with 52 additions and 5 deletions
  1. +19
    -1
      resources/ui/carla_host.ui
  2. +0
    -2
      source/carla
  3. +33
    -0
      source/carla_patchbay.py
  4. +0
    -2
      source/widgets/pixmapkeyboard.py

+ 19
- 1
resources/ui/carla_host.ui View File

@@ -180,7 +180,7 @@
<x>0</x>
<y>0</y>
<width>688</width>
<height>17</height>
<height>19</height>
</rect>
</property>
<widget class="QMenu" name="menu_File">
@@ -260,6 +260,8 @@
<string>&amp;Settings</string>
</property>
<addaction name="act_settings_show_toolbar"/>
<addaction name="act_settings_show_meters"/>
<addaction name="act_settings_show_keyboard"/>
<addaction name="separator"/>
<addaction name="act_settings_configure"/>
</widget>
@@ -633,6 +635,22 @@
<string>About &amp;Qt</string>
</property>
</action>
<action name="act_settings_show_meters">
<property name="checkable">
<bool>true</bool>
</property>
<property name="text">
<string>Show Canvas &amp;Meters</string>
</property>
</action>
<action name="act_settings_show_keyboard">
<property name="checkable">
<bool>true</bool>
</property>
<property name="text">
<string>Show Canvas &amp;Keyboard</string>
</property>
</action>
</widget>
<customwidgets>
<customwidget>


+ 0
- 2
source/carla View File

@@ -147,9 +147,7 @@ class CarlaMultiW(QTabWidget):
self.fPatchbay.projectLoaded()

def saveSettings(self, settings):
#self.fRack.saveSettings(settings)
self.fPatchbay.saveSettings(settings)
#self.fParent.saveSettings(settings)

def showEditDialog(self, pluginId):
self.fRack.showEditDialog(pluginId)


+ 33
- 0
source/carla_patchbay.py View File

@@ -118,6 +118,9 @@ class CarlaPatchbayW(QFrame):
# -------------------------------------------------------------
# Connect actions to functions

parent.ui.act_settings_show_meters.toggled.connect(self.slot_showCanvasMeters)
parent.ui.act_settings_show_keyboard.toggled.connect(self.slot_showCanvasKeyboard)

self.fView.horizontalScrollBar().valueChanged.connect(self.slot_horizontalScrollBarChanged)
self.fView.verticalScrollBar().valueChanged.connect(self.slot_verticalScrollBarChanged)

@@ -130,6 +133,23 @@ class CarlaPatchbayW(QFrame):
self.fKeys.keyboard.noteOn.connect(self.slot_noteOn)
self.fKeys.keyboard.noteOff.connect(self.slot_noteOff)

# -------------------------------------------------------------
# Load Settings

settings = QSettings()

showMeters = settings.value("ShowMeters", False, type=bool)
self.fParent.ui.act_settings_show_meters.setChecked(showMeters)
self.fPeaksIn.setVisible(showMeters)
self.fPeaksOut.setVisible(showMeters)

showKeyboard = settings.value("ShowKeyboard", True, type=bool)
self.fParent.ui.act_settings_show_keyboard.setChecked(showKeyboard)
self.fKeys.setVisible(showKeyboard)

# -------------------------------------------------------------
# Connect actions to functions (part 2)

if not doSetup: return

parent.ui.act_plugins_enable.triggered.connect(self.slot_pluginsEnable)
@@ -297,6 +317,8 @@ class CarlaPatchbayW(QFrame):
QTimer.singleShot(1000, self.slot_canvasRefresh)

def saveSettings(self, settings):
settings.setValue("ShowMeters", self.fPeaksIn.isVisible())
settings.setValue("ShowKeyboard", self.fKeys.isVisible())
settings.setValue("HorizontalScrollBarValue", self.fView.horizontalScrollBar().value())
settings.setValue("VerticalScrollBarValue", self.fView.verticalScrollBar().value())

@@ -359,6 +381,17 @@ class CarlaPatchbayW(QFrame):

# -----------------------------------------------------------------

@pyqtSlot(bool)
def slot_showCanvasMeters(self, yesNo):
self.fPeaksIn.setVisible(yesNo)
self.fPeaksOut.setVisible(yesNo)

@pyqtSlot(bool)
def slot_showCanvasKeyboard(self, yesNo):
self.fKeys.setVisible(yesNo)

# -----------------------------------------------------------------

@pyqtSlot()
def slot_miniCanvasCheckAll(self):
self.slot_miniCanvasCheckSize()


+ 0
- 2
source/widgets/pixmapkeyboard.py View File

@@ -222,8 +222,6 @@ class PixmapKeyboard(QWidget):
else:
note = -1

print(keyPos, note, octave)

if note != -1:
note += octave * 12



Loading…
Cancel
Save