Browse Source

Delete old files; Qt4 compat updates

tags/1.9.4
falkTX 11 years ago
parent
commit
c5b446fedf
9 changed files with 40 additions and 1084 deletions
  1. +0
    -1
      Makefile
  2. +0
    -792
      resources/ui/carla.ui
  3. +0
    -273
      source/carla.py
  4. +2
    -2
      source/carla_database.py
  5. +7
    -3
      source/widgets/digitalpeakmeter.py
  6. +7
    -3
      source/widgets/ledbutton.py
  7. +7
    -3
      source/widgets/pixmapbutton.py
  8. +10
    -4
      source/widgets/pixmapdial.py
  9. +7
    -3
      source/widgets/pixmapkeyboard.py

+ 0
- 1
Makefile View File

@@ -82,7 +82,6 @@ source/%_rc.py: resources/%.qrc resources/*/*.png resources/*/*.svg
# UI code

UIs = \
source/ui_carla.py \
source/ui_carla_control.py \
source/ui_carla_about.py \
source/ui_carla_database.py \


+ 0
- 792
resources/ui/carla.ui View File

@@ -1,792 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>CarlaMainW</class>
<widget class="QMainWindow" name="CarlaMainW">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>782</width>
<height>482</height>
</rect>
</property>
<property name="acceptDrops">
<bool>true</bool>
</property>
<property name="windowTitle">
<string>Carla</string>
</property>
<widget class="QWidget" name="centralwidget">
<layout class="QVBoxLayout" name="verticalLayout_5">
<item>
<widget class="QSplitter" name="splitter">
<property name="acceptDrops">
<bool>false</bool>
</property>
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<widget class="QTabWidget" name="tabMain">
<property name="acceptDrops">
<bool>true</bool>
</property>
<property name="currentIndex">
<number>0</number>
</property>
<widget class="QWidget" name="tab_plugins">
<attribute name="title">
<string>Plugins</string>
</attribute>
<layout class="QVBoxLayout" name="verticalLayout">
<property name="spacing">
<number>0</number>
</property>
<property name="leftMargin">
<number>0</number>
</property>
<property name="topMargin">
<number>2</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>2</number>
</property>
<item>
<widget class="QWidget" name="w_plugins" native="true">
<layout class="QVBoxLayout" name="layout">
<property name="spacing">
<number>0</number>
</property>
<property name="margin">
<number>0</number>
</property>
</layout>
</widget>
</item>
<item>
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>333</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
<widget class="QWidget" name="tab_patchbay">
<attribute name="title">
<string>Patchbay</string>
</attribute>
<layout class="QVBoxLayout" name="verticalLayout_2">
<property name="spacing">
<number>0</number>
</property>
<property name="margin">
<number>2</number>
</property>
<item>
<widget class="QGraphicsView" name="graphicsView">
<property name="verticalScrollBarPolicy">
<enum>Qt::ScrollBarAlwaysOn</enum>
</property>
<property name="horizontalScrollBarPolicy">
<enum>Qt::ScrollBarAlwaysOn</enum>
</property>
</widget>
</item>
</layout>
</widget>
<widget class="QWidget" name="tab_log">
<attribute name="title">
<string>Log</string>
</attribute>
<layout class="QVBoxLayout" name="verticalLayout_6">
<property name="spacing">
<number>0</number>
</property>
<property name="margin">
<number>2</number>
</property>
<item>
<widget class="QPlainTextEdit" name="pte_log">
<property name="verticalScrollBarPolicy">
<enum>Qt::ScrollBarAlwaysOn</enum>
</property>
<property name="horizontalScrollBarPolicy">
<enum>Qt::ScrollBarAlwaysOn</enum>
</property>
<property name="undoRedoEnabled">
<bool>false</bool>
</property>
<property name="lineWrapMode">
<enum>QPlainTextEdit::NoWrap</enum>
</property>
<property name="plainText">
<string notr="true"/>
</property>
<property name="textInteractionFlags">
<set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse</set>
</property>
</widget>
</item>
</layout>
</widget>
</widget>
<widget class="QWidget" name="layoutWidget">
<layout class="QVBoxLayout" name="verticalLayout_4">
<property name="spacing">
<number>1</number>
</property>
<item>
<widget class="QTabWidget" name="tabUtils">
<property name="sizePolicy">
<sizepolicy hsizetype="Ignored" vsizetype="Expanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>210</width>
<height>0</height>
</size>
</property>
<property name="acceptDrops">
<bool>false</bool>
</property>
<property name="tabPosition">
<enum>QTabWidget::East</enum>
</property>
<property name="currentIndex">
<number>0</number>
</property>
<widget class="QWidget" name="disk">
<property name="acceptDrops">
<bool>false</bool>
</property>
<attribute name="title">
<string>Disk</string>
</attribute>
<layout class="QVBoxLayout" name="verticalLayout_3">
<property name="spacing">
<number>0</number>
</property>
<property name="leftMargin">
<number>0</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>1</number>
</property>
<item>
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="QComboBox" name="cb_disk">
<item>
<property name="text">
<string>Home</string>
</property>
</item>
</widget>
</item>
<item>
<widget class="QToolButton" name="b_disk_add">
<property name="text">
<string/>
</property>
<property name="icon">
<iconset resource="../resources.qrc">
<normaloff>:/16x16/list-add.png</normaloff>:/16x16/list-add.png</iconset>
</property>
</widget>
</item>
<item>
<widget class="QToolButton" name="b_disk_remove">
<property name="enabled">
<bool>false</bool>
</property>
<property name="text">
<string/>
</property>
<property name="icon">
<iconset resource="../resources.qrc">
<normaloff>:/16x16/list-remove.png</normaloff>:/16x16/list-remove.png</iconset>
</property>
</widget>
</item>
</layout>
</item>
<item>
<widget class="QTreeView" name="fileTreeView">
<property name="editTriggers">
<set>QAbstractItemView::NoEditTriggers</set>
</property>
<property name="dragEnabled">
<bool>true</bool>
</property>
<property name="dragDropMode">
<enum>QAbstractItemView::DragDrop</enum>
</property>
</widget>
</item>
</layout>
</widget>
</widget>
</item>
<item>
<widget class="CanvasPreviewFrame" name="miniCanvasPreview">
<property name="minimumSize">
<size>
<width>210</width>
<height>162</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>210</width>
<height>162</height>
</size>
</property>
<property name="acceptDrops">
<bool>false</bool>
</property>
<property name="frameShape">
<enum>QFrame::StyledPanel</enum>
</property>
<property name="frameShadow">
<enum>QFrame::Sunken</enum>
</property>
</widget>
</item>
</layout>
</widget>
</widget>
</item>
</layout>
</widget>
<widget class="QMenuBar" name="menubar">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>782</width>
<height>19</height>
</rect>
</property>
<widget class="QMenu" name="menu_File">
<property name="title">
<string>&amp;File</string>
</property>
<addaction name="act_file_new"/>
<addaction name="act_file_open"/>
<addaction name="act_file_save"/>
<addaction name="act_file_save_as"/>
<addaction name="separator"/>
<addaction name="act_file_quit"/>
</widget>
<widget class="QMenu" name="menu_Plugin">
<property name="title">
<string>&amp;Plugin</string>
</property>
<widget class="QMenu" name="menu_PluginMacros">
<property name="title">
<string>Macros (all plugins)</string>
</property>
<addaction name="act_plugins_enable"/>
<addaction name="act_plugins_disable"/>
<addaction name="separator"/>
<addaction name="act_plugins_volume100"/>
<addaction name="act_plugins_mute"/>
<addaction name="separator"/>
<addaction name="act_plugins_wet100"/>
<addaction name="act_plugins_bypass"/>
<addaction name="separator"/>
<addaction name="act_plugins_center"/>
</widget>
<addaction name="act_plugin_add"/>
<addaction name="act_plugin_remove_all"/>
<addaction name="separator"/>
<addaction name="menu_PluginMacros"/>
</widget>
<widget class="QMenu" name="menu_Help">
<property name="title">
<string>&amp;Help</string>
</property>
<addaction name="act_help_about"/>
<addaction name="act_help_about_qt"/>
</widget>
<widget class="QMenu" name="menu_Engine">
<property name="title">
<string>&amp;Engine</string>
</property>
<addaction name="act_engine_start"/>
<addaction name="act_engine_stop"/>
</widget>
<widget class="QMenu" name="menu_Settings">
<property name="title">
<string>&amp;Settings</string>
</property>
<addaction name="act_settings_show_toolbar"/>
<addaction name="separator"/>
<addaction name="act_settings_configure"/>
</widget>
<widget class="QMenu" name="menu_Canvas">
<property name="title">
<string>&amp;Canvas</string>
</property>
<widget class="QMenu" name="menu_Canvas_Zoom">
<property name="title">
<string>Zoom</string>
</property>
<addaction name="act_canvas_zoom_fit"/>
<addaction name="separator"/>
<addaction name="act_canvas_zoom_in"/>
<addaction name="act_canvas_zoom_out"/>
<addaction name="act_canvas_zoom_100"/>
</widget>
<addaction name="act_canvas_arrange"/>
<addaction name="act_canvas_refresh"/>
<addaction name="menu_Canvas_Zoom"/>
<addaction name="separator"/>
<addaction name="act_canvas_print"/>
<addaction name="act_canvas_save_image"/>
</widget>
<widget class="QMenu" name="menu_Transport">
<property name="title">
<string>&amp;Transport</string>
</property>
<addaction name="act_transport_play"/>
<addaction name="act_transport_stop"/>
<addaction name="act_transport_backwards"/>
<addaction name="act_transport_forwards"/>
</widget>
<addaction name="menu_File"/>
<addaction name="menu_Engine"/>
<addaction name="menu_Plugin"/>
<addaction name="menu_Transport"/>
<addaction name="menu_Canvas"/>
<addaction name="menu_Settings"/>
<addaction name="menu_Help"/>
</widget>
<widget class="QToolBar" name="toolBar">
<property name="windowTitle">
<string>toolBar</string>
</property>
<property name="movable">
<bool>false</bool>
</property>
<property name="allowedAreas">
<set>Qt::NoToolBarArea</set>
</property>
<property name="toolButtonStyle">
<enum>Qt::ToolButtonTextBesideIcon</enum>
</property>
<attribute name="toolBarArea">
<enum>TopToolBarArea</enum>
</attribute>
<attribute name="toolBarBreak">
<bool>false</bool>
</attribute>
<addaction name="act_file_new"/>
<addaction name="act_file_open"/>
<addaction name="act_file_save"/>
<addaction name="act_file_save_as"/>
<addaction name="separator"/>
<addaction name="act_plugin_add2"/>
<addaction name="act_plugin_remove_all"/>
<addaction name="act_plugins_panic"/>
<addaction name="separator"/>
<addaction name="act_settings_configure"/>
</widget>
<action name="act_file_save">
<property name="icon">
<iconset resource="../resources.qrc">
<normaloff>:/16x16/document-save.png</normaloff>:/16x16/document-save.png</iconset>
</property>
<property name="text">
<string>&amp;Save</string>
</property>
<property name="shortcut">
<string>Ctrl+S</string>
</property>
</action>
<action name="act_file_save_as">
<property name="icon">
<iconset resource="../resources.qrc">
<normaloff>:/16x16/document-save-as.png</normaloff>:/16x16/document-save-as.png</iconset>
</property>
<property name="text">
<string>Save &amp;As...</string>
</property>
<property name="shortcut">
<string>Ctrl+Shift+S</string>
</property>
</action>
<action name="act_file_new">
<property name="icon">
<iconset resource="../resources.qrc">
<normaloff>:/16x16/document-new.png</normaloff>:/16x16/document-new.png</iconset>
</property>
<property name="text">
<string>&amp;New</string>
</property>
<property name="shortcut">
<string>Ctrl+N</string>
</property>
</action>
<action name="act_file_open">
<property name="icon">
<iconset resource="../resources.qrc">
<normaloff>:/16x16/document-open.png</normaloff>:/16x16/document-open.png</iconset>
</property>
<property name="text">
<string>&amp;Open...</string>
</property>
<property name="shortcut">
<string>Ctrl+O</string>
</property>
</action>
<action name="act_file_quit">
<property name="icon">
<iconset resource="../resources.qrc">
<normaloff>:/16x16/application-exit.png</normaloff>:/16x16/application-exit.png</iconset>
</property>
<property name="text">
<string>&amp;Quit</string>
</property>
<property name="shortcut">
<string>Ctrl+Q</string>
</property>
</action>
<action name="act_plugin_remove_all">
<property name="icon">
<iconset resource="../resources.qrc">
<normaloff>:/16x16/edit-delete.png</normaloff>:/16x16/edit-delete.png</iconset>
</property>
<property name="text">
<string>&amp;Remove All</string>
</property>
</action>
<action name="act_help_about">
<property name="text">
<string>&amp;About</string>
</property>
</action>
<action name="act_help_about_qt">
<property name="text">
<string>About &amp;Qt</string>
</property>
</action>
<action name="act_plugin_add">
<property name="icon">
<iconset resource="../resources.qrc">
<normaloff>:/16x16/list-add.png</normaloff>:/16x16/list-add.png</iconset>
</property>
<property name="text">
<string>&amp;Add New...</string>
</property>
<property name="shortcut">
<string>Ctrl+A</string>
</property>
</action>
<action name="act_settings_show_toolbar">
<property name="checkable">
<bool>true</bool>
</property>
<property name="text">
<string>Show &amp;Toolbar</string>
</property>
</action>
<action name="act_settings_configure">
<property name="icon">
<iconset resource="../resources.qrc">
<normaloff>:/16x16/configure.png</normaloff>:/16x16/configure.png</iconset>
</property>
<property name="text">
<string>Configure Carla</string>
</property>
</action>
<action name="act_engine_start">
<property name="icon">
<iconset resource="../resources.qrc">
<normaloff>:/16x16/media-playback-start.png</normaloff>:/16x16/media-playback-start.png</iconset>
</property>
<property name="text">
<string>&amp;Start</string>
</property>
<property name="shortcut">
<string>F5</string>
</property>
</action>
<action name="act_engine_stop">
<property name="icon">
<iconset resource="../resources.qrc">
<normaloff>:/16x16/media-playback-stop.png</normaloff>:/16x16/media-playback-stop.png</iconset>
</property>
<property name="text">
<string>St&amp;op</string>
</property>
<property name="shortcut">
<string>F6</string>
</property>
</action>
<action name="act_canvas_arrange">
<property name="icon">
<iconset resource="../resources.qrc">
<normaloff>:/16x16/view-sort-ascending.png</normaloff>:/16x16/view-sort-ascending.png</iconset>
</property>
<property name="text">
<string>&amp;Arrange</string>
</property>
<property name="shortcut">
<string>Ctrl+G</string>
</property>
</action>
<action name="act_canvas_refresh">
<property name="icon">
<iconset resource="../resources.qrc">
<normaloff>:/16x16/view-refresh.png</normaloff>:/16x16/view-refresh.png</iconset>
</property>
<property name="text">
<string>&amp;Refresh</string>
</property>
<property name="shortcut">
<string>Ctrl+R</string>
</property>
</action>
<action name="act_canvas_print">
<property name="icon">
<iconset resource="../resources.qrc">
<normaloff>:/16x16/document-print.png</normaloff>:/16x16/document-print.png</iconset>
</property>
<property name="text">
<string>&amp;Print...</string>
</property>
</action>
<action name="act_canvas_save_image">
<property name="text">
<string>Save &amp;Image...</string>
</property>
</action>
<action name="act_canvas_zoom_fit">
<property name="icon">
<iconset resource="../resources.qrc">
<normaloff>:/16x16/zoom-fit-best.png</normaloff>:/16x16/zoom-fit-best.png</iconset>
</property>
<property name="text">
<string>Auto-Fit</string>
</property>
<property name="shortcut">
<string>Home</string>
</property>
</action>
<action name="act_canvas_zoom_in">
<property name="icon">
<iconset resource="../resources.qrc">
<normaloff>:/16x16/zoom-in.png</normaloff>:/16x16/zoom-in.png</iconset>
</property>
<property name="text">
<string>Zoom In</string>
</property>
<property name="shortcut">
<string>Ctrl++</string>
</property>
</action>
<action name="act_canvas_zoom_out">
<property name="icon">
<iconset resource="../resources.qrc">
<normaloff>:/16x16/zoom-out.png</normaloff>:/16x16/zoom-out.png</iconset>
</property>
<property name="text">
<string>Zoom Out</string>
</property>
<property name="shortcut">
<string>Ctrl+-</string>
</property>
</action>
<action name="act_canvas_zoom_100">
<property name="icon">
<iconset resource="../resources.qrc">
<normaloff>:/16x16/zoom-original.png</normaloff>:/16x16/zoom-original.png</iconset>
</property>
<property name="text">
<string>Zoom 100%</string>
</property>
<property name="shortcut">
<string>Ctrl+1</string>
</property>
</action>
<action name="act_transport_play">
<property name="checkable">
<bool>true</bool>
</property>
<property name="icon">
<iconset resource="../resources.qrc">
<normaloff>:/16x16/media-playback-start.png</normaloff>:/16x16/media-playback-start.png</iconset>
</property>
<property name="text">
<string>&amp;Play</string>
</property>
<property name="shortcut">
<string>Ctrl+Shift+P</string>
</property>
</action>
<action name="act_transport_stop">
<property name="icon">
<iconset resource="../resources.qrc">
<normaloff>:/16x16/media-playback-stop.png</normaloff>:/16x16/media-playback-stop.png</iconset>
</property>
<property name="text">
<string>&amp;Stop</string>
</property>
<property name="shortcut">
<string>Ctrl+Shift+X</string>
</property>
</action>
<action name="act_transport_backwards">
<property name="icon">
<iconset resource="../resources.qrc">
<normaloff>:/16x16/media-seek-backward.png</normaloff>:/16x16/media-seek-backward.png</iconset>
</property>
<property name="text">
<string>&amp;Backwards</string>
</property>
<property name="shortcut">
<string>Ctrl+Shift+B</string>
</property>
</action>
<action name="act_transport_forwards">
<property name="icon">
<iconset resource="../resources.qrc">
<normaloff>:/16x16/media-seek-forward.png</normaloff>:/16x16/media-seek-forward.png</iconset>
</property>
<property name="text">
<string>&amp;Forwards</string>
</property>
<property name="shortcut">
<string>Ctrl+Shift+F</string>
</property>
</action>
<action name="act_plugins_enable">
<property name="text">
<string>Enable</string>
</property>
</action>
<action name="act_plugins_disable">
<property name="text">
<string>Disable</string>
</property>
</action>
<action name="act_plugins_bypass">
<property name="text">
<string>0% Wet (Bypass)</string>
</property>
</action>
<action name="act_plugins_wet100">
<property name="text">
<string>100% Wet</string>
</property>
</action>
<action name="act_plugins_mute">
<property name="text">
<string>0% Volume (Mute)</string>
</property>
</action>
<action name="act_plugins_volume100">
<property name="text">
<string>100% Volume</string>
</property>
</action>
<action name="act_plugins_center">
<property name="text">
<string>Center Balance</string>
</property>
</action>
<action name="act_plugins_panic">
<property name="icon">
<iconset resource="../resources.qrc">
<normaloff>:/16x16/dialog-warning.png</normaloff>:/16x16/dialog-warning.png</iconset>
</property>
<property name="text">
<string>Panic</string>
</property>
<property name="toolTip">
<string>Panic</string>
</property>
</action>
<action name="act_plugin_add2">
<property name="icon">
<iconset resource="../resources.qrc">
<normaloff>:/16x16/list-add.png</normaloff>:/16x16/list-add.png</iconset>
</property>
<property name="text">
<string>Add New Plugin...</string>
</property>
<property name="toolTip">
<string>Add New Plugin</string>
</property>
</action>
<action name="act_file_export_lv2">
<property name="text">
<string>Export LV2 Plugin State...</string>
</property>
</action>
</widget>
<customwidgets>
<customwidget>
<class>CanvasPreviewFrame</class>
<extends>QFrame</extends>
<header>canvaspreviewframe.h</header>
<container>1</container>
</customwidget>
</customwidgets>
<resources>
<include location="../resources.qrc"/>
</resources>
<connections>
<connection>
<sender>act_file_quit</sender>
<signal>triggered()</signal>
<receiver>CarlaMainW</receiver>
<slot>close()</slot>
<hints>
<hint type="sourcelabel">
<x>-1</x>
<y>-1</y>
</hint>
<hint type="destinationlabel">
<x>189</x>
<y>34</y>
</hint>
</hints>
</connection>
<connection>
<sender>act_settings_show_toolbar</sender>
<signal>triggered(bool)</signal>
<receiver>toolBar</receiver>
<slot>setVisible(bool)</slot>
<hints>
<hint type="sourcelabel">
<x>-1</x>
<y>-1</y>
</hint>
<hint type="destinationlabel">
<x>354</x>
<y>35</y>
</hint>
</hints>
</connection>
</connections>
</ui>

+ 0
- 273
source/carla.py View File

@@ -1,273 +0,0 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-

# Carla plugin host
# Copyright (C) 2011-2013 Filipe Coelho <falktx@falktx.com>
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation; either version 2 of
# the License, or any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# For a full copy of the GNU General Public License see the GPL.txt file

# ------------------------------------------------------------------------------------------------------------
# Imports (Global)

from time import sleep
from PyQt5.QtCore import Qt, QModelIndex, QPointF, QSize
from PyQt5.QtGui import QImage, QPalette, QResizeEvent, QSyntaxHighlighter
from PyQt5.QtPrintSupport import QPrinter, QPrintDialog
from PyQt5.QtWidgets import QApplication, QDialogButtonBox, QFileSystemModel, QLabel, QMainWindow

# ------------------------------------------------------------------------------------------------------------
# Imports (Custom Stuff)

import ui_carla

from carla_shared import *

# ------------------------------------------------------------------------------------------------------------
# Global Variables

libPrefix = None
projectFilename = None

# ------------------------------------------------------------------------------------------------------------
# Log Syntax Highlighter

class LogSyntaxHighlighter(QSyntaxHighlighter):
def __init__(self, parent):
QSyntaxHighlighter.__init__(self, parent)

palette = parent.palette()

self.fColorDebug = palette.color(QPalette.Disabled, QPalette.WindowText)
self.fColorError = Qt.red

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

def highlightBlock(self, text):
if text.startswith("DEBUG:"):
self.setFormat(0, len(text), self.fColorDebug)
elif text.startswith("ERROR:"):
self.setFormat(0, len(text), self.fColorError)

# ------------------------------------------------------------------------------------------------------------
# Main Window

class CarlaMainW(QMainWindow):
def __init__(self, parent=None):
QMainWindow.__init__(self, parent)
self.ui = ui_carla.Ui_CarlaMainW()
self.ui.setupUi(self)

# -------------------------------------------------------------
# Internal stuff

self.fFirstEngineInit = True

# -------------------------------------------------------------
# Set-up GUI stuff

if not WINDOWS:
self.fSyntaxLog = LogSyntaxHighlighter(self.ui.pte_log)
self.fSyntaxLog.setDocument(self.ui.pte_log.document())

if LADISH_APP_NAME:
self.ui.miniCanvasPreview.setVisible(False)
self.ui.tabMain.removeTab(1)
else:
self.ui.tabMain.removeTab(2)

self.ui.act_engine_start.setEnabled(False)
self.ui.act_engine_stop.setEnabled(False)
self.ui.act_plugin_remove_all.setEnabled(False)

# FIXME: Qt4 needs this so it properly creates & resizes the canvas
self.ui.tabMain.setCurrentIndex(1)
self.ui.tabMain.setCurrentIndex(0)

# -------------------------------------------------------------
# Set-up Canvas Preview

self.ui.miniCanvasPreview.setRealParent(self)
self.ui.miniCanvasPreview.setViewTheme(patchcanvas.canvas.theme.canvas_bg, patchcanvas.canvas.theme.rubberband_brush, patchcanvas.canvas.theme.rubberband_pen.color())
self.ui.miniCanvasPreview.init(self.scene, DEFAULT_CANVAS_WIDTH, DEFAULT_CANVAS_HEIGHT, self.fSavedSettings["UseCustomMiniCanvasPaint"])
QTimer.singleShot(100, self, SLOT("slot_miniCanvasInit()"))

@pyqtSlot()
def slot_fileExportLv2Preset(self):
fileFilter = self.tr("LV2 Preset (*.lv2)")
filenameTry = QFileDialog.getSaveFileName(self, self.tr("Save Carla Project File"), self.fSavedSettings["Main/DefaultProjectFolder"], filter=fileFilter)

if not filenameTry:
return

if not filenameTry.endswith(".lv2"):
filenameTry += ".lv2"

if os.path.exists(filenameTry) and not os.path.isdir(filenameTry):
# TODO - error
return

# Save current project to a tmp file, and read it
tmpFile = os.path.join(TMP, "carla-plugin-export.carxp")

if not Carla.host.save_project(tmpFile):
# TODO - error
return

tmpFileFd = open(tmpFile, "r")
presetContents = tmpFileFd.read()
tmpFileFd.close()
os.remove(tmpFile)

# Create LV2 Preset
os.mkdir(filenameTry)

manifestPath = os.path.join(filenameTry, "manifest.ttl")

manifestFd = open(manifestPath, "w")
manifestFd.write("""# LV2 Preset for the Carla LV2 Plugin
@prefix lv2: <http://lv2plug.in/ns/lv2core#> .
@prefix pset: <http://lv2plug.in/ns/ext/presets#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix state: <http://lv2plug.in/ns/ext/state#> .

<file://%s>
a pset:Preset ;
lv2:appliesTo <http://kxstudio.sf.net/carla> ;
rdfs:label "%s" ;
state:state [
<http://kxstudio.sf.net/ns/carla/string>
\"\"\"
%s
\"\"\"
] .
""" % (manifestPath, os.path.basename(filenameTry), presetContents))
manifestFd.close()

@pyqtSlot(float, float)
def slot_miniCanvasMoved(self, xp, yp):
self.ui.graphicsView.horizontalScrollBar().setValue(xp * DEFAULT_CANVAS_WIDTH)
self.ui.graphicsView.verticalScrollBar().setValue(yp * DEFAULT_CANVAS_HEIGHT)

@pyqtSlot(int)
def slot_horizontalScrollBarChanged(self, value):
maximum = self.ui.graphicsView.horizontalScrollBar().maximum()
if maximum == 0:
xp = 0
else:
xp = float(value) / maximum
self.ui.miniCanvasPreview.setViewPosX(xp)

@pyqtSlot(int)
def slot_verticalScrollBarChanged(self, value):
maximum = self.ui.graphicsView.verticalScrollBar().maximum()
if maximum == 0:
yp = 0
else:
yp = float(value) / maximum
self.ui.miniCanvasPreview.setViewPosY(yp)

@pyqtSlot(int, int, QPointF)
def slot_canvasItemMoved(self, group_id, split_mode, pos):
self.ui.miniCanvasPreview.update()

@pyqtSlot(float)
def slot_canvasScaleChanged(self, scale):
self.ui.miniCanvasPreview.setViewScale(scale)

@pyqtSlot()
def slot_miniCanvasInit(self):
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))

@pyqtSlot()
def slot_miniCanvasCheckAll(self):
self.slot_miniCanvasCheckSize()
self.slot_horizontalScrollBarChanged(self.ui.graphicsView.horizontalScrollBar().value())
self.slot_verticalScrollBarChanged(self.ui.graphicsView.verticalScrollBar().value())

@pyqtSlot()
def slot_miniCanvasCheckSize(self):
self.ui.miniCanvasPreview.setViewSize(float(self.ui.graphicsView.width()) / DEFAULT_CANVAS_WIDTH, float(self.ui.graphicsView.height()) / DEFAULT_CANVAS_HEIGHT)

@pyqtSlot(str)
def slot_handleNSM_AnnounceCallback(self, smName):
self.fSessionManagerName = smName
self.ui.act_file_new.setEnabled(False)
self.ui.act_file_open.setEnabled(False)
self.ui.act_file_save_as.setEnabled(False)
self.ui.act_engine_start.setEnabled(True)
self.ui.act_engine_stop.setEnabled(False)

@pyqtSlot(str)
def slot_handleNSM_OpenCallback(self, data):
projectPath, clientId = data.rsplit(":", 1)
self.fClientName = clientId

# restart engine
if self.fEngineStarted:
self.stopEngine()

self.slot_engineStart()

if self.fEngineStarted:
self.loadProject(projectPath)

Carla.host.nsm_reply_open()

@pyqtSlot()
def slot_handleNSM_SaveCallback(self):
self.saveProject(self.fProjectFilename)
Carla.host.nsm_reply_save()

@pyqtSlot(str)
def slot_handleErrorCallback(self, error):
QMessageBox.critical(self, self.tr("Error"), error)

@pyqtSlot()
def slot_handleQuitCallback(self):
CustomMessageBox(self, QMessageBox.Warning, self.tr("Warning"),
self.tr("Engine has been stopped or crashed.\nPlease restart Carla"),
self.tr("You may want to save your session now..."), QMessageBox.Ok, QMessageBox.Ok)

def dragEnterEvent(self, event):
if event.source() == self.ui.fileTreeView:
event.accept()
elif self.ui.tabMain.contentsRect().contains(event.pos()):
event.accept()
else:
QMainWindow.dragEnterEvent(self, event)

def dropEvent(self, event):
event.accept()

urls = event.mimeData().urls()

for url in urls:
filename = url.toLocalFile()

if not Carla.host.load_filename(filename):
CustomMessageBox(self, QMessageBox.Critical, self.tr("Error"),
self.tr("Failed to load file"),
cString(Carla.host.get_last_error()), QMessageBox.Ok, QMessageBox.Ok)

def resizeEvent(self, event):
if self.ui.tabMain.currentIndex() == 0:
# Force update of 2nd tab
width = self.ui.tab_plugins.width()-4
height = self.ui.tab_plugins.height()-4
self.ui.miniCanvasPreview.setViewSize(float(width) / DEFAULT_CANVAS_WIDTH, float(height) / DEFAULT_CANVAS_HEIGHT)
else:
QTimer.singleShot(0, self, SLOT("slot_miniCanvasCheckSize()"))

QMainWindow.resizeEvent(self, event)

+ 2
- 2
source/carla_database.py View File

@@ -147,7 +147,7 @@ gDiscoveryProcess = None

def runCarlaDiscovery(itype, stype, filename, tool, isWine=False):
if not os.path.exists(tool):
qCritical("runCarlaDiscovery() - tool '%s' does not exist" % tool)
qWarning("runCarlaDiscovery() - tool '%s' does not exist" % tool)
return

command = []
@@ -1662,7 +1662,7 @@ class PluginDatabaseW(QDialog):
# Main

if __name__ == '__main__':
from carla_style import *
from carla_style import CarlaApplication

app = CarlaApplication()



+ 7
- 3
source/widgets/digitalpeakmeter.py View File

@@ -19,9 +19,13 @@
# ------------------------------------------------------------------------------------------------------------
# Imports (Global)

from PyQt5.QtCore import qCritical, Qt, QTimer, QSize
from PyQt5.QtGui import QColor, QLinearGradient, QPainter
from PyQt5.QtWidgets import QWidget
try:
from PyQt5.QtCore import qCritical, Qt, QTimer, QSize
from PyQt5.QtGui import QColor, QLinearGradient, QPainter
from PyQt5.QtWidgets import QWidget
except:
from PyQt4.QtCore import qCritical, Qt, QTimer, QSize
from PyQt4.QtGui import QColor, QLinearGradient, QPainter, QWidget

# ------------------------------------------------------------------------------------------------------------
# Widget Class


+ 7
- 3
source/widgets/ledbutton.py View File

@@ -19,9 +19,13 @@
# ------------------------------------------------------------------------------------------------------------
# Imports (Global)

from PyQt5.QtCore import qCritical, QRectF
from PyQt5.QtGui import QPainter, QPixmap
from PyQt5.QtWidgets import QPushButton
try:
from PyQt5.QtCore import qCritical, QRectF
from PyQt5.QtGui import QPainter, QPixmap
from PyQt5.QtWidgets import QPushButton
except:
from PyQt4.QtCore import qCritical, QRectF
from PyQt4.QtGui import QPainter, QPixmap, QPushButton

# ------------------------------------------------------------------------------------------------------------
# Widget Class


+ 7
- 3
source/widgets/pixmapbutton.py View File

@@ -19,9 +19,13 @@
# ------------------------------------------------------------------------------------------------------------
# Imports (Global)

from PyQt5.QtCore import QRectF
from PyQt5.QtGui import QPainter, QPixmap
from PyQt5.QtWidgets import QPushButton
try:
from PyQt5.QtCore import QRectF
from PyQt5.QtGui import QPainter, QPixmap
from PyQt5.QtWidgets import QPushButton
except:
from PyQt4.QtCore import QRectF
from PyQt4.QtGui import QPainter, QPixmap, QPushButton

# ------------------------------------------------------------------------------------------------------------
# Widget Class


+ 10
- 4
source/widgets/pixmapdial.py View File

@@ -20,10 +20,16 @@
# Imports (Global)

from math import floor
from PyQt5.QtCore import Qt, QPointF, QRectF, QTimer, QSize
from PyQt5.QtGui import QColor, QConicalGradient, QFont, QFontMetrics
from PyQt5.QtGui import QLinearGradient, QPainter, QPainterPath, QPen, QPixmap
from PyQt5.QtWidgets import QDial

try:
from PyQt5.QtCore import Qt, QPointF, QRectF, QTimer, QSize
from PyQt5.QtGui import QColor, QConicalGradient, QFont, QFontMetrics
from PyQt5.QtGui import QLinearGradient, QPainter, QPainterPath, QPen, QPixmap
from PyQt5.QtWidgets import QDial
except:
from PyQt4.QtCore import Qt, QPointF, QRectF, QTimer, QSize
from PyQt4.QtGui import QColor, QConicalGradient, QFont, QFontMetrics
from PyQt4.QtGui import QDial, QLinearGradient, QPainter, QPainterPath, QPen, QPixmap

# ------------------------------------------------------------------------------------------------------------
# Widget Class


+ 7
- 3
source/widgets/pixmapkeyboard.py View File

@@ -19,9 +19,13 @@
# ------------------------------------------------------------------------------------------------------------
# Imports (Global)

from PyQt5.QtCore import pyqtSignal, qCritical, Qt, QPointF, QRectF, QSize
from PyQt5.QtGui import QFont, QPainter, QPixmap
from PyQt5.QtWidgets import QWidget
try:
from PyQt5.QtCore import pyqtSignal, qCritical, Qt, QPointF, QRectF, QSize
from PyQt5.QtGui import QFont, QPainter, QPixmap
from PyQt5.QtWidgets import QWidget
except:
from PyQt4.QtCore import pyqtSignal, qCritical, Qt, QPointF, QRectF, QSize
from PyQt4.QtGui import QFont, QPainter, QPixmap, QWidget

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



Loading…
Cancel
Save