Skip to content

Commit 077cc34

Browse files
authored
Update 1.5.2
1 parent f655e16 commit 077cc34

File tree

13 files changed

+1789
-576
lines changed

13 files changed

+1789
-576
lines changed

AppSettings.h

Lines changed: 49 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -677,8 +677,8 @@ struct AppSettings
677677
juce::String mixerMapBounds;
678678

679679
// PDL View layout state
680-
bool pdlViewHorizontal = false;
681-
bool pdlViewShowMixer = true;
680+
bool pdlViewHorizontal = false;
681+
bool pdlViewShowMixer = true;
682682

683683
// Per-engine settings
684684
std::vector<EngineSettings> engines;
@@ -767,8 +767,8 @@ struct AppSettings
767767
pdlViewBounds = getString("pdlViewBounds");
768768
trackMapBounds = getString("trackMapBounds");
769769
mixerMapBounds = getString("mixerMapBounds");
770-
pdlViewHorizontal = getInt("pdlViewHorizontal", 0) != 0;
771-
pdlViewShowMixer = getInt("pdlViewShowMixer", 1) != 0;
770+
pdlViewHorizontal = getInt("pdlViewHorizontal", 0) != 0;
771+
pdlViewShowMixer = getInt("pdlViewShowMixer", 1) != 0;
772772

773773
engines.clear();
774774
auto* engArray = obj->getProperty("engines").getArray();
@@ -865,4 +865,49 @@ struct AppSettings
865865
engines.push_back(es);
866866
return true;
867867
}
868+
869+
public:
870+
//------------------------------------------------------------------
871+
// Full configuration export/import (backup/restore)
872+
//
873+
// Bundles settings.json + trackmap.json + mixermap.json into a
874+
// single JSON file. Import overwrites all three and reloads.
875+
//------------------------------------------------------------------
876+
static juce::var readJsonFile(const juce::File& f)
877+
{
878+
if (!f.existsAsFile()) return {};
879+
return juce::JSON::parse(f.loadFileAsString());
880+
}
881+
882+
juce::var buildExportBundle() const
883+
{
884+
auto dir = getSettingsFile().getParentDirectory();
885+
auto* root = new juce::DynamicObject();
886+
root->setProperty("stc_backup_version", 1);
887+
root->setProperty("settings", readJsonFile(getSettingsFile()));
888+
root->setProperty("trackmap", readJsonFile(dir.getChildFile("trackmap.json")));
889+
root->setProperty("mixermap", readJsonFile(dir.getChildFile("mixermap.json")));
890+
return juce::var(root);
891+
}
892+
893+
bool applyImportBundle(const juce::var& bundle)
894+
{
895+
auto* obj = bundle.getDynamicObject();
896+
if (!obj) return false;
897+
898+
auto dir = getSettingsFile().getParentDirectory();
899+
auto settingsVar = obj->getProperty("settings");
900+
auto trackmapVar = obj->getProperty("trackmap");
901+
auto mixermapVar = obj->getProperty("mixermap");
902+
903+
// Write each section back to its file (only if present in bundle)
904+
if (!settingsVar.isVoid())
905+
getSettingsFile().replaceWithText(juce::JSON::toString(settingsVar));
906+
if (!trackmapVar.isVoid())
907+
dir.getChildFile("trackmap.json").replaceWithText(juce::JSON::toString(trackmapVar));
908+
if (!mixermapVar.isVoid())
909+
dir.getChildFile("mixermap.json").replaceWithText(juce::JSON::toString(mixermapVar));
910+
911+
return true;
912+
}
868913
};

ArtnetOutput.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,10 @@ class ArtnetOutput : public juce::HighResolutionTimer
237237
if (!isRunningFlag.load(std::memory_order_relaxed)
238238
|| paused.load(std::memory_order_relaxed)
239239
|| socket == nullptr)
240+
{
241+
stopTimer(); // Don't spin at 1000Hz when there's nothing to send
240242
return;
243+
}
241244

242245
// Single atomic read -- guarantees frame interval and packet rate code are consistent
243246
FrameRate fps = currentFps.load(std::memory_order_relaxed);

Main.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ class SuperTimecodeConverterApplication : public juce::JUCEApplication
1111
SuperTimecodeConverterApplication() {}
1212

1313
const juce::String getApplicationName() override { return "Super Timecode Converter"; }
14-
const juce::String getApplicationVersion() override { return "1.5.1"; }
14+
const juce::String getApplicationVersion() override { return "1.5.2"; }
1515
bool moreThanOneInstanceAllowed() override { return false; }
1616

1717
void initialise(const juce::String&) override

0 commit comments

Comments
 (0)