summaryrefslogtreecommitdiffstats
path: root/win/CS/Controls/AdvancedEncoderOpts.cs
blob: b3f42913a1a6e62b36669f390b5b9f4170796d86 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
/*  AdvancedEncoderOpts.cs $
    This file is part of the HandBrake source code.
    Homepage: <http://handbrake.fr>.
    It may be used under the terms of the GNU General Public License. */

namespace Handbrake.Controls
{
    using System.Windows.Forms;

    using HandBrake.ApplicationServices;
    using HandBrake.ApplicationServices.Services.Interfaces;

    /// <summary>
    /// The x264 Panel
    /// </summary>
    public partial class AdvancedEncoderOpts : UserControl
    {
        /// <summary>
        /// The User Setting Service.
        /// </summary>
        private readonly IUserSettingService UserSettingService = ServiceManager.UserSettingService;

        /// <summary>
        /// Initializes a new instance of the <see cref="AdvancedEncoderOpts"/> class. 
        /// </summary>
        public AdvancedEncoderOpts()
        {
            InitializeComponent();

            if (this.UserSettingService.GetUserSetting<bool>(UserSettingConstants.TooltipEnable))
                ToolTip.Active = true;
        }

        /// <summary>
        /// Gets or sets the X264 query string
        /// </summary>
        public string AdavancedQuery
        {
            get
            {
                return advancedQuery.Text;
            }

            set
            {
                advancedQuery.Text = value;
            }
        }

        /// <summary>
        /// Sets a value indicating whether IsDisabled.
        /// </summary>
        public bool IsDisabled
        {
            set
            {
                if (value)
                {
                    this.advancedQuery.Enabled = false;
                    this.advancedQuery.Text = "Advanced encoder option passthrough is not currently supported for the encoder you have chosen.";
                }
                else
                {
                    this.advancedQuery.Enabled = true;
                    this.advancedQuery.Text = string.Empty;
                }
            }
        }
    }
}