mirror of
https://github.com/danbee/persephone
synced 2025-03-04 08:39:11 +00:00
Remove the artist browser for now
Until we have a better idea of how it's going to work.
This commit is contained in:
parent
77cb053525
commit
3eae535be6
@ -55,8 +55,6 @@
|
||||
E440519E227BB0720090CD6F /* UIReducer.swift in Sources */ = {isa = PBXBuildFile; fileRef = E440519D227BB0720090CD6F /* UIReducer.swift */; };
|
||||
E44051A0227BB0AB0090CD6F /* UIState.swift in Sources */ = {isa = PBXBuildFile; fileRef = E440519F227BB0AB0090CD6F /* UIState.swift */; };
|
||||
E442CCCD2347E73C00004E0C /* Artist.swift in Sources */ = {isa = PBXBuildFile; fileRef = E442CCCC2347E73C00004E0C /* Artist.swift */; };
|
||||
E442CCCF2347E90800004E0C /* ArtistViewItem.xib in Resources */ = {isa = PBXBuildFile; fileRef = E442CCCE2347E90800004E0C /* ArtistViewItem.xib */; };
|
||||
E442CCD12347EAEB00004E0C /* ArtistViewItem.swift in Sources */ = {isa = PBXBuildFile; fileRef = E442CCD02347EAEB00004E0C /* ArtistViewItem.swift */; };
|
||||
E450AD7E222620A10091BED3 /* Album.swift in Sources */ = {isa = PBXBuildFile; fileRef = E450AD7D222620A10091BED3 /* Album.swift */; };
|
||||
E450AD9522262DF10091BED3 /* CoverArtQueue.swift in Sources */ = {isa = PBXBuildFile; fileRef = E450AD9422262DF10091BED3 /* CoverArtQueue.swift */; };
|
||||
E451E36B22BD214D008BE9B2 /* DraggedSongType.swift in Sources */ = {isa = PBXBuildFile; fileRef = E451E36A22BD214D008BE9B2 /* DraggedSongType.swift */; };
|
||||
@ -105,8 +103,6 @@
|
||||
E4B11BC02275EE150075461B /* QueueActions.swift in Sources */ = {isa = PBXBuildFile; fileRef = E4B11BBF2275EE150075461B /* QueueActions.swift */; };
|
||||
E4B11BC22275EE410075461B /* AlbumListActions.swift in Sources */ = {isa = PBXBuildFile; fileRef = E4B11BC12275EE410075461B /* AlbumListActions.swift */; };
|
||||
E4B5AE7E22F4C49600CCEC65 /* MPDServerDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = E4B5AE7D22F4C49600CCEC65 /* MPDServerDelegate.swift */; };
|
||||
E4BBD2EB2335735500702C16 /* BrowseController.swift in Sources */ = {isa = PBXBuildFile; fileRef = E4BBD2EA2335735500702C16 /* BrowseController.swift */; };
|
||||
E4BBD2ED2335798E00702C16 /* ArtistViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = E4BBD2EC2335798E00702C16 /* ArtistViewController.swift */; };
|
||||
E4BBD2F323357C0700702C16 /* ArtistListState.swift in Sources */ = {isa = PBXBuildFile; fileRef = E4BBD2F223357C0700702C16 /* ArtistListState.swift */; };
|
||||
E4C8B53C22342005009A20F3 /* PreferencesWindowController.swift in Sources */ = {isa = PBXBuildFile; fileRef = E4C8B53B22342005009A20F3 /* PreferencesWindowController.swift */; };
|
||||
E4C8B53E22349002009A20F3 /* MPDIdle.swift in Sources */ = {isa = PBXBuildFile; fileRef = E4C8B53D22349002009A20F3 /* MPDIdle.swift */; };
|
||||
@ -118,7 +114,6 @@
|
||||
E4E96D13233E630800AFD36F /* PMKFoundation in Frameworks */ = {isa = PBXBuildFile; productRef = E4E96D12233E630800AFD36F /* PMKFoundation */; };
|
||||
E4EB2379220F10B8008C70C0 /* MPDPair.swift in Sources */ = {isa = PBXBuildFile; fileRef = E4EB2378220F10B8008C70C0 /* MPDPair.swift */; };
|
||||
E4EB237B220F7CF1008C70C0 /* MPDAlbum.swift in Sources */ = {isa = PBXBuildFile; fileRef = E4EB237A220F7CF1008C70C0 /* MPDAlbum.swift */; };
|
||||
E4F26F732341166200D45FF9 /* ArtistDataSource.swift in Sources */ = {isa = PBXBuildFile; fileRef = E4F26F722341166200D45FF9 /* ArtistDataSource.swift */; };
|
||||
E4F26F7723411AE300D45FF9 /* ArtistListActions.swift in Sources */ = {isa = PBXBuildFile; fileRef = E4F26F7623411AE300D45FF9 /* ArtistListActions.swift */; };
|
||||
E4F26F7923411B1500D45FF9 /* ArtistReducer.swift in Sources */ = {isa = PBXBuildFile; fileRef = E4F26F7823411B1500D45FF9 /* ArtistReducer.swift */; };
|
||||
E4F26F7B23411D5400D45FF9 /* MPDClient+Artist.swift in Sources */ = {isa = PBXBuildFile; fileRef = E4F26F7A23411D5400D45FF9 /* MPDClient+Artist.swift */; };
|
||||
@ -264,8 +259,6 @@
|
||||
E440519D227BB0720090CD6F /* UIReducer.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UIReducer.swift; sourceTree = "<group>"; };
|
||||
E440519F227BB0AB0090CD6F /* UIState.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UIState.swift; sourceTree = "<group>"; };
|
||||
E442CCCC2347E73C00004E0C /* Artist.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Artist.swift; sourceTree = "<group>"; };
|
||||
E442CCCE2347E90800004E0C /* ArtistViewItem.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; name = ArtistViewItem.xib; path = "Persephone/Components/Browser/Artist Browser/ArtistViewItem.xib"; sourceTree = SOURCE_ROOT; };
|
||||
E442CCD02347EAEB00004E0C /* ArtistViewItem.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = ArtistViewItem.swift; path = "Persephone/Components/Browser/Artist Browser/ArtistViewItem.swift"; sourceTree = SOURCE_ROOT; };
|
||||
E450AD7D222620A10091BED3 /* Album.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Album.swift; sourceTree = "<group>"; };
|
||||
E450AD9422262DF10091BED3 /* CoverArtQueue.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CoverArtQueue.swift; sourceTree = "<group>"; };
|
||||
E450AD9E2229B9BC0091BED3 /* PersephoneBridgingHeader.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = PersephoneBridgingHeader.h; sourceTree = "<group>"; };
|
||||
@ -307,8 +300,6 @@
|
||||
E4B11BBF2275EE150075461B /* QueueActions.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = QueueActions.swift; sourceTree = "<group>"; };
|
||||
E4B11BC12275EE410075461B /* AlbumListActions.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AlbumListActions.swift; sourceTree = "<group>"; };
|
||||
E4B5AE7D22F4C49600CCEC65 /* MPDServerDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MPDServerDelegate.swift; sourceTree = "<group>"; };
|
||||
E4BBD2EA2335735500702C16 /* BrowseController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BrowseController.swift; sourceTree = "<group>"; };
|
||||
E4BBD2EC2335798E00702C16 /* ArtistViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ArtistViewController.swift; sourceTree = "<group>"; };
|
||||
E4BBD2F223357C0700702C16 /* ArtistListState.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ArtistListState.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>"; };
|
||||
@ -319,7 +310,6 @@
|
||||
E4E8CC9922075D370024217A /* MPDSong.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MPDSong.swift; sourceTree = "<group>"; };
|
||||
E4EB2378220F10B8008C70C0 /* MPDPair.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MPDPair.swift; sourceTree = "<group>"; };
|
||||
E4EB237A220F7CF1008C70C0 /* MPDAlbum.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MPDAlbum.swift; sourceTree = "<group>"; };
|
||||
E4F26F722341166200D45FF9 /* ArtistDataSource.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ArtistDataSource.swift; sourceTree = "<group>"; };
|
||||
E4F26F7623411AE300D45FF9 /* ArtistListActions.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ArtistListActions.swift; sourceTree = "<group>"; };
|
||||
E4F26F7823411B1500D45FF9 /* ArtistReducer.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ArtistReducer.swift; sourceTree = "<group>"; };
|
||||
E4F26F7A23411D5400D45FF9 /* MPDClient+Artist.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "MPDClient+Artist.swift"; sourceTree = "<group>"; };
|
||||
@ -608,24 +598,11 @@
|
||||
path = Shared;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
E442CCCA2347D74B00004E0C /* Artist Browser */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
E442CCCE2347E90800004E0C /* ArtistViewItem.xib */,
|
||||
E4F26F722341166200D45FF9 /* ArtistDataSource.swift */,
|
||||
E442CCD02347EAEB00004E0C /* ArtistViewItem.swift */,
|
||||
E4BBD2EC2335798E00702C16 /* ArtistViewController.swift */,
|
||||
);
|
||||
path = "Artist Browser";
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
E442CCCB2347D77A00004E0C /* Browser */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
E442CCC82347D65300004E0C /* Album Detail */,
|
||||
E442CCC72347D62F00004E0C /* Album Browser */,
|
||||
E442CCCA2347D74B00004E0C /* Artist Browser */,
|
||||
E4BBD2EA2335735500702C16 /* BrowseController.swift */,
|
||||
);
|
||||
path = Browser;
|
||||
sourceTree = "<group>";
|
||||
@ -905,7 +882,6 @@
|
||||
E40786202110CE70006887B1 /* Assets.xcassets in Resources */,
|
||||
E42A8F3C22176D6400A13ED9 /* README.md in Resources */,
|
||||
E408D3CB220E341D0006D9BE /* AlbumViewItem.xib in Resources */,
|
||||
E442CCCF2347E90800004E0C /* ArtistViewItem.xib in Resources */,
|
||||
E40786232110CE70006887B1 /* Main.storyboard in Resources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
@ -962,8 +938,6 @@
|
||||
E43AC1F622C6AD0B001E483C /* AlbumViewController+NSCollectionViewDelegate.swift in Sources */,
|
||||
E4B11B68226A4FA00075461B /* QueueState.swift in Sources */,
|
||||
E4928E0B2218D62A001D4BEA /* CGColor.swift in Sources */,
|
||||
E4BBD2ED2335798E00702C16 /* ArtistViewController.swift in Sources */,
|
||||
E4F26F732341166200D45FF9 /* ArtistDataSource.swift in Sources */,
|
||||
E4D3BFA622B419C000C56F48 /* QueueViewController+NSOutlineViewDelegate.swift in Sources */,
|
||||
E4405192227644340090CD6F /* MPDServerController.swift in Sources */,
|
||||
E4C8B53E22349002009A20F3 /* MPDIdle.swift in Sources */,
|
||||
@ -1015,7 +989,6 @@
|
||||
E41E5309223C020400173814 /* MPDClient+Command.swift in Sources */,
|
||||
E4F26F7923411B1500D45FF9 /* ArtistReducer.swift in Sources */,
|
||||
E4B11B73226A6C770075461B /* TrackTimer.swift in Sources */,
|
||||
E4BBD2EB2335735500702C16 /* BrowseController.swift in Sources */,
|
||||
E44051942278765A0090CD6F /* App.swift in Sources */,
|
||||
E4B11B79226D346B0075461B /* AlbumListReducer.swift in Sources */,
|
||||
E47E2FE52220AA0700F747E6 /* FlexibleGridViewLayout.swift in Sources */,
|
||||
@ -1035,7 +1008,6 @@
|
||||
E4B11BBE2275EDAA0075461B /* PlayerActions.swift in Sources */,
|
||||
E4F26F7723411AE300D45FF9 /* ArtistListActions.swift in Sources */,
|
||||
E4FF71942276043A00D4C412 /* MPDServer.swift in Sources */,
|
||||
E442CCD12347EAEB00004E0C /* ArtistViewItem.swift in Sources */,
|
||||
E41E530E223EF4CF00173814 /* CoverArtService+Caching.swift in Sources */,
|
||||
E4E8CC922204F4B80024217A /* QueueViewController.swift in Sources */,
|
||||
E440519C227BAF2E0090CD6F /* UIActions.swift in Sources */,
|
||||
|
||||
@ -1,27 +0,0 @@
|
||||
//
|
||||
// ArtistDataSource.swift
|
||||
// Persephone
|
||||
//
|
||||
// Created by Daniel Barber on 2019/9/29.
|
||||
// Copyright © 2019 Dan Barber. All rights reserved.
|
||||
//
|
||||
|
||||
import AppKit
|
||||
|
||||
class ArtistDataSource: NSObject, NSCollectionViewDataSource {
|
||||
var artists: [Artist] = []
|
||||
|
||||
func collectionView(_ collectionView: NSCollectionView, numberOfItemsInSection section: Int) -> Int {
|
||||
return artists.count
|
||||
}
|
||||
|
||||
func collectionView(_ collectionView: NSCollectionView, itemForRepresentedObjectAt indexPath: IndexPath) -> NSCollectionViewItem {
|
||||
let item = collectionView.makeItem(withIdentifier: .artistViewItem, for: indexPath)
|
||||
guard let artistViewItem = item as? ArtistViewItem else { return item }
|
||||
|
||||
artistViewItem.view.wantsLayer = true
|
||||
artistViewItem.setArtist(artists[indexPath.item])
|
||||
|
||||
return artistViewItem
|
||||
}
|
||||
}
|
||||
@ -1,63 +0,0 @@
|
||||
//
|
||||
// ArtistViewController.swift
|
||||
// Persephone
|
||||
//
|
||||
// Created by Daniel Barber on 2019/9/20.
|
||||
// Copyright © 2019 Dan Barber. All rights reserved.
|
||||
//
|
||||
|
||||
import AppKit
|
||||
import ReSwift
|
||||
import Differ
|
||||
|
||||
class ArtistViewController: NSViewController,
|
||||
NSCollectionViewDelegateFlowLayout {
|
||||
var dataSource = ArtistDataSource()
|
||||
let layout = FlexibleGridViewLayout(coder: NSCoder())
|
||||
|
||||
@IBOutlet var artistCollectionView: NSCollectionView!
|
||||
|
||||
override func viewDidLoad() {
|
||||
super.viewDidLoad()
|
||||
|
||||
App.store.subscribe(self) {
|
||||
$0.select { $0.artistListState }
|
||||
}
|
||||
|
||||
NotificationCenter.default.addObserver(self, selector: #selector(didConnect), name: .didConnect, object: nil)
|
||||
NotificationCenter.default.addObserver(self, selector: #selector(willDisconnect), name: .willDisconnect, object: nil)
|
||||
|
||||
artistCollectionView.dataSource = dataSource
|
||||
layout?.extraHeight = 26
|
||||
artistCollectionView.collectionViewLayout = layout
|
||||
}
|
||||
|
||||
deinit {
|
||||
App.store.unsubscribe(self)
|
||||
}
|
||||
|
||||
@objc func didConnect() {
|
||||
App.mpdClient.fetchAllArtists()
|
||||
}
|
||||
|
||||
@objc func willDisconnect() {
|
||||
DispatchQueue.main.async {
|
||||
App.store.dispatch(UpdateArtistListAction(artists: []))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
extension ArtistViewController: StoreSubscriber {
|
||||
typealias StoreSubscriberStateType = ArtistListState
|
||||
|
||||
func newState(state: StoreSubscriberStateType) {
|
||||
let oldArtists = dataSource.artists
|
||||
|
||||
dataSource.artists = state.artists
|
||||
|
||||
artistCollectionView.animateItemChanges(
|
||||
oldData: oldArtists,
|
||||
newData: dataSource.artists
|
||||
)
|
||||
}
|
||||
}
|
||||
@ -1,66 +0,0 @@
|
||||
//
|
||||
// artistViewItem.swift
|
||||
// Persephone
|
||||
//
|
||||
// Created by Daniel Barber on 2019/2/08.
|
||||
// Copyright © 2019 Dan Barber. All rights reserved.
|
||||
//
|
||||
|
||||
import AppKit
|
||||
|
||||
class ArtistViewItem: NSCollectionViewItem {
|
||||
var observer: NSKeyValueObservation?
|
||||
var artist: Artist?
|
||||
|
||||
// override var isSelected: Bool {
|
||||
// didSet {
|
||||
// artistCoverBox.layer?.borderWidth = isSelected ? 5 : 0
|
||||
// }
|
||||
// }
|
||||
|
||||
override func viewDidLoad() {
|
||||
super.viewDidLoad()
|
||||
//
|
||||
// artistCoverView.wantsLayer = true
|
||||
// artistCoverView.layer?.cornerRadius = 3
|
||||
// artistCoverView.layer?.borderWidth = 1
|
||||
//
|
||||
// artistCoverBox.wantsLayer = true
|
||||
// artistCoverBox.layer?.cornerRadius = 5
|
||||
// artistCoverBox.layer?.borderWidth = 0
|
||||
//
|
||||
// setAppearance()
|
||||
//
|
||||
// if #available(OSX 10.14, *) {
|
||||
// observer = NSApp.observe(\.effectiveAppearance) { (app, _) in
|
||||
// self.setAppearance()
|
||||
// }
|
||||
// }
|
||||
}
|
||||
|
||||
// override func prepareForReuse() {
|
||||
// super.prepareForReuse()
|
||||
//
|
||||
// artistDetailView.popover.close()
|
||||
// }
|
||||
|
||||
func setArtist(_ artist: Artist) {
|
||||
self.artist = artist
|
||||
artistName.stringValue = artist.name
|
||||
}
|
||||
|
||||
// func setAppearance() {
|
||||
// if #available(OSX 10.14, *) {
|
||||
// let darkMode = NSApp.effectiveAppearance.bestMatch(from:
|
||||
// [.darkAqua, .aqua]) == .darkAqua
|
||||
//
|
||||
// artistCoverView.layer?.borderColor = darkMode ? .albumBorderColorDark : .albumBorderColorLight
|
||||
// artistCoverBox.layer?.borderColor = NSColor.controlAccentColor.cgColor
|
||||
// } else {
|
||||
// artistCoverView.layer?.borderColor = .albumBorderColorLight
|
||||
// artistImageBox.layer?.borderColor = NSColor.selectedControlColor.cgColor
|
||||
// }
|
||||
// }
|
||||
|
||||
@IBOutlet var artistName: NSTextField!
|
||||
}
|
||||
@ -1,80 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="14868" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" customObjectInstantitationMethod="direct">
|
||||
<dependencies>
|
||||
<deployment identifier="macosx"/>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="14868"/>
|
||||
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
|
||||
</dependencies>
|
||||
<objects>
|
||||
<customObject id="-2" userLabel="File's Owner" customClass="ArtistViewItem" customModule="Persephone" customModuleProvider="target">
|
||||
<connections>
|
||||
<outlet property="artistName" destination="KEh-NL-c2W" id="xf0-q9-NIs"/>
|
||||
<outlet property="view" destination="Hz6-mo-xeY" id="v7W-XA-Emc"/>
|
||||
</connections>
|
||||
</customObject>
|
||||
<customObject id="-1" userLabel="First Responder" customClass="FirstResponder"/>
|
||||
<customObject id="-3" userLabel="Application" customClass="NSObject"/>
|
||||
<customView id="Hz6-mo-xeY">
|
||||
<rect key="frame" x="0.0" y="0.0" width="158" height="173"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
|
||||
<subviews>
|
||||
<box boxType="custom" borderType="none" cornerRadius="4" title="Box" translatesAutoresizingMaskIntoConstraints="NO" id="oat-Vd-t1v" userLabel="Artist Cover Box">
|
||||
<rect key="frame" x="5" y="30" width="148" height="138"/>
|
||||
<view key="contentView" wantsLayer="YES" id="h1X-3X-S5v">
|
||||
<rect key="frame" x="0.0" y="0.0" width="148" height="138"/>
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
|
||||
<subviews>
|
||||
<button verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="juD-33-Glf" customClass="AlbumCoverButton" customModule="Persephone" customModuleProvider="target">
|
||||
<rect key="frame" x="5" y="5" width="138" height="128"/>
|
||||
<shadow key="shadow" blurRadius="4">
|
||||
<size key="offset" width="0.0" height="2"/>
|
||||
<color key="color" white="0.0" alpha="0.34603323063380281" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
|
||||
</shadow>
|
||||
<buttonCell key="cell" type="square" bezelStyle="shadowlessSquare" image="defaultCoverArt" imagePosition="only" alignment="center" lineBreakMode="truncatingTail" refusesFirstResponder="YES" state="on" transparent="YES" imageScaling="proportionallyUpOrDown" inset="2" id="t8A-Hz-L38">
|
||||
<behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
|
||||
<font key="font" metaFont="system"/>
|
||||
</buttonCell>
|
||||
</button>
|
||||
</subviews>
|
||||
<constraints>
|
||||
<constraint firstItem="juD-33-Glf" firstAttribute="leading" secondItem="h1X-3X-S5v" secondAttribute="leading" constant="5" id="0bH-QU-yNJ"/>
|
||||
<constraint firstItem="juD-33-Glf" firstAttribute="top" secondItem="h1X-3X-S5v" secondAttribute="top" constant="5" id="iOP-iI-5gF"/>
|
||||
<constraint firstAttribute="bottom" secondItem="juD-33-Glf" secondAttribute="bottom" constant="5" id="kaN-bP-Ej1"/>
|
||||
<constraint firstItem="juD-33-Glf" firstAttribute="top" secondItem="h1X-3X-S5v" secondAttribute="top" constant="5" id="rvB-6b-GGM"/>
|
||||
<constraint firstAttribute="trailing" secondItem="juD-33-Glf" secondAttribute="trailing" constant="5" id="suk-y8-rCG"/>
|
||||
<constraint firstItem="juD-33-Glf" firstAttribute="leading" secondItem="h1X-3X-S5v" secondAttribute="leading" constant="5" id="tEg-gx-mw1"/>
|
||||
<constraint firstAttribute="trailing" secondItem="juD-33-Glf" secondAttribute="trailing" constant="5" id="tYM-2j-z4N"/>
|
||||
</constraints>
|
||||
</view>
|
||||
</box>
|
||||
<textField identifier="artistName" horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="KEh-NL-c2W" userLabel="Artist Name">
|
||||
<rect key="frame" x="8" y="9" width="142" height="17"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="height" constant="17" id="kyh-jb-F0f"/>
|
||||
</constraints>
|
||||
<textFieldCell key="cell" lineBreakMode="truncatingTail" title="Label" id="pDs-0t-e1j">
|
||||
<font key="font" metaFont="system"/>
|
||||
<color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
|
||||
<color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
|
||||
</textFieldCell>
|
||||
</textField>
|
||||
</subviews>
|
||||
<constraints>
|
||||
<constraint firstItem="oat-Vd-t1v" firstAttribute="leading" secondItem="Hz6-mo-xeY" secondAttribute="leading" constant="5" id="KmJ-Lb-i34"/>
|
||||
<constraint firstItem="oat-Vd-t1v" firstAttribute="centerX" secondItem="Hz6-mo-xeY" secondAttribute="centerX" id="bv4-qt-QTu"/>
|
||||
<constraint firstItem="KEh-NL-c2W" firstAttribute="top" secondItem="oat-Vd-t1v" secondAttribute="bottom" constant="4" id="jrN-Au-nkP"/>
|
||||
<constraint firstAttribute="trailing" secondItem="oat-Vd-t1v" secondAttribute="trailing" constant="5" id="n0s-RV-XbI"/>
|
||||
<constraint firstItem="oat-Vd-t1v" firstAttribute="leading" secondItem="Hz6-mo-xeY" secondAttribute="leading" constant="5" id="nLr-b7-Yfv"/>
|
||||
<constraint firstItem="KEh-NL-c2W" firstAttribute="leading" secondItem="Hz6-mo-xeY" secondAttribute="leading" constant="10" id="qDQ-KT-BNm"/>
|
||||
<constraint firstItem="oat-Vd-t1v" firstAttribute="top" secondItem="Hz6-mo-xeY" secondAttribute="top" constant="5" id="vFS-1V-I70"/>
|
||||
<constraint firstItem="oat-Vd-t1v" firstAttribute="centerX" secondItem="KEh-NL-c2W" secondAttribute="centerX" id="zoQ-iI-caI"/>
|
||||
<constraint firstAttribute="bottom" secondItem="KEh-NL-c2W" secondAttribute="bottom" constant="9" id="zvu-px-zE8"/>
|
||||
</constraints>
|
||||
<point key="canvasLocation" x="-20" y="102.5"/>
|
||||
</customView>
|
||||
<collectionViewItem id="Zx6-dd-JBD" customClass="ArtistViewItem" customModule="Persephone" customModuleProvider="target"/>
|
||||
</objects>
|
||||
<resources>
|
||||
<image name="defaultCoverArt" width="128" height="128"/>
|
||||
</resources>
|
||||
</document>
|
||||
@ -1,30 +0,0 @@
|
||||
//
|
||||
// BrowseController.swift
|
||||
// Persephone
|
||||
//
|
||||
// Created by Daniel Barber on 2019/9/20.
|
||||
// Copyright © 2019 Dan Barber. All rights reserved.
|
||||
//
|
||||
|
||||
import AppKit
|
||||
import ReSwift
|
||||
|
||||
class BrowseController: NSViewController {
|
||||
@IBOutlet var browseTabView: NSTabView!
|
||||
|
||||
override func viewDidLoad() {
|
||||
super.viewDidLoad()
|
||||
|
||||
App.store.subscribe(self) {
|
||||
$0.select { $0.uiState }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
extension BrowseController: StoreSubscriber {
|
||||
typealias BrowseSubscriberStateType = UIState
|
||||
|
||||
func newState(state: BrowseSubscriberStateType) {
|
||||
browseTabView.selectTabViewItem(at: state.browseViewState.rawValue)
|
||||
}
|
||||
}
|
||||
@ -302,23 +302,6 @@
|
||||
</connections>
|
||||
</button>
|
||||
</toolbarItem>
|
||||
<toolbarItem implicitItemIdentifier="D1F09BC1-069E-4734-AFB1-C8E4542D0F75" label="Browse View" paletteLabel="Browse View" sizingBehavior="auto" id="CDA-Tu-0RJ">
|
||||
<nil key="toolTip"/>
|
||||
<segmentedControl key="view" verticalHuggingPriority="750" id="F8b-3l-HcP">
|
||||
<rect key="frame" x="0.0" y="14" width="141" height="24"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
|
||||
<segmentedCell key="cell" borderStyle="border" alignment="left" style="texturedSquare" trackingMode="selectOne" id="iXx-16-jmI">
|
||||
<font key="font" metaFont="system"/>
|
||||
<segments>
|
||||
<segment label="Artists"/>
|
||||
<segment label="Albums"/>
|
||||
</segments>
|
||||
</segmentedCell>
|
||||
<connections>
|
||||
<action selector="setBrowseViewState:" target="B8D-0N-5wS" id="fVP-WG-uOi"/>
|
||||
</connections>
|
||||
</segmentedControl>
|
||||
</toolbarItem>
|
||||
</allowedToolbarItems>
|
||||
<defaultToolbarItems>
|
||||
<toolbarItem reference="p3r-ty-Pxf"/>
|
||||
@ -331,7 +314,6 @@
|
||||
<toolbarItem reference="s1h-EC-nvL"/>
|
||||
<toolbarItem reference="5U7-UV-xn2"/>
|
||||
<toolbarItem reference="9ol-aR-mzv"/>
|
||||
<toolbarItem reference="CDA-Tu-0RJ"/>
|
||||
</defaultToolbarItems>
|
||||
</toolbar>
|
||||
<connections>
|
||||
@ -339,7 +321,6 @@
|
||||
</connections>
|
||||
</window>
|
||||
<connections>
|
||||
<outlet property="browseViewControls" destination="F8b-3l-HcP" id="AMQ-6B-8Zd"/>
|
||||
<outlet property="databaseUpdatingIndicator" destination="LpV-iM-o6t" id="y0T-eR-ygY"/>
|
||||
<outlet property="repeatState" destination="OqH-lV-sAg" id="DPC-Ff-Srr"/>
|
||||
<outlet property="shuffleState" destination="E8L-uK-XT0" id="dCF-hm-dBs"/>
|
||||
@ -519,10 +500,11 @@
|
||||
</objects>
|
||||
<point key="canvasLocation" x="1459" y="-242"/>
|
||||
</scene>
|
||||
<!--Browse Controller-->
|
||||
<!--View Controller-->
|
||||
<scene sceneID="VvW-vT-alQ">
|
||||
<objects>
|
||||
<viewController id="SjO-VS-1bb" customClass="BrowseController" customModule="Persephone" customModuleProvider="target" sceneMemberID="viewController">
|
||||
<customObject id="MSG-y7-cKU" userLabel="First Responder" customClass="NSResponder" sceneMemberID="firstResponder"/>
|
||||
<viewController id="SjO-VS-1bb" sceneMemberID="viewController">
|
||||
<view key="view" id="BRY-0R-F3u">
|
||||
<rect key="frame" x="0.0" y="0.0" width="478" height="558"/>
|
||||
<autoresizingMask key="autoresizingMask"/>
|
||||
@ -531,26 +513,6 @@
|
||||
<rect key="frame" x="0.0" y="0.0" width="478" height="558"/>
|
||||
<font key="font" metaFont="system"/>
|
||||
<tabViewItems>
|
||||
<tabViewItem label="Artists" identifier="" id="bV1-g9-37C">
|
||||
<view key="view" id="5Ye-bM-Ifl">
|
||||
<rect key="frame" x="0.0" y="0.0" width="478" height="558"/>
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
|
||||
<subviews>
|
||||
<containerView translatesAutoresizingMaskIntoConstraints="NO" id="EBh-Di-UhX">
|
||||
<rect key="frame" x="0.0" y="0.0" width="478" height="558"/>
|
||||
<connections>
|
||||
<segue destination="LpS-90-tby" kind="embed" id="00m-3s-fzb"/>
|
||||
</connections>
|
||||
</containerView>
|
||||
</subviews>
|
||||
<constraints>
|
||||
<constraint firstItem="EBh-Di-UhX" firstAttribute="leading" secondItem="5Ye-bM-Ifl" secondAttribute="leading" id="SR7-0Y-U4Q"/>
|
||||
<constraint firstItem="EBh-Di-UhX" firstAttribute="top" secondItem="5Ye-bM-Ifl" secondAttribute="top" id="bcN-6r-OFW"/>
|
||||
<constraint firstAttribute="bottom" secondItem="EBh-Di-UhX" secondAttribute="bottom" id="kOK-UG-b31"/>
|
||||
<constraint firstAttribute="trailing" secondItem="EBh-Di-UhX" secondAttribute="trailing" id="vB5-SX-6iT"/>
|
||||
</constraints>
|
||||
</view>
|
||||
</tabViewItem>
|
||||
<tabViewItem label="Albums" identifier="" id="XgS-cX-SDH">
|
||||
<view key="view" id="hB7-hN-SbB">
|
||||
<rect key="frame" x="0.0" y="0.0" width="478" height="558"/>
|
||||
@ -585,7 +547,6 @@
|
||||
<outlet property="browseTabView" destination="ARv-cj-xlz" id="h93-fi-yY7"/>
|
||||
</connections>
|
||||
</viewController>
|
||||
<customObject id="MSG-y7-cKU" userLabel="First Responder" customClass="NSResponder" sceneMemberID="firstResponder"/>
|
||||
</objects>
|
||||
<point key="canvasLocation" x="1436" y="238"/>
|
||||
</scene>
|
||||
@ -878,53 +839,6 @@
|
||||
</objects>
|
||||
<point key="canvasLocation" x="825" y="746"/>
|
||||
</scene>
|
||||
<!--Artist View Controller-->
|
||||
<scene sceneID="SZb-JU-J7O">
|
||||
<objects>
|
||||
<viewController id="LpS-90-tby" customClass="ArtistViewController" customModule="Persephone" customModuleProvider="target" sceneMemberID="viewController">
|
||||
<view key="view" id="vxO-fC-BpZ">
|
||||
<rect key="frame" x="0.0" y="0.0" width="450" height="300"/>
|
||||
<autoresizingMask key="autoresizingMask"/>
|
||||
<subviews>
|
||||
<scrollView wantsLayer="YES" borderType="none" autohidesScrollers="YES" horizontalLineScroll="10" horizontalPageScroll="10" verticalLineScroll="10" verticalPageScroll="10" usesPredominantAxisScrolling="NO" translatesAutoresizingMaskIntoConstraints="NO" id="lkE-Eh-ZKl">
|
||||
<rect key="frame" x="0.0" y="0.0" width="450" height="300"/>
|
||||
<clipView key="contentView" id="W3C-r7-oJL">
|
||||
<rect key="frame" x="0.0" y="0.0" width="450" height="300"/>
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
|
||||
<subviews>
|
||||
<collectionView id="bg7-32-4Jl">
|
||||
<rect key="frame" x="0.0" y="0.0" width="450" height="158"/>
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES"/>
|
||||
<collectionViewLayout key="collectionViewLayout" id="48h-7k-nVB" customClass="FlexibleGridViewLayout" customModule="Persephone" customModuleProvider="target"/>
|
||||
<color key="primaryBackgroundColor" name="controlBackgroundColor" catalog="System" colorSpace="catalog"/>
|
||||
</collectionView>
|
||||
</subviews>
|
||||
</clipView>
|
||||
<scroller key="horizontalScroller" hidden="YES" wantsLayer="YES" verticalHuggingPriority="750" horizontal="YES" id="aW3-Xd-iIz">
|
||||
<rect key="frame" x="1" y="144" width="233" height="15"/>
|
||||
<autoresizingMask key="autoresizingMask"/>
|
||||
</scroller>
|
||||
<scroller key="verticalScroller" hidden="YES" wantsLayer="YES" verticalHuggingPriority="750" horizontal="NO" id="DhO-CB-eX0">
|
||||
<rect key="frame" x="234" y="1" width="15" height="143"/>
|
||||
<autoresizingMask key="autoresizingMask"/>
|
||||
</scroller>
|
||||
</scrollView>
|
||||
</subviews>
|
||||
<constraints>
|
||||
<constraint firstAttribute="trailing" secondItem="lkE-Eh-ZKl" secondAttribute="trailing" id="HPW-OE-lpd"/>
|
||||
<constraint firstItem="lkE-Eh-ZKl" firstAttribute="leading" secondItem="vxO-fC-BpZ" secondAttribute="leading" id="LnL-RZ-Lcm"/>
|
||||
<constraint firstItem="lkE-Eh-ZKl" firstAttribute="top" secondItem="vxO-fC-BpZ" secondAttribute="top" id="ZyG-hn-fPw"/>
|
||||
<constraint firstAttribute="bottom" secondItem="lkE-Eh-ZKl" secondAttribute="bottom" id="l4W-l0-fZS"/>
|
||||
</constraints>
|
||||
</view>
|
||||
<connections>
|
||||
<outlet property="artistCollectionView" destination="bg7-32-4Jl" id="g9V-jO-2wj"/>
|
||||
</connections>
|
||||
</viewController>
|
||||
<customObject id="Ras-zf-6qF" userLabel="First Responder" customClass="NSResponder" sceneMemberID="firstResponder"/>
|
||||
</objects>
|
||||
<point key="canvasLocation" x="2038" y="476"/>
|
||||
</scene>
|
||||
<!--Album View Controller-->
|
||||
<scene sceneID="7Ua-Hj-zWt">
|
||||
<objects>
|
||||
|
||||
@ -40,8 +40,6 @@ class WindowController: NSWindowController {
|
||||
}
|
||||
}
|
||||
|
||||
browseViewControls.setSelected(true, forSegment: App.store.state.uiState.browseViewState.rawValue)
|
||||
|
||||
App.store.dispatch(MainWindowDidOpenAction())
|
||||
|
||||
trackProgress.font = .timerFont
|
||||
@ -163,13 +161,6 @@ class WindowController: NSWindowController {
|
||||
@IBAction func handleRepeatButton(_ sender: NSButton) {
|
||||
App.mpdClient.setRepeatState(repeatState: sender.state == .on)
|
||||
}
|
||||
|
||||
@IBAction func setBrowseViewState(_ sender: NSSegmentedControl) {
|
||||
guard let browseViewState = BrowseViewState(rawValue: sender.selectedSegment)
|
||||
else { return }
|
||||
|
||||
App.store.dispatch(SetVisibleBrowseView(browseViewState: browseViewState))
|
||||
}
|
||||
}
|
||||
|
||||
extension WindowController: NSWindowDelegate {
|
||||
|
||||
@ -18,10 +18,6 @@ struct DatabaseUpdateStartedAction: Action {}
|
||||
|
||||
struct DatabaseUpdateFinishedAction: Action {}
|
||||
|
||||
struct SetVisibleBrowseView: Action {
|
||||
let browseViewState: BrowseViewState
|
||||
}
|
||||
|
||||
struct SetSelectedQueueItem: Action {
|
||||
let selectedQueueItem: QueueItem?
|
||||
}
|
||||
|
||||
@ -27,9 +27,6 @@ func uiReducer(action: Action, state: UIState?) -> UIState {
|
||||
case is DatabaseUpdateFinishedAction:
|
||||
state.databaseUpdating = false
|
||||
|
||||
case let action as SetVisibleBrowseView:
|
||||
state.browseViewState = action.browseViewState
|
||||
|
||||
case let action as SetSelectedSong:
|
||||
state.selectedSong = action.selectedSong
|
||||
|
||||
|
||||
@ -14,14 +14,8 @@ enum MainWindowState {
|
||||
case minimised
|
||||
}
|
||||
|
||||
enum BrowseViewState: Int {
|
||||
case artists = 0
|
||||
case albums = 1
|
||||
}
|
||||
|
||||
struct UIState: StateType {
|
||||
var mainWindowState: MainWindowState = .closed
|
||||
var browseViewState: BrowseViewState = .albums
|
||||
|
||||
var databaseUpdating: Bool = false
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user