Imports System.ComponentModel

Imports Stax
Imports Stax.UI
Imports Stax.AppFramework

<ToolboxItem(False)> _
Public Class OptionsAdvancedControl
    Inherits DialogControl

#Region " Designer "

    Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)
        If disposing Then
            If Not (components Is Nothing) Then
                components.Dispose()
            End If
        End If
        MyBase.Dispose(disposing)
    End Sub

    Private components As System.ComponentModel.IContainer

    Friend WithEvents AdvancedSettingTreeView As Stax.UI.SettingTreeView
    <System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
        Me.AdvancedSettingTreeView = New Stax.UI.SettingTreeView
        Me.SuspendLayout()
        '
        'AdvancedSettingTreeView
        '
        Me.AdvancedSettingTreeView.Anchor = CType((((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Bottom) _
                    Or System.Windows.Forms.AnchorStyles.Left) _
                    Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
        Me.AdvancedSettingTreeView.AutoCollaps = True
        Me.AdvancedSettingTreeView.AutoExpand = True
        Me.AdvancedSettingTreeView.HideSelection = False
        Me.AdvancedSettingTreeView.Location = New System.Drawing.Point(11, 31)
        Me.AdvancedSettingTreeView.Name = "AdvancedSettingTreeView"
        Me.AdvancedSettingTreeView.Scrollable = False
        Me.AdvancedSettingTreeView.SelectOnMouseDown = True
        Me.AdvancedSettingTreeView.Size = New System.Drawing.Size(370, 288)
        Me.AdvancedSettingTreeView.TabIndex = 108
        '
        'OptionsAdvancedControl
        '
        Me.Controls.Add(Me.AdvancedSettingTreeView)
        Me.Name = "OptionsAdvancedControl"
        Me.Padding = New System.Windows.Forms.Padding(8, 28, 8, 8)
        Me.Size = New System.Drawing.Size(392, 330)
        Me.Text = "Advanced"
        Me.UseVisualStyle = True
        Me.ResumeLayout(False)

    End Sub

#End Region

    Public Sub New()
        MyBase.New()
        InitializeComponent()

        AdvancedSettingTreeView.AddSetting(New CheckBoxTreeNodeSetting("Use ITU-R BT.601 standard", "General", p.ITU, "Normally StaxRip performs various tasks directly after a source file is opened like demuxing, auto crop, auto resize etc. In Post Processing Mode all this tasks are performed when the encoding is started (either manually or by the joblist)."))
        AdvancedSettingTreeView.AddSetting(New CheckBoxTreeNodeSetting("Post Processing Mode", "Advanced Automation", p.BatchMode, "Calculates the aspect ratio according to ITU-R BT.601 standard."))
        AdvancedSettingTreeView.AddSetting(New CheckBoxTreeNodeSetting("Auto Aspect Ratio Signaling", "Advanced Automation", p.AutoARSignaling, "In case no resize filter is used StaxRip signals the codec to write the proper aspect ratio to the bitstream so players that support aspect ratio signaling playback still the proper aspect ratio. Aspect ratio signaling is not supported by DivX and also not by every player."))
        AdvancedSettingTreeView.AddSetting(New CheckBoxTreeNodeSetting("Auto crop until proper aspect ratio is found", "Advanced Automation", p.AutoSmartCrop, "Crops until the proper aspect ratio is found. This option is useful for devices like PlayStation Portable."))
        AdvancedSettingTreeView.AddSetting(New NumericTreeNodeSetting(Of Integer)("Percentage to use for compressibility check", "General", p.CompCheckRange, Nothing, 2, 10, 1))

        AdvancedSettingTreeView.Nodes(0).ExpandAll()
    End Sub

    Private Sub OptionsGeneralControl_FormClosingOK() Handles MyBase.FormClosingOK
        AdvancedSettingTreeView.Apply()
    End Sub
End Class