Skip to content
Snippets Groups Projects
Commit a7a68896 authored by SimpelMe's avatar SimpelMe
Browse files

feat: create dynamic number of track radios


Maximal 4 stereo tracks were possible. Now the number of track radios
depend on the number of channels.

Signed-off-by: default avatarConrad Zelck <git@simpel.cc>
parent fe3568d1
No related branches found
No related tags found
No related merge requests found
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
#AutoIt3Wrapper_Icon=Icons\peakmeter.ico #AutoIt3Wrapper_Icon=Icons\peakmeter.ico
#AutoIt3Wrapper_Res_Comment=Measure loudness with ffmpeg according to R128. #AutoIt3Wrapper_Res_Comment=Measure loudness with ffmpeg according to R128.
#AutoIt3Wrapper_Res_Description=Measure loudness with ffmpeg according to R128. #AutoIt3Wrapper_Res_Description=Measure loudness with ffmpeg according to R128.
#AutoIt3Wrapper_Res_Fileversion=1.1.0.16 #AutoIt3Wrapper_Res_Fileversion=1.1.0.18
#AutoIt3Wrapper_Res_Fileversion_AutoIncrement=p #AutoIt3Wrapper_Res_Fileversion_AutoIncrement=p
#AutoIt3Wrapper_Res_CompanyName=Norddeutscher Rundfunk #AutoIt3Wrapper_Res_CompanyName=Norddeutscher Rundfunk
#AutoIt3Wrapper_Res_LegalCopyright=Conrad Zelck #AutoIt3Wrapper_Res_LegalCopyright=Conrad Zelck
...@@ -132,41 +132,23 @@ If $iMeasuringPairs = 1 Then $bShowTrackSelection = False ; then there is no cho ...@@ -132,41 +132,23 @@ If $iMeasuringPairs = 1 Then $bShowTrackSelection = False ; then there is no cho
Local $iTrackL = 1 Local $iTrackL = 1
Local $iTrackR = 2 Local $iTrackR = 2
If $bShowTrackSelection Then If $bShowTrackSelection Then
GUICreate("Tracks", 300, 50) Local $aTrackRadios[$iMeasuringPairs * 2]
Local $idTracks12 = GUICtrlCreateRadio("1+2", 10, 10, 50, 30) GUICreate("Tracks", 100 + (50 * $iMeasuringPairs), 50)
GUICtrlSetState(-1, $GUI_CHECKED) GUISetOnEvent($GUI_EVENT_CLOSE, "_Exit")
Local $idTracks34 = GUICtrlCreateRadio("3+4", 60, 10, 50, 30) For $i = 1 To $iMeasuringPairs * 2 Step 2
Local $idTracks56 = GUICtrlCreateRadio("5+6", 110, 10, 50, 30) $aTrackRadios[$i] = GUICtrlCreateRadio($i & "+" & $i +1, 10 + (25 * ($i -1)), 10, 50, 30)
Local $idTracks78 = GUICtrlCreateRadio("7+8", 160, 10, 50, 30) GUICtrlSetOnEvent(-1, "_TrackRadioPressed")
If $iMeasuringPairs < 3 Then Next
GUICtrlSetState($idTracks56, $GUI_HIDE) GUICtrlSetState($aTrackRadios[1], $GUI_CHECKED)
GUICtrlSetState($idTracks78, $GUI_HIDE) Local $idButtonOK = GUICtrlCreateButton("OK", 10 + (50 * $iMeasuringPairs), 10, 80, 30, $BS_DEFPUSHBUTTON)
ElseIf $iMeasuringPairs < 4 Then GUICtrlSetOnEvent(-1, "_ExitLoop")
GUICtrlSetState($idTracks78, $GUI_HIDE)
EndIf
Local $idButtonOK = GUICtrlCreateButton("OK", 210, 10, 80, 30, $BS_DEFPUSHBUTTON)
GUISetState(@SW_SHOW) GUISetState(@SW_SHOW)
Opt("GUIOnEventMode", 1)
While 1 Global $g_bExitLoop = False
Switch GUIGetMsg() While Not $g_bExitLoop
Case $GUI_EVENT_CLOSE Sleep(10)
Exit
Case $idButtonOK
ExitLoop
Case $idTracks12
$iTrackL = 1
$iTrackR = 2
Case $idTracks34
$iTrackL = 3
$iTrackR = 4
Case $idTracks56
$iTrackL = 5
$iTrackR = 6
Case $idTracks78
$iTrackL = 7
$iTrackR = 8
EndSwitch
WEnd WEnd
Opt("GUIOnEventMode", 0)
GUIDelete() GUIDelete()
EndIf EndIf
ConsoleWrite("L: " & $iTrackL & @CRLF) ConsoleWrite("L: " & $iTrackL & @CRLF)
...@@ -336,4 +318,22 @@ Func _Zeit($iMs, $bComfortView = True) ; from ms to a format: "12h 36m 56s 13f" ...@@ -336,4 +318,22 @@ Func _Zeit($iMs, $bComfortView = True) ; from ms to a format: "12h 36m 56s 13f"
$sReturn = $sSign & StringRight('0' & Int($iHour), 2) & 'h' & ChrW(8239) & StringRight('0' & Int($iMin), 2) & 'm' & ChrW(8239) & StringRight('0' & Int($iSec), 2) & 's' & ChrW(8239) & StringRight('0' & Int($iFrames), 2) & 'f' $sReturn = $sSign & StringRight('0' & Int($iHour), 2) & 'h' & ChrW(8239) & StringRight('0' & Int($iMin), 2) & 'm' & ChrW(8239) & StringRight('0' & Int($iSec), 2) & 's' & ChrW(8239) & StringRight('0' & Int($iFrames), 2) & 'f'
EndIf EndIf
Return $sReturn Return $sReturn
EndFunc ;==>_Zeit EndFunc ;==>_Zeit
\ No newline at end of file
Func _TrackRadioPressed()
Local $iTemp = @GUI_CtrlId
$iTemp -= 2
$iTemp *= 2
$iTrackR = $iTemp
$iTemp -= 1
$iTrackL = $iTemp
ConsoleWrite($iTemp & @CRLF)
EndFunc
Func _Exit()
Exit
EndFunc
Func _ExitLoop()
$g_bExitLoop = True
EndFunc
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment