Hopefully fix compatibility with systems older than 10.12.1

CQTexperiment
Christopher Snowhill 2019-11-14 19:16:43 -08:00
parent 09777d4554
commit 2476f8827d
3 changed files with 14 additions and 12 deletions

View File

@ -37,9 +37,9 @@
options:NSKeyValueObservingOptionNew
context:nil];
MPRemoteCommandCenter *remoteCommandCenter = [MPRemoteCommandCenter sharedCommandCenter];
if (remoteCommandCenter) {
if (NSClassFromString(@"MPRemoteCommandCenter")) {
MPRemoteCommandCenter *remoteCommandCenter = [MPRemoteCommandCenter sharedCommandCenter];
[remoteCommandCenter.playCommand setEnabled:YES];
[remoteCommandCenter.pauseCommand setEnabled:YES];
[remoteCommandCenter.togglePlayPauseCommand setEnabled:YES];

View File

@ -622,9 +622,9 @@ NSDictionary * makeRGInfo(PlaylistEntry *pe)
}
- (void)sendMetaData {
MPNowPlayingInfoCenter * defaultCenter = [MPNowPlayingInfoCenter defaultCenter];
if (defaultCenter) {
if (NSClassFromString(@"MPNowPlayingInfoCenter")) {
MPNowPlayingInfoCenter * defaultCenter = [MPNowPlayingInfoCenter defaultCenter];
PlaylistEntry * entry = [playlistController currentEntry];
NSMutableDictionary *songInfo = [[NSMutableDictionary alloc] init];
@ -641,14 +641,14 @@ NSDictionary * makeRGInfo(PlaylistEntry *pe)
}
if (playbackStatus == kCogStatusPlaying) {
[MPNowPlayingInfoCenter defaultCenter].playbackState = MPNowPlayingPlaybackStatePlaying;
defaultCenter.playbackState = MPNowPlayingPlaybackStatePlaying;
} else if (playbackStatus == kCogStatusPaused) {
[MPNowPlayingInfoCenter defaultCenter].playbackState = MPNowPlayingPlaybackStatePaused;
defaultCenter.playbackState = MPNowPlayingPlaybackStatePaused;
} else {
[MPNowPlayingInfoCenter defaultCenter].playbackState = MPNowPlayingPlaybackStateStopped;
defaultCenter.playbackState = MPNowPlayingPlaybackStateStopped;
}
[[MPNowPlayingInfoCenter defaultCenter] setNowPlayingInfo:songInfo];
[defaultCenter setNowPlayingInfo:songInfo];
}
}

View File

@ -174,7 +174,6 @@
838491881808593200E7332D /* NDHotKey.framework in CopyFiles */ = {isa = PBXBuildFile; fileRef = 8384917E1808585D00E7332D /* NDHotKey.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, ); }; };
8399D4E21805A55000B503B1 /* XmlContainer.m in Sources */ = {isa = PBXBuildFile; fileRef = 8399D4E01805A55000B503B1 /* XmlContainer.m */; };
83A360B220E4E81D00192DAB /* Flac.bundle in CopyFiles */ = {isa = PBXBuildFile; fileRef = 8303A30C20E4E3D000951EF8 /* Flac.bundle */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
83AB903E237CEFD300A433D5 /* MediaPlayer.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 83AB9031237CEFD300A433D5 /* MediaPlayer.framework */; };
83B06704180D579E008E3612 /* MIDI.bundle in CopyFiles */ = {isa = PBXBuildFile; fileRef = 83B066A1180D5669008E3612 /* MIDI.bundle */; settings = {ATTRIBUTES = (CodeSignOnCopy, ); }; };
83BC5AB220E4C87100631CD4 /* DualWindow.m in Sources */ = {isa = PBXBuildFile; fileRef = 83BC5AB020E4C87100631CD4 /* DualWindow.m */; };
83BC5ABF20E4CE7A00631CD4 /* InfoInspector.xib in Resources */ = {isa = PBXBuildFile; fileRef = 17D1B0D00F6320EA00694C57 /* InfoInspector.xib */; };
@ -1071,7 +1070,6 @@
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
83AB903E237CEFD300A433D5 /* MediaPlayer.framework in Frameworks */,
83E6B7651816178200D4576D /* Sparkle.framework in Frameworks */,
838491871808591F00E7332D /* NDHotKey.framework in Frameworks */,
8355D6B8180613FB00D05687 /* Security.framework in Frameworks */,
@ -2863,6 +2861,8 @@
OTHER_LDFLAGS = (
"-weak_framework",
CogAudio,
"-weak_framework",
MediaPlayer,
"-undefined",
dynamic_lookup,
);
@ -2900,6 +2900,8 @@
OTHER_LDFLAGS = (
"-weak_framework",
CogAudio,
"-weak_framework",
MediaPlayer,
"-undefined",
dynamic_lookup,
);