Browse Source

Misc settings fix; win32 build changes

tags/1.9.4
falkTX 11 years ago
parent
commit
77732cc46e
7 changed files with 125 additions and 52 deletions
  1. +18
    -1
      data/windows/build-win32.sh
  2. +18
    -1
      data/windows/build-win64.sh
  3. +21
    -3
      source/backend/standalone/CarlaStandalone.cpp
  4. +45
    -32
      source/carla.py
  5. +9
    -0
      source/carla_shared.py
  6. +2
    -6
      source/libs/distrho/src/DistrhoUIInternal.hpp
  7. +12
    -9
      source/libs/distrho/src/DistrhoUIQt4.cpp

+ 18
- 1
data/windows/build-win32.sh View File

@@ -34,6 +34,7 @@ export PYRCC="wine C:\\\\Python33\\\\Lib\\\\site-packages\\\\PyQt4\\\\pyrcc4.exe
export CFLAGS="-DPTW32_STATIC_LIB -I$MINGW_PATH/include"
export CXXFLAGS="-DPTW32_STATIC_LIB -DFLUIDSYNTH_NOT_A_DLL -D__WINDOWS_ASIO__ -D__WINDOWS_DS__ -D__WINDOWS_MM__ -I$MINGW_PATH/include"
export EXTRA_LIBS="-lglib-2.0 -lgthread-2.0 -lgig -lsndfile -lFLAC -lvorbisenc -lvorbis -logg -ldsound -lrpcrt4 -lwinmm"
export EXTRA_LIBS2="$MINGW_PATH/lib/qt4/plugins/imageformats/libqsvg.a $MINGW_PATH/lib/qt4/plugins/iconengines/libqsvgicon.a"

# Clean build
make clean
@@ -47,7 +48,7 @@ mv source/discovery/carla-discovery-native source/discovery/carla-discovery-win3

# Build backend
make $JOBS -C source/backend/standalone ../libcarla_standalone.dll CARLA_RTAUDIO_SUPPORT=true WIN32=true \
DGL_LIBS="" EXTRA_LIBS="$EXTRA_LIBS" OBJSN=""
DGL_LIBS="" EXTRA_LIBS="$EXTRA_LIBS $EXTRA_LIBS2" OBJSN=""

rm -rf ./data/windows/Carla
$CXFREEZE --target-dir=".\\data\\windows\\Carla" ".\\source\\carla.py"
@@ -64,9 +65,25 @@ cp $WINEPREFIX/drive_c/Python33/Lib/site-packages/PyQt4/QtCore4.dll Carla/
cp $WINEPREFIX/drive_c/Python33/Lib/site-packages/PyQt4/QtGui4.dll Carla/
cp $WINEPREFIX/drive_c/Python33/Lib/site-packages/PyQt4/QtOpenGL4.dll Carla/
cp $WINEPREFIX/drive_c/Python33/Lib/site-packages/PyQt4/QtSvg4.dll Carla/
cp $WINEPREFIX/drive_c/Python33/Lib/site-packages/PyQt4/QtXml4.dll Carla/
cp -r $WINEPREFIX/drive_c/Python33/Lib/site-packages/PyQt4/plugins/imageformats/ Carla/
cp -r $WINEPREFIX/drive_c/Python33/Lib/site-packages/PyQt4/plugins/iconengines/ Carla/

rm -f pkg-config

# Build unzipfx
make -C unzipfx-carla -f Makefile.win32

# Create static build
rm -f Carla.zip
zip -r Carla.zip Carla

rm -f Carla.exe
cat unzipfx-carla/unzipfx2cat.exe Carla.zip > Carla.exe
chmod +x Carla.exe

make -C unzipfx-carla -f Makefile.win32 clean

# Testing:
echo "export WINEPREFIX=~/.winepy3"
echo "wine $PYTHON_EXE ../../source/carla.py"

+ 18
- 1
data/windows/build-win64.sh View File

@@ -34,6 +34,7 @@ export PYRCC="wine C:\\\\Python33\\\\Lib\\\\site-packages\\\\PyQt4\\\\pyrcc4.exe
export CFLAGS="-DPTW32_STATIC_LIB -I$MINGW_PATH/include"
export CXXFLAGS="-DPTW32_STATIC_LIB -DFLUIDSYNTH_NOT_A_DLL -D__WINDOWS_ASIO__ -D__WINDOWS_DS__ -D__WINDOWS_MM__ -I$MINGW_PATH/include"
export EXTRA_LIBS="-lglib-2.0 -lgthread-2.0 -lgig -lsndfile -lFLAC -lvorbisenc -lvorbis -logg -ldsound -lrpcrt4 -lwinmm"
export EXTRA_LIBS2="$MINGW_PATH/lib/qt4/plugins/imageformats/libqsvg.a $MINGW_PATH/lib/qt4/plugins/iconengines/libqsvgicon.a"

# Clean build
make clean
@@ -47,7 +48,7 @@ mv source/discovery/carla-discovery-native source/discovery/carla-discovery-win6

# Build backend
make $JOBS -C source/backend/standalone ../libcarla_standalone.dll CARLA_RTAUDIO_SUPPORT=true WIN32=true \
DGL_LIBS="" EXTRA_LIBS="$EXTRA_LIBS" OBJSN=""
DGL_LIBS="" EXTRA_LIBS="$EXTRA_LIBS $EXTRA_LIBS2" OBJSN=""

rm -rf ./data/windows/Carla
$CXFREEZE --target-dir=".\\data\\windows\\Carla" ".\\source\\carla.py"
@@ -64,9 +65,25 @@ cp $WINEPREFIX/drive_c/Python33/Lib/site-packages/PyQt4/QtCore4.dll Carla/
cp $WINEPREFIX/drive_c/Python33/Lib/site-packages/PyQt4/QtGui4.dll Carla/
cp $WINEPREFIX/drive_c/Python33/Lib/site-packages/PyQt4/QtOpenGL4.dll Carla/
cp $WINEPREFIX/drive_c/Python33/Lib/site-packages/PyQt4/QtSvg4.dll Carla/
cp $WINEPREFIX/drive_c/Python33/Lib/site-packages/PyQt4/QtXml4.dll Carla/
cp -r $WINEPREFIX/drive_c/Python33/Lib/site-packages/PyQt4/plugins/imageformats/ Carla/
cp -r $WINEPREFIX/drive_c/Python33/Lib/site-packages/PyQt4/plugins/iconengines/ Carla/

rm -f pkg-config

# Build unzipfx
make -C unzipfx-carla -f Makefile.win32

# Create static build
rm -f Carla.zip
zip -r Carla.zip Carla

rm -f Carla.exe
cat unzipfx-carla/unzipfx2cat.exe Carla.zip > Carla.exe
chmod +x Carla.exe

make -C unzipfx-carla -f Makefile.win32 clean

# Testing:
echo "export WINEPREFIX=~/.winepy3_x64"
echo "wine $PYTHON_EXE ../../source/carla.py"

+ 21
- 3
source/backend/standalone/CarlaStandalone.cpp View File

@@ -49,15 +49,19 @@ struct CarlaBackendStandalone {
EngineOptions options;

QApplication* app;
bool needsIdle;
bool needsInit;

CarlaBackendStandalone()
: callback(nullptr),
callbackPtr(nullptr),
engine(nullptr),
app(qApp),
needsIdle(app == nullptr)
needsInit(app == nullptr) {}

void init()
{
if (! needsInit)
return;
if (app != nullptr)
return;

@@ -66,6 +70,18 @@ struct CarlaBackendStandalone {
app = new QApplication(argc, argv, true);
}

void close()
{
if (! needsInit)
return;
if (app == nullptr)
return;

app->quit();
app->processEvents();
delete app;
}

} standalone;

// -------------------------------------------------------------------------------------------------------------------
@@ -287,6 +303,7 @@ bool carla_engine_init(const char* driverName, const char* clientName)
if (initiated)
{
standalone.lastError = "no error";
standalone.init();
}
else
{
@@ -316,6 +333,7 @@ bool carla_engine_close()

delete standalone.engine;
standalone.engine = nullptr;
standalone.close();

return closed;
}
@@ -324,7 +342,7 @@ void carla_engine_idle()
{
CARLA_ASSERT(standalone.engine != nullptr);

if (standalone.needsIdle)
if (standalone.needsInit && standalone.app != nullptr)
standalone.app->processEvents();

if (standalone.engine != nullptr)


+ 45
- 32
source/carla.py View File

@@ -81,14 +81,6 @@ class CarlaSettingsW(QDialog):
self.ui = ui_carla_settings.Ui_CarlaSettingsW()
self.ui.setupUi(self)

# TODO
self.ui.lw_page.hideRow(TAB_INDEX_CANVAS)

# -------------------------------------------------------------
# Load settings

self.loadSettings()

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

@@ -98,9 +90,18 @@ class CarlaSettingsW(QDialog):
driverName = cString(Carla.host.get_engine_driver_name(i))
self.ui.cb_engine_audio_driver.addItem(driverName)

#if not hasOpenGL:
#self.cb_canvas_use_opengl.setChecked(False)
#self.cb_canvas_use_opengl.setEnabled(False)
# -------------------------------------------------------------
# Load settings

self.loadSettings()

if not hasGL:
self.ui.cb_canvas_use_opengl.setChecked(False)
self.ui.cb_canvas_use_opengl.setEnabled(False)

if WINDOWS:
self.ui.ch_engine_dssi_chunks.setChecked(False)
self.ui.ch_engine_dssi_chunks.setEnabled(False)

# -------------------------------------------------------------
# Set-up connections
@@ -130,8 +131,6 @@ class CarlaSettingsW(QDialog):
self.ui.lw_gig.setCurrentRow(0)
self.ui.lw_sf2.setCurrentRow(0)
self.ui.lw_sfz.setCurrentRow(0)
#QTimer.singleShot(0, self, )
#self.slot_pluginPathTabChanged(self.tw_paths.currentIndex())

self.ui.lw_page.setCurrentCell(0, 0)

@@ -152,17 +151,24 @@ class CarlaSettingsW(QDialog):
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))

#themeName = settings.value("Canvas/Theme", getDefaultThemeName(), type=str)
themeName = settings.value("Canvas/Theme", patchcanvas.getDefaultThemeName(), type=str)

#for i in range(Theme.THEME_MAX):
#thisThemeName = getThemeName(i)
#self.ui.cb_canvas_theme.addItem(thisThemeName)
#if thisThemeName == themeName:
#self.ui.cb_canvas_theme.setCurrentIndex(i)
for i in range(patchcanvas.Theme.THEME_MAX):
thisThemeName = patchcanvas.getThemeName(i)
self.ui.cb_canvas_theme.addItem(thisThemeName)
if thisThemeName == themeName:
self.ui.cb_canvas_theme.setCurrentIndex(i)

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

audioDriver = settings.value("Engine/AudioDriver", "JACK", type=str)
if WINDOWS:
defaultDriver = "DirectSound"
elif MACOS:
defaultDriver = "CoreAudio"
else:
defaultDriver = "JACK"

audioDriver = settings.value("Engine/AudioDriver", defaultDriver, type=str)
for i in range(self.ui.cb_engine_audio_driver.count()):
if self.ui.cb_engine_audio_driver.itemText(i) == audioDriver:
self.ui.cb_engine_audio_driver.setCurrentIndex(i)
@@ -238,15 +244,15 @@ class CarlaSettingsW(QDialog):

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

#settings.setValue("Canvas/Theme", self.ui.cb_canvas_theme.currentText())
#settings.setValue("Canvas/AutoHideGroups", self.ui.cb_canvas_hide_groups.isChecked())
#settings.setValue("Canvas/UseBezierLines", self.ui.cb_canvas_bezier_lines.isChecked())
#settings.setValue("Canvas/UseOpenGL", self.ui.cb_canvas_use_opengl.isChecked())
#settings.setValue("Canvas/HighQualityAntialiasing", self.ui.cb_canvas_render_hq_aa.isChecked())
settings.setValue("Canvas/Theme", self.ui.cb_canvas_theme.currentText())
settings.setValue("Canvas/AutoHideGroups", self.ui.cb_canvas_hide_groups.isChecked())
settings.setValue("Canvas/UseBezierLines", self.ui.cb_canvas_bezier_lines.isChecked())
settings.setValue("Canvas/UseOpenGL", self.ui.cb_canvas_use_opengl.isChecked())
settings.setValue("Canvas/HighQualityAntialiasing", self.ui.cb_canvas_render_hq_aa.isChecked())

## 0, 1, 2 match their enum variants
#settings.setValue("Canvas/EyeCandy", self.ui.cb_canvas_eyecandy.checkState())
#settings.setValue("Canvas/Antialiasing", self.ui.cb_canvas_render_aa.checkState())
# 0, 1, 2 match their enum variants
settings.setValue("Canvas/EyeCandy", self.ui.cb_canvas_eyecandy.checkState())
settings.setValue("Canvas/Antialiasing", self.ui.cb_canvas_render_aa.checkState())

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

@@ -390,7 +396,7 @@ class CarlaSettingsW(QDialog):

@pyqtSlot()
def slot_getAndSetProjectPath(self):
pass #getAndSetPath(self, self.le_main_def_folder.text(), self.le_main_def_folder)
getAndSetPath(self, self.ui.le_main_def_folder.text(), self.ui.le_main_def_folder)

@pyqtSlot()
def slot_engineAudioDriverChanged(self):
@@ -765,7 +771,14 @@ class CarlaMainW(QMainWindow):
# ---------------------------------------------
# Start

audioDriver = settings.value("Engine/AudioDriver", "JACK", type=str)
if WINDOWS:
defaultDriver = "DirectSound"
elif MACOS:
defaultDriver = "CoreAudio"
else:
defaultDriver = "JACK"

audioDriver = settings.value("Engine/AudioDriver", defaultDriver, type=str)

if not Carla.host.engine_init(audioDriver, clientName):
if self.fFirstEngineInit:
@@ -1322,7 +1335,7 @@ class CarlaMainW(QMainWindow):
if not haveLRDF:
return

settingsDir = os.path.join(HOME, ".config", "Cadence")
settingsDir = os.path.join(HOME, ".config", "falkTX")
frLadspaFile = os.path.join(settingsDir, "ladspa_rdf.db")

if os.path.exists(frLadspaFile):
@@ -1552,7 +1565,7 @@ if __name__ == '__main__':
app = QApplication(sys.argv)
app.setApplicationName("Carla")
app.setApplicationVersion(VERSION)
app.setOrganizationName("Cadence")
app.setOrganizationName("falkTX")
app.setWindowIcon(QIcon(":/scalable/carla.svg"))

libPrefix = None


+ 9
- 0
source/carla_shared.py View File

@@ -801,6 +801,15 @@ def signalHandler(sig, frame):
elif sig == SIGUSR1:
Carla.gui.emit(SIGNAL("SIGUSR1()"))

# ------------------------------------------------------------------------------------------------------------
# QLineEdit and QPushButton combo

def getAndSetPath(self_, currentPath, lineEdit):
newPath = QFileDialog.getExistingDirectory(self_, self_.tr("Set Path"), currentPath, QFileDialog.ShowDirsOnly)
if newPath:
lineEdit.setText(newPath)
return newPath

# ------------------------------------------------------------------------------------------------------------
# Custom MessageBox



+ 2
- 6
source/libs/distrho/src/DistrhoUIInternal.hpp View File

@@ -58,10 +58,9 @@ class QEmbedWidget : public QWidget
# endif
{
public:
QEmbedWidget();
QEmbedWidget(WId parent);
~QEmbedWidget();

void embedInto(WId id);
WId containerWinId() const;
};
#endif
@@ -284,7 +283,7 @@ public:
Qt4UI* qt4Ui = (Qt4UI*)kUi;

// create embedable widget
qtWidget = new QEmbedWidget;
qtWidget = new QEmbedWidget((WId)parent);

// set layout
qtWidget->setLayout(new QVBoxLayout(qtWidget));
@@ -308,9 +307,6 @@ public:
qtGrip->installEventFilter(this);
}

// reparent widget
qtWidget->embedInto((WId)parent);

// show it
qtWidget->show();
}


+ 12
- 9
source/libs/distrho/src/DistrhoUIQt4.cpp View File

@@ -21,27 +21,30 @@ START_NAMESPACE_DISTRHO
// -------------------------------------------------
// QEmbedWidget

QEmbedWidget::QEmbedWidget()
QEmbedWidget::QEmbedWidget(WId id)
#ifdef Q_WS_X11
: QX11EmbedWidget()
#else
: QWidget()
#endif
{
#ifdef Q_WS_X11
embedInto(id);
#else
create(id, false, false);
#endif
}

QEmbedWidget::~QEmbedWidget()
{
}

void QEmbedWidget::embedInto(WId id)
{
#ifdef Q_WS_X11
QX11EmbedWidget::embedInto(id);
#endif
}

WId QEmbedWidget::containerWinId() const
{
#ifdef Q_WS_X11
return QX11EmbedWidget::containerWinId();
#else
return 0;
return winId();
#endif
}



Loading…
Cancel
Save