mirror of
https://github.com/danbee/persephone
synced 2025-03-04 08:39:11 +00:00
Compare commits
No commits in common. "16584b82ed301f72ae96060daee6cb11a5c56855" and "11d49a035195f720024f804bc11234652c7c92d3" have entirely different histories.
16584b82ed
...
11d49a0351
@ -104,7 +104,6 @@
|
|||||||
E4C8B53C22342005009A20F3 /* PreferencesWindowController.swift in Sources */ = {isa = PBXBuildFile; fileRef = E4C8B53B22342005009A20F3 /* PreferencesWindowController.swift */; };
|
E4C8B53C22342005009A20F3 /* PreferencesWindowController.swift in Sources */ = {isa = PBXBuildFile; fileRef = E4C8B53B22342005009A20F3 /* PreferencesWindowController.swift */; };
|
||||||
E4C8B53E22349002009A20F3 /* MPDIdle.swift in Sources */ = {isa = PBXBuildFile; fileRef = E4C8B53D22349002009A20F3 /* MPDIdle.swift */; };
|
E4C8B53E22349002009A20F3 /* MPDIdle.swift in Sources */ = {isa = PBXBuildFile; fileRef = E4C8B53D22349002009A20F3 /* MPDIdle.swift */; };
|
||||||
E4D3BFA622B419C000C56F48 /* QueueViewController+NSOutlineViewDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = E4D3BFA522B419C000C56F48 /* QueueViewController+NSOutlineViewDelegate.swift */; };
|
E4D3BFA622B419C000C56F48 /* QueueViewController+NSOutlineViewDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = E4D3BFA522B419C000C56F48 /* QueueViewController+NSOutlineViewDelegate.swift */; };
|
||||||
E4DA820623D6236200C1EE58 /* NSSize.swift in Sources */ = {isa = PBXBuildFile; fileRef = E4DA820523D6236200C1EE58 /* NSSize.swift */; };
|
|
||||||
E4E7A6AD22AAAF98006D566C /* AlbumDetailView+NSTableViewDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = E4E7A6AC22AAAF98006D566C /* AlbumDetailView+NSTableViewDelegate.swift */; };
|
E4E7A6AD22AAAF98006D566C /* AlbumDetailView+NSTableViewDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = E4E7A6AC22AAAF98006D566C /* AlbumDetailView+NSTableViewDelegate.swift */; };
|
||||||
E4E8CC902204EC7F0024217A /* Delegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = E4E8CC8F2204EC7F0024217A /* Delegate.swift */; };
|
E4E8CC902204EC7F0024217A /* Delegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = E4E8CC8F2204EC7F0024217A /* Delegate.swift */; };
|
||||||
E4E8CC922204F4B80024217A /* QueueViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = E4E8CC912204F4B80024217A /* QueueViewController.swift */; };
|
E4E8CC922204F4B80024217A /* QueueViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = E4E8CC912204F4B80024217A /* QueueViewController.swift */; };
|
||||||
@ -298,7 +297,6 @@
|
|||||||
E4C8B53B22342005009A20F3 /* PreferencesWindowController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PreferencesWindowController.swift; sourceTree = "<group>"; };
|
E4C8B53B22342005009A20F3 /* PreferencesWindowController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PreferencesWindowController.swift; sourceTree = "<group>"; };
|
||||||
E4C8B53D22349002009A20F3 /* MPDIdle.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MPDIdle.swift; sourceTree = "<group>"; };
|
E4C8B53D22349002009A20F3 /* MPDIdle.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MPDIdle.swift; sourceTree = "<group>"; };
|
||||||
E4D3BFA522B419C000C56F48 /* QueueViewController+NSOutlineViewDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "QueueViewController+NSOutlineViewDelegate.swift"; sourceTree = "<group>"; };
|
E4D3BFA522B419C000C56F48 /* QueueViewController+NSOutlineViewDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "QueueViewController+NSOutlineViewDelegate.swift"; sourceTree = "<group>"; };
|
||||||
E4DA820523D6236200C1EE58 /* NSSize.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NSSize.swift; sourceTree = "<group>"; };
|
|
||||||
E4E7A6AC22AAAF98006D566C /* AlbumDetailView+NSTableViewDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "AlbumDetailView+NSTableViewDelegate.swift"; sourceTree = "<group>"; };
|
E4E7A6AC22AAAF98006D566C /* AlbumDetailView+NSTableViewDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "AlbumDetailView+NSTableViewDelegate.swift"; sourceTree = "<group>"; };
|
||||||
E4E8CC8F2204EC7F0024217A /* Delegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Delegate.swift; sourceTree = "<group>"; };
|
E4E8CC8F2204EC7F0024217A /* Delegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Delegate.swift; sourceTree = "<group>"; };
|
||||||
E4E8CC912204F4B80024217A /* QueueViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = QueueViewController.swift; sourceTree = "<group>"; };
|
E4E8CC912204F4B80024217A /* QueueViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = QueueViewController.swift; sourceTree = "<group>"; };
|
||||||
@ -426,7 +424,6 @@
|
|||||||
E489E39822B85D0400CA8CBD /* NSPasteboard.swift */,
|
E489E39822B85D0400CA8CBD /* NSPasteboard.swift */,
|
||||||
E489E39C22B9CF0000CA8CBD /* NSView.swift */,
|
E489E39C22B9CF0000CA8CBD /* NSView.swift */,
|
||||||
E43AC1F022C68E6A001E483C /* NSPasteboardItem.swift */,
|
E43AC1F022C68E6A001E483C /* NSPasteboardItem.swift */,
|
||||||
E4DA820523D6236200C1EE58 /* NSSize.swift */,
|
|
||||||
);
|
);
|
||||||
path = Extensions;
|
path = Extensions;
|
||||||
sourceTree = "<group>";
|
sourceTree = "<group>";
|
||||||
@ -943,7 +940,6 @@
|
|||||||
E43B67AD229194CD007DCF55 /* AlbumTracksDataSource.swift in Sources */,
|
E43B67AD229194CD007DCF55 /* AlbumTracksDataSource.swift in Sources */,
|
||||||
E41E52FD223BF87300173814 /* MPDClient+Connection.swift in Sources */,
|
E41E52FD223BF87300173814 /* MPDClient+Connection.swift in Sources */,
|
||||||
E450AD7E222620A10091BED3 /* Album.swift in Sources */,
|
E450AD7E222620A10091BED3 /* Album.swift in Sources */,
|
||||||
E4DA820623D6236200C1EE58 /* NSSize.swift in Sources */,
|
|
||||||
E408D3B6220DD8970006D9BE /* Notification.swift in Sources */,
|
E408D3B6220DD8970006D9BE /* Notification.swift in Sources */,
|
||||||
E43AC1F822C7065A001E483C /* AlbumCoverButton.swift in Sources */,
|
E43AC1F822C7065A001E483C /* AlbumCoverButton.swift in Sources */,
|
||||||
E45962C62241A78500FC1A1E /* MPDCommand.swift in Sources */,
|
E45962C62241A78500FC1A1E /* MPDCommand.swift in Sources */,
|
||||||
|
|||||||
@ -32,11 +32,18 @@ class AppDelegate: NSObject,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
_ = App.userNotificationsController
|
instantiateControllers()
|
||||||
|
connectToMPDServer()
|
||||||
|
}
|
||||||
|
|
||||||
|
func connectToMPDServer() {
|
||||||
App.mpdServerController.connect()
|
App.mpdServerController.connect()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func instantiateControllers() {
|
||||||
|
_ = App.userNotificationsController
|
||||||
|
}
|
||||||
|
|
||||||
func applicationWillTerminate(_ aNotification: Notification) {
|
func applicationWillTerminate(_ aNotification: Notification) {
|
||||||
App.mpdClient.disconnect()
|
App.mpdClient.disconnect()
|
||||||
}
|
}
|
||||||
|
|||||||
@ -64,7 +64,7 @@ class AlbumViewItem: NSCollectionViewItem {
|
|||||||
with: .provider(provider),
|
with: .provider(provider),
|
||||||
placeholder: NSImage.defaultCoverArt,
|
placeholder: NSImage.defaultCoverArt,
|
||||||
options: [
|
options: [
|
||||||
.processor(DownsamplingImageProcessor(size: .albumListCoverSize)),
|
.processor(DownsamplingImageProcessor(size: NSSize(width: 180, height: 180))),
|
||||||
.scaleFactor(2),
|
.scaleFactor(2),
|
||||||
]
|
]
|
||||||
)
|
)
|
||||||
|
|||||||
@ -141,7 +141,7 @@ class AlbumDetailView: NSViewController {
|
|||||||
with: .provider(provider),
|
with: .provider(provider),
|
||||||
placeholder: NSImage.defaultCoverArt,
|
placeholder: NSImage.defaultCoverArt,
|
||||||
options: [
|
options: [
|
||||||
.processor(DownsamplingImageProcessor(size: .albumDetailCoverSize)),
|
.processor(DownsamplingImageProcessor(size: NSSize(width: 500, height: 500))),
|
||||||
.scaleFactor(2),
|
.scaleFactor(2),
|
||||||
]
|
]
|
||||||
)
|
)
|
||||||
|
|||||||
@ -24,11 +24,11 @@ class CurrentCoverArtView: NSImageView {
|
|||||||
|
|
||||||
let imageURL = URL(fileURLWithPath: imagePath)
|
let imageURL = URL(fileURLWithPath: imagePath)
|
||||||
let provider = LocalFileImageDataProvider(fileURL: imageURL)
|
let provider = LocalFileImageDataProvider(fileURL: imageURL)
|
||||||
kf.setImage(
|
self.kf.setImage(
|
||||||
with: .provider(provider),
|
with: .provider(provider),
|
||||||
placeholder: NSImage.defaultCoverArt,
|
placeholder: NSImage.defaultCoverArt,
|
||||||
options: [
|
options: [
|
||||||
.processor(DownsamplingImageProcessor(size: .currentlyPlayingCoverSize)),
|
.processor(DownsamplingImageProcessor(size: NSSize(width: 500, height: 500))),
|
||||||
.scaleFactor(2),
|
.scaleFactor(2),
|
||||||
]
|
]
|
||||||
)
|
)
|
||||||
@ -39,11 +39,10 @@ extension CurrentCoverArtView: StoreSubscriber {
|
|||||||
typealias StoreSubscriberStateType = Song?
|
typealias StoreSubscriberStateType = Song?
|
||||||
|
|
||||||
func newState(state: Song?) {
|
func newState(state: Song?) {
|
||||||
guard let song = state else {
|
if let song = state {
|
||||||
image = .defaultCoverArt
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
setAlbumImage(song.album)
|
setAlbumImage(song.album)
|
||||||
|
} else {
|
||||||
|
image = .defaultCoverArt
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,16 +0,0 @@
|
|||||||
//
|
|
||||||
// NSSize.swift
|
|
||||||
// Persephone
|
|
||||||
//
|
|
||||||
// Created by Daniel Barber on 1/20/20.
|
|
||||||
// Copyright © 2020 Dan Barber. All rights reserved.
|
|
||||||
//
|
|
||||||
|
|
||||||
import AppKit
|
|
||||||
|
|
||||||
extension NSSize {
|
|
||||||
static let albumListCoverSize = NSSize(width: 180, height: 180)
|
|
||||||
static let albumDetailCoverSize = NSSize(width: 500, height: 500)
|
|
||||||
static let currentlyPlayingCoverSize = albumDetailCoverSize
|
|
||||||
static let notificationCoverSize = albumListCoverSize
|
|
||||||
}
|
|
||||||
@ -29,7 +29,7 @@ class UserNotificationsController {
|
|||||||
_ = KingfisherManager.shared.retrieveImage(
|
_ = KingfisherManager.shared.retrieveImage(
|
||||||
with: .provider(provider),
|
with: .provider(provider),
|
||||||
options: [
|
options: [
|
||||||
.processor(DownsamplingImageProcessor(size: .notificationCoverSize)),
|
.processor(DownsamplingImageProcessor(size: NSSize(width: 180, height: 180))),
|
||||||
.scaleFactor(2),
|
.scaleFactor(2),
|
||||||
]
|
]
|
||||||
) { result in
|
) { result in
|
||||||
|
|||||||
@ -16,9 +16,9 @@ extension MPDClient {
|
|||||||
var path: String?
|
var path: String?
|
||||||
|
|
||||||
static func == (lhs: MPDAlbum, rhs: MPDAlbum) -> Bool {
|
static func == (lhs: MPDAlbum, rhs: MPDAlbum) -> Bool {
|
||||||
return lhs.title == rhs.title &&
|
return (lhs.title == rhs.title) &&
|
||||||
lhs.artist == rhs.artist &&
|
(lhs.artist == rhs.artist) &&
|
||||||
lhs.date == rhs.date
|
(lhs.date == rhs.date)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -55,8 +55,10 @@ extension MPDClient {
|
|||||||
}
|
}
|
||||||
|
|
||||||
var path: String {
|
var path: String {
|
||||||
return NSString(string: uriString)
|
return uriString
|
||||||
.deletingLastPathComponent
|
.split(separator: "/")
|
||||||
|
.dropLast()
|
||||||
|
.joined(separator: "/")
|
||||||
}
|
}
|
||||||
|
|
||||||
func getTag(_ tagType: MPDTag) -> String {
|
func getTag(_ tagType: MPDTag) -> String {
|
||||||
|
|||||||
@ -59,6 +59,6 @@ struct Album {
|
|||||||
|
|
||||||
extension Album: Equatable {
|
extension Album: Equatable {
|
||||||
static func == (lhs: Album, rhs: Album) -> Bool {
|
static func == (lhs: Album, rhs: Album) -> Bool {
|
||||||
return lhs.mpdAlbum == rhs.mpdAlbum
|
return (lhs.mpdAlbum == rhs.mpdAlbum)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -19,6 +19,6 @@ struct Artist {
|
|||||||
|
|
||||||
extension Artist: Equatable {
|
extension Artist: Equatable {
|
||||||
static func == (lhs: Artist, rhs: Artist) -> Bool {
|
static func == (lhs: Artist, rhs: Artist) -> Bool {
|
||||||
return lhs.name == rhs.name
|
return (lhs.name == rhs.name)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -27,7 +27,7 @@ struct MPDServer {
|
|||||||
|
|
||||||
extension MPDServer: Equatable {
|
extension MPDServer: Equatable {
|
||||||
static func == (lhs: MPDServer, rhs: MPDServer) -> Bool {
|
static func == (lhs: MPDServer, rhs: MPDServer) -> Bool {
|
||||||
return lhs.host == rhs.host &&
|
return (lhs.host == rhs.host) &&
|
||||||
lhs.port == rhs.port
|
(lhs.port == rhs.port)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user