Skip to content

Commit a869799

Browse files
committed
Small fixes
1 parent 2940b47 commit a869799

File tree

6 files changed

+28
-16
lines changed

6 files changed

+28
-16
lines changed

Source/Dialogs.cpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -467,7 +467,7 @@ struct SettingsComponent : public Component
467467
g.fillRoundedRectangle(getLocalBounds().reduced(2).toFloat(), 3.0f);
468468

469469
g.setColour(highlightColour);
470-
g.fillRect(2, 42, getWidth() - 4, 4);
470+
g.fillRect(2, 44, getWidth() - 4, 4);
471471

472472
if (currentPanel > 0)
473473
{
@@ -483,7 +483,7 @@ struct SettingsComponent : public Component
483483
int toolbarPosition = 2;
484484
for (auto& button : toolbarButtons)
485485
{
486-
button->setBounds(toolbarPosition, 0, 70, toolbarHeight);
486+
button->setBounds(toolbarPosition, 2, 70, toolbarHeight);
487487
toolbarPosition += 70;
488488
}
489489

@@ -529,8 +529,6 @@ struct SettingsDialog : public Component
529529
addAndMakeVisible(closeButton.get());
530530

531531
settingsComponent.addMouseListener(this, false);
532-
533-
534532

535533
closeButton->onClick = [this]()
536534
{

Source/GUIObjects.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1556,7 +1556,7 @@ struct RadioComponent : public GUIComponent
15561556
if(isVertical) radioButtons[i]->setBounds(0, i * size, size, size);
15571557
else radioButtons[i]->setBounds(i * size, 0, size, size);
15581558
}
1559-
1559+
15601560
// Fix aspect ratio and
15611561
if(isVertical) {
15621562
if(getWidth() - Box::doubleMargin != size) {
@@ -1608,7 +1608,8 @@ struct RadioComponent : public GUIComponent
16081608

16091609
radioButtons[(int)gui.getValue()]->setToggleState(true, dontSendNotification);
16101610

1611-
box->updateBounds(false);
1611+
resized();
1612+
//box->updateBounds(false);
16121613
}
16131614

16141615
OwnedArray<TextButton> radioButtons;

Source/Pd/PdInstance.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,8 @@ extern "C"
111111
namespace pd
112112
{
113113

114+
115+
114116
Instance::Instance(std::string const& symbol)
115117
{
116118
libpd_multi_init();
@@ -155,7 +157,7 @@ Instance::Instance(std::string const& symbol)
155157
register_gui_triggers(static_cast<t_pdinstance*>(m_instance), this, gui_trigger, panel_trigger, synchronise_trigger);
156158

157159
libpd_set_verbose(0);
158-
160+
159161
setThis();
160162
}
161163

Source/Pd/PdPatch.cpp

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -196,14 +196,17 @@ std::vector<Object> Patch::getObjects(bool onlyGui) noexcept
196196
std::unique_ptr<Object> Patch::createGraphOnParent(int x, int y)
197197
{
198198
t_pd* pdobject = nullptr;
199+
std::atomic<bool> done = false;
200+
199201
instance->enqueueFunction(
200-
[this, x, y, &pdobject]() mutable
202+
[this, x, y, &pdobject, &done]() mutable
201203
{
202204
setCurrent();
203205
pdobject = libpd_creategraphonparent(getPointer(), x, y);
206+
done = true;
204207
});
205208

206-
while (!pdobject)
209+
while (!done)
207210
{
208211
instance->waitForStateUpdate();
209212
}
@@ -216,14 +219,17 @@ std::unique_ptr<Object> Patch::createGraphOnParent(int x, int y)
216219
std::unique_ptr<Object> Patch::createGraph(const String& name, int size, int x, int y)
217220
{
218221
t_pd* pdobject = nullptr;
222+
std::atomic<bool> done = false;
223+
219224
instance->enqueueFunction(
220-
[this, name, size, x, y, &pdobject]() mutable
225+
[this, name, size, x, y, &pdobject, &done]() mutable
221226
{
222227
setCurrent();
223228
pdobject = libpd_creategraph(getPointer(), name.toRawUTF8(), size, x, y);
229+
done = true;
224230
});
225231

226-
while (!pdobject)
232+
while (!done)
227233
{
228234
instance->waitForStateUpdate();
229235
}
@@ -304,14 +310,17 @@ std::unique_ptr<Object> Patch::createObject(const String& name, int x, int y, bo
304310
}
305311

306312
t_pd* pdobject = nullptr;
313+
std::atomic<bool> done = false;
314+
307315
instance->enqueueFunction(
308-
[this, argc, argv, undoable, typesymbol, &pdobject]() mutable
316+
[this, argc, argv, undoable, typesymbol, &pdobject, &done]() mutable
309317
{
310318
setCurrent();
311319
pdobject = libpd_createobj(getPointer(), typesymbol, argc, argv.data(), undoable);
320+
done = true;
312321
});
313322

314-
while (!pdobject)
323+
while (!done)
315324
{
316325
instance->waitForStateUpdate();
317326
}

Source/Pd/PdPatch.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -132,9 +132,9 @@ class Patch
132132
{"vsl", "15 128 0 127 0 0 empty empty empty 0 -9 0 10 #171717 #42a2c8 #ffffff 0 1"},
133133
{"bng", "15 250 50 0 empty empty empty 17 7 0 10 #171717 #42a2c8 #ffffff"},
134134
{"nbx", "3 14 -1e+37 1e+37 0 0 empty empty empty 0 -8 0 10 #171717 #42a2c8 #ffffff 0 256"},
135-
{"hradio", "24 1 0 8 empty empty empty 0 -8 0 10 #171717 #42a2c8 #ffffff 0"},
136-
{"vradio", "24 1 0 8 empty empty empty 0 -8 0 10 #171717 #42a2c8 #ffffff 0"},
137-
{"cnv", "15 100 60 empty empty empty 20 12 0 14 #171717 #404040"}
135+
{"hradio", "16 1 0 8 empty empty empty 0 -8 0 10 #171717 #42a2c8 #ffffff 0"},
136+
{"vradio", "16 1 0 8 empty empty empty 0 -8 0 10 #171717 #42a2c8 #ffffff 0"},
137+
{"cnv", "15 100 60 empty empty empty 20 12 0 14 #171717 #ffffff"}
138138
};
139139

140140
friend class Instance;

Source/Standalone/PlugDataApp.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ class PlugDataApp : public JUCEApplication
6262
// For opening files with PlugData standalone
6363
void anotherInstanceStarted(const String& commandLine) override
6464
{
65+
6566
auto file = File(commandLine.upToFirstOccurrenceOf(" ", false, false));
6667
if (file.existsAsFile())
6768
{
@@ -75,6 +76,7 @@ class PlugDataApp : public JUCEApplication
7576
}
7677
}
7778
}
79+
7880
}
7981

8082
virtual PlugDataWindow* createWindow()

0 commit comments

Comments
 (0)