Skip to content

Commit

Permalink
Standardized naming & case convention
Browse files Browse the repository at this point in the history
  • Loading branch information
skupjoe committed May 13, 2019
1 parent 9bf86f3 commit 153e10d
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 21 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@
- Move Album:
- New GUI window support for moving albums to second temp directory genre folder with AHK hotkey.

## [1.1.1] - 2019-05-13
### Changed
- Standardized naming & case conventions.

## [1.1.0] - 2019-05-13
### Fixed
- Scroll detection:
Expand All @@ -18,5 +22,6 @@
- First version commit.

[Unreleased]: https://github.com/skupjoe/foo-playback-helper/compare/v1.1.0...HEAD
[1.1.1]: https://github.com/skupjoe/foo-playback-helper/compare/v1.0.0...v1.1.1
[1.1.0]: https://github.com/skupjoe/foo-playback-helper/compare/v1.0.0...v1.1.0
[1.0.0]: https://github.com/skupjoe/foo-playback-helper/compare/a2bfe1c...v1.0.0
42 changes: 21 additions & 21 deletions foo-helper.ahk
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#InstallKeybdHook
#NoEnv

Global bToggle := 1
Global B_Toggle := 1
Global Toggle0
Global Toggle1
Global Toggle2
Expand All @@ -25,7 +25,7 @@ return
~^Space::
~Media_Stop::
~Media_Play_Pause::
Gosub, disableSpeed
Gosub, DisableSpeed
return

; Scroll pause
Expand All @@ -41,8 +41,8 @@ return

; Pause the loop for blacklisted titles
~^!b::
bToggle := !bToggle
if bToggle
B_Toggle := !B_Toggle
if B_Toggle
msgbox, , , % "Blacklist Toggle : On", 1
else
msgbox, , , % "Blacklist Toggle : Off", 1
Expand Down Expand Up @@ -114,7 +114,7 @@ return
Speed0:
CheckBlacklist()
if Toggle0
AND isPlaying() AND !(EndSec() < 55)
AND isPlaying() AND !(endSec() < 55)
AND !kbActive() AND !scrollActive() {
Send, {Ctrl down}{Shift down}{Right}{Ctrl up}{Shift up}
Sleep, 10000
Expand All @@ -124,7 +124,7 @@ return
Speed1:
CheckBlacklist()
if Toggle1
AND isPlaying() AND !(EndSec() < 85)
AND isPlaying() AND !(endSec() < 85)
AND !kbActive() AND !scrollActive() {
Send, {Ctrl down}{Shift down}{Up}{Ctrl up}{Shift up}
Sleep, 6000
Expand All @@ -134,14 +134,14 @@ return
Speed2:
CheckBlacklist()
if Toggle1
AND isPlaying() AND !(EndSec() < 85)
AND isPlaying() AND !(endSec() < 85)
AND !kbActive() AND !scrollActive() {
Send, {Ctrl down}{Shift down}{Up}{Ctrl up}{Shift up}
Sleep, 6000
}
return

disableSpeed:
DisableSpeed:
Toggle0 := 0
Toggle1 := 0
SetTimer, Speed0, Off
Expand Down Expand Up @@ -178,37 +178,37 @@ GetSongInfo() {
title_a := StrSplit(name_a[1], A_Space)
time := SubStr(title_a[title_a.MaxIndex()], 2, StrLen(title_a[title_a.MaxIndex()])-2)
time_a := StrSplit(time, "`/")
curr_a := StrSplit(time_a[1], "`:")
end_a := StrSplit(time_a[2], "`:")
time_curr_sec := (60*curr_a[1]+curr_a[2])
time_end_sec := (60*end_a[1]+end_a[2])
time_curr_a := StrSplit(time_a[1], "`:")
time_curr_sec := (60*time_curr_a[1]+time_curr_a[2])
time_end_a := StrSplit(time_a[2], "`:")
time_end_sec := (60*time_end_a[1]+time_end_a[2])
path := name_a[2]
}

CheckBlacklist() {
blacklist := ["vmware", "notepad++"]
WinGetActiveTitle, currWinTitle
if bToggle {
WinGetActiveTitle, title_win
if B_Toggle {
for i, v in blacklist {
if (currWinTitle == "vmware") {
if (title_win == "vmware") {
sleep, 2000
; Refresh active title
WinGetActiveTitle, currWinTitle ; Refresh
WinGetActiveTitle, title_win ; Refresh
return
}
while inStr(currWinTitle, v, 0) {
while inStr(title_win, v, 0) {
Pause, On, 1
Sleep, 2000
Pause, Off, 1
; Refresh active title
WinGetActiveTitle, currWinTitle ; Refresh
WinGetActiveTitle, title_win ; Refresh
}
}
}
return
}

EndSec() {
endSec() {
ctr := 0
GetSongInfo()
while (time_end_sec == "" OR time_curr_sec == "") {
Expand All @@ -218,7 +218,7 @@ EndSec() {
Sleep, 5500
if (ctr == 5) {
msgbox, , , % "Time has remained empty. Exiting!", 2
Gosub disableSpeed
Gosub DisableSpeed
return 0
}
}
Expand All @@ -236,7 +236,7 @@ isPlaying() {
msgbox, , , % "Foobar2000 is not playing!", 1
if (ctr == 5) {
msgbox, , , % "Foobar2000 is still not playing. Exiting!", 2
Gosub disableSpeed
Gosub DisableSpeed
return 0
}
}
Expand Down

0 comments on commit 153e10d

Please sign in to comment.