Replace iTunes references with Music (fixes #40) - #49
Open
timokox wants to merge 1 commit into
Open
Conversation
iTunes was renamed to Music in macOS 10.15, which is Jiggler's minimum deployment target. Update the running-app check, AppleScript target, and com.apple.iTunes.playerInfo distributed notification to use Music and its com.apple.Music bundle id. Rename internal identifiers (iTunesIsPlaying, onlyWithITunesPlaying, methods, IB outlet, action) for consistency, and update the Preferences UI label. The OnlyWithITunesPlaying NSUserDefaults key string is retained so existing users' stored preferences continue to work.
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #40.
iTunes was renamed to Music in macOS 10.15, which is Jiggler's minimum deployment target (
MACOSX_DEPLOYMENT_TARGET = 10.15), so iTunes is never present on any supported version. The previous code was sending AppleEvents toiTunes, registering forcom.apple.iTunes.playerInfo, and matching the running-app bundle idcom.apple.iTunes, none of which can succeed.Changes
AppDelegate.mcom.apple.iTunes.playerInfo→com.apple.Music.playerInfoiTunes/bundle idcom.apple.iTunes→Music/com.apple.Musictell application "iTunes"→tell application "Music"iTunesIsPlaying,iTunesIsRunningNow,iTunesIsPlayingNow,iTunesChanged:,onlyWithITunesPlaying,onlyWithITunesPlayingCheckbox,onlyWithITunesPlayingChanged:,OnlyWithITunesPlayingDefaultsKey(C identifier only) →music…/Music…equivalents.Base.lproj/Preferences.xib: button titleiTunes is currently playing music…→Music is currently playing…, plus matching outlet/action names.Backwards compatibility
The
NSUserDefaultskey string literal is deliberately left as@"OnlyWithITunesPlaying"(only the C identifier is renamed), so existing users' stored preferences continue to be honoured. A comment notes this.Notes
player stateproperty still returns thekPSPfour-char code for "playing" in Music.app — no change needed there.