Browse Source

Proper Qt tricks for minicanvas (closes #148); Hide some debug stuff

tags/1.9.5
falkTX 10 years ago
parent
commit
d39b8ee50d
2 changed files with 25 additions and 13 deletions
  1. +8
    -3
      source/backend/engine/CarlaEngineBridge.cpp
  2. +17
    -10
      source/carla_host.py

+ 8
- 3
source/backend/engine/CarlaEngineBridge.cpp View File

@@ -387,8 +387,11 @@ public:
const PluginBridgeNonRtOpcode opcode(fShmNonRtControl.readOpcode());
CarlaPlugin* const plugin(pData->plugins[0].plugin);

if (opcode != kPluginBridgeNonRtPing)
carla_stdout("CarlaEngineBridge::handleNonRtData() - got opcode: %s", PluginBridgeNonRtOpcode2str(opcode));
#ifdef DEBUG
if (opcode != kPluginBridgeNonRtPing) {
carla_debug("CarlaEngineBridge::handleNonRtData() - got opcode: %s", PluginBridgeNonRtOpcode2str(opcode));
}
#endif

switch (opcode)
{
@@ -682,9 +685,11 @@ protected:
const PluginBridgeRtOpcode opcode(fShmRtControl.readOpcode());
CarlaPlugin* const plugin(pData->plugins[0].plugin);

#ifdef DEBUG
if (opcode != kPluginBridgeRtProcess && opcode != kPluginBridgeRtMidiEvent) {
carla_stdout("CarlaEngineBridgeRtThread::run() - got opcode: %s", PluginBridgeRtOpcode2str(opcode));
carla_debug("CarlaEngineBridgeRtThread::run() - got opcode: %s", PluginBridgeRtOpcode2str(opcode));
}
#endif

switch (opcode)
{


+ 17
- 10
source/carla_host.py View File

@@ -399,10 +399,9 @@ class HostWindow(QMainWindow):

self.setProperWindowTitle()

# Qt4 needs this so it properly creates & resizes the canvas
# Qt needs this so it properly creates & resizes the canvas
self.ui.tabWidget.setCurrentIndex(1)
self.ui.tabWidget.setCurrentIndex(0)
self.fixCanvasPreviewSize()

# Plugin needs to have timers always running so it receives messages
if self.host.isPlugin:
@@ -1288,10 +1287,12 @@ class HostWindow(QMainWindow):
def slot_showCanvasMeters(self, yesNo):
self.ui.peak_in.setVisible(yesNo)
self.ui.peak_out.setVisible(yesNo)
QTimer.singleShot(0, self.slot_miniCanvasCheckAll)

@pyqtSlot(bool)
def slot_showCanvasKeyboard(self, yesNo):
self.ui.scrollArea.setVisible(yesNo)
QTimer.singleShot(0, self.slot_miniCanvasCheckAll)

@pyqtSlot()
def slot_configureCarla(self):
@@ -1444,18 +1445,23 @@ class HostWindow(QMainWindow):
if self.fCanvasWidth == 0 or self.fCanvasHeight == 0:
return

self.ui.miniCanvasPreview.setViewSize(float(self.width()) / self.fCanvasWidth, float(self.height()) / self.fCanvasHeight)
if self.ui.tabWidget.currentIndex() == 1:
width = self.ui.graphicsView.width()
height = self.ui.graphicsView.height()
else:
self.ui.tabWidget.setCurrentIndex(1)
width = self.ui.graphicsView.width()
height = self.ui.graphicsView.height()
self.ui.tabWidget.setCurrentIndex(0)

self.ui.miniCanvasPreview.setViewSize(float(width)/self.fCanvasWidth, float(height)/self.fCanvasHeight)

@pyqtSlot(float, float)
def slot_miniCanvasMoved(self, xp, yp):
hsb = self.ui.graphicsView.horizontalScrollBar()
vsb = self.ui.graphicsView.verticalScrollBar()
hsb.blockSignals(True)
vsb.blockSignals(True)
hsb.setValue(xp * hsb.maximum())
vsb.setValue(yp * vsb.maximum())
hsb.blockSignals(False)
vsb.blockSignals(False)
self.updateCanvasInitialPos()

# --------------------------------------------------------------------------------------------------------
@@ -1661,9 +1667,10 @@ class HostWindow(QMainWindow):
QMainWindow.resizeEvent(self, event)

if self.ui.tabWidget.currentIndex() != 1:
self.fixCanvasPreviewSize()
else:
self.slot_miniCanvasCheckSize()
size = self.ui.rack.size()
self.ui.patchbay.resize(size)

self.slot_miniCanvasCheckSize()

# --------------------------------------------------------------------------------------------------------
# timer event


Loading…
Cancel
Save