forked from LMMS/lmms
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add Carla support for MacOS (LMMS#4558)
Add Carla support for MacOS
- Loading branch information
Showing
10 changed files
with
81 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
/* | ||
* carla.cpp - Carla for LMMS | ||
* | ||
* Copyright (C) 2014 Filipe Coelho <[email protected]> | ||
* Copyright (C) 2014-2018 Filipe Coelho <[email protected]> | ||
* | ||
* This file is part of LMMS - https://lmms.io | ||
* | ||
|
@@ -24,9 +24,6 @@ | |
|
||
#include "carla.h" | ||
|
||
#define REAL_BUILD // FIXME this shouldn't be needed | ||
#include "CarlaHost.h" | ||
|
||
#include "Engine.h" | ||
#include "Song.h" | ||
#include "gui_templates.h" | ||
|
@@ -132,14 +129,6 @@ static const char* host_ui_save_file(NativeHostHandle, bool isDir, const char* t | |
|
||
// ----------------------------------------------------------------------- | ||
|
||
CARLA_EXPORT | ||
const NativePluginDescriptor* carla_get_native_patchbay_plugin(); | ||
|
||
CARLA_EXPORT | ||
const NativePluginDescriptor* carla_get_native_rack_plugin(); | ||
|
||
// ----------------------------------------------------------------------- | ||
|
||
CarlaInstrument::CarlaInstrument(InstrumentTrack* const instrumentTrack, const Descriptor* const descriptor, const bool isPatchbay) | ||
: Instrument(instrumentTrack, descriptor), | ||
kIsPatchbay(isPatchbay), | ||
|
@@ -161,8 +150,9 @@ CarlaInstrument::CarlaInstrument(InstrumentTrack* const instrumentTrack, const D | |
path.cdUp(); | ||
resourcesPath = path.absolutePath() + "/share/carla/resources"; | ||
#elif defined(CARLA_OS_MAC) | ||
// assume standard install location | ||
resourcesPath = "/Applications/Carla.app/Contents/MacOS/resources"; | ||
// parse prefix from dll filename | ||
QDir path = QFileInfo(dllName).dir(); | ||
resourcesPath = path.absolutePath() + "/resources"; | ||
#elif defined(CARLA_OS_WIN32) || defined(CARLA_OS_WIN64) | ||
// not yet supported | ||
#endif | ||
|
@@ -254,7 +244,7 @@ void CarlaInstrument::handleUiClosed() | |
emit uiClosed(); | ||
} | ||
|
||
intptr_t CarlaInstrument::handleDispatcher(const NativeHostDispatcherOpcode opcode, const int32_t index, const intptr_t value, void* const ptr, const float opt) | ||
intptr_t CarlaInstrument::handleDispatcher(const NativeHostDispatcherOpcode opcode, const int32_t, const intptr_t, void* const, const float) | ||
{ | ||
intptr_t ret = 0; | ||
|
||
|
@@ -267,13 +257,10 @@ intptr_t CarlaInstrument::handleDispatcher(const NativeHostDispatcherOpcode opco | |
qApp->processEvents(); | ||
break; | ||
default: | ||
break; | ||
break; | ||
} | ||
|
||
return ret; | ||
|
||
// unused for now | ||
(void)index; (void)value; (void)ptr; (void)opt; | ||
} | ||
|
||
// ------------------------------------------------------------------- | ||
|
@@ -448,9 +435,12 @@ bool CarlaInstrument::handleMidiEvent(const MidiEvent& event, const MidiTime&, f | |
|
||
PluginView* CarlaInstrument::instantiateView(QWidget* parent) | ||
{ | ||
// Disable plugin focus per https://bugreports.qt.io/browse/QTBUG-30181 | ||
#ifndef CARLA_OS_MAC | ||
if (QWidget* const window = parent->window()) | ||
fHost.uiParentId = window->winId(); | ||
else | ||
#endif | ||
fHost.uiParentId = 0; | ||
|
||
std::free((char*)fHost.uiName); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
/* | ||
* carla.h - Carla for LMMS | ||
* | ||
* Copyright (C) 2014 Filipe Coelho <[email protected]> | ||
* Copyright (C) 2014-2018 Filipe Coelho <[email protected]> | ||
* | ||
* This file is part of LMMS - https://lmms.io | ||
* | ||
|
@@ -27,7 +27,19 @@ | |
|
||
#include <QtCore/QMutex> | ||
|
||
#include "CarlaNative.h" | ||
#define REAL_BUILD // FIXME this shouldn't be needed | ||
#if CARLA_VERSION_HEX >= 0x010911 | ||
#include "CarlaNativePlugin.h" | ||
#else | ||
#include "CarlaBackend.h" | ||
#include "CarlaNative.h" | ||
#include "CarlaUtils.h" | ||
CARLA_EXPORT | ||
const NativePluginDescriptor* carla_get_native_patchbay_plugin(); | ||
|
||
CARLA_EXPORT | ||
const NativePluginDescriptor* carla_get_native_rack_plugin(); | ||
#endif | ||
|
||
#include "Instrument.h" | ||
#include "InstrumentView.h" | ||
|
@@ -44,7 +56,7 @@ class PLUGIN_EXPORT CarlaInstrument : public Instrument | |
CarlaInstrument(InstrumentTrack* const instrumentTrack, const Descriptor* const descriptor, const bool isPatchbay); | ||
virtual ~CarlaInstrument(); | ||
|
||
// CarlaNative functions | ||
// Carla NativeHostDescriptor functions | ||
uint32_t handleGetBufferSize() const; | ||
double handleGetSampleRate() const; | ||
bool handleIsOffline() const; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
/* | ||
* carlapatchbay.cpp - Carla for LMMS (Patchbay) | ||
* | ||
* Copyright (C) 2014 Filipe Coelho <[email protected]> | ||
* Copyright (C) 2014-2018 Filipe Coelho <[email protected]> | ||
* | ||
* This file is part of LMMS - https://lmms.io | ||
* | ||
|
@@ -36,7 +36,7 @@ Plugin::Descriptor PLUGIN_EXPORT carlapatchbay_plugin_descriptor = | |
QT_TRANSLATE_NOOP( "pluginBrowser", | ||
"Carla Patchbay Instrument" ), | ||
"falkTX <falktx/at/falktx.com>", | ||
0x0195, | ||
CARLA_VERSION_HEX, | ||
Plugin::Instrument, | ||
new PluginPixmapLoader( "logo" ), | ||
NULL, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
/* | ||
* carlarack.cpp - Carla for LMMS (Rack) | ||
* | ||
* Copyright (C) 2014 Filipe Coelho <[email protected]> | ||
* Copyright (C) 2014-2018 Filipe Coelho <[email protected]> | ||
* | ||
* This file is part of LMMS - https://lmms.io | ||
* | ||
|
@@ -36,7 +36,7 @@ Plugin::Descriptor PLUGIN_EXPORT carlarack_plugin_descriptor = | |
QT_TRANSLATE_NOOP( "pluginBrowser", | ||
"Carla Rack Instrument" ), | ||
"falkTX <falktx/at/falktx.com>", | ||
0x0195, | ||
CARLA_VERSION_HEX, | ||
Plugin::Instrument, | ||
new PluginPixmapLoader( "logo" ), | ||
NULL, | ||
|