Esempio n. 1
0
 private void ItsThe80sTheme_Click(object sender, EventArgs e)
 {
     MeterFunc.ChangeStyle(Color.White, Color.Purple, Color.DarkRed, Color.BlanchedAlmond, new Font("Comic Sans MS", 8.25f, FontStyle.Regular), new Font("Comic Sans MS", 8.25f, FontStyle.Regular));
     ClassicTheme.Checked   = false;
     DarkTheme.Checked      = false;
     ItsThe80sTheme.Checked = true;
     Properties.Settings.Default.CurrentTheme = 2;
     Properties.Settings.Default.Save();
 }
Esempio n. 2
0
 private void DarkTheme_Click(object sender, EventArgs e)
 {
     MeterFunc.ChangeStyle(Color.White, Color.Black, Color.White, Color.FromArgb(24, 24, 24), new Font("Arial", 8.25f, FontStyle.Regular), new Font("Arial", 8.25f, FontStyle.Regular));
     ClassicTheme.Checked   = false;
     DarkTheme.Checked      = true;
     ItsThe80sTheme.Checked = false;
     SetWindowTheme(Handle, "EXPLORER", null);
     Properties.Settings.Default.CurrentTheme = 1;
     Properties.Settings.Default.Save();
 }
Esempio n. 3
0
 private void ClassicTheme_Click(object sender, EventArgs e)
 {
     MeterFunc.ChangeStyle(Color.Black, Color.White, Color.White, Color.FromArgb(16, 16, 16), new Font("Microsoft Sans Serif", 8.25f, FontStyle.Regular), new Font("Lucida Console", 8.25f, FontStyle.Regular));
     ClassicTheme.Checked   = true;
     DarkTheme.Checked      = false;
     ItsThe80sTheme.Checked = false;
     SetWindowTheme(Handle, "EXPLORER", null);
     Properties.Settings.Default.CurrentTheme = 0;
     Properties.Settings.Default.Save();
 }
Esempio n. 4
0
 private void VolumeMonitor_Click(object sender, EventArgs e)
 {
     try
     {
         if (VolumeMonitor.Checked != true)
         {
             if (MaxStockClock < 1100)
             {
                 DialogResult dialogResult = MessageBox.Show("Enabling a mixer on a computer with poor specs could make the driver stutter.\n\nAre you sure you want to enable it?", "Weak processor detected", MessageBoxButtons.YesNo, MessageBoxIcon.Warning);
                 if (dialogResult == DialogResult.Yes)
                 {
                     VolumeMonitor.Checked = true;
                     Settings.SetValue("VolumeMonitor", "1", RegistryValueKind.DWord);
                     MeterFunc.EnableLEDs();
                     VUStatus = true;
                     MeterFunc.ChangeMeter(0, 0);
                     MeterFunc.ChangeMeter(1, 0);
                 }
             }
             else if (MaxStockClock >= 1100)
             {
                 VolumeMonitor.Checked = true;
                 Settings.SetValue("VolumeMonitor", "1", RegistryValueKind.DWord);
                 MeterFunc.EnableLEDs();
                 VUStatus = true;
                 MeterFunc.ChangeMeter(0, 0);
                 MeterFunc.ChangeMeter(1, 0);
             }
         }
         else
         {
             VolumeMonitor.Checked = false;
             Settings.SetValue("VolumeMonitor", "0", RegistryValueKind.DWord);
             MeterFunc.DisableLEDs();
             VUStatus = false;
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show("Can not write settings to the registry!\n\nPress OK to quit.\n\n.NET error:\n" + ex.Message.ToString(), "Fatal error", MessageBoxButtons.OK, MessageBoxIcon.Hand);
     }
 }
Esempio n. 5
0
 private void CheckIfXAudio_Tick(object sender, EventArgs e)
 {
     try
     {
         if (Convert.ToInt32(Settings.GetValue("CurrentEngine")) == 0)
         {
             if (VUStatus != false)
             {
                 MeterFunc.DisableLEDs();
                 VUStatus = false;
             }
         }
         else
         {
             if (Convert.ToInt32(Settings.GetValue("VolumeMonitor")) == 1)
             {
                 if (VUStatus != true)
                 {
                     MeterFunc.EnableLEDs();
                     VUStatus = true;
                 }
             }
             else
             {
                 if (VUStatus != false)
                 {
                     MeterFunc.DisableLEDs();
                     VUStatus = false;
                 }
             }
         }
         System.Threading.Thread.Sleep(10);
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.ToString());
     }
 }
Esempio n. 6
0
        private void KeppySynthMixerWindow_Load(object sender, EventArgs e)
        {
            try
            {
                base.DoubleBuffered = true;
                SetStyle(ControlStyles.AllPaintingInWmPaint, true);
                SetStyle(ControlStyles.ResizeRedraw, true);
                SetStyle(ControlStyles.UserPaint, true);
                SetStyle(ControlStyles.OptimizedDoubleBuffer, true);
                UpdateStyles();

                Delegate = this;
                CPUSpeed();
                if (Channels == null)
                {
                    Registry.CurrentUser.CreateSubKey("SOFTWARE\\OmniMIDI\\Channels");
                    return;
                }

                for (int i = 0; i <= 15; ++i)
                {
                    RegValInt[i] = Convert.ToInt32(Channels.GetValue(RegValName[i], 100));
                    if (RegValInt[i] > 100)
                    {
                        RegValInt[i] = 100;
                    }
                }

                CH1VOL.Value  = RegValInt[0];
                CH2VOL.Value  = RegValInt[1];
                CH3VOL.Value  = RegValInt[2];
                CH4VOL.Value  = RegValInt[3];
                CH5VOL.Value  = RegValInt[4];
                CH6VOL.Value  = RegValInt[5];
                CH7VOL.Value  = RegValInt[6];
                CH8VOL.Value  = RegValInt[7];
                CH9VOL.Value  = RegValInt[8];
                CH10VOL.Value = RegValInt[9];
                CH11VOL.Value = RegValInt[10];
                CH12VOL.Value = RegValInt[11];
                CH13VOL.Value = RegValInt[12];
                CH14VOL.Value = RegValInt[13];
                CH15VOL.Value = RegValInt[14];
                CH16VOL.Value = RegValInt[15];
                MainVol.Value = RegValInt.Max();

                if (Convert.ToInt32(Settings.GetValue("VolumeMonitor")) == 1)
                {
                    VolumeMonitor.Checked = true;
                    MeterFunc.EnableLEDs();
                    VUStatus = true;
                }
                else
                {
                    VolumeMonitor.Checked = false;
                    MeterFunc.DisableLEDs();
                    VUStatus = false;
                }
                ChannelVolume.Enabled = true;
                GarbageCollector.RunWorkerAsync();

                Meter.ContextMenu    = PeakMeterMenu;
                VolumeCheck.Interval = Convert.ToInt32((1.0 / Properties.Settings.Default.VolUpdateHz) * 1000.0);

                if (Properties.Settings.Default.CurrentTheme == 0)
                {
                    ClassicTheme.PerformClick();
                }
                else if (Properties.Settings.Default.CurrentTheme == 1)
                {
                    DarkTheme.PerformClick();
                }
                else if (Properties.Settings.Default.CurrentTheme == 2)
                {
                    ItsThe80sTheme.PerformClick();
                }
                else
                {
                    ClassicTheme.PerformClick();
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show("Can not read settings from the registry!\n\nPress OK to quit.\n\n.NET error:\n" + ex.Message.ToString(), "Fatal error", MessageBoxButtons.OK, MessageBoxIcon.Hand);
            }
        }
Esempio n. 7
0
        private void VolumeCheck_Tick(object sender, EventArgs e)
        {
            try
            {
                // Something is messed up, fix it
                try
                {
                    if (Debug.GetValueKind("leftvol") != RegistryValueKind.DWord ||
                        Debug.GetValueKind("rightvol") != RegistryValueKind.DWord)
                    {
                        Debug.SetValue("leftvol", 0, RegistryValueKind.DWord);
                        Debug.SetValue("rightvol", 0, RegistryValueKind.DWord);
                    }
                }
                catch
                {
                    try
                    {
                        Debug.DeleteValue("leftvol");
                        Debug.DeleteValue("rightvol");
                        Debug.SetValue("leftvol", 0, RegistryValueKind.DWord);
                        Debug.SetValue("rightvol", 0, RegistryValueKind.DWord);
                    }
                    catch { /* Can't do much about it */ }
                }

                // Parse the volume, and make a percentage out of it
                int left  = Convert.ToInt32(Debug.GetValue("leftvol", 1));
                int right = Convert.ToInt32(Debug.GetValue("rightvol", 1));
                var perc  = ((double)((left + right) / 2) / 32768) * 100;

                // Print the percentage
                VolLevel.Text = String.Format("{0}%", Math.Round(perc, 0));

                // Check if mono rendering is enabled, and change the view accordingly
                if (Convert.ToInt32(Settings.GetValue("MonoRendering", 0)) == 1)
                {
                    Size UseSize = new Size(39, 5);
                    LLab.Size = new Size(39, 16);
                    LLab.Text = "LVL";
                    ChangeLeftChannelSize(UseSize);
                    MeterFunc.ChangeMeter(0, left);
                    MeterFunc.ChangeMeter(1, 0);
                    MeterFunc.AverageMeter(left, left);
                }
                else
                {
                    Size UseSize = new Size(16, 5);
                    LLab.Size = new Size(16, 16);
                    LLab.Text = "L";
                    ChangeLeftChannelSize(UseSize);
                    MeterFunc.ChangeMeter(0, left);
                    MeterFunc.ChangeMeter(1, right);
                    MeterFunc.AverageMeter(left, right);
                }

                // I SLEEP x3x
                System.Threading.Thread.Sleep(1);
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.ToString());
            }
        }