1
1
mirror of https://github.com/danbee/persephone synced 2025-03-04 08:39:11 +00:00

Working album detail layout!

This commit is contained in:
Daniel Barber 2020-03-31 21:08:10 -04:00 committed by Dan Barber
parent d91d768735
commit fa16a7fe92
Signed by: danbarber
GPG Key ID: 931D8112E0103DD8
11 changed files with 335 additions and 152 deletions

View File

@ -9,21 +9,6 @@
import AppKit
class AlbumTracksDataSource: NSObject, NSTableViewDataSource {
struct AlbumSongItem {
let disc: String?
let song: Song?
init(song: Song) {
self.disc = nil
self.song = song
}
init(disc: String) {
self.disc = disc
self.song = nil
}
}
var albumSongs: [AlbumSongItem] = []
var showSongArtist: Bool = false

View File

@ -298,7 +298,7 @@
<rect key="frame" x="0.0" y="14" width="153" height="24"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<segmentedCell key="cell" borderStyle="border" alignment="left" style="texturedRounded" trackingMode="momentary" id="EBk-sD-nG7">
<font key="font" metaFont="system"/>
<font key="font" metaFont="label" size="13"/>
<segments>
<segment image="prevTrackButton" width="32" enabled="NO"/>
<segment image="playButton" width="48" enabled="NO" tag="1"/>
@ -320,7 +320,7 @@
<rect key="frame" x="16" y="14" width="55" height="17"/>
<autoresizingMask key="autoresizingMask"/>
<textFieldCell key="cell" lineBreakMode="clipping" alignment="right" placeholderString="8:88:88" id="g0c-k5-wCA">
<font key="font" metaFont="system"/>
<font key="font" metaFont="label" size="13"/>
<color key="textColor" name="tertiaryLabelColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
</textFieldCell>
@ -347,7 +347,7 @@
<rect key="frame" x="16" y="14" width="60" height="17"/>
<autoresizingMask key="autoresizingMask"/>
<textFieldCell key="cell" lineBreakMode="clipping" alignment="left" placeholderString="-8:88:88" id="XUa-pD-s5c">
<font key="font" metaFont="system"/>
<font key="font" metaFont="label" size="13"/>
<color key="textColor" name="tertiaryLabelColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
</textFieldCell>
@ -369,7 +369,7 @@
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<buttonCell key="cell" type="roundTextured" bezelStyle="texturedRounded" image="shuffleButton" imagePosition="overlaps" alignment="center" lineBreakMode="truncatingTail" borderStyle="border" inset="2" id="YNb-hd-ax8">
<behavior key="behavior" pushIn="YES" changeContents="YES" lightByContents="YES"/>
<font key="font" metaFont="system"/>
<font key="font" metaFont="label" size="13"/>
</buttonCell>
<connections>
<action selector="handleShuffleButton:" target="B8D-0N-5wS" id="THd-0g-fmb"/>
@ -385,7 +385,7 @@
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<buttonCell key="cell" type="roundTextured" bezelStyle="texturedRounded" image="repeatButton" imagePosition="only" alignment="center" lineBreakMode="truncatingTail" borderStyle="border" inset="2" id="1bu-vK-3Hb">
<behavior key="behavior" pushIn="YES" changeContents="YES" lightByContents="YES"/>
<font key="font" metaFont="system"/>
<font key="font" metaFont="label" size="13"/>
</buttonCell>
<connections>
<action selector="handleRepeatButton:" target="B8D-0N-5wS" id="EN2-u4-DNl"/>
@ -398,7 +398,7 @@
<rect key="frame" x="0.0" y="14" width="96" height="22"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<searchFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" selectable="YES" editable="YES" borderStyle="bezel" usesSingleLineMode="YES" bezelStyle="round" id="F3N-3P-tS3">
<font key="font" metaFont="system"/>
<font key="font" metaFont="label" size="13"/>
<color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
</searchFieldCell>
@ -414,7 +414,7 @@
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<buttonCell key="cell" type="roundTextured" bezelStyle="texturedRounded" image="speakerHigh" imagePosition="overlaps" alignment="center" borderStyle="border" imageScaling="proportionallyDown" inset="2" id="bJh-X9-7q0">
<behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
<font key="font" metaFont="system"/>
<font key="font" metaFont="label" size="13"/>
</buttonCell>
<connections>
<action selector="showVolumeControl:" target="B8D-0N-5wS" id="UoW-fa-jBM"/>
@ -516,7 +516,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="system"/>
<font key="font" metaFont="label" size="13"/>
<connections>
<outlet property="delegate" destination="zhe-qh-Mal" id="LUL-qN-JlP"/>
</connections>
@ -554,7 +554,7 @@
<rect key="frame" x="78" y="59" width="271" height="18"/>
<buttonCell key="cell" type="check" title="Fetch missing artwork from MusicBrainz" bezelStyle="regularSquare" imagePosition="left" enabled="NO" inset="2" id="LpD-Ew-HMd">
<behavior key="behavior" changeContents="YES" doesNotDimImage="YES" lightByContents="YES"/>
<font key="font" metaFont="system"/>
<font key="font" metaFont="label" size="13"/>
</buttonCell>
<connections>
<action selector="updateFetchMissingArtworkFromInternet:" target="3C9-vU-zjZ" id="I7x-9V-xJr"/>
@ -566,7 +566,7 @@
<rect key="frame" x="74" y="19" width="279" height="32"/>
<buttonCell key="cell" type="push" title="Clear album art cache..." bezelStyle="rounded" alignment="center" borderStyle="border" imageScaling="proportionallyDown" inset="2" id="l81-SG-7mf">
<behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
<font key="font" metaFont="system"/>
<font key="font" metaFont="label" size="13"/>
</buttonCell>
<connections>
<action selector="clearAlbumArtCache:" target="3C9-vU-zjZ" id="tXg-rz-lvh"/>
@ -614,7 +614,7 @@
<textField key="contentView" translatesAutoresizingMaskIntoConstraints="NO" id="kvB-99-zwY">
<rect key="frame" x="78" y="64" width="165" height="17"/>
<textFieldCell key="cell" lineBreakMode="clipping" alignment="right" title="Server Host:" id="AVi-g9-Irz">
<font key="font" metaFont="system"/>
<font key="font" metaFont="label" size="13"/>
<color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
</textFieldCell>
@ -637,7 +637,7 @@
<textField key="contentView" translatesAutoresizingMaskIntoConstraints="NO" id="AU9-wN-kbU">
<rect key="frame" x="78" y="29" width="165" height="16"/>
<textFieldCell key="cell" lineBreakMode="clipping" alignment="right" title="Server Port:" id="DgA-xT-2ir">
<font key="font" metaFont="system"/>
<font key="font" metaFont="label" size="13"/>
<color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
</textFieldCell>
@ -651,7 +651,7 @@
<real key="minimum" value="0.0"/>
<real key="maximum" value="65535"/>
</numberFormatter>
<font key="font" metaFont="system"/>
<font key="font" metaFont="label" size="13"/>
<color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
</textFieldCell>
@ -677,7 +677,7 @@
</viewController>
<customObject id="lzf-yO-5pP" userLabel="First Responder" customClass="NSResponder" sceneMemberID="firstResponder"/>
<textFieldCell lineBreakMode="clipping" alignment="right" title="Server Port:" id="22M-hh-h8g">
<font key="font" metaFont="system"/>
<font key="font" metaFont="label" size="13"/>
<color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
</textFieldCell>
@ -712,7 +712,7 @@
<color key="backgroundColor" name="headerColor" catalog="System" colorSpace="catalog"/>
</tableHeaderCell>
<textFieldCell key="dataCell" lineBreakMode="truncatingTail" selectable="YES" editable="YES" title="Text Cell" id="99v-Rb-3kv">
<font key="font" metaFont="system"/>
<font key="font" metaFont="label" size="13"/>
<color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="controlBackgroundColor" catalog="System" colorSpace="catalog"/>
</textFieldCell>
@ -757,7 +757,7 @@
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
</tableHeaderCell>
<textFieldCell key="dataCell" lineBreakMode="truncatingTail" selectable="YES" editable="YES" alignment="left" title="Text Cell" id="zb2-QK-DhK">
<font key="font" metaFont="system"/>
<font key="font" metaFont="label" size="13"/>
<color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="controlBackgroundColor" catalog="System" colorSpace="catalog"/>
</textFieldCell>
@ -778,7 +778,7 @@
<textField verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="i0h-bn-auJ" userLabel="Song Title View">
<rect key="frame" x="1" y="23" width="217" height="16"/>
<textFieldCell key="cell" lineBreakMode="truncatingTail" sendsActionOnEndEditing="YES" title="Song Title" id="ei8-1e-ErK">
<font key="font" metaFont="system"/>
<font key="font" metaFont="label" size="13"/>
<color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
</textFieldCell>
@ -805,7 +805,7 @@
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
</tableHeaderCell>
<textFieldCell key="dataCell" lineBreakMode="truncatingTail" selectable="YES" editable="YES" alignment="left" title="Text Cell" id="JOa-Mc-ceQ">
<font key="font" metaFont="system"/>
<font key="font" metaFont="label" size="13"/>
<color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="controlBackgroundColor" catalog="System" colorSpace="catalog"/>
</textFieldCell>
@ -818,7 +818,7 @@
<textField verticalHuggingPriority="750" horizontalCompressionResistancePriority="250" translatesAutoresizingMaskIntoConstraints="NO" id="ukg-c0-XVS">
<rect key="frame" x="11" y="13" width="41" height="16"/>
<textFieldCell key="cell" lineBreakMode="truncatingTail" sendsActionOnEndEditing="YES" alignment="right" title="88:88" id="JnJ-sF-vCP">
<font key="font" metaFont="system"/>
<font key="font" metaFont="label" size="13"/>
<color key="textColor" name="secondaryLabelColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
</textFieldCell>

View File

@ -35,7 +35,9 @@
E41222242431535E00473C1D /* MPDAlbumArtImageDataProvider.swift in Sources */ = {isa = PBXBuildFile; fileRef = E4BB7F8E23E5E7BC00906E2F /* MPDAlbumArtImageDataProvider.swift */; };
E4122228243153B200473C1D /* CGSize.swift in Sources */ = {isa = PBXBuildFile; fileRef = E41222272431539800473C1D /* CGSize.swift */; };
E41222292431555100473C1D /* CGColor.swift in Sources */ = {isa = PBXBuildFile; fileRef = E4928E0A2218D62A001D4BEA /* CGColor.swift */; };
E412222C2431830500473C1D /* AlbumDetailViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = E412222B2431830500473C1D /* AlbumDetailViewController.swift */; };
E41222302432B0A300473C1D /* AlbumTracksDataSource.swift in Sources */ = {isa = PBXBuildFile; fileRef = E412222F2432B0A300473C1D /* AlbumTracksDataSource.swift */; };
E41222322432B14000473C1D /* AlbumSongItem.swift in Sources */ = {isa = PBXBuildFile; fileRef = E41222312432B14000473C1D /* AlbumSongItem.swift */; };
E41222332432B15100473C1D /* AlbumSongItem.swift in Sources */ = {isa = PBXBuildFile; fileRef = E41222312432B14000473C1D /* AlbumSongItem.swift */; };
E419E2872249B96600216A8C /* Song.swift in Sources */ = {isa = PBXBuildFile; fileRef = E419E2862249B96600216A8C /* Song.swift */; };
E41B22C621FB932700D544F6 /* MPDClient.swift in Sources */ = {isa = PBXBuildFile; fileRef = E41B22C521FB932700D544F6 /* MPDClient.swift */; };
E41E52FD223BF87300173814 /* MPDClient+Connection.swift in Sources */ = {isa = PBXBuildFile; fileRef = E41E52FC223BF87300173814 /* MPDClient+Connection.swift */; };
@ -292,6 +294,8 @@
E4B11BBE2275EDAA0075461B /* PlayerActions.swift in Sources */ = {isa = PBXBuildFile; fileRef = E4B11BBD2275EDAA0075461B /* PlayerActions.swift */; };
E4B11BC02275EE150075461B /* QueueActions.swift in Sources */ = {isa = PBXBuildFile; fileRef = E4B11BBF2275EE150075461B /* QueueActions.swift */; };
E4B11BC22275EE410075461B /* AlbumListActions.swift in Sources */ = {isa = PBXBuildFile; fileRef = E4B11BC12275EE410075461B /* AlbumListActions.swift */; };
E4B3B3642432DB7A007E25D2 /* AlbumSongCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = E4B3B3622432DA4B007E25D2 /* AlbumSongCell.swift */; };
E4B3B3672432DF1B007E25D2 /* AlbumSongListViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = E4B3B3652432DEDB007E25D2 /* AlbumSongListViewController.swift */; };
E4B3DF6523D66A4400728F6B /* QueueSongCoverView.swift in Sources */ = {isa = PBXBuildFile; fileRef = E4B3DF6423D66A4400728F6B /* QueueSongCoverView.swift */; };
E4B46F8F2402E89800152157 /* MPDError.swift in Sources */ = {isa = PBXBuildFile; fileRef = E4B46F8E2402E89800152157 /* MPDError.swift */; };
E4B5AE7E22F4C49600CCEC65 /* MPDServerDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = E4B5AE7D22F4C49600CCEC65 /* MPDServerDelegate.swift */; };
@ -424,7 +428,8 @@
E412220B2431425400473C1D /* AlbumViewController+UICollectionViewDataSource.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "AlbumViewController+UICollectionViewDataSource.swift"; sourceTree = "<group>"; };
E412220C2431425400473C1D /* AlbumViewController+UICollectionViewDelegateFlowLayout.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "AlbumViewController+UICollectionViewDelegateFlowLayout.swift"; sourceTree = "<group>"; };
E41222272431539800473C1D /* CGSize.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CGSize.swift; sourceTree = "<group>"; };
E412222B2431830500473C1D /* AlbumDetailViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AlbumDetailViewController.swift; sourceTree = "<group>"; };
E412222F2432B0A300473C1D /* AlbumTracksDataSource.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AlbumTracksDataSource.swift; sourceTree = "<group>"; };
E41222312432B14000473C1D /* AlbumSongItem.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AlbumSongItem.swift; sourceTree = "<group>"; };
E419E2862249B96600216A8C /* Song.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Song.swift; sourceTree = "<group>"; };
E41B22C421FB715A00D544F6 /* module.modulemap */ = {isa = PBXFileReference; lastKnownFileType = "sourcecode.module-map"; path = module.modulemap; sourceTree = "<group>"; };
E41B22C521FB932700D544F6 /* MPDClient.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MPDClient.swift; sourceTree = "<group>"; };
@ -647,6 +652,8 @@
E4B11BBD2275EDAA0075461B /* PlayerActions.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PlayerActions.swift; sourceTree = "<group>"; };
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>"; };
E4B3B3622432DA4B007E25D2 /* AlbumSongCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AlbumSongCell.swift; sourceTree = "<group>"; };
E4B3B3652432DEDB007E25D2 /* AlbumSongListViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AlbumSongListViewController.swift; sourceTree = "<group>"; };
E4B3DF6423D66A4400728F6B /* QueueSongCoverView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = QueueSongCoverView.swift; sourceTree = "<group>"; };
E4B46F8E2402E89800152157 /* MPDError.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MPDError.swift; sourceTree = "<group>"; };
E4B5AE7D22F4C49600CCEC65 /* MPDServerDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MPDServerDelegate.swift; sourceTree = "<group>"; };
@ -945,7 +952,9 @@
E412222A243182F700473C1D /* Album Detail */ = {
isa = PBXGroup;
children = (
E412222B2431830500473C1D /* AlbumDetailViewController.swift */,
E412222F2432B0A300473C1D /* AlbumTracksDataSource.swift */,
E4B3B3622432DA4B007E25D2 /* AlbumSongCell.swift */,
E4B3B3652432DEDB007E25D2 /* AlbumSongListViewController.swift */,
);
path = "Album Detail";
sourceTree = "<group>";
@ -1410,6 +1419,7 @@
isa = PBXGroup;
children = (
E450AD7D222620A10091BED3 /* Album.swift */,
E41222312432B14000473C1D /* AlbumSongItem.swift */,
E43AC1F422C6A4F4001E483C /* DraggedAlbum.swift */,
E451E36C22BD23DB008BE9B2 /* DraggedSong.swift */,
E451E36A22BD214D008BE9B2 /* DraggedSongType.swift */,
@ -1729,6 +1739,7 @@
E48059EE2426D73600362CF3 /* socket.c in Sources */,
E4F6B467221E233200ACF42A /* AlbumDataSource.swift in Sources */,
E4B11BA92274EDE30075461B /* Loading.swift in Sources */,
E41222332432B15100473C1D /* AlbumSongItem.swift in Sources */,
E408D3C2220E134F0006D9BE /* AlbumViewController.swift in Sources */,
E42A4D4F22E20D7D001C6CAD /* MPDTag.swift in Sources */,
E48059D82426D73600362CF3 /* database.c in Sources */,
@ -1952,15 +1963,18 @@
E48059D72426D73600362CF3 /* ierror.c in Sources */,
E48059F32426D73600362CF3 /* capabilities.c in Sources */,
E483CE69242FEFB8001F742E /* Notification.swift in Sources */,
E41222322432B14000473C1D /* AlbumSongItem.swift in Sources */,
E480511B24255BAF00362CF3 /* TrackTimer.swift in Sources */,
E480513124255BDF00362CF3 /* MPDStatus.swift in Sources */,
E480514424255E7700362CF3 /* PlayerReducer.swift in Sources */,
E4B3B3672432DF1B007E25D2 /* AlbumSongListViewController.swift in Sources */,
E480514524255E7700362CF3 /* PreferencesReducer.swift in Sources */,
E41222292431555100473C1D /* CGColor.swift in Sources */,
E480511F24255BDB00362CF3 /* MPDClient+Album.swift in Sources */,
E4805A0B2426D73600362CF3 /* sync.c in Sources */,
E4805A052426D73600362CF3 /* connection.c in Sources */,
E480512324255BDB00362CF3 /* MPDClient+Database.swift in Sources */,
E41222302432B0A300473C1D /* AlbumTracksDataSource.swift in Sources */,
E48059ED2426D73600362CF3 /* stats.c in Sources */,
E480514824255E7700362CF3 /* UIReducer.swift in Sources */,
E480512124255BDB00362CF3 /* MPDClient+Command.swift in Sources */,
@ -1975,6 +1989,7 @@
E480513E24255E7200362CF3 /* PreferencesState.swift in Sources */,
E4805A132426D73600362CF3 /* rplaylist.c in Sources */,
E480513024255BDF00362CF3 /* MPDSong.swift in Sources */,
E4B3B3642432DB7A007E25D2 /* AlbumSongCell.swift in Sources */,
E480511524255BAF00362CF3 /* DraggedSongType.swift in Sources */,
E480512B24255BDF00362CF3 /* MPDAlbum.swift in Sources */,
E412221A2431425400473C1D /* AlbumViewController+UICollectionViewDataSource.swift in Sources */,
@ -1989,7 +2004,6 @@
E480512E24255BDF00362CF3 /* MPDIdle.swift in Sources */,
E48059E92426D73600362CF3 /* queue.c in Sources */,
E48059D12426D73600362CF3 /* send.c in Sources */,
E412222C2431830500473C1D /* AlbumDetailViewController.swift in Sources */,
E4805A1B2426D73600362CF3 /* cmessage.c in Sources */,
E48059E52426D73600362CF3 /* run.c in Sources */,
E480514D24255E7D00362CF3 /* ServerActions.swift in Sources */,

View File

@ -0,0 +1,24 @@
//
// AlbumSongItem.swift
// Persephone-iOS
//
// Created by Daniel Barber on 2020-3-30.
// Copyright © 2020 Dan Barber. All rights reserved.
//
import Foundation
struct AlbumSongItem {
let disc: String?
let song: Song?
init(song: Song) {
self.disc = nil
self.song = song
}
init(disc: String) {
self.disc = disc
self.song = nil
}
}

View File

@ -18,5 +18,9 @@
"info" : {
"author" : "xcode",
"version" : 1
},
"properties" : {
"auto-scaling" : "auto",
"preserves-vector-representation" : true
}
}

View File

@ -3,7 +3,6 @@
<device id="retina6_1" orientation="portrait" appearance="light"/>
<dependencies>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="16086"/>
<capability name="Safe area layout guides" minToolsVersion="9.0"/>
<capability name="collection view cell content view" minToolsVersion="11.0"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
@ -67,7 +66,7 @@
<outlet property="albumArtist" destination="RUQ-Qx-VQi" id="r0K-2i-kak"/>
<outlet property="albumCoverView" destination="eNz-Ou-6la" id="fPd-Sn-Dke"/>
<outlet property="albumTitle" destination="NLE-dn-N7W" id="Chx-gy-kPL"/>
<segue destination="ii3-nU-e6h" kind="show" id="Fww-At-iOj"/>
<segue destination="PiR-R2-zGX" kind="show" id="ir8-Wr-g2Z"/>
</connections>
</collectionViewCell>
</cells>
@ -81,94 +80,159 @@
</objects>
<point key="canvasLocation" x="1815.9420289855075" y="138.61607142857142"/>
</scene>
<!--Album Detail View Controller-->
<scene sceneID="7Uf-kw-bl3">
<!--Album Song List View Controller-->
<scene sceneID="oMo-KI-W9n">
<objects>
<viewController id="ii3-nU-e6h" customClass="AlbumDetailViewController" customModule="Persephone" customModuleProvider="target" sceneMemberID="viewController">
<view key="view" contentMode="scaleToFill" id="VGR-kF-UUm">
<tableViewController id="PiR-R2-zGX" customClass="AlbumSongListViewController" customModule="Persephone" customModuleProvider="target" sceneMemberID="viewController">
<tableView key="view" clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" dataMode="prototypes" style="plain" separatorStyle="default" rowHeight="-1" estimatedRowHeight="-1" sectionHeaderHeight="28" sectionFooterHeight="28" id="bb3-Ec-blb">
<rect key="frame" x="0.0" y="0.0" width="414" height="896"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<scrollView clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleToFill" ambiguous="YES" translatesAutoresizingMaskIntoConstraints="NO" id="XIW-jv-ioG">
<rect key="frame" x="0.0" y="88" width="414" height="725"/>
<subviews>
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="defaultCoverArt" translatesAutoresizingMaskIntoConstraints="NO" id="x4m-cJ-Efb">
<rect key="frame" x="20" y="30" width="179" height="179"/>
<constraints>
<constraint firstAttribute="width" secondItem="x4m-cJ-Efb" secondAttribute="height" multiplier="1:1" id="3yv-0S-X2C"/>
</constraints>
</imageView>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Album Artist" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="HNh-tV-Sqi">
<rect key="frame" x="215" y="53" width="179" height="21"/>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<color key="textColor" systemColor="secondaryLabelColor" red="0.23529411759999999" green="0.23529411759999999" blue="0.26274509800000001" alpha="0.59999999999999998" colorSpace="custom" customColorSpace="sRGB"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Album Title" lineBreakMode="wordWrap" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="hz5-e6-wXe">
<rect key="frame" x="215" y="30" width="179" height="21.5"/>
<fontDescription key="fontDescription" type="system" weight="semibold" pointSize="18"/>
<nil key="textColor"/>
<nil key="highlightedColor"/>
</label>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="MqK-AJ-gyc">
<rect key="frame" x="20" y="225" width="179" height="45"/>
<color key="backgroundColor" systemColor="secondarySystemBackgroundColor" red="0.94901960780000005" green="0.94901960780000005" blue="0.96862745100000003" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<constraints>
<constraint firstAttribute="height" constant="45" id="jk9-EB-TOt"/>
</constraints>
<fontDescription key="fontDescription" type="boldSystem" pointSize="18"/>
<state key="normal" title="Play" image="playButtonLarge">
<color key="titleColor" systemColor="linkColor" red="0.0" green="0.47843137250000001" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</state>
<connections>
<action selector="playAlbumAction:" destination="ii3-nU-e6h" eventType="touchUpInside" id="xSY-YL-t6L"/>
</connections>
</button>
</subviews>
<constraints>
<constraint firstItem="HNh-tV-Sqi" firstAttribute="leading" secondItem="x4m-cJ-Efb" secondAttribute="trailing" constant="16" id="5Pa-0J-SCI"/>
<constraint firstItem="hz5-e6-wXe" firstAttribute="leading" secondItem="x4m-cJ-Efb" secondAttribute="trailing" constant="16" id="ACA-EC-ptE"/>
<constraint firstItem="HNh-tV-Sqi" firstAttribute="top" secondItem="hz5-e6-wXe" secondAttribute="bottom" constant="1.5" id="DUa-dT-pJ1"/>
<constraint firstItem="hz5-e6-wXe" firstAttribute="width" secondItem="x4m-cJ-Efb" secondAttribute="width" id="FiT-Cz-jtL"/>
<constraint firstItem="MqK-AJ-gyc" firstAttribute="leading" secondItem="UzT-Em-gMm" secondAttribute="leading" constant="20" id="Hsf-wJ-Jgi"/>
<constraint firstItem="HNh-tV-Sqi" firstAttribute="width" secondItem="hz5-e6-wXe" secondAttribute="width" id="MnT-pH-wBT"/>
<constraint firstItem="MqK-AJ-gyc" firstAttribute="width" secondItem="x4m-cJ-Efb" secondAttribute="width" id="OVe-wp-v9Y"/>
<constraint firstItem="x4m-cJ-Efb" firstAttribute="leading" secondItem="UzT-Em-gMm" secondAttribute="leading" constant="20" id="OtV-id-weM"/>
<constraint firstItem="x4m-cJ-Efb" firstAttribute="top" secondItem="UzT-Em-gMm" secondAttribute="top" constant="30" id="U0O-oU-iaU"/>
<constraint firstItem="MqK-AJ-gyc" firstAttribute="top" secondItem="x4m-cJ-Efb" secondAttribute="bottom" constant="16" id="akc-3M-fpI"/>
<constraint firstItem="UzT-Em-gMm" firstAttribute="trailing" secondItem="HNh-tV-Sqi" secondAttribute="trailing" constant="20" id="hcQ-WE-uZP"/>
<constraint firstItem="hz5-e6-wXe" firstAttribute="top" secondItem="UzT-Em-gMm" secondAttribute="top" constant="30" id="na1-d0-EdD"/>
<constraint firstItem="UzT-Em-gMm" firstAttribute="trailing" secondItem="hz5-e6-wXe" secondAttribute="trailing" constant="20" id="uE2-Pg-mgq"/>
</constraints>
<viewLayoutGuide key="contentLayoutGuide" id="fqj-4d-6vE"/>
<viewLayoutGuide key="frameLayoutGuide" id="UzT-Em-gMm"/>
</scrollView>
</subviews>
<color key="backgroundColor" systemColor="systemBackgroundColor" cocoaTouchSystemColor="whiteColor"/>
<constraints>
<constraint firstItem="XIW-jv-ioG" firstAttribute="trailing" secondItem="xgx-ch-8Vx" secondAttribute="trailing" id="9JH-zm-iwv"/>
<constraint firstItem="XIW-jv-ioG" firstAttribute="leading" secondItem="xgx-ch-8Vx" secondAttribute="leading" id="Ee7-z5-6hs"/>
<constraint firstItem="XIW-jv-ioG" firstAttribute="top" secondItem="xgx-ch-8Vx" secondAttribute="top" id="N81-n7-eIq"/>
<constraint firstItem="XIW-jv-ioG" firstAttribute="bottom" secondItem="xgx-ch-8Vx" secondAttribute="bottom" id="NaK-3i-hav"/>
<constraint firstItem="XIW-jv-ioG" firstAttribute="top" secondItem="xgx-ch-8Vx" secondAttribute="top" id="VQc-pH-bzV"/>
<constraint firstItem="xgx-ch-8Vx" firstAttribute="trailing" secondItem="XIW-jv-ioG" secondAttribute="trailing" id="WsF-4E-Zjl"/>
<constraint firstItem="XIW-jv-ioG" firstAttribute="trailing" secondItem="xgx-ch-8Vx" secondAttribute="trailing" id="cvb-Ov-jPf"/>
<constraint firstItem="XIW-jv-ioG" firstAttribute="leading" secondItem="xgx-ch-8Vx" secondAttribute="leading" id="ldd-Mx-jjs"/>
<constraint firstItem="XIW-jv-ioG" firstAttribute="bottom" secondItem="xgx-ch-8Vx" secondAttribute="bottom" id="tp0-RF-fNB"/>
</constraints>
<viewLayoutGuide key="safeArea" id="xgx-ch-8Vx"/>
</view>
<navigationItem key="navigationItem" id="6fY-yh-Q6C"/>
<view key="tableHeaderView" contentMode="scaleToFill" id="4dR-vb-lQN">
<rect key="frame" x="0.0" y="0.0" width="414" height="523"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" ambiguous="YES" text="Album Title" lineBreakMode="wordWrap" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontForContentSizeCategory="YES" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="EZF-hY-Nqr">
<rect key="frame" x="20" y="29" width="374" height="23"/>
<fontDescription key="fontDescription" type="system" weight="semibold" pointSize="19"/>
<nil key="textColor"/>
<nil key="highlightedColor"/>
</label>
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="defaultCoverArt" translatesAutoresizingMaskIntoConstraints="NO" id="vMd-mZ-iq2">
<rect key="frame" x="20" y="76" width="374" height="374"/>
<constraints>
<constraint firstAttribute="width" secondItem="vMd-mZ-iq2" secondAttribute="height" multiplier="1:1" id="F0z-BP-vR9"/>
<constraint firstAttribute="width" secondItem="vMd-mZ-iq2" secondAttribute="height" multiplier="1:1" id="X9u-bs-kD7"/>
</constraints>
</imageView>
<button opaque="NO" contentMode="scaleToFill" misplaced="YES" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="5gg-Nm-qeI">
<rect key="frame" x="19" y="470" width="177" height="45"/>
<color key="backgroundColor" systemColor="secondarySystemBackgroundColor" red="0.94901960780000005" green="0.94901960780000005" blue="0.96862745100000003" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<constraints>
<constraint firstAttribute="height" constant="45" id="Czc-2v-b16"/>
</constraints>
<fontDescription key="fontDescription" type="system" weight="semibold" pointSize="17"/>
<state key="normal" title="Play"/>
</button>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="Lvw-rf-UJc">
<rect key="frame" x="217" y="470" width="177" height="45"/>
<color key="backgroundColor" systemColor="secondarySystemBackgroundColor" red="0.94901960780000005" green="0.94901960780000005" blue="0.96862745100000003" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<constraints>
<constraint firstAttribute="height" constant="45" id="me8-vL-evB"/>
</constraints>
<fontDescription key="fontDescription" type="system" weight="semibold" pointSize="17"/>
<state key="normal" title="Queue"/>
</button>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" ambiguous="YES" text="Metadata" lineBreakMode="wordWrap" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontForContentSizeCategory="YES" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="LH5-iT-vfZ">
<rect key="frame" x="20" y="55" width="374" height="21"/>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<color key="textColor" systemColor="secondaryLabelColor" red="0.23529411759999999" green="0.23529411759999999" blue="0.26274509800000001" alpha="0.59999999999999998" colorSpace="custom" customColorSpace="sRGB"/>
<nil key="highlightedColor"/>
</label>
</subviews>
<color key="backgroundColor" systemColor="systemBackgroundColor" cocoaTouchSystemColor="whiteColor"/>
<constraints>
<constraint firstItem="Lvw-rf-UJc" firstAttribute="leading" secondItem="5gg-Nm-qeI" secondAttribute="trailing" constant="20" id="0Lc-z6-7RU"/>
<constraint firstItem="LH5-iT-vfZ" firstAttribute="top" secondItem="EZF-hY-Nqr" secondAttribute="bottom" constant="2" id="43U-1C-keW"/>
<constraint firstItem="Lvw-rf-UJc" firstAttribute="top" secondItem="vMd-mZ-iq2" secondAttribute="bottom" constant="20" id="4Ot-Oc-aRZ"/>
<constraint firstAttribute="trailing" secondItem="vMd-mZ-iq2" secondAttribute="trailing" constant="20" id="CWm-pg-dRA"/>
<constraint firstItem="EZF-hY-Nqr" firstAttribute="top" secondItem="4dR-vb-lQN" secondAttribute="top" constant="20" id="HBK-nw-rjM"/>
<constraint firstItem="5gg-Nm-qeI" firstAttribute="top" secondItem="vMd-mZ-iq2" secondAttribute="bottom" constant="20" id="HZF-Hh-ZX0"/>
<constraint firstAttribute="trailing" secondItem="Lvw-rf-UJc" secondAttribute="trailing" constant="20" id="JXF-G0-x5r"/>
<constraint firstItem="vMd-mZ-iq2" firstAttribute="top" secondItem="LH5-iT-vfZ" secondAttribute="bottom" constant="8" id="LWF-p1-tn0"/>
<constraint firstItem="vMd-mZ-iq2" firstAttribute="leading" secondItem="4dR-vb-lQN" secondAttribute="leading" constant="20" id="Qla-Bc-wdn"/>
<constraint firstItem="LH5-iT-vfZ" firstAttribute="leading" secondItem="4dR-vb-lQN" secondAttribute="leading" constant="20" id="Qqy-dD-ZG5"/>
<constraint firstItem="Lvw-rf-UJc" firstAttribute="width" secondItem="5gg-Nm-qeI" secondAttribute="width" id="X3A-N5-WO9"/>
<constraint firstAttribute="bottom" secondItem="Lvw-rf-UJc" secondAttribute="bottom" constant="8" id="djA-PF-gfC"/>
<constraint firstAttribute="bottom" secondItem="5gg-Nm-qeI" secondAttribute="bottom" constant="8" id="eKF-ee-J9c"/>
<constraint firstItem="5gg-Nm-qeI" firstAttribute="leading" secondItem="4dR-vb-lQN" secondAttribute="leading" constant="20" id="gHS-An-Peg"/>
<constraint firstItem="EZF-hY-Nqr" firstAttribute="leading" secondItem="4dR-vb-lQN" secondAttribute="leading" constant="20" id="h5j-oH-vAG"/>
<constraint firstAttribute="trailing" secondItem="EZF-hY-Nqr" secondAttribute="trailing" constant="20" id="yaw-R1-rwu"/>
<constraint firstAttribute="trailing" secondItem="LH5-iT-vfZ" secondAttribute="trailing" constant="20" id="zBC-6u-CKb"/>
</constraints>
</view>
<prototypes>
<tableViewCell clipsSubviews="YES" contentMode="scaleToFill" insetsLayoutMarginsFromSafeArea="NO" selectionStyle="blue" hidesAccessoryWhenEditing="NO" indentationLevel="1" indentationWidth="0.0" reuseIdentifier="albumDiscCell" id="Cgr-Ay-PN6" customClass="AlbumTrackCell" customModule="Persephone" customModuleProvider="target">
<rect key="frame" x="0.0" y="551" width="414" height="43.5"/>
<autoresizingMask key="autoresizingMask"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" insetsLayoutMarginsFromSafeArea="NO" tableViewCell="Cgr-Ay-PN6" id="QJR-Pt-aua">
<rect key="frame" x="0.0" y="0.0" width="414" height="43.5"/>
<autoresizingMask key="autoresizingMask"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Disc 0" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="KZU-KX-MTh">
<rect key="frame" x="20" y="11.5" width="374" height="20.5"/>
<fontDescription key="fontDescription" type="system" weight="semibold" pointSize="17"/>
<nil key="highlightedColor"/>
</label>
</subviews>
<constraints>
<constraint firstItem="KZU-KX-MTh" firstAttribute="leading" secondItem="QJR-Pt-aua" secondAttribute="leadingMargin" id="gM3-wE-h1z"/>
<constraint firstAttribute="trailingMargin" secondItem="KZU-KX-MTh" secondAttribute="trailing" id="jN8-kr-DQ0"/>
<constraint firstItem="KZU-KX-MTh" firstAttribute="centerY" secondItem="QJR-Pt-aua" secondAttribute="centerY" id="w9Y-0V-gJb"/>
</constraints>
</tableViewCellContentView>
</tableViewCell>
<tableViewCell clipsSubviews="YES" contentMode="scaleToFill" insetsLayoutMarginsFromSafeArea="NO" selectionStyle="blue" hidesAccessoryWhenEditing="NO" indentationLevel="1" indentationWidth="0.0" reuseIdentifier="albumSongCell" id="mPK-LP-7dy" customClass="AlbumSongCell" customModule="Persephone" customModuleProvider="target">
<rect key="frame" x="0.0" y="594.5" width="414" height="43.5"/>
<autoresizingMask key="autoresizingMask"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" insetsLayoutMarginsFromSafeArea="NO" tableViewCell="mPK-LP-7dy" id="eyH-Gb-IA4">
<rect key="frame" x="0.0" y="0.0" width="414" height="43.5"/>
<autoresizingMask key="autoresizingMask"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Song Title" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="0hN-Hx-lXr">
<rect key="frame" x="56" y="11.5" width="270" height="20.5"/>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<nil key="textColor"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="00:00" textAlignment="right" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="bOC-cU-wMA">
<rect key="frame" x="348" y="11.5" width="46" height="20.5"/>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<nil key="textColor"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="0." lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="wVS-im-RKW">
<rect key="frame" x="20" y="11.5" width="14.5" height="20.5"/>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<color key="textColor" systemColor="secondaryLabelColor" red="0.23529411759999999" green="0.23529411759999999" blue="0.26274509800000001" alpha="0.59999999999999998" colorSpace="custom" customColorSpace="sRGB"/>
<nil key="highlightedColor"/>
</label>
</subviews>
<constraints>
<constraint firstItem="wVS-im-RKW" firstAttribute="centerY" secondItem="eyH-Gb-IA4" secondAttribute="centerY" id="34h-ac-Xce"/>
<constraint firstItem="0hN-Hx-lXr" firstAttribute="leading" secondItem="eyH-Gb-IA4" secondAttribute="leadingMargin" constant="36" id="H7s-vd-EFL"/>
<constraint firstItem="bOC-cU-wMA" firstAttribute="trailing" secondItem="eyH-Gb-IA4" secondAttribute="trailingMargin" id="ISs-GM-doi"/>
<constraint firstAttribute="trailing" secondItem="0hN-Hx-lXr" secondAttribute="trailing" constant="88" id="Pn5-of-7QR"/>
<constraint firstItem="0hN-Hx-lXr" firstAttribute="centerY" secondItem="eyH-Gb-IA4" secondAttribute="centerY" id="UPJ-0f-YFa"/>
<constraint firstItem="bOC-cU-wMA" firstAttribute="centerY" secondItem="eyH-Gb-IA4" secondAttribute="centerY" id="oCW-xo-Pbc"/>
<constraint firstItem="wVS-im-RKW" firstAttribute="leading" secondItem="eyH-Gb-IA4" secondAttribute="leadingMargin" id="ogf-eP-dUS"/>
</constraints>
</tableViewCellContentView>
<connections>
<outlet property="songDuration" destination="bOC-cU-wMA" id="tsb-f1-Y7Z"/>
<outlet property="songTitle" destination="0hN-Hx-lXr" id="qXH-JV-jj0"/>
<outlet property="trackNumber" destination="wVS-im-RKW" id="zKH-xk-a5c"/>
</connections>
</tableViewCell>
</prototypes>
<connections>
<outlet property="dataSource" destination="PiR-R2-zGX" id="hBZ-5o-a0K"/>
<outlet property="delegate" destination="PiR-R2-zGX" id="3Ok-IY-2Ej"/>
</connections>
</tableView>
<navigationItem key="navigationItem" id="5nr-bs-A4g"/>
<connections>
<outlet property="albumArtist" destination="HNh-tV-Sqi" id="3Bm-Kp-Tyf"/>
<outlet property="albumCoverView" destination="x4m-cJ-Efb" id="KBK-5d-7jT"/>
<outlet property="albumTitle" destination="hz5-e6-wXe" id="tsd-FD-rbX"/>
<outlet property="playAlbumButton" destination="MqK-AJ-gyc" id="05F-91-XS7"/>
<outlet property="addAlbumToQueueButton" destination="Lvw-rf-UJc" id="Zd2-53-Nge"/>
<outlet property="albumCoverView" destination="vMd-mZ-iq2" id="4o4-t9-PUa"/>
<outlet property="albumMetadata" destination="LH5-iT-vfZ" id="yz8-18-akW"/>
<outlet property="albumTitle" destination="EZF-hY-Nqr" id="MNF-am-Xam"/>
<outlet property="albumTracksView" destination="bb3-Ec-blb" id="dR9-t7-87f"/>
<outlet property="playAlbumButton" destination="5gg-Nm-qeI" id="Muh-gW-Ezy"/>
</connections>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="Ru6-mu-Q6h" userLabel="First Responder" customClass="UIResponder" sceneMemberID="firstResponder"/>
</tableViewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="WIp-Eo-GAy" userLabel="First Responder" customClass="UIResponder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="2553.6231884057975" y="138.61607142857142"/>
<point key="canvasLocation" x="2673.913043478261" y="138.61607142857142"/>
</scene>
<!--Tab Bar Controller-->
<scene sceneID="MfI-fd-cqh">
@ -210,7 +274,6 @@
</scenes>
<resources>
<image name="defaultCoverArt" width="128" height="128"/>
<image name="playButtonLarge" width="22" height="22"/>
<image name="square.grid.2x2.fill" catalog="system" width="128" height="114"/>
</resources>
</document>

View File

@ -46,7 +46,7 @@ class AlbumViewController: UICollectionViewController {
}
override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
guard let detailView = segue.destination as? AlbumDetailViewController,
guard let detailView = segue.destination as? AlbumSongListViewController,
let sender = sender as? AlbumItemCell
else { return }

View File

@ -0,0 +1,24 @@
//
// AlbumSongCell.swift
// Persephone
//
// Created by Daniel Barber on 2020-3-30.
// Copyright © 2020 Dan Barber. All rights reserved.
//
import UIKit
class AlbumSongCell: UITableViewCell {
var albumSongItem: AlbumSongItem?
func setSongItem(songItem: AlbumSongItem) {
albumSongItem = songItem
trackNumber.text = songItem.song?.trackNumber
songTitle.text = songItem.song?.title
}
@IBOutlet var trackNumber: UILabel!
@IBOutlet var songTitle: UILabel!
@IBOutlet var songDuration: UILabel!
}

View File

@ -1,39 +1,58 @@
//
// AlbumDetailController.swift
// Persephone-iOS
// AlbumSongListViewController.swift
// Persephone
//
// Created by Daniel Barber on 2020-3-29.
// Created by Daniel Barber on 2020-3-30.
// Copyright © 2020 Dan Barber. All rights reserved.
//
import UIKit
import Kingfisher
class AlbumDetailViewController: UIViewController {
class AlbumSongListViewController: UITableViewController {
var album: Album?
var albumSongs: [Song] = []
var dataSource = AlbumTracksDataSource()
override func viewDidLoad() {
super.viewDidLoad()
albumTracksView.dataSource = dataSource
albumTracksView.layoutMargins = UIEdgeInsets(top: 0, left: 20, bottom: 0, right: 20)
navigationItem.largeTitleDisplayMode = .never
albumCoverView.layer.backgroundColor = UIColor.black.cgColor
albumCoverView.layer.cornerRadius = 4
albumCoverView.layer.borderWidth = 0.5
albumCoverView.layer.masksToBounds = true
playAlbumButton.layer.cornerRadius = 8
addAlbumToQueueButton.layer.cornerRadius = 8
setAppearance()
}
override func viewWillAppear(_ animated: Bool) {
super.viewWillAppear(animated)
guard let album = album else { return }
getAlbumSongs(for: album)
albumTitle.text = album.title
albumArtist.text = album.artist
albumMetadata.text = "\(album.artist) · \(album.date)"
getAlbumSongs(for: album)
var layoutSize = UIView.layoutFittingExpandedSize
layoutSize.width = UIScreen.main.bounds.width
let headerViewSize = albumTracksView.tableHeaderView?
.systemLayoutSizeFitting(
layoutSize,
withHorizontalFittingPriority: .defaultHigh,
verticalFittingPriority: .defaultLow
)
albumTracksView.tableHeaderView?.frame.size = headerViewSize!
}
func setAlbum(_ album: Album?) {
@ -41,24 +60,26 @@ class AlbumDetailViewController: UIViewController {
self.album = album
}
func getAlbumSongs(for album: Album) {
App.mpdClient.getAlbumSongs(for: album.mpdAlbum) { [weak self] (mpdSongs: [MPDClient.MPDSong]) in
guard let self = self else { return }
DispatchQueue.main.async {
self.albumSongs = mpdSongs.map { Song(mpdSong: $0) }
self.dataSource.setAlbumSongs(
mpdSongs.map { Song(mpdSong: $0) }
)
//self.albumTracksView.reloadData()
self.albumTracksView.reloadData()
guard let mpdSong = album.mpdAlbum.firstSong
else { return }
self.getBigCoverArt(song: Song(mpdSong: mpdSong), album: album)
}
}
}
func getBigCoverArt(song: Song, album: Album) {
let provider = MPDAlbumArtImageDataProvider(
songUri: song.mpdSong.uriString,
@ -74,9 +95,11 @@ class AlbumDetailViewController: UIViewController {
]
)
}
override func traitCollectionDidChange(_ previousTraitCollection: UITraitCollection?) {
setAppearance()
@IBAction func playAlbumAction(_ sender: Any) {
guard let album = album else { return }
App.mpdClient.playAlbum(album.mpdAlbum)
}
func setAppearance() {
@ -85,14 +108,18 @@ class AlbumDetailViewController: UIViewController {
albumCoverView.layer.borderColor = darkMode ? CGColor.albumBorderColorDark : CGColor.albumBorderColorLight
}
@IBAction func playAlbumAction(_ sender: Any) {
guard let album = album else { return }
App.mpdClient.playAlbum(album.mpdAlbum)
}
// @IBAction func addAlbumToQueueAction(_ sender: Any) {
// guard let album = album else { return }
//
// let queueLength = App.store.state.queueState.queue.count
//
// App.mpdClient.addAlbumToQueue(album: album.mpdAlbum, at: queueLength)
// }
@IBOutlet var addAlbumToQueueButton: UIButton!
@IBOutlet var playAlbumButton: UIButton!
@IBOutlet var albumCoverView: UIImageView!
@IBOutlet var albumTitle: UILabel!
@IBOutlet var albumArtist: UILabel!
@IBOutlet var albumMetadata: UILabel!
@IBOutlet var albumCoverView: UIImageView!
@IBOutlet var albumTracksView: UITableView!
}

View File

@ -0,0 +1,39 @@
//
// AlbumTracksDataSource.swift
// Persephone
//
// Created by Daniel Barber on 2019/5/19.
// Copyright © 2019 Dan Barber. All rights reserved.
//
import UIKit
class AlbumTracksDataSource: NSObject, UITableViewDataSource {
var albumSongs: [AlbumSongItem] = []
func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
return albumSongs.count
}
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
guard let albumSongCell = tableView.dequeueReusableCell(withIdentifier: "albumSongCell") as? AlbumSongCell
else { return AlbumSongCell() }
albumSongCell.setSongItem(songItem: albumSongs[indexPath.row])
return albumSongCell
}
func setAlbumSongs(_ songs: [Song]) {
var disc: String? = ""
songs.forEach { song in
if song.disc != disc && song.disc != "0" {
disc = song.disc
albumSongs.append(AlbumSongItem(disc: song.disc))
}
albumSongs.append(AlbumSongItem(song: song))
}
}
}

View File

@ -1,17 +1,20 @@
//
// NSSize.swift
// CGSize.swift
// Persephone
//
// Created by Daniel Barber on 1/20/20.
// Copyright © 2020 Dan Barber. All rights reserved.
//
import CoreGraphics
import UIKit
extension CGSize {
static let albumListWidth = (UIScreen.main.bounds.width - 60) / 2
static let albumDetailWidth = UIScreen.main.bounds.width - 40
static let queueSongCoverSize = CGSize(width: 32, height: 32)
static let albumListCoverSize = CGSize(width: 180, height: 180)
static let albumDetailCoverSize = CGSize(width: 500, height: 500)
static let albumListCoverSize = CGSize(width: albumListWidth, height: albumListWidth)
static let albumDetailCoverSize = CGSize(width: albumDetailWidth, height: albumDetailWidth)
static let currentlyPlayingCoverSize = albumDetailCoverSize
static let notificationCoverSize = albumListCoverSize
}