Refresh native pairing and player UI and add the MusicBridge app icon
This commit is contained in:
@@ -0,0 +1,37 @@
|
||||
import SwiftUI
|
||||
|
||||
// Screenshots only: this fixture and its launch switches do not exist in Release.
|
||||
@MainActor
|
||||
enum PreviewSupport {
|
||||
static var enabled: Bool {
|
||||
#if DEBUG
|
||||
ProcessInfo.processInfo.arguments.contains("--preview-player")
|
||||
#else
|
||||
false
|
||||
#endif
|
||||
}
|
||||
static var largeText: Bool {
|
||||
#if DEBUG
|
||||
ProcessInfo.processInfo.arguments.contains("--preview-large-text")
|
||||
#else
|
||||
false
|
||||
#endif
|
||||
}
|
||||
static func makeStore() -> PlayerStore {
|
||||
#if DEBUG
|
||||
if enabled {
|
||||
let store = PlayerStore(storage: ConnectionStorage(load: { nil }, save: { _ in }, delete: {}), discoveryEnabled: false)
|
||||
store.connection = try? Connection(endpoint: "https://192.168.1.10:8765", fingerprint: String(repeating: "A", count: 64))
|
||||
store.connected = true
|
||||
store.status = "Предпросмотр интерфейса"
|
||||
store.state = MediaState(protocolVersion: 1, hasSession: true, title: "Ночной город", artist: "MusicBridge · пример плеера", source: "",
|
||||
playbackStatus: "Playing", positionSeconds: 42, startSeconds: 0, endSeconds: 214,
|
||||
minSeekSeconds: 0, maxSeekSeconds: 214, playbackRate: 1,
|
||||
capabilities: Capabilities(play: true, pause: true, toggle: true, next: true, previous: true, seek: true),
|
||||
volume: 0.64, muted: false, mediaError: nil, volumeError: nil, artworkId: nil, artworkError: nil)
|
||||
return store
|
||||
}
|
||||
#endif
|
||||
return PlayerStore()
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user