FileBrowser
class FileBrowser : ObservableObject
The observable FileBrowser for Chord Provider
-
The shared instance of the class
Declaration
Swift
static let shared: FileBrowser
-
The list of songs
Declaration
Swift
@Published var songList: [SongItem] { get set }
-
The list of artists
Declaration
Swift
@Published var artistList: [ArtistItem] { get set }
-
The name of the folder bookmark
Declaration
Swift
static let bookmark: String
-
The Class to monitor the songs folder
Declaration
Swift
let folderMonitor: FolderMonitor
-
The optional songs folder
Declaration
Swift
@Published var songsFolder: URL? { get set }
-
The status
Declaration
Swift
@Published var status: Status { get set }
-
The list of open windows
Declaration
Swift
@Published var openWindows: [NSWindow.WindowItem] { get set }
-
The MenuBarExtra window
Note
Needed to close the MenuBarExtra when selecting a songDeclaration
Swift
var menuBarExtraWindow: NSWindow?
-
Init the FileBrowser
Declaration
Swift
private init()
-
getFiles()
AsynchronousGet the song files from the user selected folder
Declaration
Swift
@MainActor func getFiles() async
-
Parse the song file for metadata
Declaration
Swift
private func parseSongFile(_ file: URL, _ song: inout SongItem)
-
Parse the actual metadata
Declaration
Swift
private func parseFileLine(text: String, song: inout SongItem)