Exemplo n.º 1
0
        public frmCUETools()
        {
            _profile = _defaultProfile = new CUEToolsProfile("default");
            InitializeComponent();
            //splitContainer1.AutoScaleMode = AutoScaleMode.Font;
            if (Type.GetType("Mono.Runtime", false) == null)
                m_icon_mgr = new CUEControls.ShellIconMgr();
            else
                m_icon_mgr = new CUEControls.MonoIconMgr();
            m_icon_mgr.SetExtensionIcon(".flac", global::JDP.Properties.Resources.flac1);
            m_icon_mgr.SetExtensionIcon(".wv", global::JDP.Properties.Resources.wv1);
            m_icon_mgr.SetExtensionIcon(".ape", global::JDP.Properties.Resources.ape);
            m_icon_mgr.SetExtensionIcon(".tta", global::JDP.Properties.Resources.tta);
            m_icon_mgr.SetExtensionIcon(".wav", global::JDP.Properties.Resources.wave);
            m_icon_mgr.SetExtensionIcon(".mp3", global::JDP.Properties.Resources.mp3);
            m_icon_mgr.SetExtensionIcon(".m4a", global::JDP.Properties.Resources.ipod_sound);
            m_icon_mgr.SetExtensionIcon(".ogg", global::JDP.Properties.Resources.ogg);
            m_icon_mgr.SetExtensionIcon(".cue", global::JDP.Properties.Resources.cue3);
            m_icon_mgr.SetExtensionIcon(".#puzzle", global::JDP.Properties.Resources.puzzle);
            m_icon_mgr.SetExtensionIcon(".#users", global::JDP.Properties.Resources.users);
            m_icon_mgr.SetExtensionIcon(".#alarm_clock", global::JDP.Properties.Resources.alarm_clock);
            m_icon_mgr.SetExtensionIcon(".#calendar", global::JDP.Properties.Resources.calendar);
            m_icon_mgr.SetExtensionIcon(".#ar", global::JDP.Properties.Resources.AR);
            m_icon_mgr.SetExtensionIcon(".#ctdb", global::JDP.Properties.Resources.cdrepair);
            m_icon_mgr.SetExtensionIcon(".#images", global::JDP.Properties.Resources.images);
            m_icon_mgr.SetExtensionIcon(".#images_question", global::JDP.Properties.Resources.images_question);
            m_icon_mgr.SetExtensionIcon(".#pictures", global::JDP.Properties.Resources.pictures);
            m_icon_mgr.SetExtensionIcon(".#picture", global::JDP.Properties.Resources.picture);

            //m_state_image_list = new ImageList();
            //m_state_image_list.ImageSize = new Size(16, 16);
            //m_state_image_list.ColorDepth = ColorDepth.Depth32Bit;
            //m_state_image_list.Images.Add("blank", new Bitmap(16, 16));
            //m_state_image_list.Images.Add("cue", Properties.Resources.cue3);
        }
Exemplo n.º 2
0
        private void toolStripTextBoxAddProfile_KeyDown(object sender, KeyEventArgs e)
        {
            if (e.KeyCode != Keys.Enter) return;
            if (toolStripTextBoxAddProfile.Text.IndexOfAny(Path.GetInvalidFileNameChars()) >= 0
                || toolStripTextBoxAddProfile.Text.IndexOf(' ') >= 0
                || toolStripTextBoxAddProfile.Text.Length <= 0)
            {
                //System.Media.SystemSounds.Beep.Play();
                return;
            }
            ToolStripItem item = toolStripDropDownButtonProfile.DropDownItems.Add(toolStripTextBoxAddProfile.Text);
            toolStripDropDownButtonProfile.DropDown.Close();
            e.Handled = true;
            e.SuppressKeyPress = true;

            string profileName = item.Text;
            DeactivateProfile();
            _profile = new CUEToolsProfile(profileName);
            ActivateProfile();
        }
Exemplo n.º 3
0
 private void toolStripDropDownButtonProfile_DropDownItemClicked(object sender, ToolStripItemClickedEventArgs e)
 {
     if (e.ClickedItem == toolStripTextBoxAddProfile
       || e.ClickedItem == toolStripSeparator5)
         return;
     if (e.ClickedItem == toolStripMenuItemDeleteProfile)
     {
         foreach (ToolStripItem item in toolStripDropDownButtonProfile.DropDownItems)
             if (item.Text == toolStripDropDownButtonProfile.Text
                 && item != toolStripTextBoxAddProfile
                 && item != toolStripMenuItemDeleteProfile
                 && item != defaultToolStripMenuItem
                 )
             {
                 toolStripDropDownButtonProfile.DropDownItems.Remove(item);
                 _profile = _defaultProfile;
                 ActivateProfile();
                 return;
             }
         return;
     }
     string profileName = e.ClickedItem.Text;
     if (profileName == _profile._name)
         return;
     DeactivateProfile();
     ActivateProfile(profileName);
 }
Exemplo n.º 4
0
        private void DeactivateProfile()
        {
            SaveProfile();

            if (_profile != _defaultProfile)
            {
                _defaultProfile._config.encoders = _profile._config.encoders;
                _defaultProfile._config.decoders = _profile._config.decoders;
                _defaultProfile._config.formats = _profile._config.formats;
                _defaultProfile._config.scripts = _profile._config.scripts;
                _profile = _defaultProfile;
                ActivateProfile();
            }
        }
Exemplo n.º 5
0
 private void ActivateProfile(string profileName)
 {
     if (profileName == _defaultProfile._name)
         return;
     _profile = new CUEToolsProfile(profileName);
     SettingsReader sr = new SettingsReader("CUE Tools", string.Format("profile-{0}.txt", _profile._name), Application.ExecutablePath);
     _profile.Load(sr);
     _profile._config.encoders = _defaultProfile._config.encoders;
     _profile._config.decoders = _defaultProfile._config.decoders;
     _profile._config.formats = _defaultProfile._config.formats;
     _profile._config.scripts = _defaultProfile._config.scripts;
     ActivateProfile();
 }
Exemplo n.º 6
0
		private void frmBatch_Load(object sender, EventArgs e)
		{
			textBox1.Hide();
			//SettingsReader sr = new SettingsReader("CUE Tools", "settings.txt", Application.ExecutablePath);
			//_profile.Load(sr);
			//_reducePriority = sr.LoadBoolean("ReducePriority") ?? true;
			_reducePriority = true;

			_profile = new CUEToolsProfile(_profileName);
			SettingsReader sr = new SettingsReader("CUE Tools", string.Format("profile-{0}.txt", _profileName), Application.ExecutablePath);
			_profile.Load(sr);
			
			if (_reducePriority)
				Process.GetCurrentProcess().PriorityClass = System.Diagnostics.ProcessPriorityClass.Idle;

			if (_profile._action != CUEAction.Verify)
				txtOutputFile.Show();

			StartConvert();
		}