Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 0 additions & 15 deletions Mac/Components/Browser/Album Detail/AlbumTracksDataSource.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
6 changes: 3 additions & 3 deletions Mac/Components/Shared/Extensions/CGColor.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
// Copyright © 2019 Dan Barber. All rights reserved.
//

import AppKit
import CoreGraphics

extension CGColor {
static let albumBorderColorLight = NSColor.black.withAlphaComponent(0.15).cgColor
static let albumBorderColorDark = NSColor.white.withAlphaComponent(0.15).cgColor
static let albumBorderColorLight = CGColor.black.copy(alpha: 0.15)
static let albumBorderColorDark = CGColor.white.copy(alpha: 0.15)
}
38 changes: 19 additions & 19 deletions Mac/Components/Window/Base.lproj/Main.storyboard

Large diffs are not rendered by default.

242 changes: 234 additions & 8 deletions Persephone.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1220"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "E411C26C241C10F0008B9682"
BuildableName = "Persephone.app"
BlueprintName = "Persephone-iOS"
ReferencedContainer = "container:Persephone.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
<TestableReference
skipped = "NO">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "E411C281241C10F5008B9682"
BuildableName = "Persephone-iOSTests.xctest"
BlueprintName = "Persephone-iOSTests"
ReferencedContainer = "container:Persephone.xcodeproj">
</BuildableReference>
</TestableReference>
<TestableReference
skipped = "NO">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "E411C28C241C10F5008B9682"
BuildableName = "Persephone-iOSUITests.xctest"
BlueprintName = "Persephone-iOSUITests"
ReferencedContainer = "container:Persephone.xcodeproj">
</BuildableReference>
</TestableReference>
</Testables>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
allowLocationSimulation = "YES">
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "E411C26C241C10F0008B9682"
BuildableName = "Persephone.app"
BlueprintName = "Persephone-iOS"
ReferencedContainer = "container:Persephone.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES">
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "E411C26C241C10F0008B9682"
BuildableName = "Persephone.app"
BlueprintName = "Persephone-iOS"
ReferencedContainer = "container:Persephone.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>
Binary file added Resources/export/iOS-1024x1024.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Resources/export/iOS-120x120.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Resources/export/iOS-152x152.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Resources/export/iOS-167x167.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Resources/export/iOS-180x180.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Resources/export/iOS-20x20.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Resources/export/iOS-29x29.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Resources/export/iOS-40x40.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Resources/export/iOS-58x58.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Resources/export/iOS-60x60.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Resources/export/iOS-76x76.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Resources/export/iOS-80x80.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Resources/export/iOS-87x87.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Resources/export/iosAppIcon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Resources/export/iosAppIcon@2x.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Resources/export/nextTrackButtonHugeiOS.pdf
Binary file not shown.
Binary file added Resources/export/nextTrackButtonHugeiOS.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Resources/export/nextTrackButtonHugeiOS@2x.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Resources/export/nextTrackButtonHugeiOS@3x.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Resources/export/nextTrackButtonLarge.pdf
Binary file not shown.
Binary file added Resources/export/nextTrackButtonLarge.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Resources/export/nextTrackButtonLarge@2x.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Resources/export/nextTrackButtonLarge@3x.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Resources/export/nextTrackButtonLargeiOS.pdf
Binary file not shown.
Binary file added Resources/export/nextTrackButtonLargeiOS.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Resources/export/nextTrackButtonLargeiOS@2x.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Resources/export/nextTrackButtonLargeiOS@3x.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Resources/export/pauseButtonHugeiOS.pdf
Binary file not shown.
Binary file added Resources/export/pauseButtonHugeiOS.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Resources/export/pauseButtonHugeiOS@2x.png
Binary file added Resources/export/pauseButtonHugeiOS@3x.png
Binary file added Resources/export/pauseButtonLargeiOS.pdf
Binary file not shown.
Binary file added Resources/export/pauseButtonLargeiOS.png
Binary file added Resources/export/pauseButtonLargeiOS@2x.png
Binary file added Resources/export/pauseButtonLargeiOS@3x.png
Binary file added Resources/export/playButtonHugeiOS.pdf
Binary file not shown.
Binary file added Resources/export/playButtonHugeiOS.png
Binary file added Resources/export/playButtonHugeiOS@2x.png
Binary file added Resources/export/playButtonHugeiOS@3x.png
Binary file modified Resources/export/playButtonLarge.pdf
Binary file not shown.
Binary file modified Resources/export/playButtonLarge.png
Binary file modified Resources/export/playButtonLarge@2x.png
Binary file added Resources/export/playButtonLarge@3x.png
Binary file added Resources/export/playButtonLargeiOS.pdf
Binary file not shown.
Binary file added Resources/export/playButtonLargeiOS.png
Binary file added Resources/export/playButtonLargeiOS@2x.png
Binary file added Resources/export/playButtonLargeiOS@3x.png
Binary file added Resources/export/prevTrackButtonHugeiOS.pdf
Binary file not shown.
Binary file added Resources/export/prevTrackButtonHugeiOS.png
Binary file added Resources/export/prevTrackButtonHugeiOS@2x.png
Binary file modified Resources/icons.sketch
Binary file not shown.
4 changes: 3 additions & 1 deletion Shared/Controllers/MPDServerController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,10 @@ class MPDServerController {
func connect() {
let mpdServer = App.store.state.preferencesState.mpdServer

guard let host = mpdServer.hostOrDefault else { return }

App.mpdClient.connect(
host: mpdServer.hostOrDefault,
host: host,
port: mpdServer.portOrDefault
)
}
Expand Down
15 changes: 8 additions & 7 deletions Shared/MPDClient/Extensions/MPDClient+Album.swift
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ extension MPDClient {
func albums(filter: String) {
var albums: [MPDAlbum] = []

mpd_search_db_songs(self.connection, false)
mpd_search_db_songs(connection, false)
if filter != "" {
let escapedFilter = filter.replacingOccurrences(of: "'", with: "\\'")

Expand All @@ -66,11 +66,12 @@ extension MPDClient {
"(any contains '\(escapedFilter)')"
)
}
mpd_search_add_tag_constraint(self.connection, MPD_OPERATOR_DEFAULT, MPD_TAG_TRACK, "1")
mpd_search_add_tag_constraint(connection, MPD_OPERATOR_DEFAULT, MPD_TAG_TRACK, "1")
mpd_search_add_sort_tag(connection, MPD_TAG_ALBUM_ARTIST_SORT, false)

mpd_search_commit(self.connection)

while let song = mpd_recv_song(self.connection) {
while let song = mpd_recv_song(connection) {
let mpdSong = MPDSong(song)

let mpdAlbum = MPDAlbum(
Expand All @@ -92,10 +93,10 @@ extension MPDClient {

var firstSong: MPDSong?

mpd_search_db_songs(self.connection, true)
mpd_search_add_tag_constraint(self.connection, MPD_OPERATOR_DEFAULT, MPD_TAG_ALBUM, album.title)
mpd_search_add_tag_constraint(self.connection, MPD_OPERATOR_DEFAULT, MPD_TAG_ALBUM_ARTIST, album.artist)
mpd_search_add_tag_constraint(self.connection, MPD_OPERATOR_DEFAULT, MPD_TAG_TRACK, "1")
mpd_search_db_songs(connection, true)
mpd_search_add_tag_constraint(connection, MPD_OPERATOR_DEFAULT, MPD_TAG_ALBUM, album.title)
mpd_search_add_tag_constraint(connection, MPD_OPERATOR_DEFAULT, MPD_TAG_ALBUM_ARTIST, album.artist)
mpd_search_add_tag_constraint(connection, MPD_OPERATOR_DEFAULT, MPD_TAG_TRACK, "1")

mpd_search_commit(self.connection)

Expand Down
16 changes: 9 additions & 7 deletions Shared/MPDClient/Extensions/MPDClient+Connection.swift
Original file line number Diff line number Diff line change
Expand Up @@ -35,19 +35,21 @@ extension MPDClient {

self.delegate?.willDisconnect(mpdClient: self)

mpd_connection_free(self.connection)
self.isConnected = false
mpd_connection_free(self.connection)
self.isConnected = false
}

func connect(host: String, port: Int) {
let commandOperation = BlockOperation() { [unowned self] in
self.sendCommand(command: .connect, userData: ["host": host, "port": port])
if !isConnected {
let commandOperation = BlockOperation() { [unowned self] in
self.sendCommand(command: .connect, userData: ["host": host, "port": port])

if self.isConnected {
self.idle()
if self.isConnected {
self.idle()
}
}
commandQueue.addOperation(commandOperation)
}
commandQueue.addOperation(commandOperation)
}

func disconnect() {
Expand Down
24 changes: 24 additions & 0 deletions Shared/Models/AlbumSongItem.swift
Original file line number Diff line number Diff line change
@@ -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
}
}
9 changes: 7 additions & 2 deletions Shared/Models/MPDServer.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,17 @@
//

struct MPDServer {
let hostDefault = "127.0.0.1"
#if os(macOS)
let hostDefault: String? = "127.0.0.1"
#else
let hostDefault: String? = nil
#endif

let portDefault = 6600

var host: String?

var hostOrDefault: String {
var hostOrDefault: String? {
return host ?? hostDefault
}

Expand Down
4 changes: 4 additions & 0 deletions Shared/Models/Time.swift
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,8 @@ struct Time {

return formatter.string(from: TimeInterval(timeInSeconds))!
}

var hours: Int { timeInSeconds / 3600 }

var minutes: Int { timeInSeconds % 3600 / 60 }
}
1 change: 0 additions & 1 deletion iOS/App.swift
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import ReSwift
struct App {
static let store = Store<AppState>(reducer: appReducer, state: nil)
static let trackTimer = TrackTimer()
//static let userNotificationsController = UserNotificationsController()
static let mpdServerDelegate = MPDServerDelegate()
static let mpdServerController = MPDServerController(delegate: mpdServerDelegate)
static var mpdClient: MPDClient!
Expand Down
116 changes: 116 additions & 0 deletions iOS/Assets.xcassets/AppIcon.appiconset/Contents.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,116 @@
{
"images" : [
{
"filename" : "iOS-40x40-1.png",
"idiom" : "iphone",
"scale" : "2x",
"size" : "20x20"
},
{
"filename" : "iOS-60x60.png",
"idiom" : "iphone",
"scale" : "3x",
"size" : "20x20"
},
{
"filename" : "iOS-58x58-1.png",
"idiom" : "iphone",
"scale" : "2x",
"size" : "29x29"
},
{
"filename" : "iOS-87x87.png",
"idiom" : "iphone",
"scale" : "3x",
"size" : "29x29"
},
{
"filename" : "iOS-80x80.png",
"idiom" : "iphone",
"scale" : "2x",
"size" : "40x40"
},
{
"filename" : "iOS-120x120.png",
"idiom" : "iphone",
"scale" : "3x",
"size" : "40x40"
},
{
"filename" : "iOS-120x120-1.png",
"idiom" : "iphone",
"scale" : "2x",
"size" : "60x60"
},
{
"filename" : "iOS-180x180.png",
"idiom" : "iphone",
"scale" : "3x",
"size" : "60x60"
},
{
"filename" : "iOS-20x20.png",
"idiom" : "ipad",
"scale" : "1x",
"size" : "20x20"
},
{
"filename" : "iOS-40x40.png",
"idiom" : "ipad",
"scale" : "2x",
"size" : "20x20"
},
{
"filename" : "iOS-29x29.png",
"idiom" : "ipad",
"scale" : "1x",
"size" : "29x29"
},
{
"filename" : "iOS-58x58.png",
"idiom" : "ipad",
"scale" : "2x",
"size" : "29x29"
},
{
"filename" : "iOS-40x40-2.png",
"idiom" : "ipad",
"scale" : "1x",
"size" : "40x40"
},
{
"filename" : "iOS-80x80-1.png",
"idiom" : "ipad",
"scale" : "2x",
"size" : "40x40"
},
{
"filename" : "iOS-76x76.png",
"idiom" : "ipad",
"scale" : "1x",
"size" : "76x76"
},
{
"filename" : "iOS-152x152.png",
"idiom" : "ipad",
"scale" : "2x",
"size" : "76x76"
},
{
"filename" : "iOS-167x167.png",
"idiom" : "ipad",
"scale" : "2x",
"size" : "83.5x83.5"
},
{
"filename" : "iOS-1024x1024.png",
"idiom" : "ios-marketing",
"scale" : "1x",
"size" : "1024x1024"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
6 changes: 6 additions & 0 deletions iOS/Assets.xcassets/Contents.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"info" : {
"author" : "xcode",
"version" : 1
}
}
Loading