Skip to content
Merged
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 include/element/application.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ class Application : public juce::JUCEApplication,
Context& context;
juce::MidiDeviceListConnection connection;
juce::WeakReference<MidiSettingsApply>::Master masterReference;
friend class WeakReference<MidiSettingsApply>;
friend class juce::WeakReference<MidiSettingsApply>;
};
std::unique_ptr<MidiSettingsApply> applyMidiSettings;
#endif
Expand Down
1 change: 0 additions & 1 deletion include/element/juce.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,5 @@
#include <juce_gui_extra/juce_gui_extra.h>
#include <juce_osc/juce_osc.h>

using namespace juce; // FIXME: namespace juce
namespace element {
}
2 changes: 1 addition & 1 deletion include/element/ui/standard.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ class StandardContent : public Content,
std::unique_ptr<NavigationConcertinaPanel> nav;
friend class ContentContainer;
std::unique_ptr<ContentContainer> container;
StretchableLayoutManager layout;
juce::StretchableLayoutManager layout;
class Resizer;
friend class Resizer;
std::unique_ptr<Resizer> bar1;
Expand Down
2 changes: 2 additions & 0 deletions src/application.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@
#define ELEMENT_FIRST_RUN 0
#endif

using namespace juce;

namespace element {

static std::atomic<int> sCanShutdown { 0 };
Expand Down
4 changes: 2 additions & 2 deletions src/engine/graphmanager.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ namespace element {
class PluginManager;
class RootGraph;

class GraphManager : public ChangeBroadcaster
class GraphManager : public juce::ChangeBroadcaster
{
public:
static const uint32 invalidNodeId = EL_INVALID_PORT;
Expand Down Expand Up @@ -49,7 +49,7 @@ class GraphManager : public ChangeBroadcaster
uint32 addNode (const Node& node);

/** Adss a node with a plugin description */
uint32 addNode (const PluginDescription* desc, double x = 0.0f, double y = 0.0f, uint32 nodeId = 0);
uint32 addNode (const juce::PluginDescription* desc, double x = 0.0f, double y = 0.0f, uint32 nodeId = 0);

/** Remove a node by ID */
void removeNode (const uint32 nodeId);
Expand Down
10 changes: 5 additions & 5 deletions src/engine/mappingengine.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ class MappingEngine
void stopMapping();

void capture (const bool start = true) { capturedEvent.capture.set (start); }
MidiMessage getCapturedMidiMessage() const { return capturedEvent.message; }
juce::MidiMessage getCapturedMidiMessage() const { return capturedEvent.message; }
Control getCapturedControl() const { return capturedEvent.control; }
CapturedEventSignal& capturedSignal() { return capturedEvent.callback; }

Expand All @@ -42,7 +42,7 @@ class MappingEngine
class Inputs;
std::unique_ptr<Inputs> inputs;

class CapturedEvent : public AsyncUpdater
class CapturedEvent : public juce::AsyncUpdater
{
public:
CapturedEvent() { capture.set (false); }
Expand All @@ -55,13 +55,13 @@ class MappingEngine

private:
friend class MappingEngine;
Atomic<bool> capture;
juce::Atomic<bool> capture;
Control control;
MidiMessage message;
juce::MidiMessage message;
CapturedEventSignal callback;
} capturedEvent;

bool captureNextEvent (ControllerMapInput&, const Control&, const MidiMessage&);
bool captureNextEvent (ControllerMapInput&, const Control&, const juce::MidiMessage&);
};

} // namespace element
16 changes: 8 additions & 8 deletions src/engine/midipanic.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ class MidiPanic
/** Write panic messags to a buffer. */
inline static void write (juce::MidiBuffer& buffer, int ch, int frame)
{
buffer.addEvent (MidiMessage::allNotesOff (ch), frame);
buffer.addEvent (MidiMessage::allSoundOff (ch), frame);
buffer.addEvent (juce::MidiMessage::allNotesOff (ch), frame);
buffer.addEvent (juce::MidiMessage::allSoundOff (ch), frame);
}

/** Write panic messages on all midi channels in the buffer. */
Expand All @@ -47,11 +47,11 @@ class MidiPanic
inline static std::vector<juce::MidiMessage> messages (int ch)
{
std::vector<juce::MidiMessage> msgs;
const auto timestamp = Time::getMillisecondCounterHiRes();
auto msg = MidiMessage::allNotesOff (ch);
const auto timestamp = juce::Time::getMillisecondCounterHiRes();
auto msg = juce::MidiMessage::allNotesOff (ch);
msg.setTimeStamp (timestamp);
msgs.push_back (msg);
msg = MidiMessage::allSoundOff (ch);
msg = juce::MidiMessage::allSoundOff (ch);
msg.setTimeStamp (timestamp);
msgs.push_back (msg);
return msgs;
Expand All @@ -61,13 +61,13 @@ class MidiPanic
inline static std::vector<juce::MidiMessage> messages()
{
std::vector<juce::MidiMessage> msgs;
const auto timestamp = Time::getMillisecondCounterHiRes();
const auto timestamp = juce::Time::getMillisecondCounterHiRes();
for (int ch = 1; ch <= 16; ++ch)
{
auto msg = MidiMessage::allNotesOff (ch);
auto msg = juce::MidiMessage::allNotesOff (ch);
msg.setTimeStamp (timestamp);
msgs.push_back (msg);
msg = MidiMessage::allSoundOff (ch);
msg = juce::MidiMessage::allSoundOff (ch);
msg.setTimeStamp (timestamp);
msgs.push_back (msg);
}
Expand Down
1 change: 1 addition & 0 deletions src/engine/midipipe.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
#include "el/midi_buffer.hpp"
#include "el/factories.hpp"

using namespace juce;
namespace element {

MidiPipe::MidiPipe()
Expand Down
12 changes: 6 additions & 6 deletions src/engine/miditranspose.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,26 +27,26 @@ class MidiTranspose
inline int getNoteOffset() const { return offset.get(); }

/** Process a single event */
inline static void process (MidiMessage& message, const int offset)
inline static void process (juce::MidiMessage& message, const int offset)
{
if (message.isNoteOnOrOff())
message.setNoteNumber (offset + message.getNoteNumber());
}

/** Process a single event */
inline void process (MidiMessage& message) noexcept
inline void process (juce::MidiMessage& message) noexcept
{
if (message.isNoteOnOrOff())
message.setNoteNumber (offset.get() + message.getNoteNumber());
}

/** Process a MidiBuffer */
inline void process (MidiBuffer& midi, int numSamples)
inline void process (juce::MidiBuffer& midi, int numSamples)
{
if (0 == offset.get())
return;

MidiMessage msg;
juce::MidiMessage msg;
for (auto m : midi)
{
if (m.samplePosition >= numSamples)
Expand All @@ -62,8 +62,8 @@ class MidiTranspose
}

private:
Atomic<int> offset { 0 };
MidiBuffer output;
juce::Atomic<int> offset { 0 };
juce::MidiBuffer output;
};

} // namespace element
4 changes: 3 additions & 1 deletion src/nodes/audiofileplayer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@

#include "utils.hpp"

using namespace juce;

namespace element {

class AudioFilePlayerEditor;
Expand Down Expand Up @@ -156,7 +158,7 @@ class AudioFilePlayerEditor : public AudioProcessorEditor,
}

void timerCallback() override { stabilizeComponents(); }
void changeListenerCallback (ChangeBroadcaster*) override { stabilizeComponents(); }
void changeListenerCallback (juce::ChangeBroadcaster*) override { stabilizeComponents(); }

void stabilizeComponents()
{
Expand Down
4 changes: 2 additions & 2 deletions src/nodes/audiofileplayer.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
namespace element {

class AudioFilePlayerNode : public BaseProcessor,
public AudioProcessorParameter::Listener,
public AsyncUpdater
public juce::AudioProcessorParameter::Listener,
public juce::AsyncUpdater
{
public:
enum Parameters
Expand Down
22 changes: 11 additions & 11 deletions src/nodes/audiorouter.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,29 +11,29 @@
namespace element {

class AudioRouterNode : public Processor,
public ChangeBroadcaster
public juce::ChangeBroadcaster
{
public:
explicit AudioRouterNode (int ins = 4, int outs = 4);
~AudioRouterNode();

void prepareToRender (double sampleRate, int maxBufferSize) override { ignoreUnused (sampleRate, maxBufferSize); }
void prepareToRender (double sampleRate, int maxBufferSize) override { juce::ignoreUnused (sampleRate, maxBufferSize); }
void releaseResources() override {}

inline bool wantsContext() const noexcept override { return true; }
void render (RenderContext&) override;

void getState (MemoryBlock&) override;
void getState (juce::MemoryBlock&) override;
void setState (const void*, int sizeInBytes) override;

void setSize (int newIns, int newOuts, bool async = true);
String getSizeString() const;
void setMatrixState (const MatrixState&);
MatrixState getMatrixState() const;
void setWithoutLocking (int src, int dst, bool set);
CriticalSection& getLock() { return lock; }
juce::CriticalSection& getLock() { return lock; }

int getNumPrograms() const override { return jmax (1, programs.size()); }
int getNumPrograms() const override { return juce::jmax (1, programs.size()); }
int getCurrentProgram() const override { return currentProgram; }
void setCurrentProgram (int index) override;
const String getProgramName (int index) const override
Expand All @@ -45,14 +45,14 @@ class AudioRouterNode : public Processor,

void setFadeLength (double seconds)
{
seconds = jlimit (0.001, 5.0, seconds);
ScopedLock sl (lock);
seconds = juce::jlimit (0.001, 5.0, seconds);
juce::ScopedLock sl (lock);
fadeLengthSeconds = seconds;
fadeIn.setLength (static_cast<float> (fadeLengthSeconds));
fadeOut.setLength (static_cast<float> (fadeLengthSeconds));
}

void getPluginDescription (PluginDescription& desc) const override
void getPluginDescription (juce::PluginDescription& desc) const override
{
desc.fileOrIdentifier = EL_NODE_ID_AUDIO_ROUTER;
desc.name = "Audio Router";
Expand Down Expand Up @@ -92,12 +92,12 @@ class AudioRouterNode : public Processor,
}

private:
CriticalSection lock;
juce::CriticalSection lock;
[[maybe_unused]] int numSources;
[[maybe_unused]] int nextNumSources;
[[maybe_unused]] int numDestinations;
[[maybe_unused]] int nextNumDestinations;
AudioSampleBuffer tempAudio { 1, 1 };
juce::AudioSampleBuffer tempAudio { 1, 1 };
bool rebuildPorts = true;

struct Program
Expand All @@ -109,7 +109,7 @@ class AudioRouterNode : public Processor,
MatrixState matrix;
};

OwnedArray<Program> programs;
juce::OwnedArray<Program> programs;
int currentProgram = -1;

void set (int src, int dst, bool patched);
Expand Down
4 changes: 3 additions & 1 deletion src/nodes/audioroutereditor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
#include "ui/patchmatrix.hpp"
#include "common.hpp"

using namespace juce;

namespace element {

class AudioRouterMatrix : public PatchMatrixComponent
Expand Down Expand Up @@ -268,7 +270,7 @@ String AudioRouterEditor::getSizeString() const
return {};
}

void AudioRouterEditor::changeListenerCallback (ChangeBroadcaster*)
void AudioRouterEditor::changeListenerCallback (juce::ChangeBroadcaster*)
{
if (auto* const node = getNodeObjectOfType<AudioRouterNode>())
{
Expand Down
6 changes: 3 additions & 3 deletions src/nodes/audioroutereditor.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,21 +9,21 @@
namespace element {

class AudioRouterEditor : public NodeEditor,
public ChangeListener
public juce::ChangeListener
{
public:
AudioRouterEditor (const Node& node);
~AudioRouterEditor();

void resized() override;
void paint (Graphics& g) override;
void paint (juce::Graphics& g) override;

void adjustBoundsToMatrixSize (int cellSize = 0);
String getSizeString() const;
MatrixState& getMatrixState() { return matrix; }
void applyMatrix();
void setFadeLength (double length);
void changeListenerCallback (ChangeBroadcaster*) override;
void changeListenerCallback (juce::ChangeBroadcaster*) override;

void setAutoResize (bool yn) { autoResize = yn; }

Expand Down
14 changes: 7 additions & 7 deletions src/nodes/ionodeeditor.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
namespace element {

class AudioIONodeEditor : public NodeEditor,
public ChangeListener
public juce::ChangeListener
{
public:
AudioIONodeEditor (const Node& node, DeviceManager& devs, bool ins = true, bool outs = true)
Expand All @@ -31,7 +31,7 @@ class AudioIONodeEditor : public NodeEditor,
content.reset();
}

void paint (Graphics& g) override
void paint (juce::Graphics& g) override
{
g.setFont (13.f);
g.setColour (Colors::textColor);
Expand All @@ -40,10 +40,10 @@ class AudioIONodeEditor : public NodeEditor,
text << "Input";
else if (getNode().isAudioOutputNode())
text << "Output";
g.drawText (text, getLocalBounds(), Justification::centred);
g.drawText (text, getLocalBounds(), juce::Justification::centred);
}

void changeListenerCallback (ChangeBroadcaster*) override
void changeListenerCallback (juce::ChangeBroadcaster*) override
{
content->updateDevices();
}
Expand All @@ -58,10 +58,10 @@ class AudioIONodeEditor : public NodeEditor,
DeviceManager& devices;
bool showIns = true;
bool showOuts = true;
Viewport view;
juce::Viewport view;

struct Content : public Component,
public Button::Listener
public juce::Button::Listener
{
Content (AudioIONodeEditor& ed)
: owner (ed)
Expand Down Expand Up @@ -98,7 +98,7 @@ class AudioIONodeEditor : public NodeEditor,
{
}

void buttonClicked (Button* button) override
void buttonClicked (juce::Button* button) override
{
}

Expand Down
Loading
Loading