Skip to content

Commit cd88df1

Browse files
committed
iTunes-AirPlay, System, music -> app_volume, 1.1.0
AirPlay for iTunes was added in this update. Find it in the volume screen of the iTunes player. System was also added. Gives the ability to click keyboard arrow keys, space bar, and change the system volume. When changing volume for Spotify for iTunes, it controls the app volume instead. Also, version 1.1.0.
1 parent 3a1bc60 commit cd88df1

16 files changed

Lines changed: 54 additions & 21 deletions

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
sparkle/
2+
13
# extra
24
archive
35

SimonRemote.xcodeproj/project.pbxproj

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,11 @@
6363
2FD6924F18DD06CD00C8A1C9 /* System-volume_down.scpt in Resources */ = {isa = PBXBuildFile; fileRef = 2FD6924D18DD06CD00C8A1C9 /* System-volume_down.scpt */; };
6464
2FD6925018DD06CD00C8A1C9 /* System-volume_up.scpt in Resources */ = {isa = PBXBuildFile; fileRef = 2FD6924E18DD06CD00C8A1C9 /* System-volume_up.scpt */; };
6565
2FD6929318DFD57200C8A1C9 /* SystemConfiguration.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 2FD6929218DFD57200C8A1C9 /* SystemConfiguration.framework */; };
66+
69121DED1A5601D8007C56B2 /* Spotify-volume_down.scpt in Resources */ = {isa = PBXBuildFile; fileRef = 69121DEB1A5601D8007C56B2 /* Spotify-volume_down.scpt */; };
67+
69121DEE1A5601D8007C56B2 /* Spotify-volume_up.scpt in Resources */ = {isa = PBXBuildFile; fileRef = 69121DEC1A5601D8007C56B2 /* Spotify-volume_up.scpt */; };
68+
69121DF11A5601E3007C56B2 /* iTunes-volume_down.scpt in Resources */ = {isa = PBXBuildFile; fileRef = 69121DEF1A5601E3007C56B2 /* iTunes-volume_down.scpt */; };
69+
69121DF21A5601E3007C56B2 /* iTunes-volume_up.scpt in Resources */ = {isa = PBXBuildFile; fileRef = 69121DF01A5601E3007C56B2 /* iTunes-volume_up.scpt */; };
70+
69BF9C6F1A5756CF00425055 /* System-mouse_click.scpt in Resources */ = {isa = PBXBuildFile; fileRef = 69BF9C6E1A5756CF00425055 /* System-mouse_click.scpt */; };
6671
DD4F7C0913C30F9F00825C6E /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = DD4F7C0813C30F9F00825C6E /* Cocoa.framework */; };
6772
DD4F7C1513C30F9F00825C6E /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = DD4F7C1413C30F9F00825C6E /* main.m */; };
6873
DD4F7C1C13C30F9F00825C6E /* ApplicationDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = DD4F7C1B13C30F9F00825C6E /* ApplicationDelegate.m */; };
@@ -146,6 +151,11 @@
146151
2FD6924D18DD06CD00C8A1C9 /* System-volume_down.scpt */ = {isa = PBXFileReference; lastKnownFileType = file; name = "System-volume_down.scpt"; path = "SimonRemote/Scripts/System/System-volume_down.scpt"; sourceTree = "<group>"; };
147152
2FD6924E18DD06CD00C8A1C9 /* System-volume_up.scpt */ = {isa = PBXFileReference; lastKnownFileType = file; name = "System-volume_up.scpt"; path = "SimonRemote/Scripts/System/System-volume_up.scpt"; sourceTree = "<group>"; };
148153
2FD6929218DFD57200C8A1C9 /* SystemConfiguration.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = SystemConfiguration.framework; path = System/Library/Frameworks/SystemConfiguration.framework; sourceTree = SDKROOT; };
154+
69121DEB1A5601D8007C56B2 /* Spotify-volume_down.scpt */ = {isa = PBXFileReference; lastKnownFileType = file; name = "Spotify-volume_down.scpt"; path = "simonremote/Scripts/Spotify/Spotify-volume_down.scpt"; sourceTree = "<group>"; };
155+
69121DEC1A5601D8007C56B2 /* Spotify-volume_up.scpt */ = {isa = PBXFileReference; lastKnownFileType = file; name = "Spotify-volume_up.scpt"; path = "simonremote/Scripts/Spotify/Spotify-volume_up.scpt"; sourceTree = "<group>"; };
156+
69121DEF1A5601E3007C56B2 /* iTunes-volume_down.scpt */ = {isa = PBXFileReference; lastKnownFileType = file; name = "iTunes-volume_down.scpt"; path = "simonremote/Scripts/iTunes/iTunes-volume_down.scpt"; sourceTree = "<group>"; };
157+
69121DF01A5601E3007C56B2 /* iTunes-volume_up.scpt */ = {isa = PBXFileReference; lastKnownFileType = file; name = "iTunes-volume_up.scpt"; path = "simonremote/Scripts/iTunes/iTunes-volume_up.scpt"; sourceTree = "<group>"; };
158+
69BF9C6E1A5756CF00425055 /* System-mouse_click.scpt */ = {isa = PBXFileReference; lastKnownFileType = file; name = "System-mouse_click.scpt"; path = "simonremote/Scripts/System/System-mouse_click.scpt"; sourceTree = "<group>"; };
149159
DD4F7C0413C30F9F00825C6E /* SimonRemote.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = SimonRemote.app; sourceTree = BUILT_PRODUCTS_DIR; };
150160
DD4F7C0813C30F9F00825C6E /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = System/Library/Frameworks/Cocoa.framework; sourceTree = SDKROOT; };
151161
DD4F7C0B13C30F9F00825C6E /* AppKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AppKit.framework; path = System/Library/Frameworks/AppKit.framework; sourceTree = SDKROOT; };
@@ -201,6 +211,8 @@
201211
2F921E1918DA13EF006E2934 /* iTunes */ = {
202212
isa = PBXGroup;
203213
children = (
214+
69121DEF1A5601E3007C56B2 /* iTunes-volume_down.scpt */,
215+
69121DF01A5601E3007C56B2 /* iTunes-volume_up.scpt */,
204216
2FAB73951906D88700F36112 /* iTunes-next.scpt */,
205217
2FAB73961906D88700F36112 /* iTunes-previous.scpt */,
206218
2F21FA871904C812002DD68B /* iTunes-disable_shuffle.scpt */,
@@ -216,6 +228,8 @@
216228
2F921E1A18DA13F9006E2934 /* Spotify */ = {
217229
isa = PBXGroup;
218230
children = (
231+
69121DEB1A5601D8007C56B2 /* Spotify-volume_down.scpt */,
232+
69121DEC1A5601D8007C56B2 /* Spotify-volume_up.scpt */,
219233
2FAB73911906D87900F36112 /* Spotify-next.scpt */,
220234
2FAB73921906D87900F36112 /* Spotify-previous.scpt */,
221235
2FAB738B19060B0C00F36112 /* Spotify-disable_shuffle.scpt */,
@@ -286,6 +300,7 @@
286300
2FD6924C18DD065000C8A1C9 /* System */ = {
287301
isa = PBXGroup;
288302
children = (
303+
69BF9C6E1A5756CF00425055 /* System-mouse_click.scpt */,
289304
2FCFACA219119C8D00508B0A /* System-down.scpt */,
290305
2FCFACA319119C8D00508B0A /* System-info.scpt */,
291306
2FCFACA419119C8D00508B0A /* System-left.scpt */,
@@ -475,12 +490,14 @@
475490
2FD6923E18DBEB0800C8A1C9 /* iTunes-playpause.scpt in Resources */,
476491
2F921E3318DA52E7006E2934 /* PowerPoint-previous.scpt in Resources */,
477492
2FD6925018DD06CD00C8A1C9 /* System-volume_up.scpt in Resources */,
493+
69121DED1A5601D8007C56B2 /* Spotify-volume_down.scpt in Resources */,
478494
2FCFACA819119C8D00508B0A /* System-down.scpt in Resources */,
479495
2F921E2D18DA4E72006E2934 /* PowerPoint-start_slideshow.scpt in Resources */,
480496
2F9B1D8C18D2B82700A41633 /* bottomright.png in Resources */,
481497
2F80476A18D3FCB50078905C /* Spotify-play.scpt in Resources */,
482498
2FCFACAD19119C8D00508B0A /* System-up.scpt in Resources */,
483499
2F21FA8A1904C812002DD68B /* iTunes-enable_shuffle.scpt in Resources */,
500+
69BF9C6F1A5756CF00425055 /* System-mouse_click.scpt in Resources */,
484501
2FD6924018DCA70B00C8A1C9 /* iTunes-info.scpt in Resources */,
485502
2F921E2E18DA4E72006E2934 /* PowerPoint-white_screen.scpt in Resources */,
486503
2FCFACAB19119C8D00508B0A /* System-right.scpt in Resources */,
@@ -489,12 +506,14 @@
489506
2FAB739E1906D8B200F36112 /* Keynote-info.scpt in Resources */,
490507
2F9B1D8F18D2B82700A41633 /* StatusHighlighted.png in Resources */,
491508
2FAB73A11906D8B200F36112 /* Keynote-start_slideshow.scpt in Resources */,
509+
69121DF11A5601E3007C56B2 /* iTunes-volume_down.scpt in Resources */,
492510
2FAB738E19060B0C00F36112 /* Spotify-enable_shuffle.scpt in Resources */,
493511
2FD6924618DCD30500C8A1C9 /* Spotify-info.scpt in Resources */,
494512
2F921E1718DA13DA006E2934 /* iTunes-play.scpt in Resources */,
495513
2FAB73A01906D8B200F36112 /* Keynote-previous.scpt in Resources */,
496514
2FCFACA919119C8D00508B0A /* System-info.scpt in Resources */,
497515
2FAB73941906D87900F36112 /* Spotify-previous.scpt in Resources */,
516+
69121DF21A5601E3007C56B2 /* iTunes-volume_up.scpt in Resources */,
498517
2F9B1D9018D2B82700A41633 /* StatusHighlighted@2x.png in Resources */,
499518
2F9B1D9118D2B82700A41633 /* MainMenu.xib in Resources */,
500519
2F80475B18D3FC9F0078905C /* bottomleft.png in Resources */,
@@ -512,6 +531,7 @@
512531
2FD6924F18DD06CD00C8A1C9 /* System-volume_down.scpt in Resources */,
513532
2F80476F18D422F70078905C /* PreferenceWindow.xib in Resources */,
514533
2FA264D6191C9D4200AF1175 /* dsa_pub.pem in Resources */,
534+
69121DEE1A5601D8007C56B2 /* Spotify-volume_up.scpt in Resources */,
515535
2FC01AA71922DCC7007D56F6 /* Status@2x.png in Resources */,
516536
2FAB73981906D88700F36112 /* iTunes-previous.scpt in Resources */,
517537
2F9B1D9218D2B82700A41633 /* Panel.xib in Resources */,

SimonRemote/SRActionHandler.m

Lines changed: 30 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,10 @@ + (void) handleCommand:(NSString *)command forApplication:(NSString *)app
3939
[SRRunner runScriptFromFile:@"iTunes-playpause"];
4040

4141
} else if (string_equal(command, @"volume_up")) {
42-
[SRRunner runScriptFromFile:@"System-volume_up"];
42+
[SRRunner runScriptFromFile:@"iTunes-volume_up"];
4343

4444
} else if (string_equal(command, @"volume_down")) {
45-
[SRRunner runScriptFromFile:@"System-volume_down"];
45+
[SRRunner runScriptFromFile:@"iTunes-volume_down"];
4646

4747
} else if (string_equal(command, @"enable_shuffle")) {
4848
NSLog(@"enable_shufle ran\n");
@@ -53,6 +53,22 @@ + (void) handleCommand:(NSString *)command forApplication:(NSString *)app
5353
NSLog(@"disable_shufle ran\n");
5454
[SRRunner runScriptFromFile:@"iTunes-disable_shuffle"];
5555
[NSThread sleepForTimeInterval:1.0f];
56+
57+
} else if([command hasPrefix:@"airplay_set-"]) {
58+
// Written by https://github.com/inonprince
59+
NSString* deviceName = nil;
60+
deviceName = [command substringFromIndex:12];
61+
NSString *script = @"set selecteddevice to \"%@\"\n"
62+
"tell application \"iTunes\"\n"
63+
"set apDevices to (get every AirPlay device whose available is true)\n"
64+
"set apNames to (get name of every AirPlay device whose available is true)\n"
65+
"set apChoices to {}\n"
66+
"repeat with i from 1 to length of apNames\n"
67+
"if item i of apNames is selecteddevice then set end of apChoices to item i of apDevices\n"
68+
"end repeat\n"
69+
"set current AirPlay devices to apChoices\n"
70+
"end tell";
71+
[SRRunner runScriptFromString:[NSString stringWithFormat:script, deviceName]];
5672
}
5773

5874
/* Spotify */
@@ -74,10 +90,10 @@ + (void) handleCommand:(NSString *)command forApplication:(NSString *)app
7490
[SRRunner runScriptFromFile:@"Spotify-playpause"];
7591

7692
} else if (string_equal(command, @"volume_up")) {
77-
[SRRunner runScriptFromFile:@"System-volume_up"];
93+
[SRRunner runScriptFromFile:@"Spotify-volume_up"];
7894

7995
} else if (string_equal(command, @"volume_down")) {
80-
[SRRunner runScriptFromFile:@"System-volume_down"];
96+
[SRRunner runScriptFromFile:@"Spotify-volume_down"];
8197

8298
} else if (string_equal(command, @"enable_shuffle")) {
8399
[SRRunner runScriptFromFile:@"Spotify-enable_shuffle"];
@@ -88,7 +104,7 @@ + (void) handleCommand:(NSString *)command forApplication:(NSString *)app
88104
} else if (string_equal(command, @"info")) {
89105
[SRRunner runScriptFromFile:@"Spotify-info"];
90106
}
91-
107+
92108
/* PowerPoint */
93109
} else if (string_equal(app, @"PowerPoint")) {
94110

@@ -134,33 +150,27 @@ + (void) handleCommand:(NSString *)command forApplication:(NSString *)app
134150
/* System */
135151
} else if (string_equal(app, @"System")) {
136152

137-
if (string_equal(command, @"next")) {
153+
if (string_equal(command, @"left")) {
138154
[SRRunner runScriptFromFile:@"System-left"];
139155

140-
} else if (string_equal(command, @"previous")) {
156+
} else if (string_equal(command, @"right")) {
141157
[SRRunner runScriptFromFile:@"System-right"];
142158

143-
} else if (string_equal(command, @"previous")) {
159+
} else if (string_equal(command, @"up")) {
144160
[SRRunner runScriptFromFile:@"System-up"];
145161

146-
} else if (string_equal(command, @"previous")) {
162+
} else if (string_equal(command, @"down")) {
147163
[SRRunner runScriptFromFile:@"System-down"];
148164

149-
} else if (string_equal(command, @"previous")) {
165+
} else if (string_equal(command, @"space")) {
150166
[SRRunner runScriptFromFile:@"System-space"];
151167

152-
} else if (string_equal(command, @"previous")) {
168+
} else if (string_equal(command, @"volume_up")) {
153169
[SRRunner runScriptFromFile:@"System-volume_up"];
154170

155-
} else if (string_equal(command, @"previous")) {
171+
} else if (string_equal(command, @"volume_down")) {
156172
[SRRunner runScriptFromFile:@"System-volume_down"];
157173

158-
} else if (string_equal(command, @"previous")) {
159-
[SRRunner runScriptFromFile:@"System-sleep"];
160-
161-
} else if (string_equal(command, @"previous")) {
162-
[SRRunner runScriptFromFile:@"System-reboot"];
163-
164174
}
165175
}
166176
}
@@ -176,7 +186,8 @@ + (NSDictionary *) getInfoForApplication:(NSString *)app
176186
} else if (string_equal(app, @"Keynote")) {
177187
return [SRRunner runScriptFromFile:@"Keynote-info"];
178188
} else if (string_equal(app, @"System")) {
179-
return [SRRunner runScriptFromFile:@"System-info"];
189+
// It doesn't return anything useful, so let's not put forth effort.
190+
// return [SRRunner runScriptFromFile:@"System-info"];
180191
}
181192

182193
return nil;
1.54 KB
Binary file not shown.
1.53 KB
Binary file not shown.
1.2 KB
Binary file not shown.
786 Bytes
Binary file not shown.
792 Bytes
Binary file not shown.
-1.84 KB
Binary file not shown.
-1.84 KB
Binary file not shown.

0 commit comments

Comments
 (0)