Skip to content

Commit

Permalink
Finally get things working again
Browse files Browse the repository at this point in the history
  • Loading branch information
jonathangarelick committed May 7, 2024
1 parent 2e1d4d7 commit 21c053c
Show file tree
Hide file tree
Showing 17 changed files with 270 additions and 492 deletions.
58 changes: 23 additions & 35 deletions SoundSeer.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,10 @@
/* Begin PBXBuildFile section */
9B1461312BD08573009C931B /* ScriptingBridge.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9B1461302BD08573009C931B /* ScriptingBridge.framework */; };
9B1486722BD475DA00D67669 /* WindowAccessor.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9B1486712BD475DA00D67669 /* WindowAccessor.swift */; };
9B1B0F912BE59C3800E26B26 /* PlayerStateNotification.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9B1B0F902BE59C3800E26B26 /* PlayerStateNotification.swift */; };
9B1B0F962BE5A57800E26B26 /* PlayerState.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9B1B0F952BE5A57800E26B26 /* PlayerState.swift */; };
9B1B0F992BE5AE8300E26B26 /* UtilsTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9B1B0F982BE5AE8300E26B26 /* UtilsTests.swift */; };
9B1B0F912BE59C3800E26B26 /* PlayerState.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9B1B0F902BE59C3800E26B26 /* PlayerState.swift */; };
9B1B0F962BE5A57800E26B26 /* PlaybackState.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9B1B0F952BE5A57800E26B26 /* PlaybackState.swift */; };
9B27558A2BE960D60007E18B /* Secrets.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9B2755892BE960D60007E18B /* Secrets.swift */; };
9B55030B2BD5F49C0005BEBD /* StringExtensionTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9B55030A2BD5F49C0005BEBD /* StringExtensionTests.swift */; };
9BA047082BE9A7D700AF3F34 /* Application.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9BA047072BE9A7D700AF3F34 /* Application.swift */; };
9BA047212BE9BBA000AF3F34 /* SpotifyApplication.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9BA047202BE9BBA000AF3F34 /* SpotifyApplication.swift */; };
9BA047252BE9BE5700AF3F34 /* MusicApplication.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9BA047242BE9BE5700AF3F34 /* MusicApplication.swift */; };
9BAEAE9F2BDAE2C400C85936 /* LoggerExtension.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9BAEAE9E2BDAE2C400C85936 /* LoggerExtension.swift */; };
Expand All @@ -24,12 +22,13 @@
9BC6A9822BE7F4400069726E /* SwiftJWT in Frameworks */ = {isa = PBXBuildFile; productRef = 9BC6A9812BE7F4400069726E /* SwiftJWT */; };
9BC6B6872BCA2CDF005421AE /* Alamofire in Frameworks */ = {isa = PBXBuildFile; productRef = 9BC6B6862BCA2CDF005421AE /* Alamofire */; };
9BC6B6892BCA2D49005421AE /* SpotifyAPI.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9BC6B6882BCA2D49005421AE /* SpotifyAPI.swift */; };
9BD4DCE22BC9E9D4001572F7 /* PlayerModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9BD4DCE12BC9E9D4001572F7 /* PlayerModel.swift */; };
9BD4DCE42BC9EC8B001572F7 /* PlayerViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9BD4DCE32BC9EC8B001572F7 /* PlayerViewModel.swift */; };
9BD4DCE22BC9E9D4001572F7 /* SoundSeerModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9BD4DCE12BC9E9D4001572F7 /* SoundSeerModel.swift */; };
9BD4DCE42BC9EC8B001572F7 /* SoundSeerViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9BD4DCE32BC9EC8B001572F7 /* SoundSeerViewModel.swift */; };
9BE2FA1C2BC97CCC00A7124B /* SoundSeerApp.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9BE2FA1B2BC97CCC00A7124B /* SoundSeerApp.swift */; };
9BE2FA202BC97CCD00A7124B /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 9BE2FA1F2BC97CCD00A7124B /* Assets.xcassets */; };
9BEB2DDB2BD1C02E0038E223 /* StringExtension.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9BEB2DDA2BD1C02E0038E223 /* StringExtension.swift */; };
9BF013C22BEA75010082457D /* SBApplicationManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 9BF013C12BEA75010082457D /* SBApplicationManager.m */; };
9BF013C52BEA86280082457D /* Player.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9BF013C42BEA86280082457D /* Player.swift */; };
/* End PBXBuildFile section */

/* Begin PBXContainerItemProxy section */
Expand All @@ -45,14 +44,12 @@
/* Begin PBXFileReference section */
9B1461302BD08573009C931B /* ScriptingBridge.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = ScriptingBridge.framework; path = System/Library/Frameworks/ScriptingBridge.framework; sourceTree = SDKROOT; };
9B1486712BD475DA00D67669 /* WindowAccessor.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WindowAccessor.swift; sourceTree = "<group>"; };
9B1B0F902BE59C3800E26B26 /* PlayerStateNotification.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PlayerStateNotification.swift; sourceTree = "<group>"; };
9B1B0F952BE5A57800E26B26 /* PlayerState.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PlayerState.swift; sourceTree = "<group>"; };
9B1B0F982BE5AE8300E26B26 /* UtilsTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UtilsTests.swift; sourceTree = "<group>"; };
9B1B0F902BE59C3800E26B26 /* PlayerState.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PlayerState.swift; sourceTree = "<group>"; };
9B1B0F952BE5A57800E26B26 /* PlaybackState.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PlaybackState.swift; sourceTree = "<group>"; };
9B258F2D2BDF193100DC5EE2 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
9B2755892BE960D60007E18B /* Secrets.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Secrets.swift; sourceTree = "<group>"; };
9B5503012BD5F22E0005BEBD /* SoundSeerTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = SoundSeerTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
9B55030A2BD5F49C0005BEBD /* StringExtensionTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = StringExtensionTests.swift; sourceTree = "<group>"; };
9BA047072BE9A7D700AF3F34 /* Application.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Application.swift; sourceTree = "<group>"; };
9BA047132BE9ADC000AF3F34 /* SBSpotify.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SBSpotify.h; sourceTree = "<group>"; };
9BA047142BE9ADE400AF3F34 /* Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Bridging-Header.h"; sourceTree = "<group>"; };
9BA0471D2BE9B83600AF3F34 /* SBMusic.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SBMusic.h; sourceTree = "<group>"; };
Expand All @@ -63,15 +60,16 @@
9BC6A97C2BE7F1FC0069726E /* MusicAPI.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MusicAPI.swift; sourceTree = "<group>"; };
9BC6A97E2BE7F2080069726E /* PlayerAPI.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PlayerAPI.swift; sourceTree = "<group>"; };
9BC6B6882BCA2D49005421AE /* SpotifyAPI.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SpotifyAPI.swift; sourceTree = "<group>"; };
9BD4DCE12BC9E9D4001572F7 /* PlayerModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PlayerModel.swift; sourceTree = "<group>"; };
9BD4DCE32BC9EC8B001572F7 /* PlayerViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PlayerViewModel.swift; sourceTree = "<group>"; };
9BD4DCE12BC9E9D4001572F7 /* SoundSeerModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SoundSeerModel.swift; sourceTree = "<group>"; };
9BD4DCE32BC9EC8B001572F7 /* SoundSeerViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SoundSeerViewModel.swift; sourceTree = "<group>"; };
9BE2FA182BC97CCC00A7124B /* SoundSeer.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = SoundSeer.app; sourceTree = BUILT_PRODUCTS_DIR; };
9BE2FA1B2BC97CCC00A7124B /* SoundSeerApp.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SoundSeerApp.swift; sourceTree = "<group>"; };
9BE2FA1F2BC97CCD00A7124B /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
9BE2FA242BC97CCD00A7124B /* SoundSeer.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = SoundSeer.entitlements; sourceTree = "<group>"; };
9BEB2DDA2BD1C02E0038E223 /* StringExtension.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = StringExtension.swift; sourceTree = "<group>"; };
9BF013C12BEA75010082457D /* SBApplicationManager.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SBApplicationManager.m; sourceTree = "<group>"; };
9BF013C32BEA76560082457D /* SBApplicationManager.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SBApplicationManager.h; sourceTree = "<group>"; };
9BF013C42BEA86280082457D /* Player.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Player.swift; sourceTree = "<group>"; };
/* End PBXFileReference section */

/* Begin PBXFrameworksBuildPhase section */
Expand Down Expand Up @@ -106,8 +104,11 @@
9B1B0F972BE5A5B800E26B26 /* Models */ = {
isa = PBXGroup;
children = (
9BD4DCE12BC9E9D4001572F7 /* PlayerModel.swift */,
9B1B0F902BE59C3800E26B26 /* PlayerStateNotification.swift */,
9BA047242BE9BE5700AF3F34 /* MusicApplication.swift */,
9B1B0F952BE5A57800E26B26 /* PlaybackState.swift */,
9BF013C42BEA86280082457D /* Player.swift */,
9B1B0F902BE59C3800E26B26 /* PlayerState.swift */,
9BA047202BE9BBA000AF3F34 /* SpotifyApplication.swift */,
);
path = Models;
sourceTree = "<group>";
Expand All @@ -126,7 +127,6 @@
isa = PBXGroup;
children = (
9B55030A2BD5F49C0005BEBD /* StringExtensionTests.swift */,
9B1B0F982BE5AE8300E26B26 /* UtilsTests.swift */,
);
path = SoundSeerTests;
sourceTree = "<group>";
Expand Down Expand Up @@ -176,32 +176,21 @@
isa = PBXGroup;
children = (
9B2755882BE95E9A0007E18B /* API */,
9BFF831D2BE9BEDA0030B722 /* Application */,
9BE2FA1F2BC97CCD00A7124B /* Assets.xcassets */,
9BAEAEA22BDAE8AD00C85936 /* ScriptingBridge */,
9BAEAEA32BDAE8D000C85936 /* Extensions */,
9B258F2D2BDF193100DC5EE2 /* Info.plist */,
9B1B0F972BE5A5B800E26B26 /* Models */,
9B1B0F952BE5A57800E26B26 /* PlayerState.swift */,
9BD4DCE32BC9EC8B001572F7 /* PlayerViewModel.swift */,
9BAEAEA22BDAE8AD00C85936 /* ScriptingBridge */,
9B2755892BE960D60007E18B /* Secrets.swift */,
9BE2FA1B2BC97CCC00A7124B /* SoundSeerApp.swift */,
9BD4DCE12BC9E9D4001572F7 /* SoundSeerModel.swift */,
9BD4DCE32BC9EC8B001572F7 /* SoundSeerViewModel.swift */,
9BAEAEA02BDAE6F200C85936 /* Utils.swift */,
9B1486712BD475DA00D67669 /* WindowAccessor.swift */,
);
path = SoundSeer;
sourceTree = "<group>";
};
9BFF831D2BE9BEDA0030B722 /* Application */ = {
isa = PBXGroup;
children = (
9BA047072BE9A7D700AF3F34 /* Application.swift */,
9BA047242BE9BE5700AF3F34 /* MusicApplication.swift */,
9BA047202BE9BBA000AF3F34 /* SpotifyApplication.swift */,
);
path = Application;
sourceTree = "<group>";
};
/* End PBXGroup section */

/* Begin PBXNativeTarget section */
Expand Down Expand Up @@ -311,7 +300,6 @@
buildActionMask = 2147483647;
files = (
9B55030B2BD5F49C0005BEBD /* StringExtensionTests.swift in Sources */,
9B1B0F992BE5AE8300E26B26 /* UtilsTests.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand All @@ -320,21 +308,21 @@
buildActionMask = 2147483647;
files = (
9B27558A2BE960D60007E18B /* Secrets.swift in Sources */,
9BA047082BE9A7D700AF3F34 /* Application.swift in Sources */,
9BC6A97F2BE7F2080069726E /* PlayerAPI.swift in Sources */,
9B1B0F912BE59C3800E26B26 /* PlayerStateNotification.swift in Sources */,
9B1B0F912BE59C3800E26B26 /* PlayerState.swift in Sources */,
9BE2FA1C2BC97CCC00A7124B /* SoundSeerApp.swift in Sources */,
9BD4DCE22BC9E9D4001572F7 /* PlayerModel.swift in Sources */,
9BD4DCE22BC9E9D4001572F7 /* SoundSeerModel.swift in Sources */,
9BF013C22BEA75010082457D /* SBApplicationManager.m in Sources */,
9BA047212BE9BBA000AF3F34 /* SpotifyApplication.swift in Sources */,
9BAEAEA12BDAE6F200C85936 /* Utils.swift in Sources */,
9BA047252BE9BE5700AF3F34 /* MusicApplication.swift in Sources */,
9B1486722BD475DA00D67669 /* WindowAccessor.swift in Sources */,
9BEB2DDB2BD1C02E0038E223 /* StringExtension.swift in Sources */,
9BD4DCE42BC9EC8B001572F7 /* PlayerViewModel.swift in Sources */,
9B1B0F962BE5A57800E26B26 /* PlayerState.swift in Sources */,
9BD4DCE42BC9EC8B001572F7 /* SoundSeerViewModel.swift in Sources */,
9B1B0F962BE5A57800E26B26 /* PlaybackState.swift in Sources */,
9BAEAE9F2BDAE2C400C85936 /* LoggerExtension.swift in Sources */,
9BC6A97D2BE7F1FC0069726E /* MusicAPI.swift in Sources */,
9BF013C52BEA86280082457D /* Player.swift in Sources */,
9BC6B6892BCA2D49005421AE /* SpotifyAPI.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
Expand Down
11 changes: 0 additions & 11 deletions SoundSeer/Application/Application.swift

This file was deleted.

58 changes: 0 additions & 58 deletions SoundSeer/Application/MusicApplication.swift

This file was deleted.

62 changes: 0 additions & 62 deletions SoundSeer/Application/SpotifyApplication.swift

This file was deleted.

9 changes: 9 additions & 0 deletions SoundSeer/Models/MusicApplication.swift
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)
}
}
38 changes: 38 additions & 0 deletions SoundSeer/Models/PlaybackState.swift
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
}
}
}
3 changes: 3 additions & 0 deletions SoundSeer/Models/Player.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
enum Player {
case music, spotify
}
Loading

0 comments on commit 21c053c

Please sign in to comment.