Skip to content

Commit

Permalink
Add music controls, JS for eval and fix player beta
Browse files Browse the repository at this point in the history
Switched support from beta.music.apple.com to music.apple.com.

Added controls for music to the NSMenu.

Added additional JS code and checks.

Added Reset All Settings functionality.
  • Loading branch information
Justin Bush committed Apr 17, 2020
1 parent aaac74b commit 01ad25a
Show file tree
Hide file tree
Showing 14 changed files with 416 additions and 52 deletions.
4 changes: 4 additions & 0 deletions Themes for Music.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
D0E66ADA240EB30F005D93E2 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = D0E66AD9240EB30F005D93E2 /* Assets.xcassets */; };
D0E66ADD240EB30F005D93E2 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = D0E66ADB240EB30F005D93E2 /* Main.storyboard */; };
D0E66AE6240EB37F005D93E2 /* WindowController.swift in Sources */ = {isa = PBXBuildFile; fileRef = D0E66AE5240EB37F005D93E2 /* WindowController.swift */; };
D0EAAFE1244A29680025A36D /* Controls.swift in Sources */ = {isa = PBXBuildFile; fileRef = D0EAAFE0244A29680025A36D /* Controls.swift */; };
/* End PBXBuildFile section */

/* Begin PBXFileReference section */
Expand All @@ -53,6 +54,7 @@
D0E66ADE240EB30F005D93E2 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
D0E66ADF240EB30F005D93E2 /* Themes_for_Music.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = Themes_for_Music.entitlements; sourceTree = "<group>"; };
D0E66AE5240EB37F005D93E2 /* WindowController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WindowController.swift; sourceTree = "<group>"; };
D0EAAFE0244A29680025A36D /* Controls.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Controls.swift; sourceTree = "<group>"; };
/* End PBXFileReference section */

/* Begin PBXFrameworksBuildPhase section */
Expand Down Expand Up @@ -97,6 +99,7 @@
isa = PBXGroup;
children = (
D0319B9A243F8C210046F3FA /* NowPlaying.swift */,
D0EAAFE0244A29680025A36D /* Controls.swift */,
D0319B9B243F8C210046F3FA /* Parser.swift */,
D0319B9C243F8C210046F3FA /* Scripts.swift */,
D020542824118C4B0073121A /* Settings.swift */,
Expand Down Expand Up @@ -238,6 +241,7 @@
D02BA1BA243F986800AEBA82 /* WebCacheCleaner.swift in Sources */,
D04D2F38242929E400246D6C /* Style.swift in Sources */,
D020542924118C4B0073121A /* Settings.swift in Sources */,
D0EAAFE1244A29680025A36D /* Controls.swift in Sources */,
D0319B9E243F8C210046F3FA /* Parser.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
Expand Down
Binary file not shown.
14 changes: 9 additions & 5 deletions Themes for Music/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@ class AppDelegate: NSObject, NSApplicationDelegate {
@IBOutlet weak var toggleLoginMenu: NSMenuItem!

func applicationDidFinishLaunching(_ aNotification: Notification) {
//removeDefaults()
/*
Defaults.reset() // WARNING: RESETS DEFAULTS
Defaults.synchronize()*/
//removeDefaults() // WARNING: RESETS DEFAULTS
//Defaults.reset() // WARNING: RESETS DEFAULTS
//Defaults.synchronize()

let hasLaunched = Defaults.bool(forKey: hasLaunchedKey)
if !hasLaunched { clearDefaults(); Defaults.set(true, forKey: hasLaunchedKey) }
if !debug { debugMenu.isHidden = true }
Expand Down Expand Up @@ -61,8 +61,8 @@ class AppDelegate: NSObject, NSApplicationDelegate {
let hasLaunchedKey = "hasLaunchedBefore1"
let signedIn = Defaults.bool(forKey: "signedIn")
let hideLogo = Defaults.bool(forKey: "hideLogo")
let firstLaunch = Defaults.bool(forKey: "firstLaunch")


/// WARNING: Clears all active UserDefaults: `hideLogo`, `ActiveTheme`
func clearDefaults() {
Defaults.removeObject(forKey: "signedIn")
Expand All @@ -79,6 +79,10 @@ class AppDelegate: NSObject, NSApplicationDelegate {
defaults.removeObject(forKey: key)
}
}
@IBAction func clearUserDefaults(_ sender: Any) {
clearDefaults()
removeDefaults()
}

}

Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
{
"images" : [
{
"filename" : "MenuUpNext.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"appearances" : [
{
"appearance" : "luminosity",
"value" : "dark"
}
],
"filename" : "MenuUpNextDark.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "[email protected]",
"idiom" : "universal",
"scale" : "2x"
},
{
"appearances" : [
{
"appearance" : "luminosity",
"value" : "dark"
}
],
"filename" : "[email protected]",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "[email protected]",
"idiom" : "universal",
"scale" : "3x"
},
{
"appearances" : [
{
"appearance" : "luminosity",
"value" : "dark"
}
],
"filename" : "[email protected]",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 01ad25a

Please sign in to comment.