-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
2e1d4d7
commit 21c053c
Showing
17 changed files
with
270 additions
and
492 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
enum MusicApplication { | ||
static let bundleID = "com.apple.Music" | ||
static let app: SBMusicApplication? = SBApplicationManager.musicApp() | ||
|
||
static func getPlayerState() -> PlayerState? { | ||
guard let app = app else { return nil } | ||
return PlayerState(.music, app) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
enum PlaybackState { | ||
case paused | ||
case playing | ||
case stopped | ||
|
||
init(_ state: String) { | ||
switch state { | ||
case "Paused": | ||
self = .paused | ||
case "Playing": | ||
self = .playing | ||
default: | ||
self = .stopped | ||
} | ||
} | ||
|
||
init(_ state: SBMusicEPlS) { | ||
switch state { | ||
case SBMusicEPlSPaused: | ||
self = .paused | ||
case SBMusicEPlSRewinding, SBMusicEPlSPlaying, SBMusicEPlSFastForwarding: | ||
self = .playing | ||
default: | ||
self = .stopped | ||
} | ||
} | ||
|
||
init(_ state: SBSpotifyEPlS) { | ||
switch state { | ||
case SBSpotifyEPlSPaused: | ||
self = .paused | ||
case SBSpotifyEPlSPlaying: | ||
self = .playing | ||
default: | ||
self = .stopped | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
enum Player { | ||
case music, spotify | ||
} |
Oops, something went wrong.