Browse Source

Misc fixing

tags/1.9.4
falkTX 11 years ago
parent
commit
6bfedcf08f
7 changed files with 122 additions and 134 deletions
  1. +0
    -2
      resources/resources.qrc
  2. +12
    -4
      source/carla_shared.py
  3. +5
    -5
      source/frontend/carla-discovery.pro
  4. +88
    -110
      source/frontend/carla_shared.cpp
  5. +15
    -12
      source/frontend/carla_shared.hpp
  6. +1
    -0
      source/frontend/carla_style.cpp
  7. +1
    -1
      source/frontend/carla_style.hpp

+ 0
- 2
resources/resources.qrc View File

@@ -114,8 +114,6 @@
<file>bitmaps/style/arrow.png</file>
<file>bitmaps/style/groupbox.png</file>

<file>bitmaps/thumbs/zita-rev1.png</file>

<file>bitmaps/zita-rev/ambsect.png</file>
<file>bitmaps/zita-rev/eq1sect.png</file>
<file>bitmaps/zita-rev/eq2sect.png</file>


+ 12
- 4
source/carla_shared.py View File

@@ -68,7 +68,7 @@ elif WINDOWS:
# ------------------------------------------------------------------------------------------------------------
# Set Version

VERSION = "1.9.3 (2.0-beta1)"
VERSION = "1.9.4 (2.0-beta2)"

# ------------------------------------------------------------------------------------------------------------
# Set TMP
@@ -481,11 +481,16 @@ if os.path.isfile(CWD):
CWD = os.path.dirname(CWD)

# find tool
def findTool(binDir, toolName):
path = os.path.join(CWD, binDir, toolName)
def findTool(toolName):
path = os.path.join(CWD, toolName)
if os.path.exists(path):
return path

if gCarla.pathBinaries:
path = os.path.join(gCarla.pathBinaries, toolName)
if os.path.exists(path):
return path

for p in PATH:
path = os.path.join(p, toolName)
if os.path.exists(path):
@@ -528,6 +533,9 @@ def initHost(initName, libPrefix = None, failError = True):
elif CWDl.endswith("source"):
gCarla.pathBinaries = os.path.abspath(os.path.join(CWD, "..", "bin"))

elif CWDl.endswith("bin"):
gCarla.pathBinaries = CWD

# -------------------------------------------------------------
# Fail if binary dir is not found

@@ -592,7 +600,7 @@ def toList(value):
# ------------------------------------------------------------------------------------------------------------
# Get Icon from user theme, using our own as backup (Oxygen)

def getIcon(icon, size=16):
def getIcon(icon, size = 16):
return QIcon.fromTheme(icon, QIcon(":/%ix%i/%s.png" % (size, size, icon)))

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


+ 5
- 5
source/frontend/carla-discovery.pro View File

@@ -1,10 +1,10 @@
# QtCreator project file

QT = core gui
QT = core gui widgets

TARGET = carla-frontend
TEMPLATE = app
VERSION = 1.9.0
VERSION = 1.9.4

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

@@ -46,8 +46,8 @@ INCLUDEPATH = \

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

LIBS = ../modules/theme.qt4.a
LIBS += -L../backend -lcarla_standalone2
LIBS = ../modules/theme.qt5.a
LIBS += -L../../bin -lcarla_standalone2

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

@@ -58,6 +58,6 @@ QMAKE_CXXFLAGS += -Wlogical-op -Wsign-conversion
# -Wmissing-declarations
QMAKE_CXXFLAGS += -O0 -g
QMAKE_CXXFLAGS += -std=c++0x -std=gnu++0x
QMAKE_CXXFLAGS += -isystem /opt/kxstudio/include -isystem /usr/include/qt4
QMAKE_CXXFLAGS += -isystem /opt/kxstudio/include -isystem /usr/include/qt5

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

+ 88
- 110
source/frontend/carla_shared.cpp View File

@@ -19,7 +19,8 @@

#include <QtCore/QDir>
#include <QtCore/QFile>
#include <QtGui/QFileDialog>
#include <QtWidgets/QFileDialog>
#include <QtWidgets/QLineEdit>

//#ifdef CARLA_OS_MAC
//#endif
@@ -204,12 +205,18 @@ void init()
gCarla.sampleRate = 0.0;
#ifdef CARLA_OS_LINUX
gCarla.processMode = CarlaBackend::ENGINE_PROCESS_MODE_MULTIPLE_CLIENTS;
gCarla.transportMode = CarlaBackend::ENGINE_TRANSPORT_MODE_JACK;
#else
gCarla.processMode = CarlaBackend::ENGINE_PROCESS_MODE_CONTINUOUS_RACK;
#endif
gCarla.processModeForced = false;
#ifdef CARLA_OS_LINUX
gCarla.transportMode = CarlaBackend::ENGINE_TRANSPORT_MODE_JACK;
#else
gCarla.transportMode = CarlaBackend::ENGINE_TRANSPORT_MODE_INTERNAL;
#endif
gCarla.maxParameters = CarlaBackend::MAX_DEFAULT_PARAMETERS;
gCarla.pathBinaries = "";
gCarla.pathResources = "";

// --------------------------------------------------------------------------------------------------------
// Default Plugin Folders (get)
@@ -345,6 +352,27 @@ void init()
DEFAULT_SFZ_PATH += ":/usr/share/sounds/sfz";
#endif

#ifndef CARLA_OS_WIN
QString winePrefix = std::getenv("WINEPREFIX");

if (winePrefix.isEmpty())
winePrefix = HOME + "/.wine";

if (QDir(winePrefix).exists())
{
DEFAULT_VST_PATH += ":" + winePrefix + "/drive_c/Program Files/VstPlugins";
DEFAULT_VST3_PATH += ":" + winePrefix + "/drive_c/Program Files/Common Files/VST3";

# if defined (__LP64__) || defined (_LP64)
if (QDir(winePrefix + "/drive_c/Program Files (x86)").exists())
{
DEFAULT_VST_PATH += ":" + winePrefix + "/drive_c/Program Files (x86)/VstPlugins";
DEFAULT_VST3_PATH += ":" + winePrefix + "/drive_c/Program Files (x86)/Common Files/VST3";
}
# endif
}
#endif

// --------------------------------------------------------------------------------------------------------
// Default Plugin Folders (set)

@@ -392,23 +420,26 @@ void init()
}

// ------------------------------------------------------------------------------------------------------------
// Search for Carla tools
// find tool

static
QString findTool(const QString& toolDir, const QString& toolName)
QString findTool(const QString& toolName)
{
QDir tmp(QDir::current());
tmp.cd(toolDir);

QString path = tmp.filePath(toolName);
QString path;

path = QDir::current().filePath(toolName);
if (QFile(path).exists())
return path;

if (! gCarla.pathBinaries.isEmpty())
{
path = QDir(gCarla.pathBinaries).filePath(toolName);
if (QFile(path).exists())
return path;
}

foreach (const QString& p, PATH)
{
path = QDir(p).filePath(toolName);

if (QFile(path).exists())
return path;
}
@@ -419,7 +450,7 @@ QString findTool(const QString& toolDir, const QString& toolName)
// ------------------------------------------------------------------------------------------------------------
// Init host

void initHost(const QString& /*appName*/, const char* const libPrefix, bool failError)
void initHost(const char* const initName, const char* const libPrefix, bool failError)
{
init();

@@ -442,86 +473,42 @@ void initHost(const QString& /*appName*/, const char* const libPrefix, bool fail
#endif

// -------------------------------------------------------------
// Search for the Carla library
// Set binary dir

QString libfilename = "";
QString CWD = QDir::current().absolutePath();

if (libPrefix != nullptr)
if (libPrefix != nullptr && libPrefix[0] != '\0')
{
QDir tmp(libPrefix);
tmp.cd("lib");
tmp.cd("carla");
libfilename = tmp.filePath(libname);

gCarla.pathBinaries = tmp.absolutePath();
}
else
else if (CWD.endsWith("resources", Qt::CaseInsensitive))
{
QDir tmp(QDir::current());
QDir tmp(CWD);
tmp.cdUp();
tmp.cd("backend");

QString path = tmp.filePath(libname);

if (QFile(path).exists())
{
libfilename = path;
}
else
{
QStringList CARLA_LIB_PATH;
const char* const envLibPath = std::getenv("CARLA_LIB_PATH");

if (envLibPath != nullptr && QDir(envLibPath).exists())
{
CARLA_LIB_PATH << envLibPath;
}
else
{
#if defined(CARLA_OS_WIN)
//CARLA_LIB_PATH << (os.path.join(PROGRAMFILES, "Carla"),);
#elif defined(CARLA_OS_MAC)
CARLA_LIB_PATH << "/opt/local/lib";
CARLA_LIB_PATH << "/usr/local/lib/";
CARLA_LIB_PATH << "/usr/lib";
#else
CARLA_LIB_PATH << "/usr/local/lib/";
CARLA_LIB_PATH << "/usr/lib";
#endif
}

foreach (const QString& libpath, CARLA_LIB_PATH)
{
tmp = libpath;
tmp.cd("carla");

path = tmp.filePath(libname);

if (QFile(path).exists())
{
libfilename = path;
break;
}
}
}
gCarla.pathBinaries = tmp.absolutePath();
}
else if (CWD.endsWith("source", Qt::CaseInsensitive))
{
QDir tmp(CWD);
tmp.cdUp();
tmp.cd("bin");

// -------------------------------------------------------------
// find windows tools

gCarla.discovery_win32 = findTool("discovery", "carla-discovery-win32.exe");
gCarla.discovery_win64 = findTool("discovery", "carla-discovery-win64.exe");

#ifndef CARLA_OS_WIN
// -------------------------------------------------------------
// find native and posix tools

gCarla.discovery_native = findTool("discovery", "carla-discovery-native");
gCarla.discovery_posix32 = findTool("discovery", "carla-discovery-posix32");
gCarla.discovery_posix64 = findTool("discovery", "carla-discovery-posix64");
#endif
gCarla.pathBinaries = tmp.absolutePath();
}
else if (CWD.endsWith("bin", Qt::CaseInsensitive))
{
gCarla.pathBinaries = CWD;
}

// -------------------------------------------------------------
// Fail if binary dir is not found

if (libfilename.isEmpty() && ! gCarla.isPlugin)
if (gCarla.pathBinaries.isEmpty() && ! gCarla.isPlugin)
{
if (failError)
{
@@ -532,49 +519,40 @@ void initHost(const QString& /*appName*/, const char* const libPrefix, bool fail
}

// -------------------------------------------------------------
// Set binary path

QDir tmp;
QString libfolder, localBinaries, systemBinaries;
// Set resources dir

libfolder = libfilename.replace(libname, "");
tmp = libfolder;
tmp.cdUp();
tmp.cd("bridges");
localBinaries = tmp.absolutePath();
if (libPrefix != nullptr && libPrefix[0] != '\0')
{
QDir tmp(libPrefix);
tmp.cd("share");
tmp.cd("carla");
tmp.cd("resources");

tmp = libfolder;
tmp.cd("bridges");
systemBinaries = tmp.absolutePath();
gCarla.pathResources = tmp.absolutePath();
}
else
{
QDir tmp(gCarla.pathBinaries);
tmp.cd("resources");

if (QDir(libfolder).exists())
carla_set_engine_option(ENGINE_OPTION_PATH_BINARIES, 0, libfolder.toUtf8().constData());
else if (QDir(localBinaries).exists())
carla_set_engine_option(ENGINE_OPTION_PATH_BINARIES, 0, localBinaries.toUtf8().constData());
else if (QDir(systemBinaries).exists())
carla_set_engine_option(ENGINE_OPTION_PATH_BINARIES, 0, systemBinaries.toUtf8().constData());
gCarla.pathResources = tmp.absolutePath();
}

// -------------------------------------------------------------
// Set resource path
// Print info

QString localResources, systemResources;
carla_stdout("Carla %s started, status:", VERSION);
carla_stdout(" binary dir: %s", gCarla.pathBinaries.toUtf8().constData());
carla_stdout(" resources dir: %s", gCarla.pathResources.toUtf8().constData());

tmp = libfolder;
tmp.cdUp();
tmp.cd("modules");
tmp.cd("native-plugins");
tmp.cd("resources");
localResources = tmp.absolutePath();
// -------------------------------------------------------------
// Init host

tmp = libfolder;
tmp.cd("resources");
systemResources = tmp.absolutePath();
if (! (gCarla.isControl or gCarla.isPlugin))
carla_set_engine_option(ENGINE_OPTION_NSM_INIT, getpid(), initName);

if (QDir(localResources).exists())
carla_set_engine_option(ENGINE_OPTION_PATH_RESOURCES, 0, localResources.toUtf8().constData());
else if (QDir(systemResources).exists())
carla_set_engine_option(ENGINE_OPTION_PATH_RESOURCES, 0, systemResources.toUtf8().constData());
carla_set_engine_option(ENGINE_OPTION_PATH_BINARIES, 0, gCarla.pathBinaries.toUtf8().constData());
carla_set_engine_option(ENGINE_OPTION_PATH_RESOURCES, 0, gCarla.pathResources.toUtf8().constData());
}

// ------------------------------------------------------------------------------------------------------------


+ 15
- 12
source/frontend/carla_shared.hpp View File

@@ -22,8 +22,7 @@
// Imports (Global)

#include <QtGui/QIcon>
#include <QtGui/QLineEdit>
#include <QtGui/QMessageBox>
#include <QtWidgets/QMessageBox>

class QLineEdit;

@@ -31,12 +30,11 @@ class QLineEdit;
// Imports (Custom)

#include "CarlaBackendUtils.hpp"
#include "CarlaHost.h"

// ------------------------------------------------------------------------------------------------------------
// Set Version

#define VERSION "1.9.0"
#define VERSION "1.9.4 (2.0-beta2)"

// ------------------------------------------------------------------------------------------------------------
// Set TMP
@@ -118,16 +116,16 @@ struct CarlaObject {
double sampleRate;
// current process mode
EngineProcessMode processMode;
// check if process mode is forced (rack/patchbay)
bool processModeForced;
// current transport mode
EngineTransportMode transportMode;
// current max parameters
uint maxParameters;
// discovery tools
QString discovery_native;
QString discovery_posix32;
QString discovery_posix64;
QString discovery_win32;
QString discovery_win64;
// binary dir
QString pathBinaries;
// resources dir
QString pathResources;
// default paths
QStringList DEFAULT_LADSPA_PATH;
QStringList DEFAULT_DSSI_PATH;
@@ -143,15 +141,20 @@ struct CarlaObject {

extern CarlaObject gCarla;

// ------------------------------------------------------------------------------------------------------------
// find tool

QString findTool(const QString& toolName);

// ------------------------------------------------------------------------------------------------------------
// Init host

void initHost(const QString& appName, const char* const libPrefix = nullptr, bool failError = true);
void initHost(const char* const initName, const char* const libPrefix = nullptr, bool failError = true);

// ------------------------------------------------------------------------------------------------------------
// Get Icon from user theme, using our own as backup (Oxygen)

QIcon getIcon(const QString& icon, const int size=16);
QIcon getIcon(const QString& icon, const int size = 16);

// ------------------------------------------------------------------------------------------------------------
// Signal handler


+ 1
- 0
source/frontend/carla_style.cpp View File

@@ -22,6 +22,7 @@

#include <QtCore/QDir>
#include <QtCore/QSettings>
#include <QtWidgets/QApplication>

// ------------------------------------------------------------------------------------------------------------



+ 1
- 1
source/frontend/carla_style.hpp View File

@@ -21,9 +21,9 @@
// ------------------------------------------------------------------------------------------------------------
// Imports (Global)

#include <QtGui/QApplication>
#include <QtGui/QPalette>

class QApplication;
class CarlaStyle;

// ------------------------------------------------------------------------------------------------------------


Loading…
Cancel
Save