#import <Sparkle/Sparkle.h> /* we're the update delegate */
#import "iTunes.h"
+#import "Spotify.h"
/*****************************************************************************
* Local prototypes.
- (void)resumeItunesPlayback:(id)sender
{
- if (b_has_itunes_paused && var_InheritInteger(p_intf, "macosx-control-itunes") > 1) {
- iTunesApplication *iTunesApp = [SBApplication applicationWithBundleIdentifier:@"com.apple.iTunes"];
- if (iTunesApp && [iTunesApp isRunning]) {
- if ([iTunesApp playerState] == iTunesEPlSPaused) {
- msg_Dbg(p_intf, "Unpause iTunes...");
- [iTunesApp playpause];
+ if (var_InheritInteger(p_intf, "macosx-control-itunes") > 1) {
+ if (b_has_itunes_paused) {
+ iTunesApplication *iTunesApp = [SBApplication applicationWithBundleIdentifier:@"com.apple.iTunes"];
+ if (iTunesApp && [iTunesApp isRunning]) {
+ if ([iTunesApp playerState] == iTunesEPlSPaused) {
+ msg_Dbg(p_intf, "Unpause iTunes...");
+ [iTunesApp playpause];
+ }
}
}
+ if (b_has_spotify_paused) {
+ SpotifyApplication *spotifyApp = [SBApplication applicationWithBundleIdentifier:@"com.spotify.client"];
+ if ([spotifyApp isRunning] && [spotifyApp playerState] == kSpotifyPlayerStatePaused) {
+ msg_Dbg(p_intf, "Unpause Spotify...");
+ [spotifyApp play];
+ }
+ }
}
b_has_itunes_paused = NO;
+ b_has_spotify_paused = NO;
o_itunes_play_timer = nil;
}
}
if (state == PLAYING_S) {
- // pause iTunes
- if (i_control_itunes > 0 && !b_has_itunes_paused) {
- iTunesApplication *iTunesApp = [SBApplication applicationWithBundleIdentifier:@"com.apple.iTunes"];
- if (iTunesApp && [iTunesApp isRunning]) {
- if ([iTunesApp playerState] == iTunesEPlSPlaying) {
- msg_Dbg(p_intf, "Pause iTunes...");
- [iTunesApp pause];
- b_has_itunes_paused = YES;
+ if (i_control_itunes > 0) {
+ // pause iTunes
+ if (!b_has_itunes_paused) {
+ iTunesApplication *iTunesApp = [SBApplication applicationWithBundleIdentifier:@"com.apple.iTunes"];
+ if (iTunesApp && [iTunesApp isRunning]) {
+ if ([iTunesApp playerState] == iTunesEPlSPlaying) {
+ msg_Dbg(p_intf, "Pause iTunes...");
+ [iTunesApp pause];
+ b_has_itunes_paused = YES;
+ }
}
}
- }
+ // pause Spotify
+ if (!b_has_spotify_paused) {
+ SpotifyApplication *spotifyApp = [SBApplication applicationWithBundleIdentifier:@"com.spotify.client"];
+ if ([spotifyApp isRunning] && [spotifyApp playerState] == kSpotifyPlayerStatePlaying) {
+ msg_Dbg(p_intf, "Pause Spotify...");
+ [spotifyApp pause];
+ b_has_spotify_paused = YES;
+ }
+ }
+ }
/* Declare user activity.
This wakes the display if it is off, and postpones display sleep according to the users system preferences
#define SIDEBAR_TEXT N_("Show Sidebar")
#define SIDEBAR_LONGTEXT N_("Shows a sidebar in the main window listing media sources.")
-#define ITUNES_TEXT N_("Pause iTunes during VLC playback")
-#define ITUNES_LONGTEXT N_("Pauses iTunes playback when VLC playback starts. If selected, iTunes playback will be resumed again if VLC playback is finished.")
+#define ITUNES_TEXT N_("Control external music players")
+#define ITUNES_LONGTEXT N_("When a video starts playing, VLC will pause supported music players. If selected, external player will be resumed again when playback is finished.")
static const int itunes_list[] =
{ 0, 1, 2 };
static const char *const itunes_list_text[] = {
- N_("Do nothing"), N_("Pause iTunes"), N_("Pause and resume iTunes")
+ N_("Do nothing"), N_("Pause iTunes / Spotify"), N_("Pause and resume iTunes / Spotify")
};
#define VOLUME_MAX_TEXT N_("Maximum Volume displayed")