Skip to content

Commit

Permalink
Merge pull request #58 from ffAudio/develop
Browse files Browse the repository at this point in the history
Release 1.3
  • Loading branch information
ffAudio authored Mar 1, 2021
2 parents b069da1 + 73352fd commit 9ba1996
Show file tree
Hide file tree
Showing 89 changed files with 736 additions and 277 deletions.
4 changes: 2 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ Ownership
---------

Since this project is under a dual license (free for non-commercial use, paid license for commercial use),
the sole ownership is with Foleys Finest Audio Ltd. By submitting your contributions you will not gain ownership
the sole ownership is with Foleys Finest Audio. By submitting your contributions you will not gain ownership
over parts or the entirety of foleys_gui_magic.
Any compensation is solely on the discretion of the owner.
Contributors declare, that they had ownership over the contributed code. Foleys Finest Audio Ltd. shall not be liable
Contributors declare, that they had ownership over the contributed code. Foleys Finest Audio shall not be liable
for copyright or patent infringements through external contributors.
If you have claims to any part inside the project, please get in touch and the code will be removed, if the claims are valid.

Expand Down
2 changes: 1 addition & 1 deletion Editor/foleys_GUITreeEditor.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
==============================================================================
Copyright (c) 2019-2020 Foleys Finest Audio Ltd. - Daniel Walz
Copyright (c) 2019-2021 Foleys Finest Audio - Daniel Walz
All rights reserved.
License for non-commercial projects:
Expand Down
2 changes: 1 addition & 1 deletion Editor/foleys_GUITreeEditor.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
==============================================================================
Copyright (c) 2019-2020 Foleys Finest Audio Ltd. - Daniel Walz
Copyright (c) 2019-2021 Foleys Finest Audio - Daniel Walz
All rights reserved.
License for non-commercial projects:
Expand Down
2 changes: 1 addition & 1 deletion Editor/foleys_MultiListPropertyComponent.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
==============================================================================
Copyright (c) 2019-2020 Foleys Finest Audio Ltd. - Daniel Walz
Copyright (c) 2019-2021 Foleys Finest Audio - Daniel Walz
All rights reserved.
License for non-commercial projects:
Expand Down
2 changes: 1 addition & 1 deletion Editor/foleys_MultiListPropertyComponent.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
==============================================================================
Copyright (c) 2019-2020 Foleys Finest Audio Ltd. - Daniel Walz
Copyright (c) 2019-2021 Foleys Finest Audio - Daniel Walz
All rights reserved.
License for non-commercial projects:
Expand Down
2 changes: 1 addition & 1 deletion Editor/foleys_Palette.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
==============================================================================
Copyright (c) 2019-2020 Foleys Finest Audio Ltd. - Daniel Walz
Copyright (c) 2019-2021 Foleys Finest Audio - Daniel Walz
All rights reserved.
License for non-commercial projects:
Expand Down
2 changes: 1 addition & 1 deletion Editor/foleys_Palette.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
==============================================================================
Copyright (c) 2019-2020 Foleys Finest Audio Ltd. - Daniel Walz
Copyright (c) 2019-2021 Foleys Finest Audio - Daniel Walz
All rights reserved.
License for non-commercial projects:
Expand Down
2 changes: 1 addition & 1 deletion Editor/foleys_PropertiesEditor.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
==============================================================================
Copyright (c) 2019-2020 Foleys Finest Audio Ltd. - Daniel Walz
Copyright (c) 2019-2021 Foleys Finest Audio - Daniel Walz
All rights reserved.
License for non-commercial projects:
Expand Down
2 changes: 1 addition & 1 deletion Editor/foleys_PropertiesEditor.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
==============================================================================
Copyright (c) 2019-2020 Foleys Finest Audio Ltd. - Daniel Walz
Copyright (c) 2019-2021 Foleys Finest Audio - Daniel Walz
All rights reserved.
License for non-commercial projects:
Expand Down
2 changes: 1 addition & 1 deletion Editor/foleys_StyleBoolPropertyComponent.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
==============================================================================
Copyright (c) 2019-2020 Foleys Finest Audio Ltd. - Daniel Walz
Copyright (c) 2019-2021 Foleys Finest Audio - Daniel Walz
All rights reserved.
License for non-commercial projects:
Expand Down
2 changes: 1 addition & 1 deletion Editor/foleys_StyleBoolPropertyComponent.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
==============================================================================
Copyright (c) 2019-2020 Foleys Finest Audio Ltd. - Daniel Walz
Copyright (c) 2019-2021 Foleys Finest Audio - Daniel Walz
All rights reserved.
License for non-commercial projects:
Expand Down
2 changes: 1 addition & 1 deletion Editor/foleys_StyleChoicePropertyComponent.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
==============================================================================
Copyright (c) 2019-2020 Foleys Finest Audio Ltd. - Daniel Walz
Copyright (c) 2019-2021 Foleys Finest Audio - Daniel Walz
All rights reserved.
License for non-commercial projects:
Expand Down
2 changes: 1 addition & 1 deletion Editor/foleys_StyleChoicePropertyComponent.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
==============================================================================
Copyright (c) 2019-2020 Foleys Finest Audio Ltd. - Daniel Walz
Copyright (c) 2019-2021 Foleys Finest Audio - Daniel Walz
All rights reserved.
License for non-commercial projects:
Expand Down
2 changes: 1 addition & 1 deletion Editor/foleys_StyleColourPropertyComponent.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
==============================================================================
Copyright (c) 2019-2020 Foleys Finest Audio Ltd. - Daniel Walz
Copyright (c) 2019-2021 Foleys Finest Audio - Daniel Walz
All rights reserved.
License for non-commercial projects:
Expand Down
2 changes: 1 addition & 1 deletion Editor/foleys_StyleColourPropertyComponent.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
==============================================================================
Copyright (c) 2019-2020 Foleys Finest Audio Ltd. - Daniel Walz
Copyright (c) 2019-2021 Foleys Finest Audio - Daniel Walz
All rights reserved.
License for non-commercial projects:
Expand Down
2 changes: 1 addition & 1 deletion Editor/foleys_StyleGradientPropertyComponent.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
==============================================================================
Copyright (c) 2019-2020 Foleys Finest Audio Ltd. - Daniel Walz
Copyright (c) 2019-2021 Foleys Finest Audio - Daniel Walz
All rights reserved.
License for non-commercial projects:
Expand Down
2 changes: 1 addition & 1 deletion Editor/foleys_StyleGradientPropertyComponent.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
==============================================================================
Copyright (c) 2019-2020 Foleys Finest Audio Ltd. - Daniel Walz
Copyright (c) 2019-2021 Foleys Finest Audio - Daniel Walz
All rights reserved.
License for non-commercial projects:
Expand Down
2 changes: 1 addition & 1 deletion Editor/foleys_StylePropertyComponent.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
==============================================================================
Copyright (c) 2019-2020 Foleys Finest Audio Ltd. - Daniel Walz
Copyright (c) 2019-2021 Foleys Finest Audio - Daniel Walz
All rights reserved.
License for non-commercial projects:
Expand Down
2 changes: 1 addition & 1 deletion Editor/foleys_StylePropertyComponent.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
==============================================================================
Copyright (c) 2019-2020 Foleys Finest Audio Ltd. - Daniel Walz
Copyright (c) 2019-2021 Foleys Finest Audio - Daniel Walz
All rights reserved.
License for non-commercial projects:
Expand Down
2 changes: 1 addition & 1 deletion Editor/foleys_StyleTextPropertyComponent.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
==============================================================================
Copyright (c) 2019-2020 Foleys Finest Audio Ltd. - Daniel Walz
Copyright (c) 2019-2021 Foleys Finest Audio - Daniel Walz
All rights reserved.
License for non-commercial projects:
Expand Down
2 changes: 1 addition & 1 deletion Editor/foleys_StyleTextPropertyComponent.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
==============================================================================
Copyright (c) 2019-2020 Foleys Finest Audio Ltd. - Daniel Walz
Copyright (c) 2019-2021 Foleys Finest Audio - Daniel Walz
All rights reserved.
License for non-commercial projects:
Expand Down
4 changes: 2 additions & 2 deletions Editor/foleys_ToolBox.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
==============================================================================
Copyright (c) 2019-2020 Foleys Finest Audio Ltd. - Daniel Walz
Copyright (c) 2019-2021 Foleys Finest Audio - Daniel Walz
All rights reserved.
License for non-commercial projects:
Expand Down Expand Up @@ -193,7 +193,7 @@ void ToolBox::loadGUI (const juce::File& xmlFile)

if (tree.isValid() && tree.getType() == IDs::magic)
{
builder.setConfigTree (tree);
builder.getMagicState().setGuiValueTree (tree);
stateWasReloaded();
}

Expand Down
2 changes: 1 addition & 1 deletion Editor/foleys_ToolBox.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
==============================================================================
Copyright (c) 2019-2020 Foleys Finest Audio Ltd. - Daniel Walz
Copyright (c) 2019-2021 Foleys Finest Audio - Daniel Walz
All rights reserved.
License for non-commercial projects:
Expand Down
19 changes: 17 additions & 2 deletions General/foleys_ApplicationSettings.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
==============================================================================
Copyright (c) 2020 Foleys Finest Audio Ltd. - Daniel Walz
Copyright (c) 2020 Foleys Finest Audio - Daniel Walz
All rights reserved.
License for non-commercial projects:
Expand Down Expand Up @@ -54,13 +54,17 @@ void ApplicationSettings::setFileName (juce::File file)
return;

settingsFile = file;
load();
startTimerHz (1);
}

void ApplicationSettings::load()
{
juce::InterProcessLock lock (settingsFile.getFileName() + ".lock");

auto newChecksum = juce::MD5 (settingsFile).toHexString();
if (checksum == newChecksum)
return;

auto stream = settingsFile.createInputStream();
if (stream.get() == nullptr)
return;
Expand All @@ -70,6 +74,10 @@ void ApplicationSettings::load()
return;

settings.copyPropertiesAndChildrenFrom (tree, nullptr);
settings.addListener (this);

checksum = newChecksum;
sendChangeMessage();
}

void ApplicationSettings::save()
Expand All @@ -86,6 +94,13 @@ void ApplicationSettings::save()
stream->setPosition (0);
stream->truncate();
stream->writeString (settings.toXmlString());

checksum = juce::MD5 (settingsFile).toHexString();
}

void ApplicationSettings::timerCallback()
{
load();
}

void ApplicationSettings::valueTreeChildAdded (juce::ValueTree&, juce::ValueTree&)
Expand Down
8 changes: 6 additions & 2 deletions General/foleys_ApplicationSettings.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
==============================================================================
Copyright (c) 2020 Foleys Finest Audio Ltd. - Daniel Walz
Copyright (c) 2020 Foleys Finest Audio - Daniel Walz
All rights reserved.
License for non-commercial projects:
Expand Down Expand Up @@ -44,7 +44,9 @@ namespace foleys
They are hierarchically ordered in a ValueTree and loaded via SharedResourcePointer,
so they don't exist duplicated in one process.
*/
class ApplicationSettings : private juce::ValueTree::Listener
class ApplicationSettings : public juce::ChangeBroadcaster,
private juce::Timer,
private juce::ValueTree::Listener
{
public:
ApplicationSettings();
Expand All @@ -60,6 +62,7 @@ class ApplicationSettings : private juce::ValueTree::Listener
void setFileName (juce::File file);

private:
void timerCallback() override;

void load();
void save();
Expand All @@ -70,6 +73,7 @@ class ApplicationSettings : private juce::ValueTree::Listener
void valueTreePropertyChanged (juce::ValueTree&, const juce::Identifier&) override;

juce::File settingsFile;
juce::String checksum;

JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (ApplicationSettings)
};
Expand Down
Loading

0 comments on commit 9ba1996

Please sign in to comment.