Skip to content

Commit

Permalink
Changed: All function names renamed to start with capital letter.
Browse files Browse the repository at this point in the history
  • Loading branch information
sven.seyfert committed Feb 14, 2022
1 parent 80fdeb8 commit 02796af
Show file tree
Hide file tree
Showing 7 changed files with 36 additions and 28 deletions.
10 changes: 9 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,21 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

Go to [legend](#legend---types-of-changes) for further information about the types of changes.

## [1.4.0] - 2022-02-14

### Changed

- All function names renamed to start with capital letter.
- Version bump.

## [1.3.0] - 2022-02-10

### Added

- Links to the project badges/icons.
- FAQ section to README.md file.

### Changed:
### Changed

- Move "Keyboard shortcuts" section into "Getting started" section (as sub section after "Usage").
- Version bump.
Expand Down Expand Up @@ -51,6 +58,7 @@ Go to [legend](#legend---types-of-changes) for further information about the typ

- AutoIt Code formatting to the common notation without additional spaces after opened brackets and before closed brackets.

[1.4.0]: https://github.com/Sven-Seyfert/Au3VidOverlay/compare/v1.3.0...v1.4.0
[1.3.0]: https://github.com/Sven-Seyfert/Au3VidOverlay/compare/v1.2.0...v1.3.0
[1.2.0]: https://github.com/Sven-Seyfert/Au3VidOverlay/compare/v1.1.0...v1.2.0
[1.1.0]: https://github.com/Sven-Seyfert/Au3VidOverlay/compare/v1.0.0...v1.1.0
Expand Down
Binary file modified build/Au3VidOverlay.exe
Binary file not shown.
18 changes: 9 additions & 9 deletions src/Au3VidOverlay.au3
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
; compiler information for AutoIt
#pragma compile(CompanyName, © SOLVE SMART)
#pragma compile(FileVersion, 1.3.0)
#pragma compile(FileVersion, 1.4.0)
#pragma compile(LegalCopyright, © Sven Seyfert)
#pragma compile(ProductName, Au3VidOverlay)
#pragma compile(ProductVersion, 1.3.0 - 2022-02-10)
#pragma compile(ProductVersion, 1.4.0 - 2022-02-14)

#AutoIt3Wrapper_AU3Check_Stop_OnWarning=y
#AutoIt3Wrapper_Icon=..\media\favicon.ico
Expand Down Expand Up @@ -39,21 +39,21 @@ If $aInst[0][0] > 1 Then Exit


; processing -------------------------------------------------------------------
_writeFile($aFile[$eHtml], $sHtml)
_WriteFile($aFile[$eHtml], $sHtml)

Global $iReturnValue = _upload($aFile[$eHtml])
If $iReturnValue == -1 Then _disposeAndExit()
Global $iReturnValue = _Upload($aFile[$eHtml])
If $iReturnValue == -1 Then _DisposeAndExit()

FileDelete($aFile[$eHtml])

Global $sDuration = _getVidDuration($sVidId)
Global $iDuration = _getVidDurationInSeconds($sDuration)
Global $sDuration = _GetVidDuration($sVidId)
Global $iDuration = _GetVidDurationInSeconds($sDuration)

_loadGuiAndPlayVideo()
_LoadGuiAndPlayVideo()

Global $hTimer = TimerInit()
While Round(TimerDiff($hTimer) / 1000) < $iDuration + 2
Sleep(250)
WEnd

_disposeAndExit()
_DisposeAndExit()
2 changes: 1 addition & 1 deletion src/Declaration.au3
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ If $iArgumentCount <> 1 Then
EndIf

Global $aFile[$iMaxEnumIndex]
$aFile[$eHtml] = _getUniqueString() & '.html'
$aFile[$eHtml] = _GetUniqueString() & '.html'
$aFile[$eConfig] = '..\config\config.ini'

Global $sVidId = IniRead($aFile[$eConfig], 'Youtube', 'VideoId', '')
Expand Down
26 changes: 13 additions & 13 deletions src/Functions.au3
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Func _getUniqueString()
Func _GetUniqueString()
Local $sMachineGuid = RegRead('HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Cryptography', 'MachineGuid')
$sMachineGuid = StringReplace($sMachineGuid, '-', '')
$sMachineGuid = StringTrimLeft($sMachineGuid, 5)
Expand All @@ -7,23 +7,23 @@ Func _getUniqueString()
Return StringLower($sMachineGuid)
EndFunc

Func _writeFile($sFile, $sText)
Func _WriteFile($sFile, $sText)
Local $hFile = FileOpen($sFile, 2 + 8 + 256)
FileWrite($hFile, $sText)
FileClose($hFile)
EndFunc

Func _upload($sFile)
Func _Upload($sFile)
Return RunWait('..\utilities\SecureUpload.exe "' & $aFtp[$eRc4CryptKey] & '" "' & $aFtp[$eFileLocal] & '" "' & $aFtp[$eFileRemote] & '" "' & $aFtp[$eServer] & '" "' & $aFtp[$eUser] & '" "' & $aFtp[$ePass] & '"')
EndFunc

Func _getVidDuration($sId)
Func _GetVidDuration($sId)
Local $sUrlContent = BinaryToString(InetRead('https://www.youtube.com/watch?v=' & $sId, 1))

Return StringReplace(StringRegExp($sUrlContent, 'meta itemprop="duration" content="(.+?)"', 1)[0], 'PT', '')
EndFunc

Func _getVidDurationInSeconds($sTime)
Func _GetVidDurationInSeconds($sTime)
Local $iHours = 0, $iMinutes = 0, $iSeconds = 0, $iTotalSeconds = 0

If StringInStr($sTime, 'H') Then
Expand All @@ -47,40 +47,40 @@ Func _getVidDurationInSeconds($sTime)
Return $iTotalSeconds
EndFunc

Func _setTransparency($iValue)
Func _SetTransparency($iValue)
WinSetTrans($aGui[$eHandle], '', $iValue)
_setGuiTopMost($iValue)
_SetGuiTopMost($iValue)
EndFunc

Func _setGuiTopMost($iValue)
Func _SetGuiTopMost($iValue)
If $iValue == $aTransparency[$eMax] Then
WinSetOnTop($aGui[$eHandle], '', 0)
Else
WinSetOnTop($aGui[$eHandle], '', 1)
EndIf
EndFunc

Func _increaseVisibility()
Func _IncreaseVisibility()
$aTransparency[$eValue] += $aTransparency[$eStep]

If $aTransparency[$eValue] >= $aTransparency[$eMax] Then
$aTransparency[$eValue] = $aTransparency[$eMax]
EndIf

_setTransparency($aTransparency[$eValue])
_SetTransparency($aTransparency[$eValue])
EndFunc

Func _decreaseVisibility()
Func _DecreaseVisibility()
$aTransparency[$eValue] -= $aTransparency[$eStep]

If $aTransparency[$eValue] <= $aTransparency[$eMin] Then
$aTransparency[$eValue] = $aTransparency[$eMin]
EndIf

_setTransparency($aTransparency[$eValue])
_SetTransparency($aTransparency[$eValue])
EndFunc

Func _disposeAndExit()
Func _DisposeAndExit()
GUIDelete()
FileDelete($aFile[$eHtml])

Expand Down
2 changes: 1 addition & 1 deletion src/Gui.au3
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Func _loadGuiAndPlayVideo()
Func _LoadGuiAndPlayVideo()
$aGui[$eHandle] = GUICreate('Au3VidOverlay', $aGui[$eWidth], $aGui[$eHeight], $aGui[$eXPosition], $aGui[$eYPosition], $WS_POPUP, $WS_EX_TOPMOST + $WS_EX_TRANSPARENT)
GUISetBkColor(0xFF000000, $aGui[$eHandle])

Expand Down
6 changes: 3 additions & 3 deletions src/Init.au3
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
HotKeySet('!{NUMPAD5}', '_disposeAndExit')
HotKeySet('!{NUMPADADD}', '_increaseVisibility')
HotKeySet('!{NUMPADSUB}', '_decreaseVisibility')
HotKeySet('!{NUMPAD5}', '_DisposeAndExit')
HotKeySet('!{NUMPADADD}', '_IncreaseVisibility')
HotKeySet('!{NUMPADSUB}', '_DecreaseVisibility')

0 comments on commit 02796af

Please sign in to comment.