Jump to content

Progress Loop Not Working


Recommended Posts

I'm having problems with this variable loop progress. The progress wont go past about 1/8 the of the whole progress bar. Also, this part here that is loop is the second part of the script, so it is the "B" section. I have "A" "B" and "C". How can I get this to work with the whole thing instead of just the current "B" part showing here. Thanks.

$progressbar1 = GUICtrlCreateProgress (10,330,261,20,$PBS_SMOOTH)
$looping=GuiCtrlRead($loop)
For $a = 1 to $looping
        $Percent = ($a / $looping) * 100
            GUICtrlSetData ($progressbar1, $a)
    Send("s")                                                       ;-N----Solo track
        Sleep ( 1000 )                                              ;Time before next step 1000 = 1 second
        
ProgressSet($Percent, $a & " of " & $looping & " tracks mixing down.", "Progress...")   

    Send("^!+s")                                                    ;-N----Selects all on particular track
        Sleep ( 1500 )
        
ProgressSet($Percent, $a & " of " & $looping & " tracks mixing down.", "Progress...")

    Send("!1")                                                      ;Opens edit view
        WinWaitActive ("Nuendo", "Sample Editor:")      
            Sleep ( 500 )
            
ProgressSet($Percent, $a & " of " & $looping & " tracks mixing down.", "Progress...")
 
    $bull = StringTrimLeft(WinGetText(""), 15)                      ;Copys title of track and deletes "Sample Editor:"
        Sleep ( 100 )

ProgressSet($Percent, $a & " of " & $looping & " tracks mixing down.", "Progress...")
        
    Send("!1")                                                      ;-N----Close edit view
        WinWaitClose("Nuendo", "Sample Editor:")        
            Sleep ( 1000 )

ProgressSet($Percent, $a & " of " & $looping & " tracks mixing down.", "Progress...")

    Send("!e")                                                      ;-N----Opens mixdown window
        WinWaitActive("Export Audio Mixdown in", "File name:")
            Sleep ( 1000 )

ProgressSet($Percent, $a & " of " & $looping & " tracks mixing down.", "Progress...")

    $Split = StringSplit($bull, @LF)                                ;Split off LFs from copying the text of "Sample Editor"
        If IsArray($Split) Then
            For $i = 1 To 1
                Send($Split[$i])                                    ;Pastes split up track name
                    Next
ProgressSet($Percent, $a & " of " & $looping & " tracks mixing down.", "Progress...")                   
        EndIf
            Sleep ( 1500 )

    Send("{ENTER}")                                                 ;Save---start mixdown
        WinWaitClose("Export Audio Mixdown in", "File name:")
            Sleep ( 1000 )
            
ProgressSet($Percent, $a & " of " & $looping & " tracks mixing down.", "Progress...")   
    
    If WinExists("Nuendo", "Do you want to replace") Then
        Send("{ENTER}")
;EndIf
        Sleep( 2000 )                                                 ;If there are situations where you will have tracks that ARE NOT in the pool, uncomment the line before AND after this line, AND comment out the sleep function at the beginning of this line. 
;If WinExists("Nuendo", "Continue") Then
        Send("{ENTER}")
            WinWaitClose("Export Audio:", "Abort")
                Sleep( 3000 )
ProgressSet($Percent, $a & " of " & $looping & " tracks mixing down.", "Progress...")
    EndIf


    If WinExists("Nuendo", "Import Options") Then
        Send("{ENTER}")                                             ;import
            Sleep ( 3000 )
ProgressSet($Percent, $a & " of " & $looping & " tracks mixing down.", "Progress...")           
    EndIf

    WinWaitClose("Export Audio:", "Abort")
            Sleep ( 1000 )
    ProgressSet($Percent, "", "Progress ...")
    Send("s")                                                       ;-N----unsolo track
        Sleep ( 3000 )
        
ProgressSet($Percent, $a & " of " & $looping & " tracks mixing down.", "Progress...")

    $removingMD=GuiCtrlRead($removeMD)                              ;remove original mixed down track
        if $removingMD = 1 then
            Send("!r")                                              ;-N----Remove track
                Sleep (4000)
                    Else
            Send("{DOWN}")                                          ;move to the next track
                Sleep( 2000 )
ProgressSet($Percent, $a & " of " & $looping & " tracks mixing down.", "Progress...")       
        Endif

    Next                                                              ;loop until number of times specified
ProgressOff()
Link to comment
Share on other sites

zzz~ confusing identation! Re-identing + Removing unnecesary ProgressSets:

$progressbar1 = GUICtrlCreateProgress (10,330,261,20,$PBS_SMOOTH)
$looping=GuiCtrlRead($loop)
For $a = 1 to $looping
    $Percent = ($a / $looping) * 100
    ProgressSet($Percent, $a & " of " & $looping & " tracks mixing down.", "Progress...")   
    GUICtrlSetData ($progressbar1, $a)
    
    Send("s")                                                      ;-N----Solo track
    Sleep ( 1000 )                                             ;Time before next step 1000 = 1 second
    
    Send("^!+s")                                                   ;-N----Selects all on particular track
    Sleep ( 1500 )
        
    Send("!1")                                                     ;Opens edit view
    WinWait ("Nuendo", "Sample Editor:")       ;;nfwu: more efficent code:
    WinActivate ("Nuendo", "Sample Editor:")        
    WinWaitActive ("Nuendo", "Sample Editor:")      
            
    $bull = StringTrimLeft(WinGetText(""), 15)         ;Copys title of track and deletes "Sample Editor:"

        
    Send("!1")                                                     ;-N----Close edit view
    WinWaitClose("Nuendo", "Sample Editor:")        
    Sleep ( 1000 )

    Send("!e")                                                     ;-N----Opens mixdown window
    WinWait("Export Audio Mixdown in", "File name:");;nfwu: more efficent code:
    WinActivate("Export Audio Mixdown in", "File name:")
    WinWaitActive("Export Audio Mixdown in", "File name:")

    $Split = StringSplit($bull, @LF)                               ;Split off LFs from copying the text of "Sample Editor"
    If IsArray($Split) Then
       Send($Split[1])                                 ;Pastes split up track name
    EndIf
    Sleep ( 1500 )

    Send("{ENTER}")                                                ;Save---start mixdown
    WinWaitClose("Export Audio Mixdown in", "File name:")
    Sleep ( 1000 )
             
    
    If WinExists("Nuendo", "Do you want to replace") Then
        Send("{ENTER}")
;EndIf
        Sleep( 2000 )                                                 ;If there are situations where you will have tracks that ARE NOT in the pool, uncomment the line before AND after this line, AND comment out the sleep function at the beginning of this line. 
;If WinExists("Nuendo", "Continue") Then
        Send("{ENTER}")
        WinWaitClose("Export Audio:", "Abort")
        Sleep( 3000 )
    EndIf


    If WinExists("Nuendo", "Import Options") Then
        Send("{ENTER}")                                            ;import
    EndIf

    WinWaitClose("Export Audio:", "Abort")
    Sleep ( 100 )
    Send("s")                                                      ;-N----unsolo track
    Sleep ( 3000 )
        

    $removingMD=GuiCtrlRead($removeMD)                             ;remove original mixed down track
        if $removingMD = 1 then
            Send("!r")                                             ;-N----Remove track
            Sleep (4000)
        Else
            Send("{DOWN}")                                         ;move to the next track
            Sleep( 2000 )  
        Endif

    Next                                                             ;loop until number of times specified
ProgressOff()

Easier to read code. But i do not think i have solved your problem

#)

Link to comment
Share on other sites

Well, you are right, you didn't solve my problem, but thanks anyway. I originally had it the way you are saying to do it now and the progress bar was coming up less than what it is now. I put it back to the way I originally had...the way you are saying, and the same problem as original. Any other way/idea?

Link to comment
Share on other sites

i use progresson()

ProgressOn("Progress Meter", "Increments every second", "0 percent")
For $i = 10 to 100 step 10
    sleep(1000)
    ProgressSet( $i, $i & " percent")
Next
ProgressSet(100 , "Done", "Complete")
sleep(500)
ProgressOff()

in Welcome to Autoit 1-2-3 and in IE.au3 Builder

8)

NEWHeader1.png

Link to comment
Share on other sites

  • Moderators

I actually tried that, but I didn't like how the progress bar moved in that one. I like the smooth flow version. Am I able to get that with the "ProgressOn" version?

Larry Made some nice UDFs in the Scripts and Scraps forum that can do what you want (if I understand what you want).

Edit:

I could have sworne there was one made where you could use different bitmaps or jpegs for the smooth progress bar, giving it different shades as it progressed, but for the life of me I can't find it.

I did find this one:

http://www.autoitscript.com/forum/index.ph...topic=19421&hl=

Edited by SmOke_N

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Link to comment
Share on other sites

That isn't what I wanted, however I am trying to put it in my gui but it wont even show up much less work.

What I really want is for the progress bar to be ONE long smooth bar that increases. This increases with little blocks.

The usual way with it in its own little window, it is one long bar, but it increases in block increments. I hope I'm clear with that.

Link to comment
Share on other sites

Let me get this right:

Choose only ONE option

A. You want it to look good

B. You want it to work.

I'm getting a little confused here...

#)

Link to comment
Share on other sites

  • Moderators

That isn't what I wanted, however I am trying to put it in my gui but it wont even show up much less work.

What I really want is for the progress bar to be ONE long smooth bar that increases. This increases with little blocks.

The usual way with it in its own little window, it is one long bar, but it increases in block increments. I hope I'm clear with that.

Yeah I understand what you want, like I said, I know there is a thread done on it, I just can't find it.

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Link to comment
Share on other sites

That's fine, I guess I'll look for it...no problem. But I think I found out why this wont work, if you can help. It seems the

While 1
WEnd

Is exactly what is stopping this. When I take it out, it shows up on the gui.

Link to comment
Share on other sites

  • Moderators

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Link to comment
Share on other sites

I took Example 1 and incorporated it; I like the color change. However:

1/ I still have the same problem. It's moving in blocks instead of smoothly. I THINK I figured out why. The progress bar is moving based on a variable input, so it's progressing by the amount of times it loops, and waiting until the next loop to increase to the next point. So, is there a way to change it so it moves by percentage even if it is counting the loops.....if my theory is correct.

2/ If I incorporate the one you pointed out to me...or any of the progress bars I've tried in the GUI, it still doesn't go past the first 1/8 of the bar upon completion. See image below.

That is where the bar stops upon completion.

Here is the full script I now have.

#include <GUIConstants.au3>

DllCall("uxtheme.dll", "none", "SetThemeAppProperties", "int", 0)

;left - top - width - height
$Main = GUICreate ("Nuendo Auto Mixdown", 283, 450);width, height
GuiCtrlCreatePic("nuendo2.gif",0,0, 286, 435, $WS_EX_LAYERED)


$ProgBar_1 = GUICtrlCreateProgress(10, 330, 260, 20, $PBS_Smooth)


GuiCtrlCreateGroup("Optional", 10, 10, 261, 130)
GUICtrlSetBkColor(-1,0xADC7DE)
$removeMD = GuiCtrlCreateCheckbox("Remove original track after mixdown.", 15, 25, 200)
GUICtrlSetBkColor(-1,0xADC7DE)
$removeUM = GuiCtrlCreateCheckbox("Remove unused media from pool.", 15, 55, 200)
GUICtrlSetBkColor(-1,0xADC7DE)
$emptytrash = GuiCtrlCreateCheckbox("Empty trash.", 15, 85, 200)
GUICtrlSetBkColor(-1,0xADC7DE)
$exportmaster = GuiCtrlCreateCheckbox("Create a master 2 track mixdown.", 15, 115, 200)
GUICtrlSetBkColor(-1,0xADC7DE)

$label1 = GUICtrlCreateLabel ( "Number of tracks in multitrack to mixdown.", 15,  145, 215, 20)
GUICtrlSetBkColor(-1,0xADC7DE)

$loop = GUICtrlCreateInput("", 240, 145, 27, 21, $ES_NUMBER)

GuiCtrlCreateGroup("Bypass Mixer Settings:", 10, 170, 261, 60)
GUICtrlSetBkColor(-1,0xADC7DE)
$label3 = GUICtrlCreateLabel ( "(If you do not want to print)", 15,  190, 155, 20)
GUICtrlSetBkColor(-1,0xADC7DE)
$eq = GuiCtrlCreateCheckbox("EQs",15,205)                                   ;Mixer WQs
GUICtrlSetBkColor(-1,0xADC7DE)
$send = GuiCtrlCreateCheckbox("Sends",65,205)                               ;Mixer Send
GUICtrlSetBkColor(-1,0xADC7DE)
$insert = GuiCtrlCreateCheckbox("Inserts",125,205)                          ;Mixer Inserts
GUICtrlSetBkColor(-1,0xADC7DE)
$BypassAll = GUICtrlCreateCheckbox("Bypass All", 190, 205)                  ;Bypass All
GUICtrlSetBkColor(-1,0xADC7DE)

$save = GuiCtrlCreateCheckbox("Save",10, 235)                               ;Save
GUICtrlSetBkColor(-1,0xADC7DE)

$label4 = GUICtrlCreateLabel ( "( Or )", 66, 235, 30, "",$ES_CENTER)
GUICtrlSetBkColor(-1,0xADC7DE)

$saveasCHBX = GuiCtrlCreateCheckbox("Save As:",110, 235)
GUICtrlSetBkColor(-1,0xADC7DE)
$saveasINPT = GUICtrlCreateInput("", 174, 235, 96, 21)                      ;Save As


$ok = GUICtrlCreateButton("Ok", 10, 260, 80, 20)                            ;Submit
GUICtrlSetBkColor(-1, 0xADC7DE)
$pref = GUICtrlCreateButton("Settings", 100, 260, 80, 20)                     ;Pref's
GUICtrlSetBkColor(-1, 0xADC7DE)
$cancel = GUICtrlCreateButton("Cancel", 190, 260, 80, 20)                  ;Cancel
GUICtrlSetBkColor(-1, 0xADC7DE)





;///////////////////////////////////////////////////////////////////////////////////////
;///////////////////////////////////////////////////////////////////////////////////////



$Drive = IniRead("test.ini", "Drive", "Letter", "NotFound")

$total = DriveSpaceTotal($Drive)
$free = DriveSpaceFree($Drive)
$used = $total - $free


$progress = GuiCtrlCreateProgress(10, 285, 260, 20, $PBS_SMOOTH)
GUICtrlSetBkColor(-1,0xff0000)

$labe5 = GUICtrlCreateLabel ( "Check Drive.", 10,  305, 64, 20)
GUICtrlSetBkColor(-1,0xADC7DE)

GuiCtrlSetData($progress,  100 * $used / DriveSpaceTotal($Drive))

GuiCtrlCreateLabel(Round($used/1024,2) & " GB used ", 115, 305, 80, 20,$ES_CENTER)
GUICtrlSetBkColor(-1,0xADC7DE)

;$labe5 = GUICtrlCreateLabel ( "Note", 105, 305, 70, "15",$ES_CENTER)
;GUICtrlSetBkColor(-1,0xADC7DE)
;GUICtrlSetTip(-1,"If you have multiple drives, this should be set to your Audio drive on line 57, 58, 65")

GuiCtrlCreateLabel(Round($free/1024,2) & " GB free ", 193, 305, 80, 20,$ES_CENTER)
GUICtrlSetBkColor(-1,0xADC7DE)



;///////////////////////////////////////////////////////////////////////////////////////
;///////////////////////////////////////////////////////////////////////////////////////


$filemenu = GUICtrlCreateMenu ("&File")
$fileitem = GUICtrlCreateMenuitem ("Open Nuendo",$filemenu)
GUICtrlSetState(-1,$GUI_DEFBUTTON)

$helpmenu = GUICtrlCreateMenu ("?")
$infoitem = GUICtrlCreateMenuitem ("Info",$helpmenu)




GuiSetState()


$Progress = 0; Will be 0 thru 1000
$Increment = 0


;//////////////////////////////////////////////////////////////////////////////////////

$Child = GUICreate("Nuendo - Settings", 283, 375);width, height, ?, ?
GUICtrlCreatePic("nuendo2.gif", 0, 0, 286, 375, $WS_EX_LAYERED)

$Where='test.ini'
$A='Sleep after'

$labelSleep1 = GUICtrlCreateLabel($A &" ..." , 10, 10, 220, 20)
GUICtrlSetBkColor(-1, 0xADC7DE)
$sleep1=IniRead($Where, 'Sleep', 'Solo Send', 'no')
$sleep2=GUICtrlCreateInput($sleep1, 230, 10, 36, 19, $ES_NUMBER)
iniwrite($Where, 'Sleep', 'Solo Send', guictrlread($sleep2))

$labelSleep2 = GUICtrlCreateLabel($A &" ..." , 10, 35, 220, 20)
GUICtrlSetBkColor(-1, 0xADC7DE)
$sleep3=IniRead($Where, 'Sleep', 'Solo Send', 'no')
$sleep4=GUICtrlCreateInput($sleep3, 230, 35, 36, 19, $ES_NUMBER)
iniwrite($Where, 'Sleep', 'Solo Send', guictrlread($sleep4))

$labelSleep3 = GUICtrlCreateLabel($A &" ..." , 10, 60, 220, 20)
GUICtrlSetBkColor(-1, 0xADC7DE)
$sleep5=IniRead($Where, 'Sleep', 'Solo Send', 'no')
$sleep6=GUICtrlCreateInput($sleep5, 230, 60, 36, 19, $ES_NUMBER)
iniwrite($Where, 'Sleep', 'Solo Send', guictrlread($sleep6))

$labelSleep4 = GUICtrlCreateLabel($A &" ..." , 10, 85, 220, 20)
GUICtrlSetBkColor(-1, 0xADC7DE)
$sleep7=IniRead($Where, 'Sleep', 'Solo Send', 'no')
$sleep8=GUICtrlCreateInput($sleep7, 230, 85, 36, 19, $ES_NUMBER)
iniwrite($Where, 'Sleep', 'Solo Send', guictrlread($sleep8))

$labelSleep5 = GUICtrlCreateLabel($A &" ..." , 10, 110, 220, 20)
GUICtrlSetBkColor(-1, 0xADC7DE)
$sleep9=IniRead($Where, 'Sleep', 'Solo Send', 'no')
$sleep10=GUICtrlCreateInput($sleep9, 230, 110, 36, 19, $ES_NUMBER)
iniwrite($Where, 'Sleep', 'Solo Send', guictrlread($sleep10))

$labelSleep6 = GUICtrlCreateLabel($A &" ..." , 10, 135, 220, 20)
GUICtrlSetBkColor(-1, 0xADC7DE)
$sleep11=IniRead($Where, 'Sleep', 'Solo Send', 'no')
$sleep12=GUICtrlCreateInput($sleep11, 230, 135, 36, 19, $ES_NUMBER)
iniwrite($Where, 'Sleep', 'Solo Send', guictrlread($sleep12))

$labelSleep7 = GUICtrlCreateLabel($A &" ..." , 10, 160, 220, 20)
GUICtrlSetBkColor(-1, 0xADC7DE)
$sleep13=IniRead($Where, 'Sleep', 'Solo Send', 'no')
$sleep14=GUICtrlCreateInput($sleep13, 230, 160, 36, 19, $ES_NUMBER)
iniwrite($Where, 'Sleep', 'Solo Send', guictrlread($sleep14))

$labelSleep8 = GUICtrlCreateLabel($A &" ..." , 10, 185, 220, 20)
GUICtrlSetBkColor(-1, 0xADC7DE)
$sleep15=IniRead($Where, 'Sleep', 'Solo Send', 'no')
$sleep16=GUICtrlCreateInput($sleep15, 230, 185, 36, 19, $ES_NUMBER)
iniwrite($Where, 'Sleep', 'Solo Send', guictrlread($sleep16))


$labelDrive = GUICtrlCreateLabel("Check audio drive space ex. D:" , 10, 185, 220, 20)
GUICtrlSetBkColor(-1, 0xADC7DE)
$drive1=IniRead($Where, 'Sleep', 'Solo Send', 'no')
$drive2=GUICtrlCreateInput($drive1, 230, 185, 36, 19, $ES_NUMBER)
iniwrite($Where, 'Sleep', 'Solo Send', guictrlread($drive2))




$ok2 = GUICtrlCreateButton("Ok", 10, 240, 80, 20)                         ;Submit
GUICtrlSetBkColor(-1, 0xADC7DE)

$cancel2 = GUICtrlCreateButton("Cancel", 195, 240, 80, 20)                ;Cancel
GUICtrlSetBkColor(-1, 0xADC7DE)

;//////////////////////////////////////////////////

GUISetState(@SW_HIDE)



    While 1
        $msg = GUIGetMsg()
            If $msg = $fileitem Then
                RunWait("C:\Additions\Studio\Appz\Nuendo v3.2\Nuendo3.exe")
        EndIf 
        
        If $msg = $infoitem Then Msgbox(0,"Info","Only a test...")


        If $msg = $BypassAll Then
            If GUICtrlRead($BypassAll) = $GUI_CHECKED Then
            GUICtrlSetState($eq, $GUI_CHECKED)
            GUICtrlSetState($insert, $GUI_CHECKED)
            GUICtrlSetState($send, $GUI_CHECKED)
            Else
            GUICtrlSetState($eq, $GUI_UNCHECKED)
            GUICtrlSetState($insert, $GUI_UNCHECKED)
            GUICtrlSetState($send, $GUI_UNCHECKED)              
            EndIf
        EndIf
        If $msg = $eq Then      
            If GUICtrlRead($eq) = $GUI_UNCHECKED Then
            GUICtrlSetState($BypassAll, $GUI_UNCHECKED) 
            EndIf
        EndIf   
        If $msg = $insert Then      
            If GUICtrlRead($insert) = $GUI_UNCHECKED Then
            GUICtrlSetState($BypassAll, $GUI_UNCHECKED) 
            EndIf
        EndIf       
        If $msg = $send Then        
            If GUICtrlRead($send) = $GUI_UNCHECKED Then
            GUICtrlSetState($BypassAll, $GUI_UNCHECKED) 
            EndIf
        EndIf       
        If $msg = $send AND $eq Then        
            If GUICtrlRead($send) AND ($eq) = $GUI_CHECKED Then
            GUICtrlSetState($BypassAll, $GUI_CHECKED)   
            EndIf
        EndIf               

    
    
    
Select
        Case $msg = $GUI_EVENT_CLOSE Or $msg = $cancel
            Exit
        Case $msg = $ok
            Function ()
        Case $msg = $pref
            GUISetState(@SW_HIDE, $Main)
            GUISetState(@SW_SHOW, $Child)
        Case $msg = $ok2
            GUISetState(@SW_HIDE, $Child)
            GUISetState(@SW_SHOW, $Main)

             
EndSelect
WEnd
GUIDelete()
 
Func Function ()



WinActivate("Nuendo", "Project")
Sleep (2000 )



;Open Mixer and bypass all eqs, sends, inserts
    $BSends=GuiCtrlRead($send)
    $BInserts=GuiCtrlRead($insert)
    $BEQs=GuiCtrlRead($eq)
     if GUICtrlRead($send) = 1 or GUICtrlRead($insert) = 1 or Guictrlread($eq) = 1 Then
    Send("{F3}")                                                    ;-N----Opens mixer
    
        Sleep ( 300 )       
    
        if $BEQs = 1 then   
            Send("!+e")                                             ;-N----Bypass eqs
        Endif       
        if $BSends = 1 then 
            Send("!+s")                                             ;-N----Bypass sends
        Endif   
        if $BInserts = 1 then       
            Send("!+i")                                             ;-N----Bypass inserts
        Endif       
    
        Sleep ( 700 )
    Send("{F3}")                                                    ;-N----Opens mixer

Endif

;Start Mixing Down

    Send("{HOME}")                                                  ;Go to top of multitrack
        Sleep ( 1000 )

;Start the loop function

ProgressOn("Auto Mixdown Progress","Please wait.","Beginning Mixdown","23","100","16")


$looping=GuiCtrlRead($loop)
For $a = 1 to $looping
        $Percent = ($a / $looping) * 100



    If $Percent < 0 Then $Percent = 0
    If $Percent > 1000 Then $Percent = 1000
    GUICtrlSetData($ProgBar_1, Int($Percent / 10))
    
    $Redness = Int(255 - ($Percent / 1000 * 512))
    If $Redness < 0 Then $Redness = 0
        
    $Greeness = Int(($Percent / 1000 * 512) - 257)
    If $Greeness < 0 Then $Greeness = 0
        
    $Blueness = Int(255 - ($Redness + $Greeness))
    
    $ProgColor = ($Redness * 256 * 256) + ($Greeness * 256) + $Blueness
   GUICtrlSetColor($ProgBar_1, $ProgColor)





ProgressSet($Percent, $a & " of " & $looping & " tracks mixing down.", "Progress...")   


    Send("s")                                                       ;-N----Solo track
        Sleep ( 1000 )                                              ;Time before next step 1000 = 1 second
        

    Send("^!+s")                                                    ;-N----Selects all on particular track
        Sleep ( 1500 )
        

    Send("!1")                                                      ;Opens edit view
        WinWaitActive ("Nuendo", "Sample Editor:")      
            Sleep ( 500 )
            
 
    $bull = StringTrimLeft(WinGetText(""), 15)                      ;Copys title of track and deletes "Sample Editor:"
        Sleep ( 100 )

        
    Send("!1")                                                      ;-N----Close edit view
        WinWaitClose("Nuendo", "Sample Editor:")        
            Sleep ( 1000 )



    Send("!e")                                                      ;-N----Opens mixdown window
        WinWaitActive("Export Audio Mixdown in", "File name:")
            Sleep ( 1000 )



    $Split = StringSplit($bull, @LF)                                ;Split off LFs from copying sthe text of "Sample Editor"



        If IsArray($Split) Then
            For $i = 1 To 1
                Send($Split[$i])                                    ;Pastes split up track name
                Sleep(500)
ProgressSet($Percent,$a & " of " & $looping & " tracks mixing down." & @LF & "Currently Track: " & $Split[$i] & @LF & "Please Wait.", "Progress...")                    
                    Next                            
        EndIf
            Sleep ( 1500 )

    Send("{ENTER}")                                                 ;Save---start mixdown
        WinWaitClose("Export Audio Mixdown in", "File name:")
            Sleep ( 1000 )
            
            
    
    If WinExists("Nuendo", "Do you want to replace") Then
        Send("{ENTER}")
;EndIf
        Sleep( 2000 )                                                 ;If there are situations where you will have tracks that ARE NOT in the pool, uncomment the line before AND after this line, AND comment out the sleep function at the beginning of this line. 
;If WinExists("Nuendo", "Continue") Then
        Send("{ENTER}")
            WinWaitClose("Export Audio:", "Abort")
                Sleep( 3000 )
                
    EndIf


    If WinExists("Nuendo", "Import Options") Then
        Send("{ENTER}")                                             ;import
            Sleep ( 3000 )
                    
    EndIf

    WinWaitClose("Export Audio:", "Abort")
            Sleep ( 1000 )
            
    Send("s")                                                       ;-N----unsolo track
        Sleep ( 3000 )
        

    $removingMD=GuiCtrlRead($removeMD)                              ;remove original mixed down track
        if $removingMD = 1 then
            Send("!r")                                              ;-N----Remove track
                Sleep (4000)
                    Else
            Send("{DOWN}")                                          ;move to the next track
                Sleep( 2000 )
    
        Endif

    Next                                                              ;loop until number of times specified
ProgressOff()

;Open Mixer and clear bypass on all eqs, sends, inserts

    $BSends=GuiCtrlRead($send)
    $BInserts=GuiCtrlRead($insert)
    $BEQs=GuiCtrlRead($eq)
     if GUICtrlRead($send) = 1 or GUICtrlRead($insert) = 1 or Guictrlread($eq) = 1 Then

    Send("{F3}")                                                    ;-N----Open mixer
        WinWaitActive ( "Nuendo", "Mixer" )
            Sleep ( 300 )

        if $BEQs = 1 then   
            Send("!+e")                                             ;-N----Bypass egs
    Endif   
    
        if $BSends = 1 then 
            Send("!+s")                                             ;-N----Bypass sends
    Endif   
    
        if $BInserts = 1 then       
            Send("!+i")                                             ;-N----Bypass inserts
        Endif

    Sleep ( 700 )
        Send("{F3}")                                                ;-N----Close mixer

        Endif
        
Sleep ( 2000 )


;Final options

    $removingUM=GuiCtrlRead($removeUM)                              ;Remove unused media option
        if $removeUM = 1 then
            Send("!+r")                                             ;-N----Remove unused media from pool to trash
                Sleep ( 500 )
        Endif


    $emptyingtrash=GuiCtrlRead($emptytrash)                         ;Empty trash option
        if $emptyingtrash = 1 then
            Send("!t")                                              ;-N----Erase pool trash from Hard Disk
                WinWaitActive ( "Nuendo", "Erase" )
                    Send("{ENTER}")
                        Sleep ( 5000 )
        Endif

;///////////////////////////////////////Begin Exporting Two Track Mixdown//////////////////
    $exportingmaster=GuiCtrlRead($exportmaster)                     ;Export a master 2 track of mix
        if $exportingmaster = 1 then
            $MasterMixdown1 = StringTrimLeft(WinGetText(""), 14)    ;Copys title of track and deletes "Sample Editor:"
                Sleep ( 100 )


    $MasterMixdown2 = StringTrimRight($MasterMixdown1, 5)           ;Copys title of track and deletes "Sample Editor:"
        Sleep ( 100 )

    Send("!e")                                                      ;-N----Opens mixdown window
        Sleep ( 500 )

    Send ("Mixdown")
        Sleep ( 700 )
            Send ($MasterMixdown2)                                  ;Pastes final name of track
                Sleep ( 9000 )
                    Send("{ENTER}")
                        Sleep ( 1000 )

    If WinExists("Nuendo", "Do you want to replace") Then
        Send("{ENTER}")
;           EndIf
                Sleep( 500 )                                        ;If there are situations where you will have tracks that ARE NOT in the pool, uncomment the line before AND after this line, AND comment out the sleep function at the beginning of this line.
;   If WinExists("Nuendo", "This file is already used in a pool") Then
        Send("{ENTER}")
            WinWaitClose("Nuendo", "Estimated Time Remaining")
                Sleep( 3000 )
    EndIf


    If WinExists("Nuendo", "Import Options") Then
        Send("{ENTER}")
            Sleep ( 3000 )
    EndIf
        
    WinWaitClose("Export Audio:", "Abort")
            Sleep ( 3000 )
    $saveing1=GuiCtrlRead($save)                
    $CHBX1saveas=GuiCtrlRead($saveasCHBX)                           ;Save As option
        if $saveing1 = 1 OR $CHBX1saveas = 1 then
        ; (DO NOTHING)
        Else
                MsgBox(64, "Auto Mixdown", "Your auto mixdown is complete. Master track has been exported." & @LF & "(Multitrack session is not yet saved)")
        EndIf   
                                
        Endif
;///////////////////////////////////////End Exporting Two Track Mixdown//////////////////

    $saveing2=GuiCtrlRead($save)                                        ;Save option
        if $saveing2 = 1 then
            Send("^s")                                              ;-N----Save
                Sleep ( 1000 )
                        MsgBox(64, "Auto Mixdown", "Your auto mixdown is complete. And has been saved.")
        Endif


    $CHBX2saveas=GuiCtrlRead($saveasCHBX)                           ;Save As option
        if $CHBX2saveas = 1 then                        
            Send("^+s")                                             ;-N----Save As
                WinWait("Save As -")
                    $INPTsaveas=GuiCtrlRead($saveasINPT)
                        Send($INPTsaveas)
                            Sleep ( 500 )
                                Send("{ENTER}")
                                    Sleep ( 1000 )  
                                            $exportingmaster2=GuiCtrlRead($exportmaster)
                                                if $exportingmaster2 = 1 then                                               
                                                    MsgBox(64, "Auto Mixdown", "Your master track has been exported - Your auto mixdown is complete, and saved as " & $INPTsaveas)
                                                Else
                                                    MsgBox(64, "Auto Mixdown", "Your auto mixdown is complete and as saved as " & $INPTsaveas)
                                                Endif
        Endif

                                        Send("+f")

;   Sleep( 7000 )

;$Application = IniRead("test.ini", "Editor", "Application", "App. Not Found")
;$FileExtension = IniRead("test.ini", "Editor", "FileExtension", "Track Not Found") 

;$program = $Application
;$file = "C:\Audio\Mixdown  - " & $MasterMixdown2 & "." & $FileExtension
;Run($program & ' ' & $file)
EndFunc

Thanks for any help.

Link to comment
Share on other sites

  • Moderators

There is no error. Everything goes through fine....as far as I see if I'm doing it right.

He doesn't mean litterally look for errors, he means by using a debugging method, you can see what and where you need to change what to get your desired result. That's basically what we would do to help you in other words anyway.

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Link to comment
Share on other sites

I understand. I did use the debugging method and no errors came up. But I figured out what it was wrong anyway; rather, I don't know if it was wrong, or just didn't work for my script. This is the original code and I changed the "10" to a "1", and now it goes the full length of the bar.

If $Percent < 0 Then $Percent = 0
    If $Percent > 1000 Then $Percent = 1000
    GUICtrlSetData($ProgBar_1, Int($Percent / 10))

However the bar still goes by incriments by loop counts instead of a "smooth stream" percentage wise. That I have no idea what to look at to figure out how to resolve. Ideas?

Edited by Champak
Link to comment
Share on other sites

here's an idea

#include <GUIConstants.au3>

Dim $t, $i, $progressbar2

GUICreate("My GUI Progressbar", 220, 100, 100, 200)
$progressbar1 = GUICtrlCreateProgress(10, 10, 200, 20)
GUICtrlSetColor(-1, 32250); not working with Windows XP Style
$progressbar2 = GUICtrlCreateProgress(10, 40, 200, 20, $PBS_SMOOTH)
$button = GUICtrlCreateButton("Start", 75, 70, 70, 20)
GUISetState()

While 1
    $msg = GUIGetMsg()
    
    If $msg = $GUI_EVENT_CLOSE Then Exit
    If $msg = $button Then
        AdlibEnable("set_process")
        $i = 0
        $t = 0
    EndIf
    If $t >= 99 Then
        $t = 1
        $i = $i + 20
        If $i >= 100 Then AdlibDisable()
        GUICtrlSetData($progressbar1, $i)
    EndIf
    
WEnd

Func set_process()
    $t = $t + 5
    GUICtrlSetData($progressbar2, $t)
EndFunc  ;==>set_process

8)

NEWHeader1.png

Link to comment
Share on other sites

  • Moderators

Nice one Valuater.

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Link to comment
Share on other sites

I'm sorry, I've been going over this for the past 3 hours and can't figure out how the hell to include it. Even when I take the loop variable and try to put that alone to what you provided I can't get it to go according to whatever the variable is. Could you show me how to include it....it's killing me that it is right in front of me and I still can't get it.

Edited by Champak
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...