Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
mxf-track-swap
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Conrad Zelck
mxf-track-swap
Commits
b7a60664
Commit
b7a60664
authored
1 year ago
by
Simpel
Browse files
Options
Downloads
Patches
Plain Diff
feat: check if there is enough space in %temp%
parent
fb51b12f
Branches
main
Tags
1.0.0.11
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
MXF-Track-Swap.au3
+46
-2
46 additions, 2 deletions
MXF-Track-Swap.au3
with
46 additions
and
2 deletions
MXF-Track-Swap.au3
+
46
−
2
View file @
b7a60664
...
...
@@ -3,7 +3,7 @@
#AutoIt3Wrapper_UseX64=n
#AutoIt3Wrapper_Res_Comment=Swaps audio tracks in mxf files.
#AutoIt3Wrapper_Res_Description=Swaps audio tracks in mxf files.
#AutoIt3Wrapper_Res_Fileversion=1.0.0.1
1
#AutoIt3Wrapper_Res_Fileversion=1.0.0.1
2
#AutoIt3Wrapper_Res_Fileversion_AutoIncrement=p
#AutoIt3Wrapper_Res_LegalCopyright=Conrad Zelck
#AutoIt3Wrapper_Res_SaveSource=y
...
...
@@ -615,6 +615,35 @@ Next
ConsoleWrite("$g_bMuteRouted: " & $g_bMuteRouted & @CRLF)
ConsoleWrite("$g_bExternalWavRouted: " & $g_bExternalWavRouted & @CRLF)
#Region - Check for enough space in %temp%
Local $iSize = FileGetSize($g_sMXFFile)
ConsoleWrite("File size: " & $iSize & @CRLF)
Local $iSafetyFactor = 1.01
$iSize *= $iSafetyFactor
$iSize = Ceiling($iSize)
ConsoleWrite("File size with some reserve: " & $iSize & " +" & $iSafetyFactor * 100 -100 & "%" & @CRLF)
If $g_bExternalWavRouted Then
$iSize *= 2 ; because we need that temporary ffmpeg file too
EndIf
Global $g_bEnoughSpace = False
Do
If $iSize < _GetSpace() Then $g_bEnoughSpace = True
If Not $g_bEnoughSpace Then
Local $iReturn = MsgBox($MB_TOPMOST + $MB_OKCANCEL, "Warning", "It seems that there is not enough memory in the %temp% folder." & _
" Good " & _ByteSuffix($iSize) & " is required." & @CRLF & @CRLF & _
"You can now clean up in the %temp% folder and click 'OK' afterwards (it will be checked again) or cancel the whole thing completely.")
If $iReturn <> 1 Then
Exit
EndIf
EndIf
Until $g_bEnoughSpace
ConsoleWrite("Do it." & @CRLF)
#EndRegion
SplashTextOn("Be patient", "MXF-Track-Swap will be prepared ...", 300, 50)
If Not FileExists(@TempDir & "\ffmpeg.exe") Then
FileInstall('K:\ffmpeg\bin\ffmpeg.exe', @TempDir & "\ffmpeg.exe", $FC_OVERWRITE)
...
...
@@ -642,7 +671,6 @@ WEnd
GUIDelete($g_hGUI)
Exit
;~ #cs
#Region Funcs
Func _CheckForInputFiles($aFiles)
;~ _ArrayDisplay($aFiles)
...
...
@@ -676,6 +704,22 @@ Func _CheckForInputFiles($aFiles)
EndFunc
Func _GetSpace()
Local $iFreeSpace = DriveSpaceFree(@TempDir)
$iFreeSpace *= 1024 ; in KB
$iFreeSpace *= 1024 ; in Byte
ConsoleWrite("Free space: " & $iFreeSpace & @CRLF)
Return Int($iFreeSpace)
EndFunc
Func _ByteSuffix($iBytes)
Local $iIndex = 0, $aArray = [' Bytes', ' KB', ' MB', ' GB', ' TB', ' PB', ' EB', ' ZB', ' YB']
While $iBytes > 1023
$iIndex += 1
$iBytes /= 1024
WEnd
Return Round($iBytes) & $aArray[$iIndex]
EndFunc ;==>ByteSuffix
Func _ReWrap()
$g_hTimerStart = TimerInit()
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment