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

fix: files w/ only one stream but more channels


I forgot all files that have only one stream but many channels. In that
case I take all channels and declare them mono. So divide them by two
to get the measure pairs. If uneven further processing is denied.

Signed-off-by: default avatarConrad Zelck <git@simpel.cc>
parent 190508ce
No related branches found
No related tags found
No related merge requests found
......@@ -2,7 +2,7 @@
#AutoIt3Wrapper_Icon=Icons\peakmeter.ico
#AutoIt3Wrapper_Res_Comment=Measure loudness with ffmpeg according to R128.
#AutoIt3Wrapper_Res_Description=Measure loudness with ffmpeg according to R128.
#AutoIt3Wrapper_Res_Fileversion=1.1.0.15
#AutoIt3Wrapper_Res_Fileversion=1.1.0.16
#AutoIt3Wrapper_Res_Fileversion_AutoIncrement=p
#AutoIt3Wrapper_Res_CompanyName=Norddeutscher Rundfunk
#AutoIt3Wrapper_Res_LegalCopyright=Conrad Zelck
......@@ -82,22 +82,32 @@ Next
Local Enum $eMONO = 1, $eSTEREO
Local $iMonoCount = 0, $iStereoCount = 0
Local $iLayout = 0
StringReplace($sChannels, "1", "1") ; just to get the count
If @extended > 0 Then
$iMonoCount = @extended
If $iMonoCount = $aChannels[0] Then
$iLayout = $eMONO
If Mod($iMonoCount, 2) <> 0 Then $iLayout = 0 ; uneven counter
EndIf
; only one number of channels returned
If $aChannels[0] = 1 Then
ConsoleWrite("Only one number of channels returned: " & $aChannels[0] & @CRLF)
$iLayout = $eMONO
If Mod($iMonoCount, 2) <> 0 Then $iLayout = 0 ; uneven counter
$iMonoCount = $aChannels[1]
ConsoleWrite("Monofiles: " & $iMonoCount & @CRLF)
EndIf
StringReplace($sChannels, "2", "2") ; just to get the count
If @extended > 0 Then
$iStereoCount = @extended
If $iStereoCount = $aChannels[0] Then
$iLayout = $eSTEREO
Else ; hope all returned channels are the same
StringReplace($sChannels, "1", "1") ; just to get the count
If @extended > 0 Then
$iMonoCount = @extended
If $iMonoCount = $aChannels[0] Then
$iLayout = $eMONO
If Mod($iMonoCount, 2) <> 0 Then $iLayout = 0 ; uneven counter
EndIf
ConsoleWrite("Monofiles: " & $iMonoCount & @CRLF)
EndIf
StringReplace($sChannels, "2", "2") ; just to get the count
If @extended > 0 Then
$iStereoCount = @extended
If $iStereoCount = $aChannels[0] Then
$iLayout = $eSTEREO
EndIf
ConsoleWrite("Stereofiles: " & $iStereoCount & @CRLF)
EndIf
ConsoleWrite("Stereofiles: " & $iStereoCount & @CRLF)
EndIf
Local $iMeasuringPairs = 0
Switch $iLayout
......@@ -112,6 +122,7 @@ Switch $iLayout
MsgBox($MB_TOPMOST, "Error", "Track layout is undefined." & @CRLF & @CRLF & "Application exits.")
Exit
EndSwitch
ConsoleWrite("Pairs for measuring: " & $iMeasuringPairs & @CRLF)
Local $bShowTrackSelection = True
If $iMeasuringPairs = 1 Then $bShowTrackSelection = False ; then there is no choice of tracks
......
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