Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
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 CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ set(AG_AAX_SDK_DEFAULT "${AG_SDKS_ROOT}/aax-sdk")
set(AG_AAX_SDK ${AG_AAX_SDK_DEFAULT} CACHE STRING "AAX SDK Folder")

if(CMAKE_SYSTEM_NAME STREQUAL "Darwin")
set(AG_MACOS_TARGET 10.8 CACHE STRING "macOS target, default is 10.8")
set(AG_MACOS_TARGET 14.0 CACHE STRING "macOS target, default is 10.8")
set(CMAKE_OSX_DEPLOYMENT_TARGET ${AG_MACOS_TARGET})
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libc++")
set(CMAKE_EXPORT_COMPILE_COMMANDS TRUE)
Expand Down
2 changes: 1 addition & 1 deletion Common/Source/WindowHelper.mm
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

#include "WindowHelper.hpp"

#include <juce_graphics/native/juce_mac_CoreGraphicsHelpers.h>
#include <juce_graphics/native/juce_CoreGraphicsHelpers_mac.h>

namespace e47 {
namespace WindowHelper {
Expand Down
2 changes: 1 addition & 1 deletion JUCE
Submodule JUCE updated 3872 files
12 changes: 6 additions & 6 deletions Plugin/Source/Client.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -346,7 +346,7 @@ void Client::init() {
if (useUnixDomain) {
auto socketPath = Defaults::getSocketPath(Defaults::SERVER_SOCK, {{"id", String(srvInfo.getID())}});
logln("connecting server: " << socketPath.getFullPathName());
if (!m_cmdOut->connect(socketPath, 1000)) {
if (!m_cmdOut->connect(socketPath.getFullPathName(), 1000)) {
logln("local connection to server failed");
useUnixDomain = false;
}
Expand Down Expand Up @@ -397,7 +397,7 @@ void Client::init() {
workerSocketPath = Defaults::getSocketPath(Defaults::WORKER_SOCK,
{{"id", String(srvInfo.getID())}, {"n", String(resp.port)}});
logln("connecting worker: " << workerSocketPath.getFullPathName());
m_cmdOut->connect(workerSocketPath);
m_cmdOut->connect(workerSocketPath.getFullPathName(), 1000);
} else {
logln("connecting worker: " << srvInfo.getHost() << ":" << resp.port);
m_cmdOut->connect(srvInfo.getHost(), resp.port);
Expand All @@ -410,22 +410,22 @@ void Client::init() {
}

m_cmdIn = std::make_unique<StreamingSocket>();
if (useUnixDomain ? !m_cmdIn->connect(workerSocketPath) : !m_cmdIn->connect(srvInfo.getHost(), resp.port)) {
if (useUnixDomain ? !m_cmdIn->connect(workerSocketPath.getFullPathName(), 1000) : !m_cmdIn->connect(srvInfo.getHost(), resp.port)) {
logln("failed to setup command receive connection");
m_cmdIn.reset();
}
logln("command connection established");

StreamingSocket* audioSock = nullptr;
audioSock = new StreamingSocket;
if (useUnixDomain ? !audioSock->connect(workerSocketPath) : !audioSock->connect(srvInfo.getHost(), resp.port)) {
if (useUnixDomain ? !audioSock->connect(workerSocketPath.getFullPathName(), 1000) : !audioSock->connect(srvInfo.getHost(), resp.port)) {
logln("failed to setup audio connection");
delete audioSock;
audioSock = nullptr;
}

m_screenSocket = std::make_unique<StreamingSocket>();
if (useUnixDomain ? !m_screenSocket->connect(workerSocketPath)
if (useUnixDomain ? !m_screenSocket->connect(workerSocketPath.getFullPathName(), 1000)
: !m_screenSocket->connect(srvInfo.getHost(), resp.port)) {
logln("failed to setup screen connection");
m_screenSocket.reset();
Expand All @@ -434,7 +434,7 @@ void Client::init() {
if (nullptr != audioSock) {
logln("audio connection established");
RealtimeOptions opts;
opts.workDurationMs = (uint32)round(m_samplesPerBlock / m_sampleRate * 1000) - 1;
opts = opts.withPeriodMs((double) (round(m_samplesPerBlock / m_sampleRate * 1000) - 1));
std::lock_guard<std::mutex> audiolck(m_audioMtx);
if (m_doublePrecission) {
m_audioStreamerD = std::make_shared<AudioStreamer<double>>(this, audioSock);
Expand Down
19 changes: 12 additions & 7 deletions Plugin/Source/PluginEditor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -178,14 +178,19 @@ void PluginEditor::paint(Graphics& g) {
FillType ft;
auto colBG = getLookAndFeel().findColour(ResizableWindow::backgroundColourId);
auto tp = m_processor.getTrackProperties();
if (!tp.colour.isTransparent()) {
auto gradient = ColourGradient::horizontal(colBG.interpolatedWith(tp.colour, 0.05f), 0, colBG, 100);
g.setGradientFill(gradient);
g.fillAll();
g.setColour(tp.colour);
g.fillRect(0, 0, 2, getHeight());
} else {
if (tp.colourARGB.has_value()) {
juce::Colour trackColour = juce::Colour(tp.colourARGB.value());
if (!trackColour.isTransparent()) {
juce::Colour colBG = findColour(juce::ResizableWindow::backgroundColourId);
auto gradient = ColourGradient::horizontal(colBG.interpolatedWith(trackColour, 0.05f), 0, colBG, 100);
g.setGradientFill(gradient);
g.setColour(trackColour);
g.fillRect(0, 0, getWidth(), (int)(getHeight() * 0.05)); // This assumption of how to draw might be incorrect
} else {
g.fillAll(colBG);
}
} else {
g.fillAll(colBG);
}
}

Expand Down
8 changes: 4 additions & 4 deletions Plugin/Source/PluginProcessor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1793,7 +1793,7 @@ void PluginProcessor::TrayConnection::sendStatus() {

json j;
j["connected"] = isClientReady;
j["name"] = track.name.toStdString();
j["name"] = track.name->toStdString();
j["channelsIn"] = m_processor->getMainBusNumInputChannels();
j["channelsOut"] = m_processor->getTotalNumOutputChannels();
j["channelsSC"] = m_processor->getBusCount(true) > 0 ? m_processor->getChannelCountOfBus(true, 1) : 0;
Expand All @@ -1802,7 +1802,7 @@ void PluginProcessor::TrayConnection::sendStatus() {
#else
j["instrument"] = false;
#endif
j["colour"] = track.colour.getARGB();
j["colour"] = track.colourARGB.value_or(0);
j["loadedPlugins"] = client.getLoadedPluginsString().toStdString();
j["loadedPluginsOk"] = m_processor->m_loadedPluginsOk.load();
j["perfStream"] = tsStream->getMostRecentAverage();
Expand Down Expand Up @@ -1868,9 +1868,9 @@ void PluginProcessor::TrayConnection::run() {
if (!connected) {
bool success;
if (Defaults::unixDomainSocketsSupported()) {
success = connectToSocket(Defaults::getSocketPath(Defaults::PLUGIN_TRAY_SOCK), 500);
success = connectToSocket(Defaults::getSocketPath(Defaults::PLUGIN_TRAY_SOCK).getFullPathName(), Defaults::PLUGIN_TRAY_PORT, 500); // Assumption that port should be same as below
} else {
success = connectToSocket("localhost", Defaults::PLUGIN_TRAY_PORT, 500);
success = connectToSocket("localhost", Defaults::PLUGIN_TRAY_PORT, 500); // 2nd arg is port -- we don't have that
}
if (!success) {
String path = File::getSpecialLocation(File::globalApplicationsDirectory).getFullPathName();
Expand Down
2 changes: 1 addition & 1 deletion Plugin/Source/PluginProcessor.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ class PluginProcessor : public AudioProcessor, public AudioProcessorParameter::L
void releaseResources() override;

bool isBusesLayoutSupported(const BusesLayout& layouts) const override;
Array<std::pair<short, short>> getAUChannelInfo() const override;
Array<std::pair<short, short>> getAUChannelInfo() const;

bool canAddBus(bool /*isInput*/) const override { return true; }
bool canRemoveBus(bool /*isInput*/) const override { return true; }
Expand Down
2 changes: 1 addition & 1 deletion PluginTray/Source/App.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ void App::initialise(const String& /*commandLineParameters*/) {
}
}
if (Defaults::unixDomainSocketsSupported()) {
if (!m_srv.beginWaitingForSocket(Defaults::getSocketPath(Defaults::PLUGIN_TRAY_SOCK, {}, true))) {
if (!m_srv.beginWaitingForSocket(0, Defaults::getSocketPath(Defaults::PLUGIN_TRAY_SOCK, {}, true).getFullPathName())) {
quit();
return;
}
Expand Down
9 changes: 8 additions & 1 deletion Server/Source/PluginListWindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
#include "PluginListWindow.hpp"
#include "Server.hpp"
#include "WindowPositions.hpp"
#include <juce_audio_processors/format_types/juce_VSTPluginFormat.h>

namespace e47 {

Expand All @@ -21,7 +22,13 @@ PluginListWindow::PluginListWindow(App* app, KnownPluginList& list, const String
m_deadMansPedalFile(deadMansPedalFile) {
if (auto srv = m_app->getServer()) {
setUsingNativeTitleBar(true);
m_plugmgr.addDefaultFormats();

// See <JUCE_module_dir>/modules/juce_audio_processors/format_types
// m_plugmgr.addFormat (new VSTPluginFormat()); // This fails/not found
m_plugmgr.addFormat (new VST3PluginFormat());
m_plugmgr.addFormat (new AudioUnitPluginFormat());
// m_plugmgr.addFormat (new AAXPluginFormat()); // This fails/not found

setContentOwned(new PluginListComponent(m_plugmgr, m_pluginlist, srv->getExcludeList(), m_deadMansPedalFile),
true);

Expand Down
8 changes: 7 additions & 1 deletion Server/Source/Processor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,13 @@ std::shared_ptr<AudioPluginInstance> Processor::loadPlugin(const PluginDescripti
traceScope();
String err2;
AudioPluginFormatManager plugmgr;
plugmgr.addDefaultFormats();

// See <JUCE_module_dir>/modules/juce_audio_processors/format_types
// plugmgr.addFormat (new VSTPluginFormat()); // This fails/not found
plugmgr.addFormat (new VST3PluginFormat());
plugmgr.addFormat (new AudioUnitPluginFormat());
// plugmgr.addFormat (new AAXPluginFormat()); // This fails/not found

#if JUCE_PLUGINHOST_LV2
if (plugdesc.pluginFormatName == "LV2") {
AudioPluginFormat* fmt = new LV2PluginFormat();
Expand Down
6 changes: 3 additions & 3 deletions Server/Source/ProcessorClient.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ bool ProcessorClient::connectSandbox() {
int maxTries = 100;
while (!m_sockCmdOut->isConnected() && maxTries-- > 0 && m_process.isRunning()) {
if (hasUnixDomainSockets) {
if (!m_sockCmdOut->connect(socketPath, 100)) {
if (!m_sockCmdOut->connect(socketPath.getFullPathName(), m_port, 100)) {
sleep(100);
}
} else {
Expand All @@ -209,7 +209,7 @@ bool ProcessorClient::connectSandbox() {
m_sockCmdIn = std::make_unique<StreamingSocket>();

if (hasUnixDomainSockets) {
if (!m_sockCmdIn->connect(socketPath)) {
if (!m_sockCmdIn->connect(socketPath.getFullPathName(), 0)) {
setAndLogError("failed to setup sandbox command-in connection");
success = false;
}
Expand All @@ -236,7 +236,7 @@ bool ProcessorClient::connectSandbox() {
m_sockAudio = std::make_unique<StreamingSocket>();

if (hasUnixDomainSockets) {
if (!m_sockAudio->connect(socketPath)) {
if (!m_sockAudio->connect(socketPath.getFullPathName(), m_port)) {
setAndLogError("failed to setup sandbox audio connection");
success = false;
}
Expand Down
2 changes: 1 addition & 1 deletion Server/Source/ProcessorWindow.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ class ProcessorWindow : public DocumentWindow, private Timer, public LogTag {
~ProcessorWindow() override;

void closeButtonPressed() override;
BorderSize<int> getBorderThickness() override { return {}; }
BorderSize<int> getBorderThickness() const override { return {}; }

void forgetEditor();
juce::Rectangle<int> getScreenCaptureRect();
Expand Down
19 changes: 10 additions & 9 deletions Server/Source/Server.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1197,13 +1197,13 @@ void Server::runServer() {
if (getScreenLocalMode() && Defaults::unixDomainSocketsSupported()) {
auto socketPath = Defaults::getSocketPath(Defaults::SERVER_SOCK, {{"id", String(getId())}}, true);
logln("creating listener " << socketPath.getFullPathName());
if (!m_masterSocketLocal.createListener(socketPath)) {
if (!m_masterSocketLocal.createListener(0, socketPath.getFullPathName())) {
logln("failed to create local master listener");
}
}

logln("creating listener " << (m_host.length() == 0 ? "*" : m_host) << ":" << (m_port + getId()));
if (m_masterSocket.createListener6(m_port + getId(), m_host)) {
if (m_masterSocket.createListener(m_port + getId(), m_host)) {
logln("server started: ID=" << getId() << ", PORT=" << m_port + getId() << ", NAME=" << m_name);
while (!threadShouldExit()) {
StreamingSocket* clnt = nullptr;
Expand Down Expand Up @@ -1287,8 +1287,9 @@ void Server::runServer() {
auto sandbox = std::make_shared<SandboxMaster>(*this, id);
logln("creating sandbox " << id);
if (sandbox->launchWorkerProcess(
File::getSpecialLocation(File::currentExecutableFile), Defaults::SANDBOX_CMD_PREFIX,
{"-id", String(getId()), "-islocal", String((int)isLocal), "-clientid", id}, 3000, 30000)) {
File::getSpecialLocation(File::currentExecutableFile),
Defaults::SANDBOX_CMD_PREFIX,
3000)) {
sandbox->onPortReceived = [this, id, clnt](int sandboxPort) {
traceScope();
if (!sendHandshakeResponse(clnt, true, sandboxPort)) {
Expand Down Expand Up @@ -1399,7 +1400,7 @@ void Server::runSandboxChain() {
m_sandboxController = std::make_unique<SandboxSlave>(*this);

if (!m_sandboxController->initialiseFromCommandLine(getOpt("commandLine", String()), Defaults::SANDBOX_CMD_PREFIX,
10000, 30000)) {
10000)) {
logln("failed to initialize sandbox process");
getApp()->prepareShutdown(App::EXIT_SANDBOX_INIT_ERROR);
return;
Expand Down Expand Up @@ -1517,13 +1518,13 @@ void Server::runSandboxPlugin() {

if (hasUnixDomainSockets) {
socketPath = Defaults::getSocketPath(Defaults::SANDBOX_PLUGIN_SOCK, {{"n", String(m_port)}}, true);
if (!workerMasterSocket->createListener(socketPath)) {
if (!workerMasterSocket->createListener(0, socketPath.getFullPathName())) {
logln("failed to create worker listener");
getApp()->prepareShutdown(App::EXIT_SANDBOX_BIND_ERROR);
return;
}
} else {
if (!workerMasterSocket->createListener6(m_port, m_host)) {
if (!workerMasterSocket->createListener(m_port, m_host)) {
logln("failed to create worker listener");
getApp()->prepareShutdown(App::EXIT_SANDBOX_BIND_ERROR);
return;
Expand Down Expand Up @@ -1586,10 +1587,10 @@ bool Server::createWorkerListener(std::shared_ptr<StreamingSocket> sock, bool is
Defaults::getSocketPath(Defaults::WORKER_SOCK, {{"id", String(getId())}, {"n", String(workerPort)}});
} while (socketPath.exists() && ++workerPort <= workerPortMax);
if (!socketPath.exists()) {
sock->createListener(socketPath);
sock->createListener(0, socketPath.getFullPathName());
}
} else {
while (!sock->createListener6(workerPort, m_host)) {
while (!sock->createListener(workerPort, m_host)) {
if (++workerPort > workerPortMax) {
break;
}
Expand Down
4 changes: 2 additions & 2 deletions Server/Source/Worker.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ void Worker::run() {
if (nullptr != sock && sock->isConnected()) {
m_audio->init(std::move(sock), m_cfg);
RealtimeOptions opts;
opts.workDurationMs = (uint32)lround(m_cfg.samplesPerBlock / m_cfg.sampleRate * 1000) - 1;
opts = opts.withPeriodMs((double)lround(m_cfg.samplesPerBlock / m_cfg.sampleRate * 1000) - 1);
m_audio->startRealtimeThread(opts);
} else {
logln("failed to establish audio connection");
Expand Down Expand Up @@ -275,7 +275,7 @@ void Worker::handleMessage(std::shared_ptr<Message<AddPlugin>> msg) {
jresult["supportsDoublePrecision"] = proc->supportsDoublePrecisionProcessing();
jresult["channelInstances"] = proc->getChannelInstances();
auto ts = proc->getTailLengthSeconds();
if (ts == std::numeric_limits<double>::infinity()) {
if (std::isinf(ts)) {
ts = 0.0;
}
jresult["tailSeconds"] = ts;
Expand Down