Skip to content

Commit

Permalink
Show list of connected apps in the editor
Browse files Browse the repository at this point in the history
  • Loading branch information
anjaldoshi committed Nov 19, 2020
1 parent d73a8f8 commit a303ec3
Show file tree
Hide file tree
Showing 7 changed files with 22 additions and 15 deletions.
1 change: 1 addition & 0 deletions .github/workflows/linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ jobs:
# - name: test
# run: cd build && ctest
- name: deploy
if: github.ref == 'refs/heads/master'
env:
bintrayUser: ${{ secrets.bintrayUsername }}
bintrayApiKey: ${{ secrets.bintrayApiKey }}
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/mac.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ jobs:
# - name: test
# run: cd build && ctest
- name: deploy
if: github.ref == 'refs/heads/master'
env:
bintrayUser: ${{ secrets.bintrayUsername }}
bintrayApiKey: ${{ secrets.bintrayApiKey }}
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ jobs:
# - name: test
# run: cd build && ctest
- name: deploy
if: github.ref == 'refs/heads/master'
env:
bintrayUser: ${{ secrets.bintrayUsername }}
bintrayApiKey: ${{ secrets.bintrayApiKey }}
Expand Down
6 changes: 2 additions & 4 deletions Source/ZmqInterface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -665,7 +665,7 @@ void ZmqInterface::handleSpike(const SpikeChannel* spikeInfo, const MidiMessage&
sendSpikeEvent(spikeInfo, event);
}

int ZmqInterface::receiveEvents(MidiBuffer& events)
int ZmqInterface::receiveEvents()
{

EventData ed;
Expand Down Expand Up @@ -786,9 +786,7 @@ void ZmqInterface::process(AudioSampleBuffer& buffer)
sendData(*(buffer.getArrayOfWritePointers()), buffer.getNumChannels(),
buffer.getNumSamples(), getNumSamples(0), firstTs, (int)sampleRate);

#if 0
receiveEvents(events);
#endif
receiveEvents();
checkForApplications();
}

Expand Down
3 changes: 2 additions & 1 deletion Source/ZmqInterface.h
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,8 @@ class ZmqInterface : public GenericProcessor, public Thread
int64 timestamp);
int sendSpikeEvent(const SpikeChannel* spikeInfo, const MidiMessage &event);

int receiveEvents(MidiBuffer &events);
// Currently only supports events related to keeping track of connected Applications
int receiveEvents();
void checkForApplications();

template<typename T> int sendParam(String name, T value);
Expand Down
24 changes: 14 additions & 10 deletions Source/ZmqInterfaceEditor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -95,12 +95,12 @@ private ListBoxModel, public AsyncUpdater

const int x = getTickX();

g.setFont (height * 0.6f);
g.setFont (height * 0.7f);
if (i->alive)
g.setColour(Colours::green);
else
g.setColour(Colours::red);
g.drawText (item, x, 0, width - x - 2, height, Justification::centredLeft, true);
g.drawText (item, 10, 0, width - x - 2, height, Justification::centredLeft, true);
} // end of function
}

Expand All @@ -110,15 +110,12 @@ private ListBoxModel, public AsyncUpdater
selectRow (row);
}

void paint (Graphics& g) override
void paintOverChildren (Graphics& g) override
{
ListBox::paint (g);
g.setColour (Colours::grey);
g.setGradientFill(backgroundGradient);
if (editor->getApplicationList()->size() == 0)
{
g.setColour (Colours::grey);
g.setFont (13.0f);
g.setColour (Colours::darkgrey);
g.setFont (14.0f);
g.drawText (noItemsMessage,
0, 0, getWidth(), getHeight() / 2,
Justification::centred, true);
Expand Down Expand Up @@ -148,9 +145,16 @@ private ListBoxModel, public AsyncUpdater
ZmqInterfaceEditor::ZmqInterfaceEditor(GenericProcessor *parentNode, bool useDefaultParameters): GenericEditor(parentNode, useDefaultParameters)
{
ZmqProcessor = (ZmqInterface *)parentNode;
listBox = new ZmqInterfaceEditorListBox(String("no app connected"), this);
listBox->setBounds(2,25,130,105);
listBox = new ZmqInterfaceEditorListBox(String("No App connected"), this);
listBox->setBounds(2,45,130,85);
addAndMakeVisible(listBox);

listTitle = new Label();
listTitle->setText("List of connected apps:", dontSendNotification);
listTitle->setColour(Label::textColourId, Colours::black);
listTitle->setBounds(2,27,130,15);
listTitle->setFont(Font("FiraSans Bold", 14, Font::plain));
addAndMakeVisible(listTitle);
#if 0
dataPortEditor = new TextEditor("dataport");
addAndMakeVisible(dataPortEditor);
Expand Down
1 change: 1 addition & 0 deletions Source/ZmqInterfaceEditor.h
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ class ZmqInterfaceEditor: public GenericEditor
OwnedArray<ZmqApplication> *getApplicationList();
ZmqInterface *ZmqProcessor;
ZmqInterfaceEditorListBox *listBox;
Label *listTitle;
JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (ZmqInterfaceEditor)


Expand Down

0 comments on commit a303ec3

Please sign in to comment.