Rockbox open source high quality audio player as a Music Player Daemon
mpris rockbox mpd libadwaita audio rust zig deno
2
fork

Configure Feed

Select the types of activity you want to include in your feed.

Add per-track play action in artist rows

Add position parameter to playArtistTracks and include it in the gRPC
request. Pass artist into ArtistTrackRowView and add a play Button that
invokes playArtistTracks for the specific track and captures errors.

+18 -5
macos/Rockbox.xcodeproj/project.xcworkspace/xcuserdata/tsirysandratraina.xcuserdatad/UserInterfaceState.xcuserstate

This is a binary file and will not be displayed.

+2 -1
macos/Rockbox/Services/PlaybackService.swift
··· 216 216 } 217 217 } 218 218 219 - func playArtistTracks(artistID: String, shuffle: Bool = false, host: String = "127.0.0.1", port: Int = 6061) async throws -> Void { 219 + func playArtistTracks(artistID: String, shuffle: Bool = false, position: Int32 = 0, host: String = "127.0.0.1", port: Int = 6061) async throws -> Void { 220 220 try await withGRPCClient( 221 221 transport: .http2NIOPosix( 222 222 target: .dns(host: host, port: port), ··· 227 227 var req = Rockbox_V1alpha1_PlayArtistTracksRequest() 228 228 req.shuffle = shuffle 229 229 req.artistID = artistID 230 + req.position = position 230 231 let _ = try await playback.playArtistTracks(req) 231 232 } 232 233 }
+1
macos/Rockbox/Views/ArtistDetail/ArtistDetailView.swift
··· 40 40 ForEach(Array(tracks.enumerated()), id: \.element.id) { index, track in 41 41 ArtistTrackRowView( 42 42 track: track, 43 + artist: artist, 43 44 index: index + 1, 44 45 isEven: index % 2 == 0, 45 46 library: library
+15 -4
macos/Rockbox/Views/ArtistDetail/ArtistTrackRowView.swift
··· 9 9 10 10 struct ArtistTrackRowView: View { 11 11 let track: Song 12 + let artist: Artist 12 13 let index: Int 13 14 let isEven: Bool 14 15 @ObservedObject var library: MusicLibrary 16 + @State private var errorText: String? = nil 15 17 16 18 @State private var isHovering = false 17 19 ··· 21 23 ZStack { 22 24 Text("\(index)") 23 25 .opacity(isHovering ? 0 : 1) 24 - 25 - Image(systemName: "play.fill") 26 - .font(.system(size: 10)) 27 - .opacity(isHovering ? 1 : 0) 26 + Button(action: { 27 + Task { 28 + do { 29 + try await playArtistTracks(artistID: artist.cuid, position: Int32(index) - 1) 30 + } catch { 31 + errorText = String(describing: error) 32 + } 33 + } 34 + }) { 35 + Image(systemName: "play.fill") 36 + .font(.system(size: 10)) 37 + .opacity(isHovering ? 1 : 0) 38 + }.buttonStyle(.plain) 28 39 } 29 40 .frame(width: 30, alignment: .center) 30 41 .foregroundStyle(.secondary)