Browse Source

General fixing, builds again

tags/v0.9.0
falkTX 13 years ago
parent
commit
0772dad02c
18 changed files with 164 additions and 54 deletions
  1. +1
    -1
      Makefile
  2. +7
    -0
      README
  3. +1
    -1
      src/cadence.py
  4. +1
    -1
      src/carla-backend/Makefile
  5. +25
    -17
      src/carla-backend/linuxsampler.cpp
  6. +3
    -3
      src/carla-backend/qtcreator/carla-backend.pro
  7. +12
    -9
      src/carla-discovery/carla-discovery.cpp
  8. +47
    -5
      src/carla-includes/carla_vst_includes.h
  9. +10
    -2
      src/carla.py
  10. +2
    -0
      src/carla_backend.py
  11. +2
    -1
      src/catia.py
  12. +12
    -2
      src/claudia.py
  13. +1
    -1
      src/jackmeter.py
  14. +4
    -3
      src/pixmapdial.py
  15. +1
    -0
      src/pixmapkeyboard.py
  16. +30
    -6
      src/systray.py
  17. +2
    -1
      src/ui/xycontroller.ui
  18. +3
    -1
      src/xycontroller.py

+ 1
- 1
Makefile View File

@@ -165,7 +165,7 @@ carla_backend: carla_lilv
$(MAKE) -C src/carla-backend

carla_bridge: carla_lilv
$(MAKE) -C src/carla-bridge
# $(MAKE) -C src/carla-bridge

carla_discovery:
$(MAKE) -C src/carla-discovery unix$(_arch_n) NATIVE=1


+ 7
- 0
README View File

@@ -4,3 +4,10 @@

Cadence is a set of tools useful for audio production.
It's being developed by falkTX, using Python and Qt (and some C++ where needed).

needs:
pyqt4-dev-tools
libqt4-dev
liblo-dev
libgtk2.0-dev
python3-pyqt4

+ 1
- 1
src/cadence.py View File

@@ -819,4 +819,4 @@ if __name__ == '__main__':
gui.show()

# Exit properly
sys.exit(app.exec_())
sys.exit(gui.systray.exec_(app))

+ 1
- 1
src/carla-backend/Makefile View File

@@ -20,7 +20,7 @@ CARLA_C_FLAGS = $(BASE_FLAGS) $(CFLAGS)
CARLA_CXX_FLAGS = $(BASE_FLAGS) -std=c++0x $(CXXFLAGS)
CARLA_CXX_FLAGS += $(shell pkg-config --cflags liblo QtCore QtGui)
CARLA_CXX_FLAGS += -DNDEBUG -DQT_NO_DEBUG -DQT_NO_DEBUG_STREAM -DQT_NO_DEBUG_OUTPUT
# CARLA_CXX_FLAGS += -DVESTIGE_HEADER -I../carla-includes/vestige # Comment this line to not use vestige header
CARLA_CXX_FLAGS += -DVESTIGE_HEADER -I../carla-includes/vestige # Comment this line to not use vestige header

CARLA_LD_FLAGS = -shared -ldl -lm -fPIC $(LDFLAGS)
CARLA_LD_FLAGS += $(shell pkg-config --libs liblo QtCore QtGui)


+ 25
- 17
src/carla-backend/linuxsampler.cpp View File

@@ -21,6 +21,8 @@

// TODO - setMidiProgram()

#ifdef WANT_LINUXSAMPLER

#include "carla_plugin.h"
#include "carla_linuxsampler_includes.h"

@@ -32,8 +34,6 @@ CARLA_BACKEND_START_NAMESPACE
} /* adjust editor indent */
#endif

#ifdef WANT_LINUXSAMPLER

/*!
* @defgroup CarlaBackendLinuxSamplerPlugin Carla Backend LinuxSampler Plugin
*
@@ -57,8 +57,8 @@ public:
engine_channel = nullptr;
instrument = nullptr;

audioOutputDevice = new AudioOutputDevicePlugin(this);
midiInputDevice = new MidiInputDevicePlugin(sampler);
audioOutputDevice = new LinuxSampler::AudioOutputDevicePlugin(engine_, this);
midiInputDevice = new LinuxSampler::MidiInputDevicePlugin(sampler);
midiInputPort = midiInputDevice->CreateMidiPort();

m_isGIG = isGIG;
@@ -283,7 +283,7 @@ public:

for (i=0; i < MAX_MIDI_EVENTS && midiEventCount < MAX_MIDI_EVENTS; i++)
{
if (! extMidiNotes[i].valid)
if (extMidiNotes[i].channel < 0)
break;

if (extMidiNotes[i].velo)
@@ -291,7 +291,7 @@ public:
else
midiInputPort->DispatchNoteOff(extMidiNotes[i].note, extMidiNotes[i].velo, cin_channel, framesOffset);

extMidiNotes[i].valid = false;
extMidiNotes[i].channel = -1;
midiEventCount += 1;
}

@@ -558,8 +558,8 @@ private:
LinuxSampler::InstrumentManager* instrument;
std::vector<LinuxSampler::InstrumentManager::instrument_id_t> instrumentIds;

AudioOutputDevicePlugin* audioOutputDevice;
MidiInputDevicePlugin* midiInputDevice;
LinuxSampler::AudioOutputDevicePlugin* audioOutputDevice;
LinuxSampler::MidiInputDevicePlugin* midiInputDevice;
LinuxSampler::MidiInputPort* midiInputPort;

bool m_isGIG;
@@ -571,7 +571,7 @@ CarlaPlugin* LinuxSamplerPlugin::newLinuxSampler(const initializer& init, bool i
{
qDebug("LinuxSamplerPlugin::newLinuxSampler(%p, %s, %s, %s, %s)", init.engine, init.filename, init.name, init.label, bool2str(isGIG));

short id = init.engine->getNewPluginIndex();
short id = init.engine->getNewPluginId();

if (id < 0)
{
@@ -592,29 +592,37 @@ CarlaPlugin* LinuxSamplerPlugin::newLinuxSampler(const initializer& init, bool i

return plugin;
}
#endif

CarlaPlugin* CarlaPlugin::newGIG(const initializer& init)
{
qDebug("CarlaPlugin::newGIG(%p, %s, %s, %s)", init.engine, init.filename, init.name, init.label);
#ifdef WANT_LINUXSAMPLER
return LinuxSamplerPlugin::newLinuxSampler(init, true);
#else
}

CarlaPlugin* CarlaPlugin::newSFZ(const initializer& init)
{
qDebug("CarlaPlugin::newSFZ(%p, %s, %s, %s)", init.engine, init.filename, init.name, init.label);
return LinuxSamplerPlugin::newLinuxSampler(init, false);
}
#else // WANT_LINUXSAMPLER
#include "carla_plugin.h"

CARLA_BACKEND_START_NAMESPACE

CarlaPlugin* CarlaPlugin::newGIG(const initializer& init)
{
qDebug("CarlaPlugin::newGIG(%p, %s, %s, %s)", init.engine, init.filename, init.name, init.label);
setLastError("linuxsampler support not available");
return nullptr;
#endif
}

CarlaPlugin* CarlaPlugin::newSFZ(const initializer& init)
{
qDebug("CarlaPlugin::newSFZ(%p, %s, %s, %s)", init.engine, init.filename, init.name, init.label);
#ifdef WANT_LINUXSAMPLER
return LinuxSamplerPlugin::newLinuxSampler(init, false);
#else
setLastError("linuxsampler support not available");
return nullptr;
#endif
}
#endif

/**@}*/



+ 3
- 3
src/carla-backend/qtcreator/carla-backend.pro View File

@@ -3,8 +3,8 @@
QT = core gui

CONFIG = debug link_pkgconfig qt warn_on plugin shared
PKGCONFIG = jack liblo fluidsynth alsa libpulse-simple
# linuxsampler suil-0
PKGCONFIG = jack liblo fluidsynth linuxsampler alsa libpulse-simple
# suil-0

TARGET = carla_backend
TEMPLATE = app
@@ -52,7 +52,7 @@ INCLUDEPATH = .. \

#DEFINES += HAVE_SUIL
DEFINES += WANT_FLUIDSYNTH
#DEFINES += WANT_LINUXSAMPLER
DEFINES += WANT_LINUXSAMPLER
DEFINES += CARLA_ENGINE_JACK
#DEFINES += CARLA_ENGINE_RTAUDIO
DEFINES += QTCREATOR_TEST


+ 12
- 9
src/carla-discovery/carla-discovery.cpp View File

@@ -17,7 +17,6 @@

#include "carla_includes.h"
#include "carla_lib_includes.h"
#include "carla_vst_includes.h"

#include <cmath>
#include <cstdint>
@@ -29,9 +28,11 @@
#include <QtCore/QFileInfo>
#include <QtCore/QUrl>

#include "ladspa/ladspa.h"
#include "carla_ladspa_includes.h"
#include "carla_lv2_includes.h"
#include "carla_vst_includes.h"

#include "dssi/dssi.h"
#include "lv2_rdf.h"

#ifdef BUILD_NATIVE
# ifdef WANT_FLUIDSYNTH
@@ -40,21 +41,21 @@
# warning fluidsynth not available (no SF2 support)
# endif
# ifdef WANT_LINUXSAMPLER
# include "linuxsampler/EngineFactory.h"
# define BUILD_BRIDGE // FIXME
# include "carla_linuxsampler_includes.h"
# undef BUILD_BRIDGE
# else
# warning linuxsampler not available (no GIG and SFZ support)
# endif
#endif

#define CARLA_BACKEND_NO_EXPORTS
#define CARLA_BACKEND_NO_NAMESPACE
#include "carla_backend.h"

#define DISCOVERY_OUT(x, y) std::cout << "\ncarla-discovery::" << x << "::" << y << std::endl;

// fake values to test plugins with
const uint32_t bufferSize = 512;
const double sampleRate = 44100.f;
const double sampleRate = 44100.0;

// Since discovery can find multi-architecture binaries, don't print ELF related errors
void print_lib_error(const char* filename)
@@ -64,6 +65,8 @@ void print_lib_error(const char* filename)
DISCOVERY_OUT("error", error);
}

using namespace CarlaBackend;

// ------------------------------ VST Stuff ------------------------------

intptr_t VstCurrentUniqueId = 0;
@@ -71,7 +74,7 @@ intptr_t VstCurrentUniqueId = 0;
intptr_t VstHostCallback(AEffect* effect, int32_t opcode, int32_t index, intptr_t value, void* ptr, float opt)
{
#if DEBUG
qDebug("VstHostCallback(%p, opcode: %s, index: %i, value: " P_INTPTR ", opt: %f", effect, VstOpcode2str(opcode), index, value, opt);
qDebug("VstHostCallback(%p, opcode: %s, index: %i, value: " P_INTPTR ", opt: %f", effect, VstMasterOpcode2str(opcode), index, value, opt);
#endif

switch (opcode)
@@ -177,7 +180,7 @@ intptr_t VstHostCallback(AEffect* effect, int32_t opcode, int32_t index, intptr_
return kVstLangEnglish;

default:
qDebug("VstHostCallback(%p, opcode: %s, index: %i, value: " P_INTPTR ", opt: %f", effect, VstOpcode2str(opcode), index, value, opt);
qDebug("VstHostCallback(%p, opcode: %s, index: %i, value: " P_INTPTR ", opt: %f", effect, VstMasterOpcode2str(opcode), index, value, opt);
break;
}



+ 47
- 5
src/carla-includes/carla_vst_includes.h View File

@@ -25,19 +25,66 @@

#if VESTIGE_HEADER
#warning Using vestige header
#define audioMasterGetOutputSpeakerArrangement audioMasterGetSpeakerArrangement
#define effFlagsProgramChunks (1 << 5)
#define effSetProgramName 4
#define effGetParamLabel 6
#define effGetParamDisplay 7
#define effGetVu 9
#define effEditDraw 16
#define effEditMouse 17
#define effEditKey 18
#define effEditSleep 21
#define effIdentify 22
#define effGetChunk 23
#define effSetChunk 24
#define effCanBeAutomated 26
#define effString2Parameter 27
#define effGetNumProgramCategories 28
#define effGetProgramNameIndexed 29
#define effCopyProgram 30
#define effConnectInput 31
#define effConnectOutput 32
#define effGetInputProperties 33
#define effGetOutputProperties 34
#define effGetPlugCategory 35
#define effGetCurrentPosition 36
#define effGetDestinationBuffer 37
#define effOfflineNotify 38
#define effOfflinePrepare 39
#define effOfflineRun 40
#define effProcessVarIo 41
#define effSetSpeakerArrangement 42
#define effSetBlockSizeAndSampleRate 43
#define effSetBypass 44
#define effGetErrorText 46
#define effVendorSpecific 50
#define effGetTailSize 52
#define effIdle 53
#define effGetIcon 54
#define effSetViewPosition 55
#define effKeysRequired 57
#define effEditKeyDown 59
#define effEditKeyUp 60
#define effSetEditKnobMode 61
#define effGetMidiProgramName 62
#define effGetCurrentMidiProgram 63
#define effGetMidiProgramCategory 64
#define effHasMidiProgramsChanged 65
#define effGetMidiKeyName 66
#define effBeginSetProgram 67
#define effEndSetProgram 68
#define effGetSpeakerArrangement 69
#define effShellGetNextPlugin 70
#define effStartProcess 71
#define effStopProcess 72
#define effSetTotalSampleToProcess 73
#define effSetPanLaw 74
#define effBeginLoadBank 75
#define effBeginLoadProgram 76
#define effSetProcessPrecision 77
#define effGetNumMidiInputChannels 78
#define effGetNumMidiOutputChannels 79
#define kPlugCategSynth 2
#define kPlugCategAnalysis 3
#define kPlugCategMastering 4
@@ -52,7 +99,6 @@
#define kVstProcessPrecision32 0
#define kVstTransportChanged 1
#define kVstVersion 2400
//#define audioMasterGetOutputSpeakerArrangement audioMasterGetSpeakerArrangement
struct ERect {
short top, left, bottom, right;
};
@@ -332,11 +378,7 @@ const char* VstMasterOpcode2str(const int32_t opcode)
#if ! VST_FORCE_DEPRECATED
case audioMasterSetOutputSampleRate:
return "audioMasterSetOutputSampleRate";
#ifdef VESTIGE_HEADER
case audioMasterGetSpeakerArrangement:
#else
case audioMasterGetOutputSpeakerArrangement:
#endif
return "audioMasterGetOutputSpeakerArrangement";
#endif
case audioMasterGetVendorString:


+ 10
- 2
src/carla.py View File

@@ -3430,7 +3430,8 @@ class CarlaMainW(QMainWindow, ui_carla.Ui_CarlaMainW):
if event.timerId() == self.TIMER_GUI_STUFF:
for pwidget in self.m_plugin_list:
if pwidget: pwidget.check_gui_stuff()
CarlaHost.idle_guis()
if CarlaHost.is_engine_running():
CarlaHost.idle_guis()
elif event.timerId() == self.TIMER_GUI_STUFF2:
for pwidget in self.m_plugin_list:
if pwidget: pwidget.check_gui_stuff2()
@@ -3514,8 +3515,15 @@ if __name__ == '__main__':
if carla_bridge_vst_x11:
CarlaHost.set_option(OPTION_PATH_BRIDGE_VST_X11, 0, carla_bridge_vst_x11)

# TEST
#count = CarlaHost.get_engine_driver_count()
#print(count)
#for i in range(0, count):
#dname = cString(CarlaHost.get_engine_driver_name(i))
#print("%i - %s" % (i, dname))

if not CarlaHost.engine_init("JACK", "Carla"):
CustomMessageBox(None, QMessageBox.Critical, "Error", "Could not connect to JACK",
CustomMessageBox(None, QMessageBox.Critical, "Error", "Could not connect to Audio backend, possible reasons:",
cString(CarlaHost.get_last_error()), QMessageBox.Ok, QMessageBox.Ok)
sys.exit(1)



+ 2
- 0
src/carla_backend.py View File

@@ -779,6 +779,8 @@ class Host(object):
if lib_prefix_arg:
carla_library_path = os.path.join(lib_prefix_arg, "lib", "carla", carla_libname)

print("Host() - using carla-backend library '%s'" % carla_library_path)

self.lib = cdll.LoadLibrary(carla_library_path)

self.lib.get_engine_driver_count.argtypes = None


+ 2
- 1
src/catia.py View File

@@ -1309,8 +1309,9 @@ if __name__ == '__main__':

else:
DBus.jack = None
DBus.a2j = None
DBus.a2j = None
a2j_client_name = None
print("Not using DBus")

# Show GUI
gui = CatiaMainW()


+ 12
- 2
src/claudia.py View File

@@ -17,8 +17,6 @@
# For a full copy of the GNU General Public License see the COPYING file

# Imports (Global)
import dbus
from dbus.mainloop.qt import DBusQtMainLoop
from time import ctime
from PyQt4.QtCore import QPointF, QSettings
from PyQt4.QtGui import QAction, QApplication, QMainWindow, QVBoxLayout, QTableWidgetItem, QTreeWidgetItem
@@ -40,6 +38,13 @@ try:
except:
hasGL = False

try:
import dbus
from dbus.mainloop.qt import DBusQtMainLoop
haveDBus = True
except:
haveDBus = False

# NOTE - set to true when supported
USE_CLAUDIA_ADD_NEW = True

@@ -2485,6 +2490,11 @@ if __name__ == '__main__':
app.setOrganizationName("Cadence")
app.setWindowIcon(QIcon(":/scalable/claudia.svg"))

if not haveDBus:
QMessageBox.critical(None, app.translate("ClaudiaMainW", "Error"), app.translate("ClaudiaMainW",
"DBus is not available, Claudia cannot start without it!"))
sys.exit(1)

DBus.loop = DBusQtMainLoop(set_as_default=True)
DBus.bus = dbus.SessionBus(mainloop=DBus.loop)
DBus.jack = DBus.bus.get_object("org.jackaudio.service", "/org/jackaudio/Controller")


+ 1
- 1
src/jackmeter.py View File

@@ -139,7 +139,7 @@ if __name__ == '__main__':

# JACK initialization
jack_status = jacklib.jack_status_t(0)
client = jacklib.client_open("M", jacklib.JackSessionID, jacklib.pointer(jack_status))
client = jacklib.client_open("M", jacklib.JackNoStartServer|jacklib.JackSessionID, jacklib.pointer(jack_status))

if not client:
errorString = get_jack_status_error_string(jack_status)


+ 4
- 3
src/pixmapdial.py View File

@@ -56,9 +56,10 @@ class PixmapDial(QDial):

if self.palette().window().color().lightness() > 100:
# Light background
self.m_color1 = QColor(100, 100, 100, 255)
self.m_color2 = QColor(0, 0, 0, 0)
self.m_colorT = [self.palette().text().color(), self.palette().mid().color()]
c = self.palette().dark().color()
self.m_color1 = c
self.m_color2 = QColor(c.red(), c.green(), c.blue(), 0)
self.m_colorT = [self.palette().buttonText().color(), self.palette().mid().color()]
else:
# Dark background
self.m_color1 = QColor(0, 0, 0, 255)


+ 1
- 0
src/pixmapkeyboard.py View File

@@ -99,6 +99,7 @@ class PixmapKeyboard(QWidget):
self.m_font = QFont("Monospace", 8, QFont.Normal)
self.m_pixmap = QPixmap("")

self.setCursor(Qt.PointingHandCursor)
self.setMode(self.HORIZONTAL)

def sendNoteOn(self, note, sendSignal=True):


+ 30
- 6
src/systray.py View File

@@ -17,17 +17,41 @@
# For a full copy of the GNU General Public License see the COPYING file

# Imports (Global)
from os import getenv
import os, sys
from PyQt4.QtCore import SIGNAL
from PyQt4.QtGui import QAction, QIcon, QMenu, QSystemTrayIcon

try:
if getenv("DESKTOP_SESSION") in ("ubuntu", "ubuntu-2d") and not os.path.exists("/var/kxstudio/no_appindicators"):
from gi.repository import AppIndicator3, Gtk
if os.getenv("DESKTOP_SESSION") in ("ubuntu", "ubuntu-2d") and not os.path.exists("/var/cadence/no_appindicators"):
# Check current Qt theme. If Gtk+, use Gtk2 AppIndicator
style = None
if len(sys.argv) > 2 and "-style" in sys.argv:
i = sys.argv.index("-style")
if i < len(sys.argv):
style = sys.argv[i+1]

check_cmd = "python3 -c 'import sys; from PyQt4.QtGui import QApplication; app = QApplication(sys.argv); print(app.style().objectName())'"
if style:
check_cmd += " -style "
check_cmd += style

from subprocess import getoutput
needsGtk2 = bool(getoutput(check_cmd).strip().lower() in ("gtk", "gtk+"))

if needsGtk2:
from gi import pygtkcompat
pygtkcompat.enable()
pygtkcompat.enable_gtk(version="2.0")
from gi.repository import Gtk, AppIndicator
else:
from gi.repository import Gtk, AppIndicator3 as AppIndicator

TrayEngine = "AppIndicator"

elif getenv("KDE_FULL_SESSION"):
from PyKDE4.kdeui import KAction, KIcon, KMenu, KStatusNotifierItem
TrayEngine = "KDE"

else:
TrayEngine = "Qt"
except:
@@ -80,7 +104,7 @@ class GlobalSysTray(object):

elif TrayEngine == "AppIndicator":
self.menu = Gtk.Menu()
self.tray = AppIndicator3.Indicator.new(name, icon, AppIndicator3.IndicatorCategory.APPLICATION_STATUS)
self.tray = AppIndicator.Indicator.new(name, icon, AppIndicator.IndicatorCategory.APPLICATION_STATUS)
self.tray.set_menu(self.menu)
# Double-click is not possible with App-Indicators

@@ -484,7 +508,7 @@ class GlobalSysTray(object):
if TrayEngine == "KDE":
self.tray.setStatus(KStatusNotifierItem.Active)
elif TrayEngine == "AppIndicator":
self.tray.set_status(AppIndicator3.IndicatorStatus.ACTIVE)
self.tray.set_status(AppIndicator.IndicatorStatus.ACTIVE)
elif TrayEngine == "Qt":
self.tray.show()

@@ -492,7 +516,7 @@ class GlobalSysTray(object):
if TrayEngine == "KDE":
self.tray.setStatus(KStatusNotifierItem.Passive)
elif TrayEngine == "AppIndicator":
self.tray.set_status(AppIndicator3.IndicatorStatus.PASSIVE)
self.tray.set_status(AppIndicator.IndicatorStatus.PASSIVE)
elif TrayEngine == "Qt":
self.tray.hide()



+ 2
- 1
src/ui/xycontroller.ui View File

@@ -217,6 +217,7 @@
<height>64</height>
</size>
</property>
<layout class="QHBoxLayout" name="horizontalLayout_4"/>
</widget>
</item>
</layout>
@@ -231,7 +232,7 @@
<x>0</x>
<y>0</y>
<width>588</width>
<height>21</height>
<height>20</height>
</rect>
</property>
<widget class="QMenu" name="menu_File">


+ 3
- 1
src/xycontroller.py View File

@@ -206,6 +206,7 @@ class XYGraphicsScene(QGraphicsScene):
def mousePressEvent(self, event):
self.m_mouseLock = True
self.handleMousePos(event.scenePos())
self.parent().setCursor(Qt.CrossCursor)
QGraphicsScene.mousePressEvent(self, event)

def mouseMoveEvent(self, event):
@@ -214,6 +215,7 @@ class XYGraphicsScene(QGraphicsScene):

def mouseReleaseEvent(self, event):
self.m_mouseLock = False
self.parent().setCursor(Qt.ArrowCursor)
QGraphicsScene.mouseReleaseEvent(self, event)

# XY Controller Window
@@ -605,7 +607,7 @@ if __name__ == '__main__':

# Start jack
jack_status = jacklib.jack_status_t(0)
jack_client = jacklib.client_open("XY-Controller", jacklib.JackSessionID, jacklib.pointer(jack_status))
jack_client = jacklib.client_open("XY-Controller", jacklib.JackNoStartServer|jacklib.JackSessionID, jacklib.pointer(jack_status))

if not jack_client:
errorString = get_jack_status_error_string(jack_status)


Loading…
Cancel
Save