Skip to content

Commit

Permalink
Adding play/pause, previous track. Removed LastFM option.
Browse files Browse the repository at this point in the history
  • Loading branch information
NorfolkNChance committed Sep 12, 2020
1 parent 9e29223 commit 1f1a4fc
Show file tree
Hide file tree
Showing 5 changed files with 965 additions and 960 deletions.
5 changes: 3 additions & 2 deletions Spotify-Notifications.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -252,6 +252,7 @@
developmentRegion = English;
hasScannedForEncodings = 0;
knownRegions = (
English,
en,
cs,
de,
Expand Down Expand Up @@ -456,7 +457,7 @@
isa = XCBuildConfiguration;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CODE_SIGN_IDENTITY = "Mac Developer";
CODE_SIGN_IDENTITY = "Apple Development";
"CODE_SIGN_IDENTITY[sdk=macosx*]" = "";
CODE_SIGN_STYLE = Automatic;
COMBINE_HIDPI_IMAGES = YES;
Expand Down Expand Up @@ -484,7 +485,7 @@
isa = XCBuildConfiguration;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CODE_SIGN_IDENTITY = "Mac Developer";
CODE_SIGN_IDENTITY = "Apple Development";
"CODE_SIGN_IDENTITY[sdk=macosx*]" = "";
CODE_SIGN_STYLE = Automatic;
COMBINE_HIDPI_IMAGES = YES;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,6 @@
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
</Testables>
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
Expand All @@ -38,8 +36,8 @@
ReferencedContainer = "container:Spotify-Notifications.xcodeproj">
</BuildableReference>
</MacroExpansion>
<AdditionalOptions>
</AdditionalOptions>
<Testables>
</Testables>
</TestAction>
<LaunchAction
buildConfiguration = "Release"
Expand All @@ -61,8 +59,6 @@
ReferencedContainer = "container:Spotify-Notifications.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
Expand Down
3 changes: 3 additions & 0 deletions Spotify-Notifications/AppDelegate.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@
@property (strong, nonatomic) IBOutlet NSMenuItem *openLastFMMenu;
@property (strong, nonatomic) IBOutlet NSMenuItem *openPreferences;
@property (strong, nonatomic) IBOutlet NSMenuItem *currentSongMenuItem;
@property (strong, nonatomic) IBOutlet NSMenuItem *nextTrackMenuItem;
@property (strong, nonatomic) IBOutlet NSMenuItem *previousTrackMenuItem;
@property (strong, nonatomic) IBOutlet NSMenuItem *playPauseMenuItem;

//Preferences
@property (assign) IBOutlet NSWindow *prefsWindow;
Expand Down
14 changes: 14 additions & 0 deletions Spotify-Notifications/AppDelegate.m
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,18 @@ - (IBAction)openSpotify:(NSMenuItem*)sender {
[spotify activate];
}

- (IBAction)nextTrack:(NSMenuItem*)sender {
[spotify nextTrack];
}

- (IBAction)previousTrack:(NSMenuItem*)sender {
[spotify previousTrack];
}

- (IBAction)playPause:(NSMenuItem*)sender {
[spotify playpause];
}

- (IBAction)showLastFM:(NSMenuItem*)sender {

//Artist - we always need at least this
Expand All @@ -109,6 +121,8 @@ - (void)userNotificationCenter:(NSUserNotificationCenter *)center didActivateNot

} else if (actionType == NSUserNotificationActivationTypeActionButtonClicked && spotify.playerState == SpotifyEPlSPlaying) {
[spotify nextTrack];
// } else if (actionType == NSUserNotificationActivationTypeActionButtonClicked && spotify.playerState == SpotifyEPlSPlaying) {
// [spotify previousTrack];
}
}

Expand Down
Loading

0 comments on commit 1f1a4fc

Please sign in to comment.