Browse Source

Add carla-rack/patchbay files for easy setup/starting

tags/1.9.4
falkTX 11 years ago
parent
commit
fb61ca773d
3 changed files with 101 additions and 16 deletions
  1. +96
    -0
      source/carla-patchbay
  2. +2
    -4
      source/carla-rack
  3. +3
    -12
      source/carla_style.py

+ 96
- 0
source/carla-patchbay View File

@@ -0,0 +1,96 @@
#!/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 (Custom Stuff)

from carla_host import *
from carla_patchbay import CarlaPatchbayW

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

class CarlaHostW(HostWindow):
def __init__(self, parent=None):
HostWindow.__init__(self, parent)

self.fContainer = CarlaPatchbayW(self)
self.setCentralWidget(self.fContainer)

# ------------------------------------------------------------------------------------------------------------
# Main

if __name__ == '__main__':
# -------------------------------------------------------------
# App initialization

app = CarlaApplication()

# -------------------------------------------------------------
# Set-up custom signal handling

setUpSignals()

# -------------------------------------------------------------
# Read CLI args

appName = os.path.basename(__file__) if ("__file__" in dir() and os.path.dirname(__file__) in PATH) else sys.argv[0]
libPrefix = None
projectFilename = None

argv = app.arguments()
argc = len(argv)

for i in range(argc):
if i == 0: continue
argument = argv[i]

if argument.startswith("--with-appname="):
appName = os.path.basename(argument.replace("--with-appname=", ""))

elif argument.startswith("--with-libprefix="):
libPrefix = argument.replace("--with-libprefix=", "")

elif os.path.exists(argument):
projectFilename = argument

# -------------------------------------------------------------
# Init host backend

initHost(appName, libPrefix)

# -------------------------------------------------------------
# Create GUI

Carla.gui = CarlaHostW()

# -------------------------------------------------------------
# Load project file if set

if projectFilename is not None:
Carla.gui.loadProjectLater(projectFilename)

# -------------------------------------------------------------
# Show GUI

Carla.gui.show()

# -------------------------------------------------------------
# App-Loop

sys.exit(app.exec_())

source/carla-mini → source/carla-rack View File

@@ -21,17 +21,15 @@


from carla_host import * from carla_host import *
from carla_rack import CarlaRackW from carla_rack import CarlaRackW
from carla_patchbay import CarlaPatchbayW


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


class CarlaMiniW(HostWindow):
class CarlaHostW(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 = CarlaRackW(self)
#self.fContainer = CarlaPatchbayW(self)
self.setCentralWidget(self.fContainer) self.setCentralWidget(self.fContainer)


# ------------------------------------------------------------------------------------------------------------ # ------------------------------------------------------------------------------------------------------------
@@ -79,7 +77,7 @@ if __name__ == '__main__':
# ------------------------------------------------------------- # -------------------------------------------------------------
# Create GUI # Create GUI


Carla.gui = CarlaMiniW()
Carla.gui = CarlaHostW()


# ------------------------------------------------------------- # -------------------------------------------------------------
# Load project file if set # Load project file if set

+ 3
- 12
source/carla_style.py View File

@@ -35,11 +35,6 @@ from carla_shared import *
# ------------------------------------------------------------------------------------------------------------ # ------------------------------------------------------------------------------------------------------------


class CarlaApplication(object): class CarlaApplication(object):
# Colors
COLOR_SYSTEM = 0
COLOR_BLACK = 1
COLOR_BLUE = 1

def __init__(self, appName = "Carla"): def __init__(self, appName = "Carla"):
object.__init__(self) object.__init__(self)


@@ -181,7 +176,6 @@ class CarlaApplication(object):
self.fPalBlue.setColor(QPalette.Inactive, QPalette.LinkVisited, QColor(64, 128, 255)) self.fPalBlue.setColor(QPalette.Inactive, QPalette.LinkVisited, QColor(64, 128, 255))


self.loadSettings() self.loadSettings()
print("TESTING", self.fApp.style().objectName())


def loadSettings(self): def loadSettings(self):
settings = QSettings() settings = QSettings()
@@ -189,17 +183,14 @@ class CarlaApplication(object):
useProTheme = settings.value("Main/UseProTheme", True, type=bool) useProTheme = settings.value("Main/UseProTheme", True, type=bool)


if useProTheme: if useProTheme:
print("USING PRO THEME")
self.fApp.setStyle("carla") self.fApp.setStyle("carla")


proThemeColor = settings.value("Main/ProThemeColor", "Black", type=str)
proThemeColor = settings.value("Main/ProThemeColor", "Black", type=str).lower()


if proThemeColor.lower() == "black":
print("USING PRO AND BLACK THEME")
if proThemeColor == "black":
self.fApp.setPalette(self.fPalBlack) self.fApp.setPalette(self.fPalBlack)


elif proThemeColor.lower() == "blue":
print("USING PRO AND BLUE THEME")
elif proThemeColor == "blue":
self.fApp.setPalette(self.fPalBlue) self.fApp.setPalette(self.fPalBlue)


def arguments(self): def arguments(self):


Loading…
Cancel
Save