Repository navigation
refactor(native N-MOD-14–18): durable Player transactions, library plans and state projection #799
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
masarray
wants to merge
35
commits into
main
Choose a base branch
from
refactor/native-mv14-player-setlist-archive-20261119
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
35 commits
Select commit
Hold shift + click to select a range
da1ce7f
refactor(native-mv14): extract Player v1-v3 setlist archive codec fro…
masarray a565269
test(native-mv14): resolve PlayerTrackSettings owner after archive ex…
masarray 8247cf6
fix(native-mv14): keep saved setlist schema round-trip lossless
masarray 8820b49
perf(native-mv14): enforce duplicate-path safety in O(n log n) save p…
masarray dd883f7
fix(native-mv14): keep setlist creation unique after delete/recreate
masarray 92991ea
test(native-mv14): prove reused setlist number remains unique across …
masarray 9210ab3
fix(native-mv14): match JUCE File identity for portable duplicate checks
masarray 97a4a01
test(native-mv14): contract-lock unique native setlist creation policy
masarray 718742d
test(native-mv14): correct literal native contract regex escaping
masarray fbf693c
fix(native-mv14): prevent full-setlist Undo from invalidating archive
masarray cfceb86
test(native-mv14): pin full-library Undo policy at native action and …
masarray 875eb02
test(native-mv14): exercise real 2000-song Save/Remove/Import/Undo ar…
masarray 72b7680
fix(native-mv14): validate rounded Player cues before native/deck or …
masarray 5c05d45
fix(native-mv14): reject OUT marker quantized to media-end sentinel
masarray 705ccc5
perf(native-nmod): O(n log n) Player archive import with JUCE file id…
masarray 46ee0b4
merge(main): N-MOD-14 Player archive + cue rules on approved N-MOD-13
masarray 10906be
refactor(native N-MOD-15): isolate atomic Player setlist disk repository
masarray d78985e
merge(main): reconcile N-MOD-14 Player archive and G-MV hardware owne…
masarray ffd7464
merge(native): reconcile N-MOD-15 Player persistence with G-MV main a…
masarray 95f40e7
merge(main): preserve N-MOD-14 Player archive and latest G-MV channel…
masarray 475ca9b
merge(native): align N-MOD-15 Player repository with latest G-MV main
masarray 94672b2
merge(main): consolidate N-MOD-14 archive and N-MOD-15 atomic repository
masarray c19c34d
merge(main): reconcile N-MOD-14/15 with G-MV-25 without source overlap
masarray 89c76e6
refactor(native N-MOD-16): durable-first Player setlist metadata tran…
masarray 632983e
refactor(native N-MOD-16): stage track edits and imports before atomi…
masarray c054ae3
test(native N-MOD-16): assert real transaction alias and invoke site
masarray 658cbc2
fix(native N-MOD-16): include transaction under standalone JUCE CTest
masarray 08b6eeb
merge(main): reconcile native Player setlist archive with G-MV contract
masarray 529b298
merge(native): integrate N-MOD-16 durable Player edits with N-MOD-14/15
masarray 2eba5e7
refactor(native N-MOD-17): compensate live metadata edits and persist…
masarray 1cae6de
merge(main): preserve G-MV-27 bridge while carrying N-MOD-14/15/16
masarray 0a3e6c2
merge(native): integrate N-MOD-17 Player metadata rollback and durabl…
masarray 818ae6c
refactor(native N-MOD-18): isolate Player library edit/import/relink …
masarray 87503bf
refactor(native N-MOD-18): extract authoritative Player snapshot proj…
masarray 258ea2b
test(native N-MOD-18): fix Player projection source-contract regex
masarray File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,47 @@ | ||
| // SPDX-License-Identifier: AGPL-3.0-only | ||
| #pragma once | ||
| #include <cmath> | ||
| #include <optional> | ||
|
|
||
| // Pure Player metadata edit policy. CONTROL thread only; neither disk nor | ||
| // native deck/PCM is mutated until the live deck accepts the proposed range. | ||
| namespace armix::player { | ||
| struct PlayerCueEditPolicy final { | ||
| enum class Command { clear, markIn, markOut }; | ||
| struct Range { | ||
| double in=0., out=0.; | ||
| }; | ||
| // Match the v3 archive's loadable range, rather than admitting a cue | ||
| // that silently disappears when player-library.json is reopened. | ||
| static bool validArchive(Range range) noexcept { | ||
| return std::isfinite(range.in) && std::isfinite(range.out) && | ||
| range.in>=0. && range.out>=0. && | ||
| range.in<86400. && range.out<86400. && | ||
| (range.out==0. || range.out>range.in+0.05); | ||
| } | ||
| static std::optional<Range> plan(Range existing,Command action, | ||
| double position,double duration) noexcept { | ||
| if(action==Command::clear)return Range{}; | ||
| if(!validArchive(existing) || | ||
| !std::isfinite(position)||!std::isfinite(duration)|| | ||
| duration<=0.||position<0.||position>=duration) | ||
| return std::nullopt; | ||
| // Quantize BEFORE validating. A native time 1.059 must not create | ||
| // an unsavable OUT=1.05 when IN=1.00. | ||
| const double rounded=std::floor(position*100.)/100.; | ||
| Range candidate=existing; | ||
| if(action==Command::markIn) { | ||
| candidate.in=rounded; | ||
| if(candidate.out>0.&&candidate.out<=candidate.in+0.05) | ||
| candidate.out=0.; | ||
| } else { | ||
| // Mark OUT must never impersonate the OUT=0 media-end sentinel. | ||
| // In particular, positions below 10ms quantize to zero. | ||
| if(rounded<=candidate.in+0.05)return std::nullopt; | ||
| candidate.out=rounded; | ||
| } | ||
| if(!validArchive(candidate))return std::nullopt; | ||
| return candidate; | ||
| } | ||
| }; | ||
| } // namespace armix::player | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,29 @@ | ||
| // SPDX-License-Identifier: AGPL-3.0-only | ||
| #pragma once | ||
|
|
||
| // N-MOD-17: compensation policy for durable Player metadata writes on the | ||
| // JUCE CONTROL thread. The existing LiveAudioEngine remains the sole deck | ||
| // owner. Native acceptance precedes disk I/O for responsive live KEY/TEMPO | ||
| // and Cue gestures; failed persistence attempts the exact previous values. | ||
| // An unrecoverable native rollback is handled by the caller's safe stop. | ||
| namespace armix::player { | ||
| struct PlayerLiveMetadataCommitPolicy final { | ||
| enum class Outcome { | ||
| accepted, | ||
| nativeRejected, | ||
| saveRejectedRecovered, | ||
| saveRejectedRollbackFailed | ||
| }; | ||
| template<typename ApplyNative,typename Save,typename RestoreNative> | ||
| static Outcome run(bool requiresNative,ApplyNative&& apply, | ||
| Save&& save,RestoreNative&& restore) { | ||
| // Editing NEXT is metadata only. No native/PCM DSP mutation happens. | ||
| if(!requiresNative) | ||
| return save()?Outcome::accepted:Outcome::saveRejectedRecovered; | ||
| if(!apply())return Outcome::nativeRejected; | ||
| if(save())return Outcome::accepted; | ||
| return restore()?Outcome::saveRejectedRecovered: | ||
| Outcome::saveRejectedRollbackFailed; | ||
| } | ||
| }; | ||
| } // namespace armix::player |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.