1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-01-09 23:34:20 +00:00

Fix some compiler warnings

This commit is contained in:
Tom Poole 2023-08-18 15:14:51 +01:00
parent 0f307122d9
commit 82f1fd57a4
23 changed files with 88 additions and 101 deletions

View file

@ -412,6 +412,7 @@ public:
readerSource->setLooping (loopState.getValue());
init();
resized();
return true;
}
@ -461,7 +462,15 @@ public:
audioSourcePlayer.setSource (currentDemo.get());
initParameters();
auto& parameters = currentDemo->getParameters();
parametersComponent.reset();
if (! parameters.empty())
{
parametersComponent = std::make_unique<DemoParametersComponent> (parameters);
addAndMakeVisible (parametersComponent.get());
}
}
void play()
@ -485,21 +494,6 @@ public:
AudioThumbnailComponent& getThumbnailComponent() { return header.thumbnailComp; }
void initParameters()
{
auto& parameters = currentDemo->getParameters();
parametersComponent.reset();
if (parameters.size() > 0)
{
parametersComponent.reset (new DemoParametersComponent (parameters));
addAndMakeVisible (parametersComponent.get());
}
resized();
}
private:
//==============================================================================
class AudioPlayerHeader : public Component,

View file

@ -412,6 +412,7 @@ public:
readerSource->setLooping (loopState.getValue());
init();
resized();
return true;
}
@ -461,7 +462,15 @@ public:
audioSourcePlayer.setSource (currentDemo.get());
initParameters();
auto& parameters = currentDemo->getParameters();
parametersComponent.reset();
if (! parameters.empty())
{
parametersComponent = std::make_unique<DemoParametersComponent> (parameters);
addAndMakeVisible (parametersComponent.get());
}
}
void play()
@ -485,21 +494,6 @@ public:
AudioThumbnailComponent& getThumbnailComponent() { return header.thumbnailComp; }
void initParameters()
{
auto& parameters = currentDemo->getParameters();
parametersComponent.reset();
if (parameters.size() > 0)
{
parametersComponent.reset (new DemoParametersComponent (parameters));
addAndMakeVisible (parametersComponent.get());
}
resized();
}
private:
//==============================================================================
class AudioPlayerHeader : public Component,

View file

@ -78,7 +78,7 @@ public:
addAndMakeVisible (fileChooser);
fileChooser.addListener (this);
lookAndFeelChanged();
updateLookAndFeel();
setSize (500, 500);
}
@ -121,7 +121,7 @@ private:
editor->loadContent (fileChooser.getCurrentFile().loadFileAsString());
}
void lookAndFeelChanged() override
void updateLookAndFeel()
{
if (auto* v4 = dynamic_cast<LookAndFeel_V4*> (&LookAndFeel::getDefaultLookAndFeel()))
{
@ -135,6 +135,11 @@ private:
}
}
void lookAndFeelChanged() override
{
updateLookAndFeel();
}
CodeEditorComponent::ColourScheme getDarkCodeEditorColourScheme()
{
struct Type

View file

@ -1044,12 +1044,12 @@ private:
addAndMakeVisible (textureLabel);
textureLabel.attachToComponent (&textureBox, true);
lookAndFeelChanged();
}
void initialise()
{
lookAndFeelChanged();
showBackgroundToggle.setToggleState (false, sendNotification);
textureBox.setSelectedItemIndex (0);
presetBox .setSelectedItemIndex (0);

View file

@ -86,7 +86,7 @@ public:
DemoSliderPropertyComponent (const String& propertyName)
: SliderPropertyComponent (propertyName, 0.0, 100.0, 0.001)
{
setValue (Random::getSystemRandom().nextDouble() * 42.0);
slider.setValue (Random::getSystemRandom().nextDouble() * 42.0);
}
void setValue (double newValue) override

View file

@ -298,9 +298,6 @@ private:
}
};
constexpr const char* HostAudioProcessorImpl::innerStateTag;
constexpr const char* HostAudioProcessorImpl::editorStyleTag;
//==============================================================================
constexpr auto margin = 10;

View file

@ -155,13 +155,9 @@ public:
pointer_sized_int handleVstPluginCanDo (int32, pointer_sized_int, void* ptr, float) override
{
if (auto* str = static_cast<const char*> (ptr))
{
if (strcmp (str, "hasCockosEmbeddedUI") == 0)
return 0xbeef0000;
if (strcmp (str, "hasCockosExtensions") == 0)
return 0xbeef0000;
}
for (auto* key : { "hasCockosEmbeddedUI", "hasCockosExtensions" })
if (strcmp (str, key) == 0)
return (pointer_sized_int) 0xbeef0000;
return 0;
}

View file

@ -70,7 +70,7 @@ public:
.withAlpha (0.5f)
.withBrightness (0.7f);
componentMovedOrResized (containerComponent, true, true);
updateParentSize (comp);
x = Random::getSystemRandom().nextFloat() * parentWidth;
y = Random::getSystemRandom().nextFloat() * parentHeight;
@ -117,7 +117,7 @@ public:
}
private:
void componentMovedOrResized (Component& comp, bool, bool) override
void updateParentSize (Component& comp)
{
const ScopedLock lock (drawing);
@ -125,6 +125,11 @@ private:
parentHeight = (float) comp.getHeight() - size;
}
void componentMovedOrResized (Component& comp, bool, bool) override
{
updateParentSize (comp);
}
float x = 0.0f, y = 0.0f,
size = Random::getSystemRandom().nextFloat() * 30.0f + 30.0f,
dx = 0.0f, dy = 0.0f,