Exemple #1
0
        /// <summary>
        /// default constructor
        /// initializes all the GUI components, initializes the internal objects and makes a default selection for all the GUI dropdowns
        /// In addition, all the jobs and profiles are being loaded from the harddisk
        /// </summary>
        public MeGUIInfo()
        {
            this.codecs               = new CodecManager();
            this.gen                  = new CommandLineGenerator();
            this.path                 = System.Windows.Forms.Application.StartupPath;
            this.jobs                 = new Dictionary <string, Job>();
            this.skipJobs             = new List <Job>();
            this.logBuilder           = new StringBuilder();
            this.jobUtil              = new JobUtil(this);
            this.settings             = new MeGUISettings();
            this.calc                 = new BitrateCalculator();
            audioStreams              = new AudioStream[2];
            audioStreams[0].path      = "";
            audioStreams[0].output    = "";
            audioStreams[0].settings  = null;
            audioStreams[1].path      = "";
            audioStreams[1].output    = "";
            audioStreams[1].settings  = null;
            this.videoEncoderProvider = new VideoEncoderProvider();
            this.audioEncoderProvider = new AudioEncoderProvider();
            this.profileManager       = new ProfileManager(this.path);
            this.profileManager.LoadProfiles(videoProfile, audioProfile);
            this.loadSettings();
            this.loadJobs();
            this.dialogManager = new DialogManager(this);
#warning refactor menus
            int index = menuItem1.MenuItems.Count;
            foreach (IMuxing muxer in PackageSystem.MuxerProviders.Values)
            {
                MenuItem newMenuItem = new MenuItem();
                newMenuItem.Text  = muxer.Name;
                newMenuItem.Tag   = muxer;
                newMenuItem.Index = index;
                index++;
                menuItem1.MenuItems.Add(newMenuItem);
                newMenuItem.Click += new System.EventHandler(this.mnuMuxer_Click);
            }
            index = mnuTools.MenuItems.Count;
            foreach (ITool tool in PackageSystem.Tools.Values)
            {
                MenuItem newMenuItem = new MenuItem();
                newMenuItem.Text  = tool.Name;
                newMenuItem.Tag   = tool;
                newMenuItem.Index = index;
                index++;
                mnuTools.MenuItems.Add(newMenuItem);
                newMenuItem.Click += new System.EventHandler(this.mnuTool_Click);
            }
            //MessageBox.Show(String.Join("|", this.GetType().Assembly.GetManifestResourceNames()));
            using (TextReader r = new StreamReader(this.GetType().Assembly.GetManifestResourceStream("MeGUI.Changelog.txt")))
            {
                mainForm.Changelog.Text = r.ReadToEnd();
            }
        }
Exemple #2
0
 internal void showAfterEncodingStatus(MeGUISettings Settings)
 {
     currentAfterEncoding          = Settings.AfterEncoding;
     cbAfterEncoding.SelectedIndex = (int)currentAfterEncoding;
     if (String.IsNullOrEmpty(Settings.AfterEncodingCommand))
     {
         cbAfterEncoding.Items[2] = "Run command (command not specified!)";
     }
     else
     {
         cbAfterEncoding.Items[2] = "Run '" + Settings.AfterEncodingCommand + "'";
     }
 }
Exemple #3
0
 internal void showAfterEncodingStatus(MeGUISettings Settings)
 {
     if (Settings.AfterEncoding == AfterEncoding.DoNothing)
     {
         afterEncoding.Text = "After encoding: do nothing";
     }
     else if (Settings.AfterEncoding == AfterEncoding.Shutdown)
     {
         afterEncoding.Text = "After encoding: shutdown";
     }
     else
     {
         afterEncoding.Text = "After encoding: run '" + Settings.AfterEncodingCommand + "'";
     }
 }
Exemple #4
0
        public static IWebProxy GetProxy(MeGUISettings settings)
        {
            // if None then return null
            if (settings.HttpProxyMode == ProxyMode.None)
            {
                return(null);
            }

            // if SystemProxy then return the System proxy details with the logged in credentials
            if (settings.HttpProxyMode == ProxyMode.SystemProxy)
            {
                var systemProxy = WebRequest.GetSystemWebProxy();
                systemProxy.Credentials = CredentialCache.DefaultCredentials;
                return(systemProxy);
            }

            // CustomProxy and CustomProxyWithLogin both require a Url
            if (String.IsNullOrEmpty(settings.HttpProxyAddress))
            {
                return(null);
            }

            var address = string.IsNullOrEmpty(settings.HttpProxyPort)
                              ? settings.HttpProxyAddress
                              : string.Format("{0}:{1}", settings.HttpProxyAddress, settings.HttpProxyPort);

            // if CustomProxyWithLogin then generate the credentials
            ICredentials credentials;

            if (settings.HttpProxyMode == ProxyMode.CustomProxy || string.IsNullOrEmpty(settings.HttpProxyUid))
            {
                credentials = null;
            }
            else
            {
                credentials = new NetworkCredential(settings.HttpProxyUid, settings.HttpProxyPwd);
            }

            var proxy = new WebProxy(address, true, null, credentials);

            return(proxy);
        }
        public HdBdStreamExtractor(MainForm info)
        {
            this.info = info;
            this.settings = info.Settings;
            InitializeComponent();

            eac3toPath = settings.EAC3toPath;
        }
Exemple #6
0
        /// <summary>
        /// default constructor
        /// initializes all the GUI components, initializes the internal objects and makes a default selection for all the GUI dropdowns
        /// In addition, all the jobs and profiles are being loaded from the harddisk
        /// </summary>
        public MeGUIInfo()
        {
            this.codecs = new CodecManager();
            this.gen = new CommandLineGenerator();
            this.path = System.Windows.Forms.Application.StartupPath;
            this.jobs = new Dictionary<string, Job>();
            this.skipJobs = new List<Job>();
            this.logBuilder = new StringBuilder();
            this.jobUtil = new JobUtil(this);
            this.settings = new MeGUISettings();
            this.calc = new BitrateCalculator();
            audioStreams = new AudioStream[2];
            audioStreams[0].path = "";
            audioStreams[0].output = "";
            audioStreams[0].settings = null;
            audioStreams[1].path = "";
            audioStreams[1].output = "";
            audioStreams[1].settings = null;
            this.videoEncoderProvider = new VideoEncoderProvider();
            this.audioEncoderProvider = new AudioEncoderProvider();
            this.profileManager = new ProfileManager(this.path);
            this.profileManager.LoadProfiles(videoProfile, audioProfile);
            this.loadSettings();
            this.loadJobs();
            this.dialogManager = new DialogManager(this);

            int index = menuItem1.MenuItems.Count;
            foreach (IMuxing muxer in PackageSystem.MuxerProviders.Values)
            {
                MenuItem newMenuItem = new MenuItem();
                newMenuItem.Text = muxer.Name;
                newMenuItem.Tag = muxer;
                newMenuItem.Index = index;
                index++;
                menuItem1.MenuItems.Add(newMenuItem);
                newMenuItem.Click += new System.EventHandler(this.mnuMuxer_Click);
            }
            index = mnuTools.MenuItems.Count;
            foreach (ITool tool in PackageSystem.Tools.Values)
            {
                MenuItem newMenuItem = new MenuItem();
                newMenuItem.Text = tool.Name;
                newMenuItem.Tag = tool;
                newMenuItem.Index = index;
                index++;
                mnuTools.MenuItems.Add(newMenuItem);
                newMenuItem.Click += new System.EventHandler(this.mnuTool_Click);
            }
            //MessageBox.Show(String.Join("|", this.GetType().Assembly.GetManifestResourceNames()));
            using (TextReader r = new StreamReader(this.GetType().Assembly.GetManifestResourceStream("MeGUI.Changelog.txt")))
            {
                mainForm.Changelog.Text = r.ReadToEnd();
            }
        }
 public HdBdStreamExtractor(MainForm info)
 {
     this.mainForm = info;
     this.settings = info.Settings;
     InitializeComponent();
 }