Release 2.0.0: metronome, rig mute + shortcuts, set-list ordering, per-rig persistence
- Visual metronome tempo indicator (pendulum playhead) replacing the flashing LED - Rig Mute (Cmd-Z) hard-silence, distinct from Bypass Rig; wired to header, board menu, MIDI - Keyboard shortcuts: Cmd-1..9 board switch, Cmd-Shift-1..0 set-list rig load, Cmd-Z mute (macOS native menus + iOS/iPadOS hardware keyboards) - Rig set-list ordering: drag or Move Up/Down in the picker; order saved and archive-portable - Persist tempo, input selection, and engine I/O with a rig (I/O applied via opt-in applyChannelLayout, not forced on load) - Fix archive import colliding set-list positions with existing rigs - Remove ShoeGazeDemo / ShoeGazeiOSDemo apps and projects; keep the two Builder apps - Bump marketing version to 2.0.0 on both Builder projects; pin Lyrebird 1.2.3 - Add CHANGELOG.md Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -43,6 +43,14 @@ public struct RigEntry: Codable, Identifiable, Equatable {
|
||||
/// The full rig snapshot — every board, segment, and pedal parameter.
|
||||
public let state: ShoeGazeState
|
||||
|
||||
/// The rig's position in the user's manually-ordered set list, or `nil` for a rig that has
|
||||
/// not been placed (a legacy entry saved before ordering existed, or one not yet reordered).
|
||||
///
|
||||
/// Persisted per-file and inside archive export/import, so a set-list order travels with a
|
||||
/// shared or backed-up library. `RigLibraryStore` sorts placed entries by this index and
|
||||
/// falls back to name/date for unplaced ones. Optional, so older files decode cleanly.
|
||||
public let sortIndex: Int?
|
||||
|
||||
/// Creates a rig library entry.
|
||||
///
|
||||
/// - Parameters:
|
||||
@@ -51,11 +59,13 @@ public struct RigEntry: Codable, Identifiable, Equatable {
|
||||
/// - savedAt: Save timestamp. Defaults to `Date()` (now). Rounded to the nearest
|
||||
/// whole second so persistence round-trips are lossless.
|
||||
/// - state: The ``ShoeGazeState`` rig snapshot to store.
|
||||
/// - sortIndex: Manual set-list position, or `nil` when unplaced. Defaults to `nil`.
|
||||
public init(
|
||||
id: UUID = UUID(),
|
||||
name: String,
|
||||
savedAt: Date = Date(),
|
||||
state: ShoeGazeState
|
||||
state: ShoeGazeState,
|
||||
sortIndex: Int? = nil
|
||||
) {
|
||||
self.id = id
|
||||
self.name = name
|
||||
@@ -64,6 +74,16 @@ public struct RigEntry: Codable, Identifiable, Equatable {
|
||||
// disk round-trip.
|
||||
self.savedAt = Date(timeIntervalSince1970: savedAt.timeIntervalSince1970.rounded())
|
||||
self.state = state
|
||||
self.sortIndex = sortIndex
|
||||
}
|
||||
|
||||
/// Returns a copy of this entry placed at `index` in the set list, keeping its identity,
|
||||
/// name, timestamp, and state. Used by `RigLibraryStore` reordering.
|
||||
///
|
||||
/// - Parameter index: The new set-list position, or `nil` to unplace.
|
||||
/// - Returns: A copy at the new `sortIndex`.
|
||||
public func reordered(to index: Int?) -> RigEntry {
|
||||
RigEntry(id: id, name: name, savedAt: savedAt, state: state, sortIndex: index)
|
||||
}
|
||||
|
||||
/// Returns a copy of this entry with a new `name`, a fresh `id`, and `savedAt` updated to
|
||||
@@ -78,7 +98,9 @@ public struct RigEntry: Codable, Identifiable, Equatable {
|
||||
name: String,
|
||||
date: Date = Date()
|
||||
) -> RigEntry {
|
||||
RigEntry(id: UUID(), name: name, savedAt: date, state: state)
|
||||
// A duplicate is unplaced (`sortIndex: nil`) so the store appends it to the set list rather
|
||||
// than colliding with the source's position.
|
||||
RigEntry(id: UUID(), name: name, savedAt: date, state: state, sortIndex: nil)
|
||||
}
|
||||
|
||||
/// Returns a copy of this entry with a new `name` and `savedAt` updated to `date`, keeping
|
||||
@@ -93,6 +115,7 @@ public struct RigEntry: Codable, Identifiable, Equatable {
|
||||
to name: String,
|
||||
date: Date = Date()
|
||||
) -> RigEntry {
|
||||
RigEntry(id: id, name: name, savedAt: date, state: state)
|
||||
// Preserve the set-list position on rename — only the name and timestamp change.
|
||||
RigEntry(id: id, name: name, savedAt: date, state: state, sortIndex: sortIndex)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user