VERSION 5.00
Object = "{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}#2.1#0"; "mscomctl.ocx"
Begin VB.Form frmTutorial 
   BorderStyle     =   1  'Fixed Single
   Caption         =   "AVStoDVD Quick StartUp Tutorial"
   ClientHeight    =   8850
   ClientLeft      =   45
   ClientTop       =   330
   ClientWidth     =   6495
   BeginProperty Font 
      Name            =   "Tahoma"
      Size            =   8.25
      Charset         =   0
      Weight          =   400
      Underline       =   0   'False
      Italic          =   0   'False
      Strikethrough   =   0   'False
   EndProperty
   HelpContextID   =   83
   Icon            =   "frmTutorial.frx":0000
   LinkTopic       =   "Form1"
   MaxButton       =   0   'False
   MinButton       =   0   'False
   ScaleHeight     =   8850
   ScaleWidth      =   6495
   StartUpPosition =   2  'CenterScreen
   Begin MSComctlLib.StatusBar StatusBar 
      Align           =   2  'Align Bottom
      Height          =   255
      Left            =   0
      TabIndex        =   26
      Top             =   8595
      Width           =   6495
      _ExtentX        =   11456
      _ExtentY        =   450
      Style           =   1
      _Version        =   393216
      BeginProperty Panels {8E3867A5-8586-11D1-B16A-00C0F0283628} 
         NumPanels       =   1
         BeginProperty Panel1 {8E3867AB-8586-11D1-B16A-00C0F0283628} 
         EndProperty
      EndProperty
   End
   Begin VB.CommandButton plsCancel 
      Caption         =   "Don't bother me"
      Height          =   435
      Left            =   4920
      Picture         =   "frmTutorial.frx":0E42
      TabIndex        =   25
      Top             =   8040
      Width           =   1435
   End
   Begin VB.CommandButton plsOK 
      Caption         =   "OK"
      Height          =   435
      Left            =   3960
      Picture         =   "frmTutorial.frx":170C
      TabIndex        =   24
      Top             =   8040
      Width           =   915
   End
   Begin VB.Frame corGUI 
      Caption         =   "Graphic User Interface (GUI) Preferences"
      BeginProperty Font 
         Name            =   "Tahoma"
         Size            =   8.25
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   2055
      Left            =   120
      TabIndex        =   17
      Top             =   5880
      Width           =   6255
      Begin VB.ComboBox cmbGUILang 
         Height          =   315
         ItemData        =   "frmTutorial.frx":1FD6
         Left            =   3840
         List            =   "frmTutorial.frx":1FD8
         Sorted          =   -1  'True
         Style           =   2  'Dropdown List
         TabIndex        =   19
         Top             =   480
         Width           =   2175
      End
      Begin VB.ComboBox cmbGUISkin 
         Height          =   315
         ItemData        =   "frmTutorial.frx":1FDA
         Left            =   3840
         List            =   "frmTutorial.frx":1FDC
         Sorted          =   -1  'True
         Style           =   2  'Dropdown List
         TabIndex        =   21
         Top             =   960
         Width           =   2175
      End
      Begin VB.CheckBox intAdvSettings 
         Alignment       =   1  'Right Justify
         Caption         =   "Show Advanced Project Settings:"
         Height          =   255
         Left            =   240
         TabIndex        =   22
         Top             =   1500
         Width           =   3795
      End
      Begin VB.Label lblGUISkin 
         Caption         =   "Select GUI Skin:"
         Height          =   255
         Left            =   240
         TabIndex        =   20
         Top             =   1020
         Width           =   3315
      End
      Begin VB.Label lblGUILang 
         Caption         =   "Select GUI Language:"
         Height          =   255
         Left            =   240
         TabIndex        =   18
         Top             =   540
         Width           =   3255
      End
   End
   Begin VB.Frame corEncoding 
      Caption         =   "Encoding Preferences"
      BeginProperty Font 
         Name            =   "Tahoma"
         Size            =   8.25
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   2055
      Left            =   120
      TabIndex        =   10
      Top             =   3600
      Width           =   6255
      Begin VB.CheckBox intKeepAudio 
         Alignment       =   1  'Right Justify
         Caption         =   "Audio:"
         Height          =   255
         Left            =   5040
         TabIndex        =   16
         Top             =   1500
         Width           =   915
      End
      Begin VB.CheckBox intKeepVideo 
         Alignment       =   1  'Right Justify
         Caption         =   "Keep MPEG2 DVD Compliant Video:"
         Height          =   255
         Left            =   240
         TabIndex        =   15
         Top             =   1500
         Width           =   3795
      End
      Begin VB.ComboBox cmbEncoderAudio 
         Height          =   315
         ItemData        =   "frmTutorial.frx":1FDE
         Left            =   3840
         List            =   "frmTutorial.frx":1FE0
         Sorted          =   -1  'True
         Style           =   2  'Dropdown List
         TabIndex        =   14
         Top             =   960
         Width           =   2175
      End
      Begin VB.ComboBox cmbEncoderVideo 
         Height          =   315
         ItemData        =   "frmTutorial.frx":1FE2
         Left            =   3840
         List            =   "frmTutorial.frx":1FE4
         Sorted          =   -1  'True
         Style           =   2  'Dropdown List
         TabIndex        =   13
         Top             =   480
         Width           =   2175
      End
      Begin VB.Label lblEncoderVideo 
         Caption         =   "Select MPEG2 Video Encoder:"
         Height          =   255
         Left            =   240
         TabIndex        =   12
         Top             =   540
         Width           =   3375
      End
      Begin VB.Label lblEncoderAudio 
         Caption         =   "Select AC3 Audio Encoder:"
         Height          =   255
         Left            =   240
         TabIndex        =   11
         Top             =   1020
         Width           =   3315
      End
   End
   Begin VB.Frame Frame8 
      Height          =   975
      Left            =   120
      TabIndex        =   3
      Top             =   120
      Width           =   6255
      Begin VB.Label lblTutorial2 
         Alignment       =   2  'Center
         Caption         =   "It is intended to be run at first AVStoDVD usage."
         BeginProperty Font 
            Name            =   "Tahoma"
            Size            =   9
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   255
         Left            =   120
         TabIndex        =   9
         Top             =   540
         Width           =   6015
      End
      Begin VB.Label lblTutorial1 
         Alignment       =   2  'Center
         Caption         =   "This Tutorial is a quick guide thru main AVStoDVD settings."
         BeginProperty Font 
            Name            =   "Tahoma"
            Size            =   9
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   255
         Left            =   120
         TabIndex        =   8
         Top             =   240
         Width           =   6015
      End
   End
   Begin VB.Frame corDVD 
      Caption         =   "DVD Preferences"
      BeginProperty Font 
         Name            =   "Tahoma"
         Size            =   8.25
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   2055
      Left            =   120
      TabIndex        =   0
      Top             =   1320
      Width           =   6255
      Begin VB.ComboBox cmbDVDSubsLang 
         Height          =   315
         ItemData        =   "frmTutorial.frx":1FE6
         Left            =   3840
         List            =   "frmTutorial.frx":1FF0
         Sorted          =   -1  'True
         Style           =   2  'Dropdown List
         TabIndex        =   6
         Top             =   1440
         Width           =   2175
      End
      Begin VB.ComboBox cmbDVDAudioLang 
         Height          =   315
         ItemData        =   "frmTutorial.frx":1FFF
         Left            =   3840
         List            =   "frmTutorial.frx":2009
         Sorted          =   -1  'True
         Style           =   2  'Dropdown List
         TabIndex        =   4
         Top             =   960
         Width           =   2175
      End
      Begin VB.ComboBox cmbDVDStandard 
         Height          =   315
         ItemData        =   "frmTutorial.frx":2018
         Left            =   3840
         List            =   "frmTutorial.frx":201A
         Sorted          =   -1  'True
         Style           =   2  'Dropdown List
         TabIndex        =   2
         Top             =   480
         Width           =   2175
      End
      Begin VB.Label lblDVDSubsLang 
         Caption         =   "Select DVD Subtitles Language (primary):"
         Height          =   255
         Left            =   240
         TabIndex        =   7
         Top             =   1500
         Width           =   3315
      End
      Begin VB.Label lblDVDAudioLang 
         Caption         =   "Select DVD Audio Language (primary):"
         Height          =   255
         Left            =   240
         TabIndex        =   5
         Top             =   1020
         Width           =   3315
      End
      Begin VB.Label lblDVDStandard 
         Caption         =   "Select DVD Video Standard:"
         Height          =   255
         Left            =   240
         TabIndex        =   1
         Top             =   540
         Width           =   3315
      End
   End
   Begin VB.Label lblMSCodecs 
      Alignment       =   2  'Center
      Caption         =   "Warning! Video and/or Audio codecs setup needs to be revised! Double-Click to check."
      Height          =   495
      Left            =   120
      TabIndex        =   23
      ToolTipText     =   "Microsoft Windows internal DirectShow filters are active for H.264/AVC or AAC media types, instead of LAV Filters!"
      Top             =   8040
      Width           =   3615
   End
End
Attribute VB_Name = "frmTutorial"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
' -------------------------------------------------------------------------------
'
'   AVStoDVD - by MrC
'   File: frmTutorial.frm
'   Purpose: AVStoDVD Tutorial
'
' -------------------------------------------------------------------------------


Option Explicit
Option Compare Binary
Option Base 0


Private Sub Form_Load()

    Dim LangFiles As New Collection
    Dim SkinDirs As New Collection
    Dim jj As Integer
    
    On Error GoTo Err_Handling
    
    ' Load Skin Font settings
    Call modMain.Load_Skin_Font(Me)
    
    ' Load Language
    Call Populate_Form_Language

    With Me.cmbDVDStandard
        .Clear
        .AddItem "PAL", 0
        .AddItem "NTSC", 1
        .ListIndex = Preferences.VideoStandard
    End With
    Me.cmbDVDAudioLang.Clear
    Me.cmbDVDSubsLang.Clear
    With ISOLangCode
        For jj = 1 To .Count
            Me.cmbDVDAudioLang.AddItem .Item(jj)
            Me.cmbDVDSubsLang.AddItem .Item(jj)
        Next jj
    End With
    Me.cmbDVDAudioLang.Text = Preferences.AudioLanguage
    Me.cmbDVDSubsLang.Text = Preferences.SubsLanguage
    
    With Me.cmbEncoderVideo
        .AddItem "Smart Selection", 0
        .AddItem "FFmpeg CBR 1-pass", 1
        .AddItem "HCenc VBR 1-pass", 2
        .AddItem "HCenc VBR 2-pass", 3
        .ListIndex = Preferences.VideoEncoder
    End With
    With Me.cmbEncoderAudio
        .AddItem "Wavi+Aften", 0
        .AddItem "FFmpeg+Aften", 1
        .AddItem "FFmpeg (AviSynth)", 2
        .AddItem "FFmpeg (Safe Mode)", 3
        .ListIndex = Preferences.AC3AudioEncoder
    End With
    With Me.intKeepVideo
        .value = -CInt(Preferences.KeepOrigVideo)
    End With
    With Me.intKeepAudio
        .value = -CInt(Preferences.KeepOrigAudio)
    End With
    
    With Me.cmbGUILang
        Set LangFiles = modFS.FileList(App.Path & "\Lang\", "*.ini", vbArchive)
        For jj = 1 To IIf(LangFiles.Count > 9, 9, LangFiles.Count)
            .AddItem modStr.RemoveStr(LangFiles.Item(jj), ".lang.ini")
        Next jj
        Set LangFiles = Nothing
        .Text = Preferences.Language
    End With
    With Me.cmbGUISkin
        Set SkinDirs = modFS.FileList(App.Path & "\Skins\", "", vbDirectory)
        For jj = 1 To IIf(SkinDirs.Count > 9, 9, SkinDirs.Count)
            .AddItem SkinDirs.Item(jj)
        Next jj
        Set SkinDirs = Nothing
        For jj = 0 To .ListCount - 1
            If .List(jj) = Preferences.Skin Then
                .Text = .List(jj)
                Exit For
            End If
        Next jj
        If .Text = "" Then .Text = "Default"
    End With
    With Me.intAdvSettings
        .value = modReg.EmiLeggiChiaveNumero(AVStoDVD_RegKey, "DefaultAdvancedSettings", 0)
    End With
    
    Exit Sub
    
Err_Handling:
Select Case Err.Number
Case 9999
    Resume
Case Else
    MsgBox "Warning! " & Err.Description & vbCrLf & vbCrLf & "Error number: " & Err.Number, vbCritical, App.Title
    Resume Next
End Select
    
End Sub

Private Sub Form_Activate()

    Dim PrefRegKey As String
    Dim MSDTVVideoID As String
    Dim MSDTVAudioID As String
    Dim AVCID As String
    Dim AACID As String
    
    PrefRegKey = "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\DirectShow\Preferred"
    MSDTVVideoID = "{212690FB-83E5-4526-8FD7-74478B7939CD}"
    MSDTVAudioID = "{E1F1A0B8-BEEE-490D-BA7C-066C40B5E2B9}"
    AVCID = "{31435641-0000-0010-8000-00AA00389B71}"
    AACID = "{000000FF-0000-0010-8000-00aa00389b71}"
    
    Me.lblMSCodecs.Visible = False
    If modReg.EmiLeggiChiaveStringa(PrefRegKey, AVCID) = MSDTVVideoID Or modReg.EmiLeggiChiaveStringa(PrefRegKey, AACID) = MSDTVAudioID Then
        Me.lblMSCodecs.Visible = True
    End If

End Sub

Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer)

    'If UnloadMode = 0 Then Cancel = True
    If modUtil.FormIsLoad("frmMain") = True Then
        frmMain.Menu_Options_Advanced_Project_Settings.Checked = CBool(Me.intAdvSettings.value)
        frmMain.Toolbar.Buttons("Advanced_Settings").value = Me.intAdvSettings.value
    End If

End Sub

Private Sub Form_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
    
    Me.StatusBar.SimpleText = ""
    Me.lblMSCodecs.FontUnderline = False
    
End Sub

Private Sub corDVD_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)

    Me.StatusBar.SimpleText = ""

End Sub

Private Sub corEncoding_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
    
    Me.StatusBar.SimpleText = ""

End Sub

Private Sub corGUI_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)

    Me.StatusBar.SimpleText = ""
    Me.lblMSCodecs.FontUnderline = False

End Sub

Private Sub lblDVDStandard_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)

    Me.StatusBar.SimpleText = Me.cmbDVDStandard.ToolTipText

End Sub

Private Sub lblDVDAudioLang_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)

    Me.StatusBar.SimpleText = Me.cmbDVDAudioLang.ToolTipText

End Sub

Private Sub lblDVDSubsLang_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)

    Me.StatusBar.SimpleText = Me.cmbDVDSubsLang.ToolTipText

End Sub

Private Sub lblEncoderVideo_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)

    Me.StatusBar.SimpleText = Me.cmbEncoderVideo.ToolTipText

End Sub

Private Sub lblEncoderAudio_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)

    Me.StatusBar.SimpleText = Me.cmbEncoderAudio.ToolTipText

End Sub

Private Sub intKeepVideo_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)

    Me.StatusBar.SimpleText = Me.intKeepVideo.ToolTipText

End Sub

Private Sub intKeepAudio_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)

    Me.StatusBar.SimpleText = Me.intKeepAudio.ToolTipText

End Sub

Private Sub lblGUILang_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)

    Me.StatusBar.SimpleText = Me.cmbGUILang.ToolTipText

End Sub

Private Sub lblGUISkin_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)

    Me.StatusBar.SimpleText = Me.cmbGUISkin.ToolTipText

End Sub

Private Sub intAdvSettings_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)

    Me.StatusBar.SimpleText = Me.intAdvSettings.ToolTipText

End Sub

Private Sub lblMSCodecs_DblClick()

    'Me.Visible = False
    Load frmCodecsCheck
    frmCodecsCheck.Show 1, Me
    'Me.Visible = True

End Sub

Private Sub lblMSCodecs_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)

    Me.lblMSCodecs.FontUnderline = True

End Sub

Private Sub plsOK_Click()

    With Preferences
        .VideoStandard = Me.cmbDVDStandard.ListIndex
        .AudioLanguage = Me.cmbDVDAudioLang.Text
        .SubsLanguage = Me.cmbDVDSubsLang.Text
        .VideoEncoder = Me.cmbEncoderVideo.ListIndex
        .AC3AudioEncoder = Me.cmbEncoderAudio.ListIndex
        .KeepOrigVideo = CBool(Me.intKeepVideo.value)
        .KeepOrigAudio = CBool(Me.intKeepAudio.value)
        .Language = Me.cmbGUILang.Text
        Set Language = modMain.Load_Language(.Language)
        .Skin = Me.cmbGUISkin.Text
    End With
    modMain.Reg_Preferences_Update
    modReg.ScriviChiaveNumero AVStoDVD_RegKey, "DefaultAdvancedSettings", Me.intAdvSettings.value
    ' TutorialExecuted = 1     ->   Pressed 'OK'
    ' TutorialExecuted = -1    ->   Tutorial skipped with upper-right close window
    ' TutorialExecuted = 0     ->   Pressed 'Don't bother'
    modReg.ScriviChiaveNumero AVStoDVD_RegKey, "TutorialExecuted", 1
    
    Unload Me

End Sub

Private Sub plsCancel_Click()

    If modReg.EmiLeggiChiaveNumero(AVStoDVD_RegKey, "TutorialExecuted", -1) = -1 Then
        MsgBox Me.plsCancel.Tag, vbInformation, App.Title
    End If
    modReg.ScriviChiaveNumero AVStoDVD_RegKey, "TutorialExecuted", 0
    
    Unload Me

End Sub

Private Sub Populate_Form_Language()

    On Error Resume Next
    
    If Language.Count > 0 Then
        With Me
            ' Form
            .Caption = modStr.DefaultStr(Language("730000"), .Caption)
            .lblTutorial1.Caption = modStr.DefaultStr(Language("730010"), .lblTutorial1.Caption)
            .lblTutorial2.Caption = modStr.DefaultStr(Language("730020"), .lblTutorial2.Caption)
            .corDVD.Caption = modStr.DefaultStr(Language("730100"), .corDVD.Caption)
            .lblDVDStandard.Caption = modStr.DefaultStr(Language("730110"), .lblDVDStandard.Caption)
            .cmbDVDStandard.ToolTipText = modStr.DefaultStr(Language("730111"), .cmbDVDStandard.ToolTipText)
            .lblDVDAudioLang.Caption = modStr.DefaultStr(Language("730120"), .lblDVDAudioLang.Caption)
            .cmbDVDAudioLang.ToolTipText = modStr.DefaultStr(Language("730121"), .cmbDVDAudioLang.ToolTipText)
            .lblDVDSubsLang.Caption = modStr.DefaultStr(Language("730130"), .lblDVDSubsLang.Caption)
            .cmbDVDSubsLang.ToolTipText = modStr.DefaultStr(Language("730131"), .cmbDVDSubsLang.ToolTipText)
            .corEncoding.Caption = modStr.DefaultStr(Language("730200"), .corEncoding.Caption)
            .lblEncoderVideo.Caption = modStr.DefaultStr(Language("730210"), .lblEncoderVideo.Caption)
            .cmbEncoderVideo.ToolTipText = modStr.DefaultStr(Language("730211"), .cmbEncoderVideo.ToolTipText)
            .lblEncoderAudio.Caption = modStr.DefaultStr(Language("730220"), .lblEncoderAudio.Caption)
            .cmbEncoderAudio.ToolTipText = modStr.DefaultStr(Language("730221"), .cmbEncoderAudio.ToolTipText)
            .intKeepVideo.Caption = modStr.DefaultStr(Language("730230"), .intKeepVideo.Caption)
            .intKeepVideo.ToolTipText = modStr.DefaultStr(Language("730231"), .intKeepVideo.ToolTipText)
            .intKeepAudio.Caption = modStr.DefaultStr(Language("730240"), .intKeepAudio.Caption)
            .intKeepAudio.ToolTipText = modStr.DefaultStr(Language("730241"), .intKeepAudio.ToolTipText)
            .corGUI.Caption = modStr.DefaultStr(Language("730300"), .corGUI.Caption)
            .lblGUILang.Caption = modStr.DefaultStr(Language("730310"), .lblGUILang.Caption)
            .cmbGUILang.ToolTipText = modStr.DefaultStr(Language("730311"), .cmbGUILang.ToolTipText)
            .lblGUISkin.Caption = modStr.DefaultStr(Language("730320"), .lblGUISkin.Caption)
            .cmbGUISkin.ToolTipText = modStr.DefaultStr(Language("730321"), .cmbGUISkin.ToolTipText)
            .intAdvSettings.Caption = modStr.DefaultStr(Language("730330"), .intAdvSettings.Caption)
            .intAdvSettings.ToolTipText = modStr.DefaultStr(Language("730331"), .intAdvSettings.ToolTipText)
            .plsOK.Caption = modStr.DefaultStr(Language("730400"), .plsOK.Caption)
            .plsOK.ToolTipText = modStr.DefaultStr(Language("730401"), .plsOK.ToolTipText)
            .plsCancel.Caption = modStr.DefaultStr(Language("730500"), .plsCancel.Caption)
            .plsCancel.ToolTipText = modStr.DefaultStr(Language("730501"), .plsCancel.ToolTipText)
            .plsCancel.Tag = modStr.DefaultStr(Language("730598"), "Warning! This Tutorial will not be loaded during next AVStoDVD restart.") & vbCrLf & vbCrLf & _
                             modStr.DefaultStr(Language("730599"), "You can still open it from Main Menu window.")
            .lblMSCodecs.Caption = modStr.DefaultStr(Language("730600"), .lblMSCodecs.Caption)
            .lblMSCodecs.ToolTipText = modStr.DefaultStr(Language("730601"), .lblMSCodecs.ToolTipText)
        End With
    End If
 
 End Sub

