mirror of
https://github.com/danbee/persephone
synced 2025-03-04 08:39:11 +00:00
Compare commits
8 Commits
2186cd69e3
...
11d49a0351
| Author | SHA1 | Date | |
|---|---|---|---|
| 11d49a0351 | |||
| d445ea197d | |||
| ee1262376f | |||
| 9702a15052 | |||
| 87110cae0f | |||
| fd51fa7356 | |||
| c364deb24c | |||
| 3b68577b93 |
@ -11,8 +11,6 @@ import ReSwift
|
||||
import Kingfisher
|
||||
|
||||
class UserNotificationsController {
|
||||
let cache = ImageCache.default
|
||||
|
||||
init() {
|
||||
App.store.subscribe(self) {
|
||||
$0.select { $0.playerState.currentSong }
|
||||
|
||||
@ -1,8 +1,8 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<document type="com.apple.InterfaceBuilder3.Cocoa.Storyboard.XIB" version="3.0" toolsVersion="14868" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" initialViewController="B8D-0N-5wS">
|
||||
<document type="com.apple.InterfaceBuilder3.Cocoa.Storyboard.XIB" version="3.0" toolsVersion="15702" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" initialViewController="B8D-0N-5wS">
|
||||
<dependencies>
|
||||
<deployment identifier="macosx"/>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="14868"/>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="15702"/>
|
||||
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
|
||||
</dependencies>
|
||||
<scenes>
|
||||
@ -339,6 +339,7 @@
|
||||
<connections>
|
||||
<outlet property="databaseUpdatingIndicator" destination="LpV-iM-o6t" id="y0T-eR-ygY"/>
|
||||
<outlet property="repeatState" destination="OqH-lV-sAg" id="DPC-Ff-Srr"/>
|
||||
<outlet property="searchQuery" destination="xfU-Xe-eno" id="d8u-sH-13V"/>
|
||||
<outlet property="shuffleState" destination="E8L-uK-XT0" id="dCF-hm-dBs"/>
|
||||
<outlet property="trackProgress" destination="kx6-xm-TAN" id="XDv-Th-Agj"/>
|
||||
<outlet property="trackProgressBar" destination="KMy-xf-rmN" id="a67-JU-cyQ"/>
|
||||
@ -408,7 +409,7 @@
|
||||
<tabView key="tabView" type="noTabsNoBorder" id="6dC-M0-oC5">
|
||||
<rect key="frame" x="0.0" y="0.0" width="418" height="300"/>
|
||||
<autoresizingMask key="autoresizingMask"/>
|
||||
<font key="font" metaFont="message"/>
|
||||
<font key="font" metaFont="system"/>
|
||||
<connections>
|
||||
<outlet property="delegate" destination="zhe-qh-Mal" id="LUL-qN-JlP"/>
|
||||
</connections>
|
||||
@ -646,26 +647,26 @@
|
||||
<objects>
|
||||
<viewController id="KIP-rq-4dM" customClass="QueueViewController" customModule="Persephone" customModuleProvider="target" sceneMemberID="viewController">
|
||||
<splitView key="view" dividerStyle="thin" id="84I-w3-Mxl">
|
||||
<rect key="frame" x="0.0" y="0.0" width="328" height="548"/>
|
||||
<rect key="frame" x="0.0" y="0.0" width="328" height="547"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
|
||||
<subviews>
|
||||
<scrollView borderType="none" autohidesScrollers="YES" horizontalLineScroll="17" horizontalPageScroll="10" verticalLineScroll="17" verticalPageScroll="10" usesPredominantAxisScrolling="NO" id="S3o-nF-NN7">
|
||||
<scrollView misplaced="YES" borderType="none" autohidesScrollers="YES" horizontalLineScroll="17" horizontalPageScroll="10" verticalLineScroll="17" verticalPageScroll="10" usesPredominantAxisScrolling="NO" id="S3o-nF-NN7">
|
||||
<rect key="frame" x="0.0" y="0.0" width="328" height="219"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
|
||||
<clipView key="contentView" drawsBackground="NO" id="WI8-Pw-03L">
|
||||
<rect key="frame" x="0.0" y="0.0" width="328" height="219"/>
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
|
||||
<subviews>
|
||||
<outlineView verticalHuggingPriority="750" allowsExpansionToolTips="YES" columnAutoresizingStyle="lastColumnOnly" selectionHighlightStyle="sourceList" multipleSelection="NO" autosaveColumns="NO" rowSizeStyle="automatic" viewBased="YES" indentationPerLevel="14" outlineTableColumn="0Co-uF-CCB" id="jEJ-jg-fll" customClass="QueueView" customModule="Persephone" customModuleProvider="target">
|
||||
<rect key="frame" x="0.0" y="0.0" width="328" height="219"/>
|
||||
<autoresizingMask key="autoresizingMask"/>
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
|
||||
<size key="intercellSpacing" width="3" height="0.0"/>
|
||||
<color key="backgroundColor" name="_sourceListBackgroundColor" catalog="System" colorSpace="catalog"/>
|
||||
<color key="gridColor" name="gridColor" catalog="System" colorSpace="catalog"/>
|
||||
<tableColumns>
|
||||
<tableColumn identifier="songTitleColumn" width="200" minWidth="128" maxWidth="1000" id="0Co-uF-CCB">
|
||||
<tableHeaderCell key="headerCell" lineBreakMode="truncatingTail" borderStyle="border" title="Title">
|
||||
<font key="font" metaFont="smallSystem"/>
|
||||
<font key="font" metaFont="message" size="11"/>
|
||||
<color key="textColor" name="headerTextColor" catalog="System" colorSpace="catalog"/>
|
||||
<color key="backgroundColor" name="headerColor" catalog="System" colorSpace="catalog"/>
|
||||
</tableHeaderCell>
|
||||
@ -746,7 +747,7 @@
|
||||
</tableColumn>
|
||||
<tableColumn identifier="songArtistColumn" width="122" minWidth="64" maxWidth="1000" id="SPM-QP-DX8">
|
||||
<tableHeaderCell key="headerCell" lineBreakMode="truncatingTail" borderStyle="border" alignment="left" title="Artist">
|
||||
<font key="font" metaFont="smallSystem"/>
|
||||
<font key="font" metaFont="message" size="11"/>
|
||||
<color key="textColor" name="headerTextColor" catalog="System" colorSpace="catalog"/>
|
||||
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
|
||||
</tableHeaderCell>
|
||||
@ -804,8 +805,8 @@
|
||||
<autoresizingMask key="autoresizingMask"/>
|
||||
</scroller>
|
||||
</scrollView>
|
||||
<customView id="iUb-eV-Qws">
|
||||
<rect key="frame" x="0.0" y="220" width="328" height="328"/>
|
||||
<customView misplaced="YES" id="iUb-eV-Qws">
|
||||
<rect key="frame" x="0.0" y="220" width="328" height="327"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
|
||||
<subviews>
|
||||
<imageView horizontalHuggingPriority="251" verticalHuggingPriority="251" horizontalCompressionResistancePriority="250" verticalCompressionResistancePriority="250" translatesAutoresizingMaskIntoConstraints="NO" id="Dw3-M5-tWY" customClass="CurrentCoverArtView" customModule="Persephone" customModuleProvider="target">
|
||||
|
||||
@ -27,6 +27,8 @@ class WindowController: NSWindowController {
|
||||
@IBOutlet var shuffleState: NSButton!
|
||||
@IBOutlet var repeatState: NSButton!
|
||||
|
||||
@IBOutlet weak var searchQuery: NSSearchField!
|
||||
|
||||
override func windowDidLoad() {
|
||||
super.windowDidLoad()
|
||||
window?.titleVisibility = .hidden
|
||||
@ -39,6 +41,8 @@ class WindowController: NSWindowController {
|
||||
}
|
||||
|
||||
App.store.dispatch(MainWindowDidOpenAction())
|
||||
|
||||
NotificationCenter.default.addObserver(self, selector: #selector(willDisconnect), name: .willDisconnect, object: nil)
|
||||
|
||||
trackProgress.font = .timerFont
|
||||
trackRemaining.font = .timerFont
|
||||
@ -116,6 +120,13 @@ class WindowController: NSWindowController {
|
||||
|
||||
trackRemaining.stringValue = time.formattedTime
|
||||
}
|
||||
|
||||
@objc func willDisconnect() {
|
||||
DispatchQueue.main.async {
|
||||
App.store.dispatch(SetSearchQuery(searchQuery: ""))
|
||||
self.searchQuery.stringValue = ""
|
||||
}
|
||||
}
|
||||
|
||||
// TODO: Refactor this using a gesture recognizer
|
||||
@IBAction func changeTrackProgress(_ sender: NSSlider) {
|
||||
|
||||
@ -23,8 +23,8 @@ extension MPDClient {
|
||||
self.connection = connection
|
||||
self.status = MPDStatus(status)
|
||||
|
||||
self.delegate?.didConnect(mpdClient: self)
|
||||
self.delegate?.didUpdateStatus(mpdClient: self, status: self.status!)
|
||||
delegate?.didConnect(mpdClient: self)
|
||||
delegate?.didUpdateStatus(mpdClient: self, status: self.status!)
|
||||
}
|
||||
|
||||
func freeConnection() {
|
||||
@ -40,7 +40,9 @@ extension MPDClient {
|
||||
let commandOperation = BlockOperation() { [unowned self] in
|
||||
self.sendCommand(command: .connect, userData: ["host": host, "port": port])
|
||||
|
||||
self.idle()
|
||||
if self.isConnected {
|
||||
self.idle()
|
||||
}
|
||||
}
|
||||
commandQueue.addOperation(commandOperation)
|
||||
}
|
||||
|
||||
@ -37,7 +37,7 @@ struct Album {
|
||||
return [
|
||||
"cover.jpg",
|
||||
"folder.jpg",
|
||||
"\(artist) - \(title ).jpg",
|
||||
"\(artist) - \(title).jpg",
|
||||
"cover.png",
|
||||
"folder.png",
|
||||
"\(artist) - \(title ).png",
|
||||
|
||||
Loading…
Reference in New Issue
Block a user