@@ -21,7 +21,7 @@ | |||||
# define nullptr (0) | # define nullptr (0) | ||||
#endif | #endif | ||||
#define VERSION "0.8.1" | |||||
#define VERSION "0.9.2" | |||||
#include "../jack_utils.hpp" | #include "../jack_utils.hpp" | ||||
#include "../midi_queue.hpp" | #include "../midi_queue.hpp" | ||||
@@ -685,7 +685,7 @@ protected slots: | |||||
QMessageBox::about(this, tr("About XY Controller"), tr("<h3>XY Controller</h3>" | QMessageBox::about(this, tr("About XY Controller"), tr("<h3>XY Controller</h3>" | ||||
"<br>Version %1" | "<br>Version %1" | ||||
"<br>XY Controller is a simple XY widget that sends and receives data from Jack MIDI.<br>" | "<br>XY Controller is a simple XY widget that sends and receives data from Jack MIDI.<br>" | ||||
"<br>Copyright (C) 2012-2013 falkTX").arg(VERSION)); | |||||
"<br>Copyright (C) 2012-2022 falkTX").arg(VERSION)); | |||||
} | } | ||||
void slot_updateScreen() | void slot_updateScreen() | ||||
@@ -56,8 +56,8 @@ class CanvasPreviewFrame(QFrame): | |||||
self.fScale = 1.0 | self.fScale = 1.0 | ||||
self.fScene = None | self.fScene = None | ||||
self.fRealParent = None | self.fRealParent = None | ||||
self.fFakeWidth = 0.0 | |||||
self.fFakeHeight = 0.0 | |||||
self.fFakeWidth = 0 | |||||
self.fFakeHeight = 0 | |||||
self.fRenderSource = self.getRenderSource() | self.fRenderSource = self.getRenderSource() | ||||
self.fRenderTarget = QRectF(0, 0, 0, 0) | self.fRenderTarget = QRectF(0, 0, 0, 0) | ||||
@@ -70,8 +70,8 @@ class CanvasPreviewFrame(QFrame): | |||||
padding = 6 | padding = 6 | ||||
self.fScene = scene | self.fScene = scene | ||||
self.fFakeWidth = float(realWidth) / 15 | |||||
self.fFakeHeight = float(realHeight) / 15 | |||||
self.fFakeWidth = int(realWidth / 15) | |||||
self.fFakeHeight = int(realHeight / 15) | |||||
self.setMinimumSize(self.fFakeWidth+padding, self.fFakeHeight+padding) | self.setMinimumSize(self.fFakeWidth+padding, self.fFakeHeight+padding) | ||||
self.setMaximumSize(self.fFakeWidth*4+padding, self.fFakeHeight+padding) | self.setMaximumSize(self.fFakeWidth*4+padding, self.fFakeHeight+padding) | ||||
@@ -166,6 +166,9 @@ class CanvasPreviewFrame(QFrame): | |||||
QFrame.mouseReleaseEvent(self, event) | QFrame.mouseReleaseEvent(self, event) | ||||
def paintEvent(self, event): | def paintEvent(self, event): | ||||
if not self.fUseCustomPaint: | |||||
QFrame.paintEvent(self, event) | |||||
painter = QPainter(self) | painter = QPainter(self) | ||||
if self.fUseCustomPaint: | if self.fUseCustomPaint: | ||||
@@ -198,12 +201,7 @@ class CanvasPreviewFrame(QFrame): | |||||
painter.setBrush(self.fViewBrush) | painter.setBrush(self.fViewBrush) | ||||
painter.setPen(self.fViewPen) | painter.setPen(self.fViewPen) | ||||
painter.drawRect(self.fViewRect[iX], self.fViewRect[iY], maxWidth, maxHeight) | |||||
if self.fUseCustomPaint: | |||||
event.accept() | |||||
else: | |||||
QFrame.paintEvent(self, event) | |||||
painter.drawRect(QRectF(self.fViewRect[iX], self.fViewRect[iY], maxWidth, maxHeight)) | |||||
def resizeEvent(self, event): | def resizeEvent(self, event): | ||||
self.fRenderSource = self.getRenderSource() | self.fRenderSource = self.getRenderSource() | ||||
@@ -1026,7 +1026,7 @@ class CatarinaMainW(AbstractCanvasJackClass): | |||||
@pyqtSlot() | @pyqtSlot() | ||||
def slot_projectOpen(self): | def slot_projectOpen(self): | ||||
path = QFileDialog.getOpenFileName(self, self.tr("Load State"), filter=self.tr("Catarina XML Document (*.xml)")) | |||||
path, _ = QFileDialog.getOpenFileName(self, self.tr("Load State"), filter=self.tr("Catarina XML Document (*.xml)")) | |||||
if path: | if path: | ||||
self.loadFile(path) | self.loadFile(path) | ||||
@@ -1039,8 +1039,7 @@ class CatarinaMainW(AbstractCanvasJackClass): | |||||
@pyqtSlot() | @pyqtSlot() | ||||
def slot_projectSaveAs(self): | def slot_projectSaveAs(self): | ||||
path = QFileDialog.getSaveFileName(self, self.tr("Save State"), filter=self.tr("Catarina XML Document (*.xml)")) | |||||
path = path[0] | |||||
path, _ = QFileDialog.getSaveFileName(self, self.tr("Save State"), filter=self.tr("Catarina XML Document (*.xml)")) | |||||
if path: | if path: | ||||
self.m_save_path = path | self.m_save_path = path | ||||
self.saveFile(path) | self.saveFile(path) | ||||
@@ -1261,7 +1260,7 @@ class CatarinaMainW(AbstractCanvasJackClass): | |||||
QMessageBox.about(self, self.tr("About Catarina"), self.tr("<h3>Catarina</h3>" | QMessageBox.about(self, self.tr("About Catarina"), self.tr("<h3>Catarina</h3>" | ||||
"<br>Version %s" | "<br>Version %s" | ||||
"<br>Catarina is a testing ground for the 'PatchCanvas' module.<br>" | "<br>Catarina is a testing ground for the 'PatchCanvas' module.<br>" | ||||
"<br>Copyright (C) 2010-2018 falkTX") % VERSION) | |||||
"<br>Copyright (C) 2010-2022 falkTX") % VERSION) | |||||
def saveSettings(self): | def saveSettings(self): | ||||
settings = QSettings() | settings = QSettings() | ||||
@@ -1318,7 +1318,7 @@ class CatiaMainW(AbstractCanvasJackClass): | |||||
QMessageBox.about(self, self.tr("About Catia"), self.tr("<h3>Catia</h3>" | QMessageBox.about(self, self.tr("About Catia"), self.tr("<h3>Catia</h3>" | ||||
"<br>Version %s" | "<br>Version %s" | ||||
"<br>Catia is a nice JACK Patchbay with A2J Bridge integration.<br>" | "<br>Catia is a nice JACK Patchbay with A2J Bridge integration.<br>" | ||||
"<br>Copyright (C) 2010-2018 falkTX" % VERSION)) | |||||
"<br>Copyright (C) 2010-2022 falkTX" % VERSION)) | |||||
def saveSettings(self): | def saveSettings(self): | ||||
settings = QSettings() | settings = QSettings() | ||||
@@ -2160,13 +2160,13 @@ class ClaudiaMainW(AbstractCanvasJackClass): | |||||
@pyqtSlot() | @pyqtSlot() | ||||
def slot_miniCanvasInit(self): | def slot_miniCanvasInit(self): | ||||
settings = QSettings() | settings = QSettings() | ||||
self.ui.graphicsView.horizontalScrollBar().setValue(settings.value("HorizontalScrollBarValue", DEFAULT_CANVAS_WIDTH / 3, type=int)) | |||||
self.ui.graphicsView.verticalScrollBar().setValue(settings.value("VerticalScrollBarValue", DEFAULT_CANVAS_HEIGHT * 3 / 8, type=int)) | |||||
self.ui.graphicsView.horizontalScrollBar().setValue(settings.value("HorizontalScrollBarValue", int(DEFAULT_CANVAS_WIDTH / 3), type=int)) | |||||
self.ui.graphicsView.verticalScrollBar().setValue(settings.value("VerticalScrollBarValue", int(DEFAULT_CANVAS_HEIGHT * 3 / 8), type=int)) | |||||
@pyqtSlot(float, float) | @pyqtSlot(float, float) | ||||
def slot_miniCanvasMoved(self, xp, yp): | def slot_miniCanvasMoved(self, xp, yp): | ||||
self.ui.graphicsView.horizontalScrollBar().setValue(xp * DEFAULT_CANVAS_WIDTH) | |||||
self.ui.graphicsView.verticalScrollBar().setValue(yp * DEFAULT_CANVAS_HEIGHT) | |||||
self.ui.graphicsView.horizontalScrollBar().setValue(int(xp * DEFAULT_CANVAS_WIDTH)) | |||||
self.ui.graphicsView.verticalScrollBar().setValue(int(yp * DEFAULT_CANVAS_HEIGHT)) | |||||
@pyqtSlot() | @pyqtSlot() | ||||
def slot_miniCanvasCheckAll(self): | def slot_miniCanvasCheckAll(self): | ||||
@@ -2176,7 +2176,8 @@ class ClaudiaMainW(AbstractCanvasJackClass): | |||||
@pyqtSlot() | @pyqtSlot() | ||||
def slot_miniCanvasCheckSize(self): | def slot_miniCanvasCheckSize(self): | ||||
self.ui.miniCanvasPreview.setViewSize(float(self.ui.graphicsView.width()) / DEFAULT_CANVAS_WIDTH, float(self.ui.graphicsView.height()) / DEFAULT_CANVAS_HEIGHT) | |||||
self.ui.miniCanvasPreview.setViewSize(float(self.ui.graphicsView.width()) / DEFAULT_CANVAS_WIDTH, | |||||
float(self.ui.graphicsView.height()) / DEFAULT_CANVAS_HEIGHT) | |||||
@pyqtSlot() | @pyqtSlot() | ||||
def slot_handleCrash_jack(self): | def slot_handleCrash_jack(self): | ||||
@@ -2655,7 +2656,7 @@ class ClaudiaMainW(AbstractCanvasJackClass): | |||||
QMessageBox.about(self, self.tr("About Claudia"), self.tr("<h3>Claudia</h3>" | QMessageBox.about(self, self.tr("About Claudia"), self.tr("<h3>Claudia</h3>" | ||||
"<br>Version %s" | "<br>Version %s" | ||||
"<br>Claudia is a Graphical User Interface to LADISH.<br>" | "<br>Claudia is a Graphical User Interface to LADISH.<br>" | ||||
"<br>Copyright (C) 2010-2018 falkTX" % VERSION)) | |||||
"<br>Copyright (C) 2010-2022 falkTX" % VERSION)) | |||||
def saveSettings(self): | def saveSettings(self): | ||||
settings = QSettings() | settings = QSettings() | ||||
@@ -406,7 +406,7 @@ class JackSettingsW(QDialog): | |||||
elif attribute == "client-timeout": | elif attribute == "client-timeout": | ||||
self.setComboBoxValue(self.ui.obj_server_client_timeout, str(int(value))) | self.setComboBoxValue(self.ui.obj_server_client_timeout, str(int(value))) | ||||
elif attribute == "clock-source": | elif attribute == "clock-source": | ||||
if len(str(value)) == 1 : | |||||
if len(str(value)) == 1 and not isinstance(value, dbus.UInt32): | |||||
value = str(value) | value = str(value) | ||||
if value == "c": | if value == "c": | ||||
self.ui.obj_server_clock_source_cycle.setChecked(True) | self.ui.obj_server_clock_source_cycle.setChecked(True) | ||||
@@ -2480,16 +2480,16 @@ class CanvasBox(QGraphicsItem): | |||||
else: | else: | ||||
painter.setBrush(canvas.theme.box_bg_1) | painter.setBrush(canvas.theme.box_bg_1) | ||||
painter.drawRect(0, 0, self.p_width, self.p_height) | |||||
painter.drawRect(QRectF(0, 0, self.p_width, self.p_height)) | |||||
# Draw pixmap header | # Draw pixmap header | ||||
if canvas.theme.box_header_pixmap: | if canvas.theme.box_header_pixmap: | ||||
painter.setPen(Qt.NoPen) | painter.setPen(Qt.NoPen) | ||||
painter.setBrush(canvas.theme.box_bg_2) | painter.setBrush(canvas.theme.box_bg_2) | ||||
painter.drawRect(1, 1, self.p_width-2, canvas.theme.box_header_height) | |||||
painter.drawRect(QRectF(1, 1, self.p_width-2, canvas.theme.box_header_height)) | |||||
headerPos = QPointF(1, 1) | headerPos = QPointF(1, 1) | ||||
headerRect = QRectF(2, 2, self.p_width-4, canvas.theme.box_header_height-3) | |||||
headerRect = QRectF(2, 2, int(self.p_width-4), canvas.theme.box_header_height-3) | |||||
painter.drawTiledPixmap(headerRect, canvas.theme.box_header_pixmap, headerPos) | painter.drawTiledPixmap(headerRect, canvas.theme.box_header_pixmap, headerPos) | ||||
# Draw text | # Draw text | ||||
@@ -349,7 +349,7 @@ class RenderW(QDialog): | |||||
@pyqtSlot() | @pyqtSlot() | ||||
def slot_updateProgressbar(self): | def slot_updateProgressbar(self): | ||||
time = int(jacklib.get_current_transport_frame(self.fJackClient)) / self.fSampleRate | |||||
time = int(int(jacklib.get_current_transport_frame(self.fJackClient)) / self.fSampleRate) | |||||
self.ui.progressBar.setValue(time) | self.ui.progressBar.setValue(time) | ||||
if time > self.fMaxTime or (self.fLastTime > time and not self.fFreewheel): | if time > self.fMaxTime or (self.fLastTime > time and not self.fFreewheel): | ||||
@@ -85,7 +85,7 @@ sys.excepthook = sys_excepthook | |||||
# ------------------------------------------------------------------------------------------------------------ | # ------------------------------------------------------------------------------------------------------------ | ||||
# Set Version | # Set Version | ||||
VERSION = "0.9.0" | |||||
VERSION = "0.9.2" | |||||
# ------------------------------------------------------------------------------------------------------------ | # ------------------------------------------------------------------------------------------------------------ | ||||
# Set Debug mode | # Set Debug mode | ||||
@@ -515,7 +515,7 @@ class AbstractCanvasJackClass(QMainWindow): | |||||
imgFormat = "PNG" | imgFormat = "PNG" | ||||
newPath += ".png" | newPath += ".png" | ||||
self.fExportImage = QImage(self.scene.sceneRect().width(), self.scene.sceneRect().height(), QImage.Format_RGB32) | |||||
self.fExportImage = QImage(int(self.scene.sceneRect().width()), int(self.scene.sceneRect().height()), QImage.Format_RGB32) | |||||
painter = QPainter(self.fExportImage) | painter = QPainter(self.fExportImage) | ||||
painter.save() | painter.save() | ||||
painter.setRenderHint(QPainter.Antialiasing, True) | painter.setRenderHint(QPainter.Antialiasing, True) | ||||