Skip to content

Commit

Permalink
fix for macos 15
Browse files Browse the repository at this point in the history
  • Loading branch information
zhiayang committed Oct 29, 2024
1 parent 9693a08 commit 8601358
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 35 deletions.
14 changes: 9 additions & 5 deletions MoeStreamer.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
archiveVersion = 1;
classes = {
};
objectVersion = 52;
objectVersion = 54;
objects = {

/* Begin PBXBuildFile section */
Expand Down Expand Up @@ -657,10 +657,11 @@
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CODE_SIGN_ENTITLEMENTS = MoeStreamer/MoeStreamer.entitlements;
CODE_SIGN_IDENTITY = "Apple Development";
"CODE_SIGN_IDENTITY[sdk=macosx*]" = "-";
CODE_SIGN_STYLE = Automatic;
COMBINE_HIDPI_IMAGES = YES;
DEVELOPMENT_ASSET_PATHS = "";
DEVELOPMENT_TEAM = 49F59MY7Q4;
DEVELOPMENT_TEAM = "";
ENABLE_HARDENED_RUNTIME = YES;
ENABLE_PREVIEWS = YES;
FRAMEWORK_SEARCH_PATHS = (
Expand All @@ -673,9 +674,10 @@
"@executable_path/../Frameworks",
);
MACOSX_DEPLOYMENT_TARGET = 10.15;
MARKETING_VERSION = 0.17.13;
MARKETING_VERSION = 0.17.14;
PRODUCT_BUNDLE_IDENTIFIER = com.zhiayang.MoeStreamer;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
SWIFT_OBJC_BRIDGING_HEADER = "";
SWIFT_VERSION = 5.0;
SYSTEM_FRAMEWORK_SEARCH_PATHS = (
Expand All @@ -692,10 +694,11 @@
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CODE_SIGN_ENTITLEMENTS = MoeStreamer/MoeStreamer.entitlements;
CODE_SIGN_IDENTITY = "Apple Development";
"CODE_SIGN_IDENTITY[sdk=macosx*]" = "-";
CODE_SIGN_STYLE = Automatic;
COMBINE_HIDPI_IMAGES = YES;
DEVELOPMENT_ASSET_PATHS = "";
DEVELOPMENT_TEAM = 49F59MY7Q4;
DEVELOPMENT_TEAM = "";
ENABLE_HARDENED_RUNTIME = YES;
ENABLE_PREVIEWS = YES;
FRAMEWORK_SEARCH_PATHS = (
Expand All @@ -708,9 +711,10 @@
"@executable_path/../Frameworks",
);
MACOSX_DEPLOYMENT_TARGET = 10.15;
MARKETING_VERSION = 0.17.13;
MARKETING_VERSION = 0.17.14;
PRODUCT_BUNDLE_IDENTIFIER = com.zhiayang.MoeStreamer;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
SWIFT_OBJC_BRIDGING_HEADER = "";
SWIFT_VERSION = 5.0;
SYSTEM_FRAMEWORK_SEARCH_PATHS = (
Expand Down
2 changes: 2 additions & 0 deletions MoeStreamer/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@
<string>NSApplication</string>
<key>NSSupportsAutomaticTermination</key>
<true/>
<key>NSAppleMusicUsageDescription</key>
<string>For playing music obviously</string>
<key>NSSupportsSuddenTermination</key>
<false/>
</dict>
Expand Down
29 changes: 0 additions & 29 deletions MoeStreamer/src/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -26,40 +26,11 @@ class AppDelegate : NSObject, NSApplicationDelegate
globalMediaKeyHandler.enable(Settings.get(.shouldUseMediaKeys()),
musicCon: self.controller.getModel().controller())

/*
// register the sleep handler, so we pause on sleep.
NSWorkspace.shared.notificationCenter.addObserver(self, selector: #selector(AppDelegate.onSleep),
name: NSWorkspace.willSleepNotification, object: nil)

NSWorkspace.shared.notificationCenter.addObserver(self, selector: #selector(AppDelegate.onWake),
name: NSWorkspace.didWakeNotification, object: nil)
*/
DispatchQueue.main.asyncAfter(deadline: .now() + 0.2) {
self.controller.showPopover()
}
}
/*
@objc func onSleep()
{
Logger.log(msg: "pausing playback due to sleep")
self.wasPlayingWhenSlept = self.controller.getModel().isPlaying

self.controller.getModel().isPlaying = false
self.controller.getModel().poke()
}

@objc func onWake()
{
if self.wasPlayingWhenSlept && Settings.get(.shouldResumeOnWake())
{
self.wasPlayingWhenSlept = false
Logger.log(msg: "resuming playback")

self.controller.getModel().isPlaying = true
self.controller.getModel().poke()
}
}
*/
func applicationWillTerminate(_ aNotification: Notification)
{
globalMediaKeyHandler.enable(false, musicCon: self.controller.getModel().controller())
Expand Down
2 changes: 1 addition & 1 deletion MoeStreamer/src/backends/itunes/LocalMusic.swift
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ class LocalMusicController : ServiceController

required init(viewModel: ViewModel?)
{
self.library = try! ITLibrary(apiVersion: "1.0")
self.library = try! ITLibrary(apiVersion: "1.1")
self.shuffleBehaviour = Settings.getKE(.localMusicShuffle())
self.viewModel = viewModel

Expand Down
2 changes: 2 additions & 0 deletions MoeStreamer/src/ui/ViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,7 @@ class ViewController : NSObject, NSPopoverDelegate
self.popover.show(relativeTo: statusBarButton.bounds, of: statusBarButton,
preferredEdge: NSRectEdge.minY)
self.popover.contentViewController?.view.window?.makeKey()
self.becomeFirstResponder()
}

func closePopover(sender: AnyObject?)
Expand Down Expand Up @@ -242,6 +243,7 @@ class CustomPopover : NSPopover

override func keyDown(with event: NSEvent)
{
print("key went down bitch")
self.keydownHandler?(event)
}
}

0 comments on commit 8601358

Please sign in to comment.