@@ -771,6 +771,7 @@ class CatarinaMainW(QMainWindow, ui_catarina.Ui_CatarinaMainW): | |||||
patchcanvas.connectPorts(connection[iConnId], connection[iConnOutput], connection[iConnInput]) | patchcanvas.connectPorts(connection[iConnId], connection[iConnOutput], connection[iConnInput]) | ||||
self.m_group_list_pos = [] | self.m_group_list_pos = [] | ||||
patchcanvas.updateZValues() | |||||
def saveFile(self, path): | def saveFile(self, path): | ||||
content = ("<?xml version='1.0' encoding='UTF-8'?>\n" | content = ("<?xml version='1.0' encoding='UTF-8'?>\n" | ||||
@@ -1055,9 +1056,9 @@ class CatarinaMainW(QMainWindow, ui_catarina.Ui_CatarinaMainW): | |||||
new_port = [None, None, None, None, None] | new_port = [None, None, None, None, None] | ||||
new_port[iPortGroup] = group_id | new_port[iPortGroup] = group_id | ||||
new_port[iPortId] = self.m_last_port_id | new_port[iPortId] = self.m_last_port_id | ||||
new_port[iPortName] = new_port_name | |||||
new_port[iPortMode] = new_port_mode | |||||
new_port[iPortType] = new_port_type | |||||
new_port[iPortName] = port_name | |||||
new_port[iPortMode] = port_mode | |||||
new_port[iPortType] = port_type | |||||
self.m_port_list.append(new_port) | self.m_port_list.append(new_port) | ||||
self.m_last_port_id += 1 | self.m_last_port_id += 1 | ||||
@@ -1074,12 +1075,12 @@ class CatarinaMainW(QMainWindow, ui_catarina.Ui_CatarinaMainW): | |||||
for connection in self.m_connection_list: | for connection in self.m_connection_list: | ||||
if (connection[iConnOutput] == port_id or connection[iConnInput] == port_id): | if (connection[iConnOutput] == port_id or connection[iConnInput] == port_id): | ||||
patchcanvas.disconnectPorts(self.m_connection_list[i-h][iConnId]) | |||||
patchcanvas.disconnectPorts(connection[iConnId]) | |||||
self.m_connection_list.remove(connection) | self.m_connection_list.remove(connection) | ||||
patchcanvas.removePort(port_id) | patchcanvas.removePort(port_id) | ||||
for port in range(len(self.m_port_list)): | |||||
for port in self.m_port_list: | |||||
if (port[iPortId] == port_id): | if (port[iPortId] == port_id): | ||||
self.m_port_list.remove(port) | self.m_port_list.remove(port) | ||||
break | break | ||||
@@ -1113,7 +1114,7 @@ class CatarinaMainW(QMainWindow, ui_catarina.Ui_CatarinaMainW): | |||||
port_out_id = dialog.ret_port_out_id | port_out_id = dialog.ret_port_out_id | ||||
port_in_id = dialog.ret_port_in_id | port_in_id = dialog.ret_port_in_id | ||||
for connection in range(len(self.m_connection_list)): | |||||
for connection in self.m_connection_list: | |||||
if (connection[iConnOutput] == port_out_id and connection[iConnInput] == port_in_id): | if (connection[iConnOutput] == port_out_id and connection[iConnInput] == port_in_id): | ||||
QMessageBox.warning(self, self.tr("Warning"), self.tr("Ports already connected!")) | QMessageBox.warning(self, self.tr("Warning"), self.tr("Ports already connected!")) | ||||
return | return | ||||
@@ -1136,12 +1137,13 @@ class CatarinaMainW(QMainWindow, ui_catarina.Ui_CatarinaMainW): | |||||
if (len(self.m_connection_list) > 0): | if (len(self.m_connection_list) > 0): | ||||
dialog = CatarinaDisconnectPortsW(self, self.m_group_list, self.m_port_list, self.m_connection_list) | dialog = CatarinaDisconnectPortsW(self, self.m_group_list, self.m_port_list, self.m_connection_list) | ||||
if (dialog.exec_()): | if (dialog.exec_()): | ||||
connection_id = 0 | |||||
connection_id = -1 | |||||
port_out_id = dialog.ret_port_out_id | port_out_id = dialog.ret_port_out_id | ||||
port_in_id = dialog.ret_port_in_id | port_in_id = dialog.ret_port_in_id | ||||
for connection in range(len(self.m_connection_list)): | |||||
for connection in self.m_connection_list: | |||||
if (connection[iConnOutput] == port_out_id and connection[iConnInput] == port_in_id): | if (connection[iConnOutput] == port_out_id and connection[iConnInput] == port_in_id): | ||||
connection_id = connection[iConnId] | |||||
self.m_connection_list.remove(connection) | self.m_connection_list.remove(connection) | ||||
break | break | ||||
@@ -64,7 +64,7 @@ class DigitalPeakMeter(QWidget): | |||||
self.m_channels_data = [] | self.m_channels_data = [] | ||||
self.m_lastValueData = [] | self.m_lastValueData = [] | ||||
for i in range(channels): | |||||
for x in range(channels): | |||||
self.m_channels_data.append(0.0) | self.m_channels_data.append(0.0) | ||||
self.m_lastValueData.append(0.0) | self.m_lastValueData.append(0.0) | ||||
@@ -813,12 +813,12 @@ def midi_get_lost_event_count(port_buffer): | |||||
# Session | # Session | ||||
def set_timebase_callback(client, session_callback, arg): | |||||
def set_session_callback(client, session_callback, arg): | |||||
global _session_callback | global _session_callback | ||||
_session_callback = JackSessionCallback(session_callback) | _session_callback = JackSessionCallback(session_callback) | ||||
jacklib.jack_set_timebase_callback.argtypes = [POINTER(jack_client_t), JackSessionCallback, c_void_p] | |||||
jacklib.jack_set_timebase_callback.restype = c_int | |||||
return jacklib.jack_set_timebase_callback(client, _session_callback, arg) | |||||
jacklib.jack_set_session_callback.argtypes = [POINTER(jack_client_t), JackSessionCallback, c_void_p] | |||||
jacklib.jack_set_session_callback.restype = c_int | |||||
return jacklib.jack_set_session_callback(client, _session_callback, arg) | |||||
def session_reply(client, event): | def session_reply(client, event): | ||||
jacklib.jack_session_reply.argtypes = [POINTER(jack_client_t), POINTER(jack_session_event_t)] | jacklib.jack_session_reply.argtypes = [POINTER(jack_client_t), POINTER(jack_session_event_t)] | ||||
@@ -225,8 +225,8 @@ class LogsW(QDialog, ui_logs.Ui_LogsW): | |||||
LOG_FILE_LASH = os.path.join(LOG_PATH, "lash", "lash.log") | LOG_FILE_LASH = os.path.join(LOG_PATH, "lash", "lash.log") | ||||
LOG_FILE_LADISH = os.path.join(LOG_PATH, "ladish", "ladish.log") | LOG_FILE_LADISH = os.path.join(LOG_PATH, "ladish", "ladish.log") | ||||
def __init__(self, parent, flags): | |||||
QDialog.__init__(self, parent, flags) | |||||
def __init__(self, parent): | |||||
QDialog.__init__(self, parent) | |||||
self.setupUi(self) | self.setupUi(self) | ||||
self.b_close.setIcon(getIcon("window-close")) | self.b_close.setIcon(getIcon("window-close")) | ||||
@@ -17,7 +17,7 @@ | |||||
# For a full copy of the GNU General Public License see the COPYING file | # For a full copy of the GNU General Public License see the COPYING file | ||||
# Imports (Global) | # Imports (Global) | ||||
from PyQt4.QtCore import pyqtSlot, qDebug, qCritical, qFatal, Qt, QObject, SIGNAL, SLOT | |||||
from PyQt4.QtCore import pyqtSlot, qDebug, qCritical, qFatal, qWarning, Qt, QObject, SIGNAL, SLOT | |||||
from PyQt4.QtCore import QAbstractAnimation, QLineF, QPointF, QRectF, QSettings, QTimer | from PyQt4.QtCore import QAbstractAnimation, QLineF, QPointF, QRectF, QSettings, QTimer | ||||
from PyQt4.QtGui import QColor, QLinearGradient, QPen, QPolygonF, QPainter, QPainterPath | from PyQt4.QtGui import QColor, QLinearGradient, QPen, QPolygonF, QPainter, QPainterPath | ||||
from PyQt4.QtGui import QCursor, QFont, QFontMetrics, QInputDialog, QLineEdit, QMenu | from PyQt4.QtGui import QCursor, QFont, QFontMetrics, QInputDialog, QLineEdit, QMenu | ||||
@@ -873,9 +873,19 @@ def disconnectPorts(connection_id): | |||||
QTimer.singleShot(0, canvas.scene, SLOT("update()")) | QTimer.singleShot(0, canvas.scene, SLOT("update()")) | ||||
def Arrange(): | |||||
def arrange(): | |||||
if (canvas.debug): | if (canvas.debug): | ||||
qDebug("PatchCanvas::Arrange()") | |||||
qDebug("PatchCanvas::arrange()") | |||||
def updateZValues(): | |||||
if (canvas.debug): | |||||
qDebug("PatchCanvas::updateZValues()") | |||||
for group in canvas.group_list: | |||||
group.widgets[0].resetLinesZValue() | |||||
if (group.split and group.widgets[1]): | |||||
group.widgets[1].resetLinesZValue() | |||||
# Extra Internal functions | # Extra Internal functions | ||||
@@ -1726,7 +1736,7 @@ class CanvasPort(QGraphicsItem): | |||||
for connection in canvas.connection_list: | for connection in canvas.connection_list: | ||||
if ( (connection.port_out_id == self.m_port_id and connection.port_in_id == self.m_hover_item.getPortId()) or | if ( (connection.port_out_id == self.m_port_id and connection.port_in_id == self.m_hover_item.getPortId()) or | ||||
(connection.port_out_id == self.m_hover_item.getPortId() and connection.port_in_id == self.m_port_id) ): | (connection.port_out_id == self.m_hover_item.getPortId() and connection.port_in_id == self.m_port_id) ): | ||||
canvas.callback(ACTION_PORTS_DISCONNECT, canvas.connection_list[i].connection_id, 0, "") | |||||
canvas.callback(ACTION_PORTS_DISCONNECT, connection.connection_id, 0, "") | |||||
check = True | check = True | ||||
break | break | ||||
@@ -1778,7 +1788,7 @@ class CanvasPort(QGraphicsItem): | |||||
act_x_rename.setVisible(False) | act_x_rename.setVisible(False) | ||||
if (features.port_info == False and features.port_rename == False): | if (features.port_info == False and features.port_rename == False): | ||||
act_x_sep1.setVisible(False) | |||||
act_x_sep_1.setVisible(False) | |||||
act_selected = menu.exec_(event.screenPos()) | act_selected = menu.exec_(event.screenPos()) | ||||
@@ -1859,7 +1869,7 @@ class CanvasPort(QGraphicsItem): | |||||
poly_color = canvas.theme.port_midi_alsa_bg_sel if (self.isSelected()) else canvas.theme.port_midi_alsa_bg | poly_color = canvas.theme.port_midi_alsa_bg_sel if (self.isSelected()) else canvas.theme.port_midi_alsa_bg | ||||
poly_pen = canvas.theme.port_midi_alsa_pen_sel if (self.isSelected()) else canvas.theme.port_midi_alsa_pen | poly_pen = canvas.theme.port_midi_alsa_pen_sel if (self.isSelected()) else canvas.theme.port_midi_alsa_pen | ||||
else: | else: | ||||
qCritical("PatchCanvas::CanvasPort.paint() - invalid port type '%s'" % (port_type2str(m_port_type))) | |||||
qCritical("PatchCanvas::CanvasPort.paint() - invalid port type '%s'" % (port_type2str(self.m_port_type))) | |||||
return | return | ||||
polygon = QPolygonF() | polygon = QPolygonF() | ||||
@@ -41,6 +41,10 @@ VERSION = "0.5.0" | |||||
# Set Debug mode | # Set Debug mode | ||||
DEBUG = True | DEBUG = True | ||||
# Global variables | |||||
global x_gui | |||||
x_gui = None | |||||
# Small integrity tests | # Small integrity tests | ||||
HOME = os.getenv("HOME") | HOME = os.getenv("HOME") | ||||
if (HOME == None): | if (HOME == None): | ||||
@@ -184,8 +188,6 @@ def CustomMessageBox(self, icon, title, text, extraText="", buttons=QMessageBox. | |||||
# signal handler for unix systems | # signal handler for unix systems | ||||
def set_up_signals(_gui): | def set_up_signals(_gui): | ||||
if (WINDOWS == False): | |||||
from signal import signal, SIGINT, SIGTERM, SIGUSR1, SIGUSR2 | |||||
global x_gui | global x_gui | ||||
x_gui = _gui | x_gui = _gui | ||||
signal(SIGINT, signal_handler) | signal(SIGINT, signal_handler) | ||||
@@ -17,7 +17,6 @@ | |||||
# For a full copy of the GNU General Public License see the COPYING file | # For a full copy of the GNU General Public License see the COPYING file | ||||
# Imports (Global) | # Imports (Global) | ||||
import os | |||||
from PyQt4.QtCore import Qt, SIGNAL | from PyQt4.QtCore import Qt, SIGNAL | ||||
from PyQt4.QtGui import QFileDialog, QImage, QPainter, QPrinter, QPrintDialog | from PyQt4.QtGui import QFileDialog, QImage, QPainter, QPrinter, QPrintDialog | ||||
@@ -26,7 +25,7 @@ import patchcanvas | |||||
# Shared Canvas code | # Shared Canvas code | ||||
def canvas_arrange(self): | def canvas_arrange(self): | ||||
patchcanvas.Arrange() | |||||
patchcanvas.arrange() | |||||
def canvas_refresh(self): | def canvas_refresh(self): | ||||
self.init_ports_prepare() | self.init_ports_prepare() | ||||