-
Notifications
You must be signed in to change notification settings - Fork 8
/
StreamDeckFunctions.ahk
291 lines (249 loc) · 7.76 KB
/
StreamDeckFunctions.ahk
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
KillOrOpenDiscord() {
if WinExist("ahk_exe Discord.exe") {
Process, Close, Discord.exe
CoordMode, Mouse, Screen
BlockInput, MouseMove
MouseGetPos, mouseX, mouseY
MouseMove, 2630, 1415, 0
MouseMove, 3350, 1415, 30
MouseMove, mouseX, mouseY, 0
BlockInput, MouseMoveOff
} else {
Run, C:\Users\Sebastian\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Discord Inc\Discord.lnk
}
}
OpenAndMoveCuttingFolder() {
Run, explorer.exe E:\cutting
Sleep, 1000
hWnd := WinExist("E:\cutting")
WinMove,ahk_id %hwnd%,,3433,203,974,1087
}
OpenAndMoveCamFolder() {
Run, explorer.exe E:\cam
Sleep, 1000
hWnd := WinExist("E:\cam")
WinMove,ahk_id %hwnd%,,4393,203,974,1087
}
CreateAndOrderLeftScreen() {
; Test window existance first
;if !WinExist("ahk_exe Discord.exe") {
; Run, C:\Users\Sebastian\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Discord Inc\Discord.lnk
; Sleep, 1000
;}
if !WinExist("ahk_exe Timeular.exe") {
Run, C:\Users\Sebastian\AppData\Local\Programs\Timeular\Timeular.exe
Sleep, 1000
}
if !WinExist("ahk_exe Spotify.exe") {
Run, C:\Users\Sebastian\AppData\Roaming\Spotify\Spotify.exe
Sleep, 1000
}
if !WinExist("ahk_exe Scarlett MixControl.exe") {
Run, C:\Program Files (x86)\Focusrite\Scarlett MixControl\Scarlett MixControl.exe
Sleep, 1000
}
; Move windows to their final position
hWnd := WinExist("Timeular")
WinMove,ahk_id %hwnd%,,-1200,850,1200,740
hWnd := WinExist("ahk_exe Scarlett MixControl.exe")
WinMove,ahk_id %hwnd%,,-1917,609,1025,622 ; 231
hWnd := WinExist("ahk_exe Spotify.exe")
WinMove,ahk_id %hwnd%,,-894,610,894,972
hWnd := WinExist("ahk_exe Discord.exe")
WinMove,ahk_id %hwnd%,,-1080,-336,1080,946
; Separate function to set window order
LeftScreenActivate()
; Additional step for broken spotify
Sleep, 1000
WinClose, ahk_exe Spotify.exe
Sleep, 1000
Run, C:\Users\Sebastian\AppData\Roaming\Spotify\Spotify.exe
}
LeftScreenActivate() {
WinActivate, Timeular
WinActivate, ahk_exe Scarlett MixControl.exe
WinActivate, ahk_exe Spotify.exe
WinActivate, ahk_exe Discord.exe
}
ScarlettMuteUnmute() {
if !WinExist("ahk_exe Scarlett MixControl.exe") {
Run, C:\Program Files (x86)\Focusrite\Scarlett MixControl\Scarlett MixControl.exe
; End here, since the window is sometimes a little bit buggy
} else {
WinActivate, ahk_exe Scarlett MixControl.exe
CoordMode, Mouse, Screen
WinGetPos, scarlettX, scarlettY,,,ahk_exe Scarlett MixControl.exe
BlockInput, MouseMove
MouseGetPos, mouseX, mouseY
; Mute / Unmute speaker
MouseClick, left, scarlettX + 897, scarlettY + 398
MouseClick, left, scarlettX + 897, scarlettY + 421
; Mute / Unmute headphone
MouseClick, left, scarlettX + 956, scarlettY + 398
MouseClick, left, scarlettX + 956, scarlettY + 421
MouseMove, mouseX, mouseY, 0
BlockInput, MouseMoveOff
; Restore left screen layout (where the window is usually)
LeftScreenActivate()
}
}
ScarlettVolume(volume) {
if !WinExist("ahk_exe Scarlett MixControl.exe") {
Run, C:\Program Files (x86)\Focusrite\Scarlett MixControl\Scarlett MixControl.exe
; End here, since the window is sometimes a little bit buggy
} else {
if(volume > 0) {
ScarlettVolume(0)
}
WinActivate, ahk_exe Scarlett MixControl.exe
CoordMode, Mouse, Screen
WinGetPos, scarlettX, scarlettY,,,ahk_exe Scarlett MixControl.exe
BlockInput, MouseMove
MouseGetPos, mouseX, mouseY
if(volume = 0) {
MouseClickDrag, left, scarlettX + 926, scarlettY + 512, scarlettX + 926, scarlettY + 150
} else if(volume = 10) {
MouseClickDrag, left, scarlettX + 926, scarlettY + 512, scarlettX + 926, scarlettY + 558
} else if(volume = 20) {
MouseClickDrag, left, scarlettX + 926, scarlettY + 512, scarlettX + 926, scarlettY + 587
} else if(volume = 30) {
MouseClickDrag, left, scarlettX + 926, scarlettY + 512, scarlettX + 926, scarlettY + 609
}
MouseMove, mouseX, mouseY, 0
BlockInput, MouseMoveOff
; Restore left screen layout (where the window is usually)
LeftScreenActivate()
}
}
ScarlettVolume0() {
ScarlettVolume(0)
}
ScarlettVolume10() {
ScarlettVolume(10)
}
ScarlettVolume20() {
ScarlettVolume(20)
}
ScarlettVolume30() {
ScarlettVolume(30)
}
OpenTwitchAndChat() {
Run, chrome.exe https://www.twitch.tv/skate702/dashboard/live
Sleep, 10000
CoordMode, Mouse, Screen
WinGetPos, chromeX, chromeY,,,ahk_exe chrome.exe
BlockInput, MouseMove
MouseGetPos, mouseX, mouseY
MouseClick, left, chromeX + 1047, chromeY + 645
MouseMove, mouseX, mouseY, 0
BlockInput, MouseMoveOff
}
AddAndSelectMarker(markerColor) {
customURL = http://localhost:8081/addCustomMarker?color=%markerColor%
RunWait curl %customURL% ,,hide
Send, {Right 3}
Sleep, 300
Send, ^+a
Sleep, 300
RunWait curl ""http://localhost:8081/selectCurrentMarker"" ,,hide
Sleep, 300
Send, ö
}
AddAndSelectMarkerRed() {
AddAndSelectMarker(6)
}
AddAndSelectMarkerBlue() {
AddAndSelectMarker(9)
}
AddAndSelectMarkerGreen() {
AddAndSelectMarker(13)
}
TargetPremiereTracks(videoTrack, audioTrack) {
customURL = http://localhost:8081/targetTracks?videoTrack=%videoTrack%&audioTrack=%audioTrack%
RunWait curl %customURL% ,,hide
sleep 50
}
LoadPremiereClipboard(clipName) {
WinActivate, Adobe Premiere Pro
; Load some text to... well premiere things.
RunWait, %comspec% /c E:\code\PremiereClipboard\PremiereClipboard\PremiereClipboard\bin\Debug\PremiereClipboard.exe --fill
; After loading some text, tab out of premiere and tab back in. This trigger some weird reset action, nobody will ever understand
sleep 500
Send, !{Tab}
sleep 500
Send, !{Tab}
sleep 500
; Load clipboard (don't forget to change paths)
RunWait, %comspec% /c E:\code\PremiereClipboard\PremiereClipboard\PremiereClipboard\bin\Debug\PremiereClipboard.exe --load E:\cut\clipboards\%clipName%
sleep 10
Send, ^+a ; deselect everything
sleep 10
; Ctrl + V, but the "save" taran way
SendInput, {Shift Down}{Shift Up}{Ctrl Down}{v Down}
sleep 5
SendInput, {v Up}{Ctrl Up}
sleep 10
sleep 10
Send, ^+a ; deselect everything
}
PremierePasteAd() {
TargetPremiereTracks(6, 1000)
LoadPremiereClipboard("ad.clp")
}
PremierePasteChapter() {
TargetPremiereTracks(3, 1000)
LoadPremiereClipboard("chapter.clp")
}
PremierePasteGlitch() {
TargetPremiereTracks(5, 2)
LoadPremiereClipboard("glitch.clp")
}
PremierePasteInfo() {
TargetPremiereTracks(3, 1000)
LoadPremiereClipboard("info.clp")
}
PremierePasteIntro() {
TargetPremiereTracks(3, 2)
LoadPremiereClipboard("intro.clp")
sleep 200
Run https://fontawesome.com/icons?d=gallery&m=free
}
PremierePasteOutro() {
TargetPremiereTracks(1, 1000)
LoadPremiereClipboard("outro.clp")
}
PremierePasteRewind() {
TargetPremiereTracks(4, 2)
LoadPremiereClipboard("rewind.clp")
}
PremierePasteSignature() {
TargetPremiereTracks(3, 2)
LoadPremiereClipboard("signature.clp")
}
PremiereReloadCEP2AHK() {
Send, {Alt}
Sleep, 100
Send, f
Sleep, 100
Send, {Down}
Sleep, 100
Send, {Down}
Sleep, 100
Send, {Right}
Sleep, 100
Send, {Enter}
Sleep, 100
Send, ^w
Sleep, 200
Send, {Alt}
Sleep, 100
Send, f
Sleep, 100
Send, {Down}
Sleep, 100
Send, {Down}
Sleep, 100
Send, {Right}
Sleep, 100
Send, {Enter}
}