@@ -31,7 +31,7 @@ except: | |||||
from carla_host import * | from carla_host import * | ||||
from carla_rack import CarlaRackW | from carla_rack import CarlaRackW | ||||
#from carla_patchbay import CarlaPatchbayW | |||||
from carla_patchbay import CarlaPatchbayW | |||||
# ------------------------------------------------------------------------------------------------------------ | # ------------------------------------------------------------------------------------------------------------ | ||||
# Main Window | # Main Window | ||||
@@ -40,8 +40,8 @@ class CarlaMiniW(HostWindow): | |||||
def __init__(self, parent=None): | def __init__(self, parent=None): | ||||
HostWindow.__init__(self, parent) | HostWindow.__init__(self, parent) | ||||
self.fContainer = CarlaRackW(self) | |||||
#self.fContainer = CarlaPatchbayW(self) | |||||
#self.fContainer = CarlaRackW(self) | |||||
self.fContainer = CarlaPatchbayW(self) | |||||
self.setCentralWidget(self.fContainer) | self.setCentralWidget(self.fContainer) | ||||
Carla.host.engine_init("JACK", "Carla") | Carla.host.engine_init("JACK", "Carla") | ||||
@@ -55,7 +55,7 @@ class CarlaMiniW(HostWindow): | |||||
HostWindow.closeEvent(self, event) | HostWindow.closeEvent(self, event) | ||||
# ------------------------------------------------------------------------------------------------------------ | # ------------------------------------------------------------------------------------------------------------ | ||||
# --------------- main ------------------ | |||||
# Main | |||||
if __name__ == '__main__': | if __name__ == '__main__': | ||||
# App initialization | # App initialization | ||||
@@ -65,15 +65,9 @@ if __name__ == '__main__': | |||||
app.setOrganizationName("falkTX") | app.setOrganizationName("falkTX") | ||||
app.setWindowIcon(QIcon(":/scalable/carla.svg")) | app.setWindowIcon(QIcon(":/scalable/carla.svg")) | ||||
libName = carla_library_filename | |||||
libPath = os.path.join(carla_library_filename.replace(carla_libname, ""), "..", "modules", "carla_native", "resources") | |||||
# Init backend | |||||
print("libName:", libName, ":", carla_libname) | |||||
Carla.host = Host(libName) | |||||
initHost() | |||||
Carla.host.set_engine_option(OPTION_PROCESS_NAME, 0, "carla") | Carla.host.set_engine_option(OPTION_PROCESS_NAME, 0, "carla") | ||||
Carla.host.set_engine_option(OPTION_PATH_RESOURCES, 0, libPath) | |||||
# Create GUI and start engine | # Create GUI and start engine | ||||
Carla.gui = CarlaMiniW() | Carla.gui = CarlaMiniW() | ||||
@@ -350,7 +350,7 @@ class SearchPluginsThread(QThread): | |||||
self.fCheckSF2 = False | self.fCheckSF2 = False | ||||
self.fCheckSFZ = False | self.fCheckSFZ = False | ||||
self.fToolNative = carla_discovery_native | |||||
self.fToolNative = Carla.discovery_native | |||||
self.fCurCount = 0 | self.fCurCount = 0 | ||||
self.fCurPercentValue = 0 | self.fCurPercentValue = 0 | ||||
@@ -365,6 +365,8 @@ class SearchPluginsThread(QThread): | |||||
self.fCsoundPlugins = [] | self.fCsoundPlugins = [] | ||||
self.fKitPlugins = [] | self.fKitPlugins = [] | ||||
print(Carla.discovery_native) | |||||
# ------------------------------------------------------------- | # ------------------------------------------------------------- | ||||
def hasSomethingChanged(self): | def hasSomethingChanged(self): | ||||
@@ -466,25 +468,25 @@ class SearchPluginsThread(QThread): | |||||
if not self.fContinueChecking: return | if not self.fContinueChecking: return | ||||
if self.fCheckPosix32: | if self.fCheckPosix32: | ||||
self._checkLADSPA(OS, carla_discovery_posix32) | |||||
self._checkLADSPA(OS, Carla.discovery_posix32) | |||||
settingsDB.setValue("Plugins/LADSPA_posix32", self.fLadspaPlugins) | settingsDB.setValue("Plugins/LADSPA_posix32", self.fLadspaPlugins) | ||||
if not self.fContinueChecking: return | if not self.fContinueChecking: return | ||||
if self.fCheckPosix64: | if self.fCheckPosix64: | ||||
self._checkLADSPA(OS, carla_discovery_posix64) | |||||
self._checkLADSPA(OS, Carla.discovery_posix64) | |||||
settingsDB.setValue("Plugins/LADSPA_posix64", self.fLadspaPlugins) | settingsDB.setValue("Plugins/LADSPA_posix64", self.fLadspaPlugins) | ||||
if not self.fContinueChecking: return | if not self.fContinueChecking: return | ||||
if self.fCheckWin32: | if self.fCheckWin32: | ||||
self._checkLADSPA("WINDOWS", carla_discovery_win32, not WINDOWS) | |||||
self._checkLADSPA("WINDOWS", Carla.discovery_win32, not WINDOWS) | |||||
settingsDB.setValue("Plugins/LADSPA_win32", self.fLadspaPlugins) | settingsDB.setValue("Plugins/LADSPA_win32", self.fLadspaPlugins) | ||||
if not self.fContinueChecking: return | if not self.fContinueChecking: return | ||||
if self.fCheckWin64: | if self.fCheckWin64: | ||||
self._checkLADSPA("WINDOWS", carla_discovery_win64, not WINDOWS) | |||||
self._checkLADSPA("WINDOWS", Carla.discovery_win64, not WINDOWS) | |||||
settingsDB.setValue("Plugins/LADSPA_win64", self.fLadspaPlugins) | settingsDB.setValue("Plugins/LADSPA_win64", self.fLadspaPlugins) | ||||
settingsDB.sync() | settingsDB.sync() | ||||
@@ -512,25 +514,25 @@ class SearchPluginsThread(QThread): | |||||
if not self.fContinueChecking: return | if not self.fContinueChecking: return | ||||
if self.fCheckPosix32: | if self.fCheckPosix32: | ||||
self._checkDSSI(OS, carla_discovery_posix32) | |||||
self._checkDSSI(OS, Carla.discovery_posix32) | |||||
settingsDB.setValue("Plugins/DSSI_posix32", self.fDssiPlugins) | settingsDB.setValue("Plugins/DSSI_posix32", self.fDssiPlugins) | ||||
if not self.fContinueChecking: return | if not self.fContinueChecking: return | ||||
if self.fCheckPosix64: | if self.fCheckPosix64: | ||||
self._checkDSSI(OS, carla_discovery_posix64) | |||||
self._checkDSSI(OS, Carla.discovery_posix64) | |||||
settingsDB.setValue("Plugins/DSSI_posix64", self.fDssiPlugins) | settingsDB.setValue("Plugins/DSSI_posix64", self.fDssiPlugins) | ||||
if not self.fContinueChecking: return | if not self.fContinueChecking: return | ||||
if self.fCheckWin32: | if self.fCheckWin32: | ||||
self._checkDSSI("WINDOWS", carla_discovery_win32, not WINDOWS) | |||||
self._checkDSSI("WINDOWS", Carla.discovery_win32, not WINDOWS) | |||||
settingsDB.setValue("Plugins/DSSI_win32", self.fDssiPlugins) | settingsDB.setValue("Plugins/DSSI_win32", self.fDssiPlugins) | ||||
if not self.fContinueChecking: return | if not self.fContinueChecking: return | ||||
if self.fCheckWin64: | if self.fCheckWin64: | ||||
self._checkDSSI("WINDOWS", carla_discovery_win64, not WINDOWS) | |||||
self._checkDSSI("WINDOWS", Carla.discovery_win64, not WINDOWS) | |||||
settingsDB.setValue("Plugins/DSSI_win64", self.fDssiPlugins) | settingsDB.setValue("Plugins/DSSI_win64", self.fDssiPlugins) | ||||
settingsDB.sync() | settingsDB.sync() | ||||
@@ -545,25 +547,25 @@ class SearchPluginsThread(QThread): | |||||
if not self.fContinueChecking: return | if not self.fContinueChecking: return | ||||
if self.fCheckPosix32: | if self.fCheckPosix32: | ||||
self._checkLV2(carla_discovery_posix32) | |||||
self._checkLV2(Carla.discovery_posix32) | |||||
settingsDB.setValue("Plugins/LV2_posix32", self.fLv2Plugins) | settingsDB.setValue("Plugins/LV2_posix32", self.fLv2Plugins) | ||||
if not self.fContinueChecking: return | if not self.fContinueChecking: return | ||||
if self.fCheckPosix64: | if self.fCheckPosix64: | ||||
self._checkLV2(carla_discovery_posix64) | |||||
self._checkLV2(Carla.discovery_posix64) | |||||
settingsDB.setValue("Plugins/LV2_posix64", self.fLv2Plugins) | settingsDB.setValue("Plugins/LV2_posix64", self.fLv2Plugins) | ||||
if not self.fContinueChecking: return | if not self.fContinueChecking: return | ||||
if self.fCheckWin32: | if self.fCheckWin32: | ||||
self._checkLV2(carla_discovery_win32, not WINDOWS) | |||||
self._checkLV2(Carla.discovery_win32, not WINDOWS) | |||||
settingsDB.setValue("Plugins/LV2_win32", self.fLv2Plugins) | settingsDB.setValue("Plugins/LV2_win32", self.fLv2Plugins) | ||||
if not self.fContinueChecking: return | if not self.fContinueChecking: return | ||||
if self.fCheckWin64: | if self.fCheckWin64: | ||||
self._checkLV2(carla_discovery_win64, not WINDOWS) | |||||
self._checkLV2(Carla.discovery_win64, not WINDOWS) | |||||
settingsDB.setValue("Plugins/LV2_win64", self.fLv2Plugins) | settingsDB.setValue("Plugins/LV2_win64", self.fLv2Plugins) | ||||
settingsDB.sync() | settingsDB.sync() | ||||
@@ -578,25 +580,25 @@ class SearchPluginsThread(QThread): | |||||
if not self.fContinueChecking: return | if not self.fContinueChecking: return | ||||
if self.fCheckPosix32: | if self.fCheckPosix32: | ||||
self._checkVST(OS, carla_discovery_posix32) | |||||
self._checkVST(OS, Carla.discovery_posix32) | |||||
settingsDB.setValue("Plugins/VST_posix32", self.fVstPlugins) | settingsDB.setValue("Plugins/VST_posix32", self.fVstPlugins) | ||||
if not self.fContinueChecking: return | if not self.fContinueChecking: return | ||||
if self.fCheckPosix64: | if self.fCheckPosix64: | ||||
self._checkVST(OS, carla_discovery_posix64) | |||||
self._checkVST(OS, Carla.discovery_posix64) | |||||
settingsDB.setValue("Plugins/VST_posix64", self.fVstPlugins) | settingsDB.setValue("Plugins/VST_posix64", self.fVstPlugins) | ||||
if not self.fContinueChecking: return | if not self.fContinueChecking: return | ||||
if self.fCheckWin32: | if self.fCheckWin32: | ||||
self._checkVST("WINDOWS", carla_discovery_win32, not WINDOWS) | |||||
self._checkVST("WINDOWS", Carla.discovery_win32, not WINDOWS) | |||||
settingsDB.setValue("Plugins/VST_win32", self.fVstPlugins) | settingsDB.setValue("Plugins/VST_win32", self.fVstPlugins) | ||||
if not self.fContinueChecking: return | if not self.fContinueChecking: return | ||||
if self.fCheckWin64: | if self.fCheckWin64: | ||||
self._checkVST("WINDOWS", carla_discovery_win64, not WINDOWS) | |||||
self._checkVST("WINDOWS", Carla.discovery_win64, not WINDOWS) | |||||
settingsDB.setValue("Plugins/VST_win64", self.fVstPlugins) | settingsDB.setValue("Plugins/VST_win64", self.fVstPlugins) | ||||
settingsDB.sync() | settingsDB.sync() | ||||
@@ -611,13 +613,13 @@ class SearchPluginsThread(QThread): | |||||
if not self.fContinueChecking: return | if not self.fContinueChecking: return | ||||
if self.fCheckPosix32: | if self.fCheckPosix32: | ||||
self._checkAU(carla_discovery_posix32) | |||||
self._checkAU(Carla.discovery_posix32) | |||||
settingsDB.setValue("Plugins/AU_posix32", self.fAuPlugins) | settingsDB.setValue("Plugins/AU_posix32", self.fAuPlugins) | ||||
if not self.fContinueChecking: return | if not self.fContinueChecking: return | ||||
if self.fCheckPosix64: | if self.fCheckPosix64: | ||||
self._checkAU(carla_discovery_posix64) | |||||
self._checkAU(Carla.discovery_posix64) | |||||
settingsDB.setValue("Plugins/AU_posix64", self.fAuPlugins) | settingsDB.setValue("Plugins/AU_posix64", self.fAuPlugins) | ||||
settingsDB.sync() | settingsDB.sync() | ||||
@@ -939,28 +941,28 @@ class PluginRefreshW(QDialog): | |||||
self.ui.ch_posix32.setText("MacOS 32bit") | self.ui.ch_posix32.setText("MacOS 32bit") | ||||
self.ui.ch_posix64.setText("MacOS 64bit") | self.ui.ch_posix64.setText("MacOS 64bit") | ||||
if carla_discovery_posix32 and not WINDOWS: | |||||
if Carla.discovery_posix32 and not WINDOWS: | |||||
self.ui.ico_posix32.setPixmap(self.fIconYes) | self.ui.ico_posix32.setPixmap(self.fIconYes) | ||||
else: | else: | ||||
self.ui.ico_posix32.setPixmap(self.fIconNo) | self.ui.ico_posix32.setPixmap(self.fIconNo) | ||||
self.ui.ch_posix32.setChecked(False) | self.ui.ch_posix32.setChecked(False) | ||||
self.ui.ch_posix32.setEnabled(False) | self.ui.ch_posix32.setEnabled(False) | ||||
if carla_discovery_posix64 and not WINDOWS: | |||||
if Carla.discovery_posix64 and not WINDOWS: | |||||
self.ui.ico_posix64.setPixmap(self.fIconYes) | self.ui.ico_posix64.setPixmap(self.fIconYes) | ||||
else: | else: | ||||
self.ui.ico_posix64.setPixmap(self.fIconNo) | self.ui.ico_posix64.setPixmap(self.fIconNo) | ||||
self.ui.ch_posix64.setChecked(False) | self.ui.ch_posix64.setChecked(False) | ||||
self.ui.ch_posix64.setEnabled(False) | self.ui.ch_posix64.setEnabled(False) | ||||
if carla_discovery_win32: | |||||
if Carla.discovery_win32: | |||||
self.ui.ico_win32.setPixmap(self.fIconYes) | self.ui.ico_win32.setPixmap(self.fIconYes) | ||||
else: | else: | ||||
self.ui.ico_win32.setPixmap(self.fIconNo) | self.ui.ico_win32.setPixmap(self.fIconNo) | ||||
self.ui.ch_win32.setChecked(False) | self.ui.ch_win32.setChecked(False) | ||||
self.ui.ch_win32.setEnabled(False) | self.ui.ch_win32.setEnabled(False) | ||||
if carla_discovery_win64: | |||||
if Carla.discovery_win64: | |||||
self.ui.ico_win64.setPixmap(self.fIconYes) | self.ui.ico_win64.setPixmap(self.fIconYes) | ||||
else: | else: | ||||
self.ui.ico_win64.setPixmap(self.fIconNo) | self.ui.ico_win64.setPixmap(self.fIconNo) | ||||
@@ -972,35 +974,35 @@ class PluginRefreshW(QDialog): | |||||
else: | else: | ||||
self.ui.ico_rdflib.setPixmap(self.fIconNo) | self.ui.ico_rdflib.setPixmap(self.fIconNo) | ||||
hasNative = bool(carla_discovery_native) | |||||
hasNative = bool(Carla.discovery_native) | |||||
hasNonNative = False | hasNonNative = False | ||||
if WINDOWS: | if WINDOWS: | ||||
if kIs64bit: | if kIs64bit: | ||||
hasNative = bool(carla_discovery_win64) | |||||
hasNonNative = bool(carla_discovery_win32) | |||||
self.fThread.setSearchToolNative(carla_discovery_win64) | |||||
hasNative = bool(Carla.discovery_win64) | |||||
hasNonNative = bool(Carla.discovery_win32) | |||||
self.fThread.setSearchToolNative(Carla.discovery_win64) | |||||
self.ui.ch_win64.setChecked(False) | self.ui.ch_win64.setChecked(False) | ||||
self.ui.ch_win64.setVisible(False) | self.ui.ch_win64.setVisible(False) | ||||
self.ui.ico_win64.setVisible(False) | self.ui.ico_win64.setVisible(False) | ||||
self.ui.label_win64.setVisible(False) | self.ui.label_win64.setVisible(False) | ||||
else: | else: | ||||
hasNative = bool(carla_discovery_win32) | |||||
hasNonNative = bool(carla_discovery_win64) | |||||
self.fThread.setSearchToolNative(carla_discovery_win32) | |||||
hasNative = bool(Carla.discovery_win32) | |||||
hasNonNative = bool(Carla.discovery_win64) | |||||
self.fThread.setSearchToolNative(Carla.discovery_win32) | |||||
self.ui.ch_win32.setChecked(False) | self.ui.ch_win32.setChecked(False) | ||||
self.ui.ch_win32.setVisible(False) | self.ui.ch_win32.setVisible(False) | ||||
self.ui.ico_win32.setVisible(False) | self.ui.ico_win32.setVisible(False) | ||||
self.ui.label_win32.setVisible(False) | self.ui.label_win32.setVisible(False) | ||||
elif LINUX or MACOS: | elif LINUX or MACOS: | ||||
if kIs64bit: | if kIs64bit: | ||||
hasNonNative = bool(carla_discovery_posix32 or carla_discovery_win32 or carla_discovery_win64) | |||||
hasNonNative = bool(Carla.discovery_posix32 or Carla.discovery_win32 or Carla.discovery_win64) | |||||
self.ui.ch_posix64.setChecked(False) | self.ui.ch_posix64.setChecked(False) | ||||
self.ui.ch_posix64.setVisible(False) | self.ui.ch_posix64.setVisible(False) | ||||
self.ui.ico_posix64.setVisible(False) | self.ui.ico_posix64.setVisible(False) | ||||
self.ui.label_posix64.setVisible(False) | self.ui.label_posix64.setVisible(False) | ||||
else: | else: | ||||
hasNonNative = bool(carla_discovery_posix64 or carla_discovery_win32 or carla_discovery_win64) | |||||
hasNonNative = bool(Carla.discovery_posix64 or Carla.discovery_win32 or Carla.discovery_win64) | |||||
self.ui.ch_posix32.setChecked(False) | self.ui.ch_posix32.setChecked(False) | ||||
self.ui.ch_posix32.setVisible(False) | self.ui.ch_posix32.setVisible(False) | ||||
self.ui.ico_posix32.setVisible(False) | self.ui.ico_posix32.setVisible(False) | ||||
@@ -1662,10 +1664,23 @@ class PluginDatabaseW(QDialog): | |||||
self.close() | self.close() | ||||
# ------------------------------------------------------------------------------------------------------------ | # ------------------------------------------------------------------------------------------------------------ | ||||
# TESTING | |||||
# Main | |||||
if __name__ == '__main__': | |||||
try: | |||||
from PyQt5.QtWidgets import QApplication | |||||
except: | |||||
from PyQt4.QtGui import QApplication | |||||
app = QApplication(sys.argv) | |||||
app.setApplicationName("Carla") | |||||
app.setApplicationVersion(VERSION) | |||||
app.setOrganizationName("falkTX") | |||||
app.setWindowIcon(QIcon(":/scalable/carla.svg")) | |||||
initHost(False) | |||||
gui = PluginDatabaseW(None) | |||||
gui.show() | |||||
#from PyQt5.QtWidgets import QApplication | |||||
#app = QApplication(sys.argv) | |||||
#gui = PluginDatabaseW(None) | |||||
#gui.show() | |||||
#app.exec_() | |||||
sys.exit(app.exec_()) |
@@ -198,70 +198,15 @@ class HostWindow(QMainWindow): | |||||
self.ui = ui_carla_host.Ui_CarlaHostW() | self.ui = ui_carla_host.Ui_CarlaHostW() | ||||
self.ui.setupUi(self) | self.ui.setupUi(self) | ||||
# ------------------------------------------------------------- | |||||
# Set bridge paths | |||||
if carla_bridge_native: | |||||
Carla.host.set_engine_option(OPTION_PATH_BRIDGE_NATIVE, 0, carla_bridge_native) | |||||
if carla_bridge_posix32: | |||||
Carla.host.set_engine_option(OPTION_PATH_BRIDGE_POSIX32, 0, carla_bridge_posix32) | |||||
if carla_bridge_posix64: | |||||
Carla.host.set_engine_option(OPTION_PATH_BRIDGE_POSIX64, 0, carla_bridge_posix64) | |||||
if carla_bridge_win32: | |||||
Carla.host.set_engine_option(OPTION_PATH_BRIDGE_WIN32, 0, carla_bridge_win32) | |||||
if carla_bridge_win64: | |||||
Carla.host.set_engine_option(OPTION_PATH_BRIDGE_WIN64, 0, carla_bridge_win64) | |||||
if carla_bridge_lv2_external: | |||||
Carla.host.set_engine_option(OPTION_PATH_BRIDGE_LV2_EXTERNAL, 0, carla_bridge_lv2_external) | |||||
if WINDOWS: | |||||
if carla_bridge_lv2_windows: | |||||
Carla.host.set_engine_option(OPTION_PATH_BRIDGE_LV2_WINDOWS, 0, carla_bridge_lv2_windows) | |||||
if carla_bridge_vst_hwnd: | |||||
Carla.host.set_engine_option(OPTION_PATH_BRIDGE_VST_HWND, 0, carla_bridge_vst_hwnd) | |||||
elif MACOS: | |||||
if carla_bridge_lv2_cocoa: | |||||
Carla.host.set_engine_option(OPTION_PATH_BRIDGE_LV2_COCOA, 0, carla_bridge_lv2_cocoa) | |||||
if carla_bridge_vst_mac: | |||||
Carla.host.set_engine_option(OPTION_PATH_BRIDGE_VST_MAC, 0, carla_bridge_vst_mac) | |||||
else: | |||||
if carla_bridge_lv2_gtk2: | |||||
Carla.host.set_engine_option(OPTION_PATH_BRIDGE_LV2_GTK2, 0, carla_bridge_lv2_gtk2) | |||||
if carla_bridge_lv2_gtk3: | |||||
Carla.host.set_engine_option(OPTION_PATH_BRIDGE_LV2_GTK3, 0, carla_bridge_lv2_gtk3) | |||||
if carla_bridge_lv2_qt4: | |||||
Carla.host.set_engine_option(OPTION_PATH_BRIDGE_LV2_QT4, 0, carla_bridge_lv2_qt4) | |||||
if carla_bridge_lv2_qt5: | |||||
Carla.host.set_engine_option(OPTION_PATH_BRIDGE_LV2_QT5, 0, carla_bridge_lv2_qt5) | |||||
if carla_bridge_lv2_x11: | |||||
Carla.host.set_engine_option(OPTION_PATH_BRIDGE_LV2_X11, 0, carla_bridge_lv2_x11) | |||||
if carla_bridge_vst_x11: | |||||
Carla.host.set_engine_option(OPTION_PATH_BRIDGE_VST_X11, 0, carla_bridge_vst_x11) | |||||
if False: | |||||
Carla.gui = self | |||||
self.fContainer = CarlaDummyW(self) | |||||
# ------------------------------------------------------------- | # ------------------------------------------------------------- | ||||
# Set callback | # Set callback | ||||
Carla.host.set_engine_callback(EngineCallback) | Carla.host.set_engine_callback(EngineCallback) | ||||
# ------------------------------------------------------------- | |||||
# Set custom signal handling | |||||
setUpSignals() | |||||
# ------------------------------------------------------------- | # ------------------------------------------------------------- | ||||
# Internal stuff | # Internal stuff | ||||
@@ -272,8 +217,6 @@ class HostWindow(QMainWindow): | |||||
self.fLadspaRdfNeedsUpdate = True | self.fLadspaRdfNeedsUpdate = True | ||||
self.fLadspaRdfList = [] | self.fLadspaRdfList = [] | ||||
self.fContainer = CarlaDummyW(self) | |||||
# ------------------------------------------------------------- | # ------------------------------------------------------------- | ||||
# Connect actions to functions | # Connect actions to functions | ||||
@@ -31,11 +31,11 @@ except: | |||||
# ------------------------------------------------------------------------------------------------------------ | # ------------------------------------------------------------------------------------------------------------ | ||||
# Imports (Custom) | # Imports (Custom) | ||||
#import patchcanvas | |||||
import ui_carla_settings | import ui_carla_settings | ||||
import ui_carla_settings_driver | import ui_carla_settings_driver | ||||
from carla_shared import * | from carla_shared import * | ||||
from patchcanvas_theme import * | |||||
# ------------------------------------------------------------------------------------------------------------ | # ------------------------------------------------------------------------------------------------------------ | ||||
# Carla defaults | # Carla defaults | ||||
@@ -70,6 +70,12 @@ else: | |||||
CARLA_DEFAULT_PROCESS_MODE = PROCESS_MODE_CONTINUOUS_RACK | CARLA_DEFAULT_PROCESS_MODE = PROCESS_MODE_CONTINUOUS_RACK | ||||
CARLA_DEFAULT_TRANSPORT_MODE = TRANSPORT_MODE_INTERNAL | CARLA_DEFAULT_TRANSPORT_MODE = TRANSPORT_MODE_INTERNAL | ||||
# ------------------------------------------------------------------------------------------------------------ | |||||
# PatchCanvas defines | |||||
CANVAS_ANTIALIASING_SMALL = 1 | |||||
CANVAS_EYECANDY_SMALL = 1 | |||||
# ------------------------------------------------------------------------------------------------------------ | # ------------------------------------------------------------------------------------------------------------ | ||||
# ... | # ... | ||||
@@ -177,7 +183,7 @@ class CarlaSettingsW(QDialog): | |||||
# so add +2 pos padding if driverName != "JACK". | # so add +2 pos padding if driverName != "JACK". | ||||
PROCESS_MODE_NON_JACK_PADDING = 2 | PROCESS_MODE_NON_JACK_PADDING = 2 | ||||
def __init__(self, parent, hasGL): | |||||
def __init__(self, parent, hasCanvas, hasGL): | |||||
QDialog.__init__(self, parent) | QDialog.__init__(self, parent) | ||||
self.ui = ui_carla_settings.Ui_CarlaSettingsW() | self.ui = ui_carla_settings.Ui_CarlaSettingsW() | ||||
self.ui.setupUi(self) | self.ui.setupUi(self) | ||||
@@ -256,20 +262,20 @@ class CarlaSettingsW(QDialog): | |||||
# --------------------------------------- | # --------------------------------------- | ||||
#self.ui.cb_canvas_hide_groups.setChecked(settings.value("Canvas/AutoHideGroups", False, type=bool)) | |||||
#self.ui.cb_canvas_bezier_lines.setChecked(settings.value("Canvas/UseBezierLines", True, type=bool)) | |||||
#self.ui.cb_canvas_eyecandy.setCheckState(settings.value("Canvas/EyeCandy", patchcanvas.EYECANDY_SMALL, type=int)) | |||||
#self.ui.cb_canvas_use_opengl.setChecked(settings.value("Canvas/UseOpenGL", False, type=bool)) | |||||
#self.ui.cb_canvas_render_aa.setCheckState(settings.value("Canvas/Antialiasing", patchcanvas.ANTIALIASING_SMALL, type=int)) | |||||
#self.ui.cb_canvas_render_hq_aa.setChecked(settings.value("Canvas/HighQualityAntialiasing", False, type=bool)) | |||||
self.ui.cb_canvas_hide_groups.setChecked(settings.value("Canvas/AutoHideGroups", False, type=bool)) | |||||
self.ui.cb_canvas_bezier_lines.setChecked(settings.value("Canvas/UseBezierLines", True, type=bool)) | |||||
self.ui.cb_canvas_eyecandy.setCheckState(settings.value("Canvas/EyeCandy", CANVAS_EYECANDY_SMALL, type=int)) | |||||
self.ui.cb_canvas_use_opengl.setChecked(settings.value("Canvas/UseOpenGL", False, type=bool)) | |||||
self.ui.cb_canvas_render_aa.setCheckState(settings.value("Canvas/Antialiasing", CANVAS_ANTIALIASING_SMALL, type=int)) | |||||
self.ui.cb_canvas_render_hq_aa.setChecked(settings.value("Canvas/HighQualityAntialiasing", False, type=bool)) | |||||
#canvasThemeName = settings.value("Canvas/Theme", patchcanvas.getDefaultThemeName(), type=str) | |||||
canvasThemeName = settings.value("Canvas/Theme", getDefaultThemeName(), type=str) | |||||
#for i in range(patchcanvas.Theme.THEME_MAX): | |||||
#thisThemeName = patchcanvas.getThemeName(i) | |||||
#self.ui.cb_canvas_theme.addItem(thisThemeName) | |||||
#if thisThemeName == canvasThemeName: | |||||
#self.ui.cb_canvas_theme.setCurrentIndex(i) | |||||
for i in range(Theme.THEME_MAX): | |||||
thisThemeName = getThemeName(i) | |||||
self.ui.cb_canvas_theme.addItem(thisThemeName) | |||||
if thisThemeName == canvasThemeName: | |||||
self.ui.cb_canvas_theme.setCurrentIndex(i) | |||||
# -------------------------------------------- | # -------------------------------------------- | ||||
@@ -637,10 +643,23 @@ class CarlaSettingsW(QDialog): | |||||
self.close() | self.close() | ||||
# ------------------------------------------------------------------------------------------------------------ | # ------------------------------------------------------------------------------------------------------------ | ||||
# TESTING | |||||
# Main | |||||
if __name__ == '__main__': | |||||
try: | |||||
from PyQt5.QtWidgets import QApplication | |||||
except: | |||||
from PyQt4.QtGui import QApplication | |||||
app = QApplication(sys.argv) | |||||
app.setApplicationName("Carla") | |||||
app.setApplicationVersion(VERSION) | |||||
app.setOrganizationName("falkTX") | |||||
app.setWindowIcon(QIcon(":/scalable/carla.svg")) | |||||
initHost(False) | |||||
gui = CarlaSettingsW(None, True, True) | |||||
gui.show() | |||||
#from PyQt5.QtWidgets import QApplication | |||||
#app = QApplication(sys.argv) | |||||
#gui = CarlaSettingsW(None, True) | |||||
#gui.show() | |||||
#app.exec_() | |||||
sys.exit(app.exec_()) |
@@ -305,12 +305,25 @@ else: | |||||
class CarlaObject(object): | class CarlaObject(object): | ||||
__slots__ = [ | __slots__ = [ | ||||
# Host library object | |||||
'host', | 'host', | ||||
# Host Window | |||||
'gui', | 'gui', | ||||
# bool, is controller | |||||
'isControl', | 'isControl', | ||||
# bool, is controller local | |||||
'isLocal', | 'isLocal', | ||||
# current process mode | |||||
'processMode', | 'processMode', | ||||
# current max parameters | |||||
'maxParameters', | 'maxParameters', | ||||
# discovery tools | |||||
'discovery_native', | |||||
'discovery_posix32', | |||||
'discovery_posix64', | |||||
'discovery_win32', | |||||
'discovery_win64', | |||||
# default paths | |||||
'DEFAULT_LADSPA_PATH', | 'DEFAULT_LADSPA_PATH', | ||||
'DEFAULT_DSSI_PATH', | 'DEFAULT_DSSI_PATH', | ||||
'DEFAULT_LV2_PATH', | 'DEFAULT_LV2_PATH', | ||||
@@ -330,6 +343,12 @@ Carla.isLocal = True | |||||
Carla.processMode = PROCESS_MODE_MULTIPLE_CLIENTS if LINUX else PROCESS_MODE_CONTINUOUS_RACK | Carla.processMode = PROCESS_MODE_MULTIPLE_CLIENTS if LINUX else PROCESS_MODE_CONTINUOUS_RACK | ||||
Carla.maxParameters = MAX_DEFAULT_PARAMETERS | Carla.maxParameters = MAX_DEFAULT_PARAMETERS | ||||
Carla.discovery_native = "" | |||||
Carla.discovery_posix32 = "" | |||||
Carla.discovery_posix64 = "" | |||||
Carla.discovery_win32 = "" | |||||
Carla.discovery_win64 = "" | |||||
# ------------------------------------------------------------------------------------------------------------ | # ------------------------------------------------------------------------------------------------------------ | ||||
# Default Plugin Folders (set) | # Default Plugin Folders (set) | ||||
@@ -373,43 +392,7 @@ else: | |||||
Carla.DEFAULT_SFZ_PATH = DEFAULT_SFZ_PATH.split(splitter) | Carla.DEFAULT_SFZ_PATH = DEFAULT_SFZ_PATH.split(splitter) | ||||
# ------------------------------------------------------------------------------------------------------------ | # ------------------------------------------------------------------------------------------------------------ | ||||
# Search for Carla library and tools | |||||
carla_library_filename = "" | |||||
carla_discovery_native = "" | |||||
carla_discovery_posix32 = "" | |||||
carla_discovery_posix64 = "" | |||||
carla_discovery_win32 = "" | |||||
carla_discovery_win64 = "" | |||||
carla_bridge_native = "" | |||||
carla_bridge_posix32 = "" | |||||
carla_bridge_posix64 = "" | |||||
carla_bridge_win32 = "" | |||||
carla_bridge_win64 = "" | |||||
carla_bridge_lv2_external = "" | |||||
carla_bridge_lv2_gtk2 = "" | |||||
carla_bridge_lv2_gtk3 = "" | |||||
carla_bridge_lv2_qt4 = "" | |||||
carla_bridge_lv2_qt5 = "" | |||||
carla_bridge_lv2_cocoa = "" | |||||
carla_bridge_lv2_windows = "" | |||||
carla_bridge_lv2_x11 = "" | |||||
carla_bridge_vst_mac = "" | |||||
carla_bridge_vst_hwnd = "" | |||||
carla_bridge_vst_x11 = "" | |||||
carla_libname = "libcarla_%s" % ("control" if Carla.isControl else "standalone") | |||||
if WINDOWS: | |||||
carla_libname += ".dll" | |||||
elif MACOS: | |||||
carla_libname += ".dylib" | |||||
else: | |||||
carla_libname += ".so" | |||||
# Search for Carla tools | |||||
CWD = sys.path[0] | CWD = sys.path[0] | ||||
@@ -419,24 +402,6 @@ if CWD.endswith("/carla"): | |||||
elif CWD.endswith("\\carla.exe"): | elif CWD.endswith("\\carla.exe"): | ||||
CWD = CWD.rsplit("\\carla.exe", 1)[0] | CWD = CWD.rsplit("\\carla.exe", 1)[0] | ||||
# find carla_library_filename | |||||
if os.path.exists(os.path.join(CWD, "backend", carla_libname)): | |||||
carla_library_filename = os.path.join(CWD, "backend", carla_libname) | |||||
else: | |||||
if WINDOWS: | |||||
CARLA_PATH = (os.path.join(PROGRAMFILES, "Carla"),) | |||||
elif MACOS: | |||||
CARLA_PATH = ("/opt/local/lib", "/usr/local/lib/", "/usr/lib") | |||||
else: | |||||
CARLA_PATH = ("/usr/local/lib/", "/usr/lib") | |||||
for path in CARLA_PATH: | |||||
if os.path.exists(os.path.join(path, "carla", carla_libname)): | |||||
carla_library_filename = os.path.join(path, "carla", carla_libname) | |||||
break | |||||
del CARLA_PATH | |||||
# find tool | # find tool | ||||
def findTool(toolDir, toolName): | def findTool(toolDir, toolName): | ||||
if os.path.exists(os.path.join(CWD, toolDir, toolName)): | if os.path.exists(os.path.join(CWD, toolDir, toolName)): | ||||
@@ -448,42 +413,194 @@ def findTool(toolDir, toolName): | |||||
return "" | return "" | ||||
# find windows tools | |||||
carla_discovery_win32 = findTool("discovery", "carla-discovery-win32.exe") | |||||
carla_discovery_win64 = findTool("discovery", "carla-discovery-win64.exe") | |||||
carla_bridge_win32 = findTool("bridges", "carla-bridge-win32.exe") | |||||
carla_bridge_win64 = findTool("bridges", "carla-bridge-win64.exe") | |||||
# find native and posix tools | |||||
if not WINDOWS: | |||||
carla_discovery_native = findTool("discovery", "carla-discovery-native") | |||||
carla_discovery_posix32 = findTool("discovery", "carla-discovery-posix32") | |||||
carla_discovery_posix64 = findTool("discovery", "carla-discovery-posix64") | |||||
carla_bridge_native = findTool("bridges", "carla-bridge-native") | |||||
carla_bridge_posix32 = findTool("bridges", "carla-bridge-posix32") | |||||
carla_bridge_posix64 = findTool("bridges", "carla-bridge-posix64") | |||||
# find generic tools | |||||
carla_bridge_lv2_external = findTool("bridges", "carla-bridge-lv2-external") | |||||
# find windows only tools | |||||
if WINDOWS: | |||||
carla_bridge_lv2_windows = findTool("bridges", "carla-bridge-lv2-windows.exe") | |||||
carla_bridge_vst_hwnd = findTool("bridges", "carla-bridge-vst-hwnd.exe") | |||||
# ------------------------------------------------------------------------------------------------------------ | |||||
# Init host | |||||
# find mac os only tools | |||||
elif MACOS: | |||||
carla_bridge_lv2_cocoa = findTool("bridges", "carla-bridge-lv2-cocoa") | |||||
carla_bridge_vst_mac = findTool("bridges", "carla-bridge-vst-mac") | |||||
def initHost(failError = True): | |||||
# ------------------------------------------------------------- | |||||
# Search for Carla library | |||||
# find other tools | |||||
else: | |||||
carla_bridge_lv2_gtk2 = findTool("bridges", "carla-bridge-lv2-gtk2") | |||||
carla_bridge_lv2_gtk3 = findTool("bridges", "carla-bridge-lv2-gtk3") | |||||
carla_bridge_lv2_qt4 = findTool("bridges", "carla-bridge-lv2-qt4") | |||||
carla_bridge_lv2_qt5 = findTool("bridges", "carla-bridge-lv2-qt5") | |||||
carla_bridge_lv2_x11 = findTool("bridges", "carla-bridge-lv2-x11") | |||||
carla_bridge_vst_x11 = findTool("bridges", "carla-bridge-vst-x11") | |||||
libname = "libcarla_" | |||||
if Carla.isControl: | |||||
libname += "control" | |||||
else: | |||||
libname += "standalone" | |||||
if WINDOWS: | |||||
libname += ".dll" | |||||
elif MACOS: | |||||
libname += ".dylib" | |||||
else: | |||||
libname += ".so" | |||||
libfilename = "" | |||||
if os.path.exists(os.path.join(CWD, "backend", libname)): | |||||
libfilename = os.path.join(CWD, "backend", libname) | |||||
#else: | |||||
#CARLA_LIB_PATH = os.getenv("CARLA_LIB_PATH") | |||||
#if CARLA_LIB_PATH and os.path.exists(CARLA_LIB_PATH): | |||||
#CARLA_LIB_PATH = os.path.join(CARLA_LIB_PATH, "..") | |||||
#elif WINDOWS: | |||||
#CARLA_LIB_PATH = (os.path.join(PROGRAMFILES, "Carla"),) | |||||
#elif MACOS: | |||||
#CARLA_LIB_PATH = ("/opt/local/lib", "/usr/local/lib/", "/usr/lib") | |||||
#else: | |||||
#CARLA_LIB_PATH = ("/usr/local/lib/", "/usr/lib") | |||||
#for path in CARLA_LIB_PATH: | |||||
#if os.path.exists(os.path.join(path, "carla", libname)): | |||||
#libfilename = os.path.join(path, "carla", libname) | |||||
#break | |||||
# ------------------------------------------------------------- | |||||
# Search for Carla tools | |||||
carla_bridge_native = "" | |||||
carla_bridge_posix32 = "" | |||||
carla_bridge_posix64 = "" | |||||
carla_bridge_win32 = "" | |||||
carla_bridge_win64 = "" | |||||
carla_bridge_lv2_external = "" | |||||
carla_bridge_lv2_gtk2 = "" | |||||
carla_bridge_lv2_gtk3 = "" | |||||
carla_bridge_lv2_qt4 = "" | |||||
carla_bridge_lv2_qt5 = "" | |||||
carla_bridge_lv2_cocoa = "" | |||||
carla_bridge_lv2_windows = "" | |||||
carla_bridge_lv2_x11 = "" | |||||
carla_bridge_vst_mac = "" | |||||
carla_bridge_vst_hwnd = "" | |||||
carla_bridge_vst_x11 = "" | |||||
# ------------------------------------------------------------- | |||||
# find windows tools | |||||
Carla.discovery_win32 = findTool("discovery", "carla-discovery-win32.exe") | |||||
Carla.discovery_win64 = findTool("discovery", "carla-discovery-win64.exe") | |||||
carla_bridge_win32 = findTool("bridges", "carla-bridge-win32.exe") | |||||
carla_bridge_win64 = findTool("bridges", "carla-bridge-win64.exe") | |||||
# ------------------------------------------------------------- | |||||
# find native and posix tools | |||||
if not WINDOWS: | |||||
Carla.discovery_native = findTool("discovery", "carla-discovery-native") | |||||
Carla.discovery_posix32 = findTool("discovery", "carla-discovery-posix32") | |||||
Carla.discovery_posix64 = findTool("discovery", "carla-discovery-posix64") | |||||
carla_bridge_native = findTool("bridges", "carla-bridge-native") | |||||
carla_bridge_posix32 = findTool("bridges", "carla-bridge-posix32") | |||||
carla_bridge_posix64 = findTool("bridges", "carla-bridge-posix64") | |||||
# ------------------------------------------------------------- | |||||
# find generic tools | |||||
carla_bridge_lv2_external = findTool("bridges", "carla-bridge-lv2-external") | |||||
# ------------------------------------------------------------- | |||||
# find windows only tools | |||||
if WINDOWS: | |||||
carla_bridge_lv2_windows = findTool("bridges", "carla-bridge-lv2-windows.exe") | |||||
carla_bridge_vst_hwnd = findTool("bridges", "carla-bridge-vst-hwnd.exe") | |||||
# ------------------------------------------------------------- | |||||
# find mac os only tools | |||||
elif MACOS: | |||||
carla_bridge_lv2_cocoa = findTool("bridges", "carla-bridge-lv2-cocoa") | |||||
carla_bridge_vst_mac = findTool("bridges", "carla-bridge-vst-mac") | |||||
# ------------------------------------------------------------- | |||||
# find other tools | |||||
else: | |||||
carla_bridge_lv2_gtk2 = findTool("bridges", "carla-bridge-lv2-gtk2") | |||||
carla_bridge_lv2_gtk3 = findTool("bridges", "carla-bridge-lv2-gtk3") | |||||
carla_bridge_lv2_qt4 = findTool("bridges", "carla-bridge-lv2-qt4") | |||||
carla_bridge_lv2_qt5 = findTool("bridges", "carla-bridge-lv2-qt5") | |||||
carla_bridge_lv2_x11 = findTool("bridges", "carla-bridge-lv2-x11") | |||||
carla_bridge_vst_x11 = findTool("bridges", "carla-bridge-vst-x11") | |||||
if not libfilename: | |||||
if failError: | |||||
QMessageBox.critical(None, "Error", "Failed to find the carla library, cannot continue") | |||||
sys.exit(1) | |||||
return | |||||
# ------------------------------------------------------------- | |||||
# Init now | |||||
Carla.host = Host(libfilename) | |||||
# ------------------------------------------------------------- | |||||
# Set resource path | |||||
localResources = os.path.join(libfilename.replace(libname, ""), "..", "modules", "carla_native", "resources") | |||||
systemResources = os.path.join(libfilename.replace(libname, ""), "resources") | |||||
if os.path.exists(localResources): | |||||
Carla.host.set_engine_option(OPTION_PATH_RESOURCES, 0, localResources) | |||||
elif os.path.exists(systemResources): | |||||
Carla.host.set_engine_option(OPTION_PATH_RESOURCES, 0, systemResources) | |||||
# ------------------------------------------------------------- | |||||
# Set bridge paths | |||||
if carla_bridge_native: | |||||
Carla.host.set_engine_option(OPTION_PATH_BRIDGE_NATIVE, 0, carla_bridge_native) | |||||
if carla_bridge_posix32: | |||||
Carla.host.set_engine_option(OPTION_PATH_BRIDGE_POSIX32, 0, carla_bridge_posix32) | |||||
if carla_bridge_posix64: | |||||
Carla.host.set_engine_option(OPTION_PATH_BRIDGE_POSIX64, 0, carla_bridge_posix64) | |||||
if carla_bridge_win32: | |||||
Carla.host.set_engine_option(OPTION_PATH_BRIDGE_WIN32, 0, carla_bridge_win32) | |||||
if carla_bridge_win64: | |||||
Carla.host.set_engine_option(OPTION_PATH_BRIDGE_WIN64, 0, carla_bridge_win64) | |||||
if carla_bridge_lv2_external: | |||||
Carla.host.set_engine_option(OPTION_PATH_BRIDGE_LV2_EXTERNAL, 0, carla_bridge_lv2_external) | |||||
if WINDOWS: | |||||
if carla_bridge_lv2_windows: | |||||
Carla.host.set_engine_option(OPTION_PATH_BRIDGE_LV2_WINDOWS, 0, carla_bridge_lv2_windows) | |||||
if carla_bridge_vst_hwnd: | |||||
Carla.host.set_engine_option(OPTION_PATH_BRIDGE_VST_HWND, 0, carla_bridge_vst_hwnd) | |||||
elif MACOS: | |||||
if carla_bridge_lv2_cocoa: | |||||
Carla.host.set_engine_option(OPTION_PATH_BRIDGE_LV2_COCOA, 0, carla_bridge_lv2_cocoa) | |||||
if carla_bridge_vst_mac: | |||||
Carla.host.set_engine_option(OPTION_PATH_BRIDGE_VST_MAC, 0, carla_bridge_vst_mac) | |||||
else: | |||||
if carla_bridge_lv2_gtk2: | |||||
Carla.host.set_engine_option(OPTION_PATH_BRIDGE_LV2_GTK2, 0, carla_bridge_lv2_gtk2) | |||||
if carla_bridge_lv2_gtk3: | |||||
Carla.host.set_engine_option(OPTION_PATH_BRIDGE_LV2_GTK3, 0, carla_bridge_lv2_gtk3) | |||||
if carla_bridge_lv2_qt4: | |||||
Carla.host.set_engine_option(OPTION_PATH_BRIDGE_LV2_QT4, 0, carla_bridge_lv2_qt4) | |||||
if carla_bridge_lv2_qt5: | |||||
Carla.host.set_engine_option(OPTION_PATH_BRIDGE_LV2_QT5, 0, carla_bridge_lv2_qt5) | |||||
if carla_bridge_lv2_x11: | |||||
Carla.host.set_engine_option(OPTION_PATH_BRIDGE_LV2_X11, 0, carla_bridge_lv2_x11) | |||||
if carla_bridge_vst_x11: | |||||
Carla.host.set_engine_option(OPTION_PATH_BRIDGE_VST_X11, 0, carla_bridge_vst_x11) | |||||
# ------------------------------------------------------------------------------------------------------------ | # ------------------------------------------------------------------------------------------------------------ | ||||
# Convert a ctypes c_char_p into a python string | # Convert a ctypes c_char_p into a python string | ||||
@@ -1645,14 +1645,23 @@ class PluginWidget(QFrame): | |||||
QFrame.paintEvent(self, event) | QFrame.paintEvent(self, event) | ||||
# ------------------------------------------------------------------------------------------------------------ | # ------------------------------------------------------------------------------------------------------------ | ||||
# TESTING | |||||
#hasGL = True | |||||
#from PyQt5.QtWidgets import QApplication | |||||
#app = QApplication(sys.argv) | |||||
#gui = PluginParameter(None, pInfo, 0, 0) | |||||
#gui = PluginEdit(None, 0) | |||||
#gui = PluginWidget(None, 0) | |||||
#gui.show() | |||||
#app.exec_() | |||||
# Main | |||||
if __name__ == '__main__': | |||||
try: | |||||
from PyQt5.QtWidgets import QApplication | |||||
except: | |||||
from PyQt4.QtGui import QApplication | |||||
app = QApplication(sys.argv) | |||||
app.setApplicationName("Carla") | |||||
app.setApplicationVersion(VERSION) | |||||
app.setOrganizationName("falkTX") | |||||
app.setWindowIcon(QIcon(":/scalable/carla.svg")) | |||||
#gui = PluginParameter(None, gFakeParamInfo, 0, 0) | |||||
#gui = PluginEdit(None, 0) | |||||
gui = PluginWidget(None, 0) | |||||
gui.show() | |||||
sys.exit(app.exec_()) |