Jump to content

DVD Auto


strate
 Share

Recommended Posts

This isn't complete yet but thought I'd share. This will be used (eventually) in conjunction with CDCOVERS.CC Downloader. http://www.autoitscript.com/forum/index.php?showtopic=32391 The reason it is here is because it is the guts of the script, and I want to add a gui. I can make them, its just I'm not as good as everyone else. The only request I have is that the final product not consist of adding any more third party programs.

What does it do, and what do you need.

This automates the burning and backup process of user owned DVDs. To use it you need DVD Decrypter, AnyDVD, and DVD Shrink, and AutoIt. I used the following versions:

AutoIt v3.2.1.1 (beta)

DVD Decrypter v3.5.4.0

DVD Shrink v3.2.0.15

AnyDVD v6.0.6.1

Wish List would be that it download a cover for you, create a library, create log of ALL actions of the program, and finally delete the images that were created. ERROR PROOFING also.

System changes it makes:

Edits the Registry for Audio success with DVD Decrypter. This is restored to original setting.

Edits the Registry for 'ISO Image File and burn with DVD Decrypter' with DVD Shrink.

Be harsh critics.

#include <GUIConstants.au3>
#include <File.au3>

Opt("TrayIconDebug",1)

$RegPath = RegRead('HKCU\Software\DVD Decrypter','InstallDirectory')
$Source = ''

While 1
    While 1
        $var = DriveGetDrive( "cdrom" )
        If NOT @error Then
            Select
                Case $var[0] = 1
                    $Source = $var[1]
                    $Source_Size = DriveSpaceTotal($Source)
                    ExitLoop
                Case $var[0] = 0
                    MsgBox(4096,'Error','No disc drives detected.')
                    Exit
                Case Else
                    $List = ''
                    For $i = 1 to $var[0]
                        $label = DriveGetLabel($var[$i])
                        $List = $List & StringUpper($var[$i]) & '  ' & $label & '|'
                    Next
                    GUICreate("Select Source",220,70,-1,-1); will create a dialog box that when displayed is centered
                    $GUI_List = GUICtrlCreateCombo ('', 10,10); create first item
                    GUICtrlSetData(-1,$List)
                    $b_Ok = GUICtrlCreateButton('Continue',10,40,60,20)
                    GUISetState ()
                    While 1
                        $msg = GUIGetMsg()
                        If $msg = $b_Ok Then
                            $Source = StringLeft(GUICtrlRead($GUI_List),2)
                            $Source_Size = DriveSpaceTotal($Source)
                            If @error = 1 Then
                                MsgBox(4096,'Error','Either invalid location, or no disc.'& @CRLF & @CRLF & 'Try again.')
                                ContinueLoop
                            EndIf
                            GUIDelete()
                            ExitLoop(2)
                        EndIf
                        If $msg = $GUI_EVENT_CLOSE Then Exit
                    Wend
            EndSelect
        EndIf
    WEnd
    
    $Dest = _GetDestination($Source_Size)
    If @error = 0 Then
        ExitLoop
    EndIf
WEnd

Do
    $DVDTitle = DriveGetLabel($Source)
    Sleep(10)
Until $DVDTitle <> '' 

$RegSound = RegRead('HKEY_CURRENT_USER\Software\DVD Decrypter','SOUNDS_PlaySuccessSound')
If $RegSound = 1 Then
    RegWrite('HKEY_CURRENT_USER\Software\DVD Decrypter','SOUNDS_PlaySuccessSound','REG_DWORD','0')
EndIf

#region; DVD Readin
BlockInput(1)
$i_PID = Run($RegPath&'\DVDDecrypter.exe /Mode ISOREAD /start /Src "'&$Source&'" /Dest "'&$Dest&'" /verify yes')
Opt("WinTitleMatchMode", 4)
WinWait("classname=TfrmSplashScreen")
WinWaitClose("classname=TfrmSplashScreen")
WinWait("classname=TfrmMain")
WinActivate("classname=TfrmMain")
WinWaitActive("classname=TfrmMain")
Do
    Sleep(25)
    $Status = StatusbarGetText("classname=TfrmMain")
Until $Status = 'Extracting Sectors...'
WinSetState("classname=TfrmMain",'',@SW_MINIMIZE)
WinSetState("classname=TfrmMain",'',@SW_DISABLE)
BlockInput(0)
Opt("WinTitleMatchMode", 3)
WinWait("DVD Decrypter",'Operation Successfully Completed!')
WinActivate("DVD Decrypter",'Operation Successfully Completed!')
WinWaitActive("DVD Decrypter",'Operation Successfully Completed!')
ControlClick("DVD Decrypter",'Operation Successfully Completed!','Button1')
WinWaitClose("DVD Decrypter",'Operation Successfully Completed!')
Opt("WinTitleMatchMode", 4)
WinSetState("classname=TfrmMain",'',@SW_ENABLE)
WinSetState("classname=TfrmMain",'',@SW_SHOW)
WinClose("classname=TfrmMain")
WinWaitClose("classname=TfrmMain")
If $RegSound = 1 Then
    RegWrite('HKEY_CURRENT_USER\Software\DVD Decrypter','SOUNDS_PlaySuccessSound','REG_DWORD','1')
EndIf
BlockInput(0)
#endregion

$DVDTitle = DriveGetLabel($Source)
CDTray ($Source, "open")
MsgBox(4096,'DVD Auto', 'Iso read is complete.'&@CRLF&@CRLF&'Remove DVD, and insert blank DVD.')
BlockInput(1)

RegWrite('HKCU\Software\DVD Shrink\DVD Shrink 3.2\Preferences','TargetDevice','REG_SZ','ISO Image File and burn with DVD Decrypter')
$RegShrinkPath = RegRead('HKCU\Software\DVD Shrink\DVD Shrink 3.2\Preferences','InstallApp')

$ISO_FileName = StringUpper($Dest & "\" & $DVDTitle & ".iso")
$i_PID = Run($RegShrinkPath & ' "' & $ISO_FileName &'"','',@SW_MAXIMIZE)

#region; Shrink Analyze Window
Opt("WinTitleMatchMode", 4) 
WinWait("classname=#32770")
BlockInput(0)
WinSetState("classname=#32770",'',@SW_DISABLE)
WinSetState("classname=#32770",'',@SW_MINIMIZE)
WinWaitClose("classname=#32770")
#endregion
#region; Activation and command sequence to activate the Backup Dialog
; Better method to actually open the backup dialog instead of sending keys
Opt("WinTitleMatchMode", 1) 
BlockInput(1)
$WindowTitle = "DVD Shrink 3.2 - " & $ISO_FileName
WinWait($WindowTitle)
WinSetOnTop($WindowTitle,'',1)
WinSetState($WindowTitle,'',@SW_MAXIMIZE)
WinActivate($WindowTitle)
WinWaitActive($WindowTitle)
Send('{Alt}')
Send('f')
Send('b')
#endregion

#region; DVD Shrink Window requesting setup parameters for backup.
BlockInput(0)
Opt("WinTitleMatchMode", 4) 
WinWait("classname=#32770")
$ISO_FileName = StringUpper($Dest & "\" & $DVDTitle & " burn.iso")
ControlSetText("classname=#32770",'','Edit1',$ISO_FileName)
$WindowTitle = WinGetTitle("classname=#32770")
ControlClick("classname=#32770",'','Button4')
Opt("WinTitleMatchMode", 2)
WinWaitClose($WindowTitle)
#endregion

#region; Encoding Window
WinWait("% Encoding")
WinSetState("% Encoding",'',@SW_DISABLE)
WinSetState("% Encoding",'',@SW_MINIMIZE)
WinWaitClose("% Encoding")
#endregion

#region; DVD Decrypter - Burn & Verify
Opt("WinTitleMatchMode", 4)
WinWait("classname=TfrmMain")
Opt("WinTitleMatchMode", 3)
WinWait("DVD Decrypter",'Operation Successfully Completed!')
BlockInput(1)
WinActivate("DVD Decrypter",'Operation Successfully Completed!')
WinWaitActive("DVD Decrypter",'Operation Successfully Completed!')
ControlClick("DVD Decrypter",'Operation Successfully Completed!','Button1')
BlockInput(0)
WinWaitClose("DVD Decrypter",'Operation Successfully Completed!')
Opt("WinTitleMatchMode", 4)
WinClose("classname=TfrmMain")
WinWaitClose("classname=TfrmMain")
#endregion


MsgBox(4096,'DVD Auto', 'Burn is complete.')
CDTray ($Source, "open")

Exit

Func _GetDestination($Source_Size)
    Local $Source
    $var = DriveGetDrive( "Fixed" )
    If NOT @error Then
        For $i = 1 to $var[0]
            $var1 = DriveSpaceFree($var[$i])
            If ($Source*2) < $var1 Then
                $Dest = $var[$i]
                ExitLoop
            EndIf
        Next
    EndIf
    Select
        Case $Dest = ''
            SetError(1); @ERROR = 1   Local disks do not have enough free space.
            If $var[0] = 1 Then
                MsgBox(4096,"Final",'Nwot enough free space on hard drive.' & @CRLF & @CRLF & 'Make space to continue.')
                Exit
            Else
                MsgBox(4096,"Final",'Nwot enough free space on hard drives.' & @CRLF & @CRLF & 'Make space to continue.')
                Exit
            EndIf
        Case Else
            SetError(0); @ERROR = 0  A destination is returned
            Return $Dest
    EndSelect
EndFunc

EDIT: Link to big daddys thread

Edited by strate
INI TreeViewA bus station is where a bus stops, a train station is where a train stops. Onmy desk I have a work station...
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...