Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Carla support for MacOS #4558

Merged
merged 20 commits into from
Sep 15, 2018
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .travis/osx..install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@ fi

brew install $PACKAGES ccache
# FIXME: Move "carla" to $PACKAGES once https://github.com/Homebrew/homebrew-core/pull/31560 is merged
brew install https://github.com/tresf/homebrew-core/blob/carla/Formula/carla.rb
brew install https://gist.githubusercontent.com/tresf/a8ffb8299227c51cf11aaf3929765264/raw/e94ad17aea63084c66bcb7e90009e3d5e848a467/carla.rb

sudo npm install -g appdmg
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ ENDIF(WANT_TAP)

# check for CARLA
IF(WANT_CARLA)
PKG_CHECK_MODULES(CARLA carla-standalone>=1.9.5)
PKG_CHECK_MODULES(CARLA carla-native-plugin)
PhysSong marked this conversation as resolved.
Show resolved Hide resolved
IF(CARLA_FOUND)
SET(LMMS_HAVE_CARLA TRUE)
SET(STATUS_CARLA "OK")
Expand Down
9 changes: 1 addition & 8 deletions cmake/apple/install_apple.sh.in
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,7 @@ echo -e "$MSG_COLOR\n\nCreating App Bundle \"$APP\"...$COLOR_RESET"
# Locate macdeployqt, assume homebrew & Qt5
which macdeployqt > /dev/null 2>&1
if [ $? -ne 0 ]; then
brew --prefix qt55 > /dev/null 2>&1
if [ $? -eq 0 ]; then
# Prefer Qt 5.5 (QTBUG-53533)
export PATH=$PATH:$(brew --prefix qt55)/bin
else
# Fallback Qt 5.6+
export PATH=$PATH:$(brew --prefix qt5)/bin
fi
tresf marked this conversation as resolved.
Show resolved Hide resolved
export PATH=$PATH:$(brew --prefix qt)/bin
fi

# Remove any old .app bundles
Expand Down
16 changes: 7 additions & 9 deletions plugins/carlabase/carla.cpp
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
*
Expand All @@ -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"
Expand Down Expand Up @@ -255,7 +252,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;

Expand All @@ -272,9 +269,6 @@ intptr_t CarlaInstrument::handleDispatcher(const NativeHostDispatcherOpcode opco
}
tresf marked this conversation as resolved.
Show resolved Hide resolved

return ret;

// unused for now
(void)index; (void)value; (void)ptr; (void)opt;
}

// -------------------------------------------------------------------
Expand Down Expand Up @@ -449,10 +443,15 @@ 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
#ifdef CARLA_OS_MAC
tresf marked this conversation as resolved.
Show resolved Hide resolved
fHost.uiParentId = 0;
#else
if (QWidget* const window = parent->window())
fHost.uiParentId = window->winId();
else
fHost.uiParentId = 0;
#endif

std::free((char*)fHost.uiName);

Expand Down Expand Up @@ -532,4 +531,3 @@ void CarlaInstrumentView::timerEvent(QTimerEvent* event)
}

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

7 changes: 4 additions & 3 deletions plugins/carlabase/carla.h
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
*
Expand All @@ -27,7 +27,8 @@

#include <QtCore/QMutex>

#include "CarlaNative.h"
#define REAL_BUILD // FIXME this shouldn't be needed
#include "CarlaNativePlugin.h"

#include "Instrument.h"
#include "InstrumentView.h"
Expand All @@ -44,7 +45,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;
Expand Down
4 changes: 2 additions & 2 deletions plugins/carlapatchbay/carlapatchbay.cpp
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
*
Expand Down Expand Up @@ -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,
Expand Down
4 changes: 2 additions & 2 deletions plugins/carlarack/carlarack.cpp
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
*
Expand Down Expand Up @@ -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,
Expand Down