示例#1
0
            public QPodcastDetails(PodcastSubscription Subscription, Callback Done)
                : base()
            {
                this.ps           = Subscription;
                this.doneCallback = Done;

                lblTitle       = new QLabel("Title");
                lblURL         = new QLabel("URL");
                lblGenre       = new QLabel("Mark New Episodes with Genre");
                txtTitle       = new QTextBox();
                txtTitle.Width = 1000; // prevent scrolling when text set
                txtTitle.Text  = ps.Name;
                txtURL         = new QTextBox();
                txtURL.Text    = ps.URL;

                btnOK     = new QButton("Save", false, false);
                btnCancel = new QButton("Cancel", false, false);

                AddButton(btnOK, ok);
                AddButton(btnCancel, cancel);

                cboGenre = new QComboBox(true);
                List <string> genres = Database.GetGenres();

                if (!genres.Contains(ps.DefaultGenre, StringComparer.OrdinalIgnoreCase))
                {
                    genres.Add(ps.DefaultGenre);
                }
                genres.Sort();
                cboGenre.Items.AddRange(genres.ToArray());
                cboGenre.SelectedIndex = genres.FindIndex(g => String.Compare(g, ps.DefaultGenre, StringComparison.OrdinalIgnoreCase) == 0);

                this.Controls.Add(lblTitle);
                this.Controls.Add(lblURL);
                this.Controls.Add(txtTitle);
                this.Controls.Add(txtURL);
                this.Controls.Add(lblGenre);
                this.Controls.Add(cboGenre);

                buttonWidth = Math.Max(btnOK.Width, btnCancel.Width);

                btnOK.Width     = buttonWidth;
                btnCancel.Width = buttonWidth;

                this.Height = calcHeight();

                int tabIndex = 0;

                lblTitle.TabIndex  = tabIndex++;
                txtTitle.TabIndex  = tabIndex++;
                lblURL.TabIndex    = tabIndex++;
                txtURL.TabIndex    = tabIndex++;
                lblGenre.TabIndex  = tabIndex++;
                cboGenre.TabIndex  = tabIndex++;
                btnOK.TabIndex     = tabIndex++;
                btnCancel.TabIndex = tabIndex++;

                setWrapAroundTabControl(tabIndex, txtTitle, null);
            }
示例#2
0
        private void setupComboBox(out QComboBox ComboBox, string Caption, string DefaultText, string[] Values, bool MakeCheckbox)
        {
            ComboBox = new QComboBox(true, Styles.FontSmaller);
            ComboBox.Items.AddRange(Values);
            ComboBox.Text = DefaultText;

            setupControl(ComboBox, Caption, MakeCheckbox);
        }
示例#3
0
            public QPodcastAutoManageOptions(Callback DoneCallback) : base()
            {
                doneCallback = DoneCallback;

                lblHeading = new QLabel("Podcast Automanagement Options", Styles.FontBold);
                this.Controls.Add(lblHeading);

                lblCheckFreq = new QLabel("Check for new Episodes");
                this.Controls.Add(lblCheckFreq);

                cboRefreshSchedule = new QComboBox(false);
                cboRefreshSchedule.Items.AddRange(new string[] { "Every 15 Minutes", "Every Half Hour", "Every Hour", "Every Time QuuxPlayer Starts", "Manual Only" });
                cboRefreshSchedule.AutoSetWidth();
                cboRefreshSchedule.SelectedIndex = (int)Setting.PodcastDownloadSchedule;
                this.Controls.Add(cboRefreshSchedule);

                lblDownloadDisposition = new QLabel("When new episodes are found");
                this.Controls.Add(lblDownloadDisposition);

                cboDownloadDisposition = new QComboBox(false);
                cboDownloadDisposition.Items.AddRange(new string[] { "Download All New Episodes", "Download Latest Episode", "Don't Download" });
                cboDownloadDisposition.AutoSetWidth();
                cboDownloadDisposition.SelectedIndex = (int)Setting.PodcastDownloadDisposition;
                this.Controls.Add(cboDownloadDisposition);

                System.Diagnostics.Debug.Assert(cboRefreshSchedule.Items.Count == (int)PodcastDownloadSchedule.Count);
                System.Diagnostics.Debug.Assert(cboDownloadDisposition.Items.Count == (int)PodcastDownloadDisposition.Count);

                /*
                 * spnMaxConcurrentDownloads = new QSpin(false, false, "Maximum Simultaneous Downloads:", String.Empty, 1, 10, 1, 1, this.BackColor);
                 * this.Controls.Add(spnMaxConcurrentDownloads);
                 */

                btnOK = new QButton(Localization.OK, false, false);
                AddButton(btnOK, ok);

                btnCancel = new QButton(Localization.CANCEL, false, false);
                AddButton(btnCancel, cancel);

                //btnOK.Width = btnCancel.Width = (Math.Max(btnOK.Width, btnCancel.Width));

                int tabIndex = 0;

                lblCheckFreq.TabIndex           = tabIndex++;
                cboRefreshSchedule.TabIndex     = tabIndex++;
                lblDownloadDisposition.TabIndex = tabIndex++;
                cboDownloadDisposition.TabIndex = tabIndex++;
                btnOK.TabIndex     = tabIndex++;
                btnCancel.TabIndex = tabIndex++;

                setWrapAroundTabControl(tabIndex, cboRefreshSchedule, null);

                arrangeControls();

                //this.Height = spnMaxConcurrentDownloads.Bottom + MARGIN;
                this.Height = cboDownloadDisposition.Bottom + MARGIN;
            }
示例#4
0
        public frmSleep(Controller Controller) : base(Localization.Get(UI_Key.Sleep_Title), ButtonCreateType.OKAndCancel)
        {
            this.controller = Controller;

            this.SuspendLayout();

            lblInstructions          = new QLabel(Localization.Get(UI_Key.Sleep_Instructions, Application.ProductName));
            lblInstructions.AutoSize = false;
            this.Controls.Add(lblInstructions);

            txtTime = new QSpin(true, true, Localization.Get(UI_Key.Sleep_Play_For_Another), Localization.Get(UI_Key.Sleep_Minutes), 1, 24 * 60, 60, 5, this.BackColor);
            txtTime.CheckedChanged += new EventHandler(txtTime_CheckedChanged);
            txtTime.ValueChanged   += new EventHandler(txtTime_ValueChanged);
            this.Controls.Add(txtTime);

            lblAndThen = new QLabel(Localization.Get(UI_Key.Sleep_And_Then));
            this.Controls.Add(lblAndThen);

            cboAction = new QComboBox(false);
            cboAction.Items.Add(SHUTDOWN_TEXT);
            cboAction.Items.Add(STANDBY_TEXT);
            cboAction.Items.Add(HIBERNATE_TEXT);
            cboAction.Items.Add(EXIT_TEXT);

            cboAction.SelectedIndexChanged += new EventHandler(cboAction_SelectedIndexChanged);
            cboAction.Width = TextRenderer.MeasureText(SHUTDOWN_TEXT, this.Font).Width + 40;
            this.Controls.Add(cboAction);

            txtFadeTime = new QSpin(true, true, Localization.Get(UI_Key.Sleep_Gradually_Reduce_Volume_After), Localization.Get(UI_Key.Sleep_Minutes), 0, 24 * 60, 0, 5, this.BackColor);
            txtFadeTime.ValueChanged += new EventHandler(txtFadeTime_ValueChanged);
            this.Controls.Add(txtFadeTime);

            chkForce = new QCheckBox(Localization.Get(UI_Key.Sleep_Force_Shutdown), this.BackColor);
            chkForce.EnabledChanged += (s, e) => { this.Invalidate(); };
            this.Controls.Add(chkForce);

            Sleep = new Sleep(controller);

            txtFadeTime_ValueChanged(this, EventArgs.Empty);
            txtTime_ValueChanged(this, EventArgs.Empty);

            setupControls();

            this.ResumeLayout(false);
        }
示例#5
0
        private void setupCompilation(out QComboBox ComboBox, string Caption, bool MakeCheckbox)
        {
            ComboBox = new QComboBox(false, Styles.FontSmaller);

            bool?isComp = tracks[0].Compilation;

            foreach (Track t in tracks)
            {
                if (t.Compilation != isComp)
                {
                    isComp = null;
                    break;
                }
            }

            if (isComp.HasValue)
            {
                ComboBox.Items.AddRange(new string[] { Localization.YES, Localization.NO });
                if (isComp.Value)
                {
                    ComboBox.SelectedIndex = ComboBox.FindStringExact(Localization.YES);
                }
                else
                {
                    ComboBox.SelectedIndex = ComboBox.FindStringExact(Localization.NO);
                }
            }
            else
            {
                System.Diagnostics.Debug.Assert(isMultiple);
                ComboBox.Items.AddRange(new string[] { MULTIPLE_VALUES, Localization.YES, Localization.NO });
                ComboBox.SelectedIndex = 0;
                ComboBox.EnableWatermark(this, MULTIPLE_VALUES, MULTIPLE_VALUES);
            }

            setupControl(ComboBox, Caption, MakeCheckbox);
        }
示例#6
0
        private void setupRename(string Caption, bool MakeCheckbox)
        {
            cboRename = new QComboBox(false, Styles.FontSmaller);
            setupControl(cboRename, Caption, MakeCheckbox);

            if (isMultiple)
            {
                string[] ss = TrackWriter.GetRenames().ToArray();
                cboRename.Items.AddRange(ss);
                cboRename.SelectedIndex = 0; // cboRename.FindStringExact(ss[0]);
                cboRename.LostFocus    += (s, e) =>
                {
                    if (cboRename.Text.Length == 0)
                    {
                        checkboxes[cboRename].Checked = false;
                    }
                };
                cboRename.EnableWatermark(this, MULTIPLE_VALUES, MULTIPLE_VALUES);
            }
            else
            {
                updateFilenames(0);
            }
        }
示例#7
0
        public TagCloud()
        {
            Item.Parent         = this;
            Item.NeedRefresh   += (i) => { this.invalidate(i); };
            this.DoubleBuffered = true;

            artists   = Localization.Get(UI_Key.Tag_Cloud_Artists);
            albums    = Localization.Get(UI_Key.Tag_Cloud_Albums);
            groupings = Localization.Get(UI_Key.Tag_Cloud_Groupings);
            genres    = Localization.Get(UI_Key.Tag_Cloud_Genres);

            lblShow           = new QLabel(Localization.Get(UI_Key.Tag_Cloud_Show_At_Most));
            lblShow.Location  = new Point(MARGIN, MARGIN + 4);
            lblShow.ForeColor = Styles.LightText;
            this.Controls.Add(lblShow);

            cboType = new QComboBox(false);
            cboType.DropDownStyle = ComboBoxStyle.DropDownList;
            cboType.Items.AddRange(new string[] { "10", "25", "50", "75", "100", "125", "150", "200", "300", "500", "1000" });
            cboType.SelectedIndex = 4;

            cboType.Location = new Point(lblShow.Right, MARGIN);
            this.Controls.Add(cboType);

            btnGenres                = new QButton(genres, false, false);
            btnGenres.Value          = false;
            btnGenres.ButtonPressed += (s) =>
            {
                this.ViewMode = ViewModeEnum.Genre;
                this.setupItems();
            };
            btnGenres.Location = new Point(cboType.Right + MARGIN + MARGIN, MARGIN);
            this.Controls.Add(btnGenres);

            btnArtists                = new QButton(artists, false, false);
            btnArtists.Value          = true;
            btnArtists.ButtonPressed += (s) =>
            {
                if (this.ViewMode == ViewModeEnum.Artist)
                {
                    currentGenre    = String.Empty;
                    currentGrouping = String.Empty;
                }
                else
                {
                    currentArtist = String.Empty;
                    this.ViewMode = ViewModeEnum.Artist;
                }
                this.setupItems();
            };
            btnArtists.Location = new Point(btnGenres.Right + MARGIN, btnGenres.Top);
            this.Controls.Add(btnArtists);

            btnAlbums                = new QButton(albums, false, false);
            btnArtists.Value         = false;
            btnAlbums.ButtonPressed += (s) =>
            {
                if (this.ViewMode == ViewModeEnum.Album)
                {
                    currentArtist = String.Empty;
                }
                else
                {
                    this.ViewMode = ViewModeEnum.Album;
                }
                this.setupItems();
            };
            btnAlbums.Location = new Point(btnArtists.Right + MARGIN, btnGenres.Top);
            this.Controls.Add(btnAlbums);

            btnGroupings                = new QButton(groupings, false, false);
            btnGroupings.Value          = false;
            btnGroupings.ButtonPressed += (s) =>
            {
                this.ViewMode = ViewModeEnum.Grouping;
                this.setupItems();
            };
            btnGroupings.Location = new Point(btnAlbums.Right + MARGIN, btnGenres.Top);
            this.Controls.Add(btnGroupings);

            btnChooseTop                = new QButton(Localization.Get(UI_Key.Tag_Cloud_Choose_Top), false, false);
            btnChooseTop.Value          = true;
            btnChooseTop.ButtonPressed += (s) =>
            {
                clearCurrentValues();
                this.ChooseMode = ChooseModeEnum.Top;
                this.setupItems();
            };
            btnChooseTop.Location = new Point(btnGroupings.Right + MARGIN + MARGIN, btnGenres.Top);
            this.Controls.Add(btnChooseTop);

            btnChooseRandom                = new QButton(Localization.Get(UI_Key.Tag_Cloud_Choose_Random), false, false);
            btnChooseRandom.Value          = false;
            btnChooseRandom.ButtonPressed += (s) =>
            {
                clearCurrentValues();
                this.ChooseMode = ChooseModeEnum.Random;
                this.setupItems();
            };
            btnChooseRandom.Location = new Point(btnChooseTop.Right + MARGIN, btnGenres.Top);
            this.Controls.Add(btnChooseRandom);

            btnUseColor                = new QButton("Use Color", true, false);
            btnUseColor.Value          = false;
            btnUseColor.ButtonPressed += (s) =>
            {
                Item.UseColor = btnUseColor.Value;
                this.Invalidate();
            };
            btnUseColor.Location = new Point(btnChooseRandom.Right + MARGIN + MARGIN, btnGenres.Top);
            this.Controls.Add(btnUseColor);
        }
示例#8
0
        public frmTwitter() : base(Localization.Get(UI_Key.Twitter_Title), ButtonCreateType.OKAndCancel)
        {
            this.ClientSize = new Size(420, 200);

            lblInstructions          = new QLabel(Localization.Get(UI_Key.Twitter_Instructions, Application.ProductName));
            lblInstructions.Location = new Point(MARGIN, MARGIN);
            lblInstructions.SetWidth(this.ClientRectangle.Width - MARGIN - MARGIN);
            this.Controls.Add(lblInstructions);

            chkEnable                 = new QCheckBox(Localization.Get(UI_Key.Twitter_Enable), this.BackColor);
            chkEnable.Location        = new Point(MARGIN, lblInstructions.Bottom + MARGIN + MARGIN);
            chkEnable.CheckedChanged += new EventHandler(enableCheckChanged);
            this.Controls.Add(chkEnable);

            lblUserName = new QLabel(Localization.Get(UI_Key.Twitter_User_Name));
            lblPassword = new QLabel(Localization.Get(UI_Key.Twitter_Password));

            txtUserName              = new QTextBox();
            txtUserName.Text         = Twitter.UserName;
            txtUserName.MaxLength    = 64;
            txtUserName.TextChanged += new EventHandler(textChanged);

            txtPassword              = new QTextBox();
            txtPassword.Text         = Twitter.Password;
            txtPassword.MaxLength    = 64;
            txtPassword.TextChanged += new EventHandler(textChanged);
            txtPassword.PasswordChar = '*';

            lblUserName.Location = new Point(2 * MARGIN, chkEnable.Bottom + MARGIN + MARGIN + (txtUserName.Height - lblUserName.Height) / 2);
            lblPassword.Location = new Point(2 * MARGIN, lblUserName.Top + MARGIN + txtUserName.Height);

            this.Controls.Add(lblUserName);
            this.Controls.Add(lblPassword);

            int x = Math.Max(lblUserName.Right, lblPassword.Right) + MARGIN;

            txtUserName.Location = new Point(x, lblUserName.Top + (lblUserName.Height - txtUserName.Height) / 2);
            txtPassword.Location = new Point(x, lblPassword.Top + (lblPassword.Height - txtPassword.Height) / 2);

            this.Controls.Add(txtUserName);
            this.Controls.Add(txtPassword);

            lblMode = new QLabel("Post A Tweet With Each:");
            this.Controls.Add(lblMode);
            lblMode.Location = new Point(4 * MARGIN, txtPassword.Bottom + MARGIN);

            cboMode = new QComboBox(false);
            cboMode.Items.Add(Localization.Get(UI_Key.Twitter_Mode_Song));
            cboMode.Items.Add(Localization.Get(UI_Key.Twitter_Mode_Album));

            this.Controls.Add(cboMode);

            cboMode.Location = new Point(lblMode.Right + MARGIN, lblMode.Top + (lblMode.Height - cboMode.Height) / 2);

            switch (Twitter.TwitterMode)
            {
            case Twitter.Mode.Album:
                cboMode.SelectedIndex = cboMode.FindStringExact(Localization.Get(UI_Key.Twitter_Mode_Album));
                break;

            default:
                cboMode.SelectedIndex = cboMode.FindStringExact(Localization.Get(UI_Key.Twitter_Mode_Song));
                break;
            }

            btnTest = new QButton(Localization.Get(UI_Key.Twitter_Test), false, false);
            AddButton(btnTest, test);

            btnViewOnWeb = new QButton(Localization.Get(UI_Key.Twitter_View_On_Web), false, false);
            AddButton(btnViewOnWeb, viewOnWeb);

            PlaceButtons(this.ClientRectangle.Width,
                         cboMode.Bottom + MARGIN + MARGIN,
                         btnCancel,
                         btnOK,
                         btnTest,
                         btnViewOnWeb);

            this.ClientSize = new Size(this.ClientRectangle.Width, btnCancel.Bottom + MARGIN);

            int tabIndex = 0;

            chkEnable.TabIndex   = tabIndex++;
            txtUserName.TabIndex = tabIndex++;
            txtPassword.TabIndex = tabIndex++;

            btnViewOnWeb.TabIndex = tabIndex++;
            btnTest.TabIndex      = tabIndex++;
            btnOK.TabIndex        = tabIndex++;
            btnCancel.TabIndex    = tabIndex++;

            chkEnable.Checked = Twitter.On;
            enableControls();
        }
示例#9
0
        public RadioEditPanel(RadioStation Station, string[] GenreList, Radio.StationEditComplete Callback) : base()
        {
            SPACING = 8;

            station  = Station;
            callback = Callback;

            lblName = new QLabel("&Name");
            lblName.ShowAccellerator();
            this.Controls.Add(lblName);

            lblGenre = new QLabel("&Genre");
            lblGenre.ShowAccellerator();
            this.Controls.Add(lblGenre);

            lblBitRate = new QLabel("&Bit Rate");
            lblBitRate.ShowAccellerator();
            this.Controls.Add(lblBitRate);

            lblStreamType = new QLabel("&Stream Type");
            lblStreamType.ShowAccellerator();
            this.Controls.Add(lblStreamType);

            lblURL = new QLabel("&URL");
            lblURL.ShowAccellerator();
            this.Controls.Add(lblURL);

            txtName           = new QTextBox();
            txtName.Width     = 1000;
            txtName.MaxLength = 140;
            txtName.GotFocus += (s, e) => txtName.SelectAll();
            this.Controls.Add(txtName);

            cboGenre           = new QComboBox(true);
            cboGenre.MaxLength = 30;
            cboGenre.Items.AddRange(GenreList);
            this.Controls.Add(cboGenre);

            txtBitrate             = new QTextBox();
            txtBitrate.NumericOnly = true;
            txtBitrate.MaxLength   = 3;
            this.Controls.Add(txtBitrate);

            cboStreamType = new QComboBox(false);
            cboStreamType.Items.AddRange(RadioStation.StreamTypeArray);
            this.Controls.Add(cboStreamType);

            txtURL           = new QTextBox();
            txtURL.MaxLength = 2048;
            this.Controls.Add(txtURL);

            txtName.Text  = station.Name;
            cboGenre.Text = station.Genre;
            if (station.BitRate > 0)
            {
                txtBitrate.Text = station.BitRate.ToString();
            }
            else
            {
                txtBitrate.Text = String.Empty;
            }

            cboStreamType.SelectedIndex = (int)station.StreamType;
            txtURL.Text = station.URL;

            btnOK = new QButton(Localization.OK, false, false);
            AddButton(btnOK, ok);
            btnCancel = new QButton(Localization.CANCEL, false, false);
            AddButton(btnCancel, cancel);

            resize();

            this.ClientSize = new Size(this.ClientRectangle.Width, btnOK.Bottom + MARGIN);

            int tabIndex = 0;

            lblName.TabIndex       = tabIndex++;
            txtName.TabIndex       = tabIndex++;
            lblGenre.TabIndex      = tabIndex++;
            cboGenre.TabIndex      = tabIndex++;
            lblURL.TabIndex        = tabIndex++;
            txtURL.TabIndex        = tabIndex++;
            lblBitRate.TabIndex    = tabIndex++;
            txtBitrate.TabIndex    = tabIndex++;
            lblStreamType.TabIndex = tabIndex++;
            cboStreamType.TabIndex = tabIndex++;
            btnOK.TabIndex         = tabIndex++;
            btnCancel.TabIndex     = tabIndex++;

            setWrapAroundTabControl(tabIndex, txtName, null);

            initialized = true;
        }
示例#10
0
        public frmOptions() : base(Localization.Get(UI_Key.Options_Title, Application.ProductName), ButtonCreateType.OKAndCancel)
        {
            this.SPACING = 4;

            tabs = new Dictionary <QButton, List <Control> >();

            InitializeComponent();

            QButton        button   = new QButton("Primary Options", true, false);
            List <Control> controls = new List <Control>();

            tabs.Add(button, controls);
            button.Value          = true;
            button.ButtonPressed += clickTab;

            topMargin = PADDING + button.Height + SPACING + SPACING;

            lblSound = new QLabel(Localization.Get(UI_Key.Options_Label_Sound), Styles.FontBold);
            controls.Add(lblSound);

            chkAutoClippingControl = new QCheckBox(Localization.Get(UI_Key.Options_Auto_Clipping_Control), this.BackColor);
            controls.Add(chkAutoClippingControl);

            lblSoundDevice = new QLabel("Specify a sound output device:");
            controls.Add(lblSoundDevice);

            cboSoundDevice = new QComboBox(false);
            cboSoundDevice.Items.AddRange(OutputDX.GetDeviceNames());
            cboSoundDevice.SelectedIndexChanged += new EventHandler(cboSoundDevice_SelectedIndexChanged);

            asioDevices = OutputASIO.GetDeviceNames().ToArray();
            cboSoundDevice.Items.AddRange(asioDevices);

            chkVolumeControlsWindowsVolume = new QCheckBox(Localization.Get(UI_Key.Options_Volume_Controls_Windows_Volume, Application.ProductName), this.BackColor);

            if (!Lib.IsVistaOrLater)
            {
                controls.Add(chkVolumeControlsWindowsVolume);
            }
            else
            {
                chkVolumeControlsWindowsVolume.Visible = false;
            }

            if (cboSoundDevice.Items.Count > 0)
            {
                cboSoundDevice.SelectedIndex = 0;
                cboSoundDevice.AutoSetWidth();
            }
            controls.Add(cboSoundDevice);

            lblDisplay = new QLabel(Localization.Get(UI_Key.Options_Label_Display), Styles.FontBold);
            controls.Add(lblDisplay);

            chkIncludeTagCloud = new QCheckBox(Localization.Get(UI_Key.Options_Include_Tag_Cloud), this.BackColor);
            controls.Add(chkIncludeTagCloud);

            chkDisableScreensavers = new QCheckBox(Localization.Get(UI_Key.Options_Disable_Screensaver), this.BackColor);
            controls.Add(chkDisableScreensavers);

            chkDisableScreensaversOnlyWhenPlaying = new QCheckBox("Only When Playing", this.BackColor);
            controls.Add(chkDisableScreensaversOnlyWhenPlaying);

            chkShowGridOnSpectrum = new QCheckBox(Localization.Get(UI_Key.Options_Spectrum_Show_Grid), this.BackColor);
            controls.Add(chkShowGridOnSpectrum);

            button                = new QButton("Secondary Options", true, false);
            button.Value          = false;
            button.ButtonPressed += clickTab;
            controls              = new List <Control>();
            tabs.Add(button, controls);

            lblInternet = new QLabel(Localization.Get(UI_Key.Options_Label_Internet), Styles.FontBold);
            controls.Add(lblInternet);

            chkAutoCheckUpdates = new QCheckBox(Localization.Get(UI_Key.Options_Auto_Check_Updates), this.BackColor);
            controls.Add(chkAutoCheckUpdates);

            chkDownloadCoverArt = new QCheckBox(Localization.Get(UI_Key.Options_Download_Cover_Art), this.BackColor);
            controls.Add(chkDownloadCoverArt);

            lblArtSave         = new QLabel(Localization.Get(UI_Key.Options_Save_Art_Caption));
            lblArtSave.Enabled = false;
            controls.Add(lblArtSave);

            cboArtSave = new QComboBox(false);
            cboArtSave.Items.Add(Localization.Get(UI_Key.Options_Save_Art_Folder_JPG));
            cboArtSave.Items.Add(Localization.Get(UI_Key.Options_Save_Art_Artist_Album));
            cboArtSave.Items.Add(Localization.Get(UI_Key.Options_Save_Art_None));
            cboArtSave.AutoSetWidth();
            cboArtSave.Enabled = false;
            controls.Add(cboArtSave);

            lblMisc = new QLabel(Localization.Get(UI_Key.Options_Label_Other), Styles.FontBold);
            controls.Add(lblMisc);

            chkUseGlobalHotkeys = new QCheckBox(Localization.Get(UI_Key.Options_Use_Global_Hotkeys), this.BackColor);
            controls.Add(chkUseGlobalHotkeys);

            spnShortTracks = new QSpin(true,
                                       true,
                                       Localization.Get(UI_Key.Options_Dont_Load_Shorter_Than),
                                       Localization.Get(UI_Key.Options_Dont_Load_Seconds),
                                       1,
                                       60,
                                       10,
                                       5,
                                       this.BackColor);

            spnShortTracks.OffEquivalent = 0;
            controls.Add(spnShortTracks);

            chkDownloadCoverArt.CheckedChanged += (s, e) =>
            {
                lblArtSave.Enabled = chkDownloadCoverArt.Checked;
                cboArtSave.Enabled = chkDownloadCoverArt.Checked;
            };

            chkStopClearsNowPlaying = new QCheckBox("Stop clears Now Playing", this.BackColor);
            controls.Add(chkStopClearsNowPlaying);

            chkSaveNowPlayingOnExit = new QCheckBox("Save Now Playing on exit", this.BackColor);
            controls.Add(chkSaveNowPlayingOnExit);

            bool isFirst  = true;
            int  tabIndex = 0;

            foreach (KeyValuePair <QButton, List <Control> > kvp in tabs)
            {
                this.Controls.Add(kvp.Key);
                kvp.Key.TabIndex = tabIndex++;
                foreach (Control c in kvp.Value)
                {
                    c.Visible = isFirst;
                    this.Controls.Add(c);
                }
                isFirst = false;
            }

            cboSoundDevice.TabIndex = tabIndex++;

            if (!Lib.IsVistaOrLater)
            {
                chkVolumeControlsWindowsVolume.TabIndex = tabIndex++;
            }

            chkAutoClippingControl.TabIndex = tabIndex++;

            chkIncludeTagCloud.TabIndex     = tabIndex++;
            chkDisableScreensavers.TabIndex = tabIndex++;
            chkDisableScreensaversOnlyWhenPlaying.TabIndex = tabIndex++;
            chkShowGridOnSpectrum.TabIndex = tabIndex++;
            chkAutoCheckUpdates.TabIndex   = tabIndex++;
            chkDownloadCoverArt.TabIndex   = tabIndex++;
            cboArtSave.TabIndex            = tabIndex++;

            chkUseGlobalHotkeys.TabIndex     = tabIndex++;
            chkStopClearsNowPlaying.TabIndex = tabIndex++;
            chkSaveNowPlayingOnExit.TabIndex = tabIndex++;
            spnShortTracks.TabIndex          = tabIndex++;

            btnOK.TabIndex     = tabIndex++;
            btnCancel.TabIndex = tabIndex++;

            arrangeLayout();
        }
示例#11
0
        public Equalizer()
        {
            instance = this;

            this.DoubleBuffered = true;

            _currentEqualizer = EqualizerSetting.Off;

            scrollBars = new QScrollBar[MAX_NUM_BANDS];

            for (int i = 0; i < MAX_NUM_BANDS; i++)
            {
                QScrollBar qsb = new QScrollBar(false);
                qsb.Max         = SCALE;
                qsb.Min         = -SCALE;
                qsb.LargeChange = LARGE_CHANGE;
                qsb.Value       = 0;
                qsb.Brightness  = QScrollBar.SBBrightness.Dim;
                qsb.UserScroll += new QScrollBar.ScrollDelegate(scroll);
                this.Controls.Add(qsb);
                qsb.Tag       = i;
                scrollBars[i] = qsb;
            }

            btnOn           = new QButton(Localization.Get(UI_Key.Equalizer_Eq_Off), true, false);
            btnOn.BackColor = Color.Black;

            cboName                       = new QComboBox(true);
            cboName.Location              = new Point(HORIZ_MARGIN, BUTTON_TOPS + btnOn.Height / 2 - cboName.Height / 2);
            cboName.DropDownStyle         = ComboBoxStyle.DropDownList;
            cboName.SelectedValueChanged += new EventHandler(cboName_SelectedValueChanged);
            this.Controls.Add(cboName);

            btnOn.ButtonPressed += new QButton.ButtonDelegate(turnOn);
            this.Controls.Add(btnOn);

            btnLockPreset                = new QButton(Localization.Get(UI_Key.Equalizer_Lock), true, false);
            btnLockPreset.BackColor      = Color.Black;
            btnLockPreset.ButtonPressed += new QButton.ButtonDelegate(btnLockPreset_ButtonPressed);
            this.Controls.Add(btnLockPreset);

            btnFineControl                = new QButton(Localization.Get(UI_Key.Equalizer_Fine_Control), true, false);
            btnFineControl.BackColor      = Color.Black;
            btnFineControl.Value          = false;
            btnFineControl.ButtonPressed += (s) => { if (btnFineControl.Value)
                                                     {
                                                         btnAllTogether.Value = false;
                                                     }
            };
            this.Controls.Add(btnFineControl);

            btnAllTogether                = new QButton(Localization.Get(UI_Key.Equalizer_All_Together), true, false);
            btnAllTogether.BackColor      = Color.Black;
            btnAllTogether.Value          = false;
            btnAllTogether.ButtonPressed += (s) => { if (btnAllTogether.Value)
                                                     {
                                                         btnFineControl.Value = false;
                                                     }
            };
            this.Controls.Add(btnAllTogether);

            btnExpand                = new QButton(Localization.Get(UI_Key.Equalizer_Expand), false, false);
            btnExpand.BackColor      = Color.Black;
            btnExpand.ButtonPressed += new QButton.ButtonDelegate(expand);
            this.Controls.Add(btnExpand);

            btnCompress                = new QButton(Localization.Get(UI_Key.Equalizer_Compress), false, false);
            btnCompress.BackColor      = Color.Black;
            btnCompress.ButtonPressed += new QButton.ButtonDelegate(compress);
            this.Controls.Add(btnCompress);

            btnReset                = new QButton(Localization.Get(UI_Key.Equalizer_Reset), false, false);
            btnReset.BackColor      = Color.Black;
            btnReset.ButtonPressed += new QButton.ButtonDelegate(reset);
            this.Controls.Add(btnReset);

            btnRemovePreset                = new QButton(Localization.Get(UI_Key.Equalizer_Remove), false, false);
            btnRemovePreset.BackColor      = Color.Black;
            btnRemovePreset.ButtonPressed += new QButton.ButtonDelegate(btnRemovePreset_ButtonPressed);
            this.Controls.Add(btnRemovePreset);

            btnNewPreset                = new QButton(Localization.Get(UI_Key.Equalizer_New), false, false);
            btnNewPreset.BackColor      = Color.Black;
            btnNewPreset.ButtonPressed += new QButton.ButtonDelegate(btnNewPreset_ButtonPressed);
            this.Controls.Add(btnNewPreset);

            btnNumBands                = new QButton(Localization.Get(UI_Key.Equalizer_Bands, "10"), false, false);
            btnNumBands.BackColor      = Color.Black;
            btnNumBands.ButtonPressed += new QButton.ButtonDelegate(btnNumBands_ButtonPressed);
            this.Controls.Add(btnNumBands);

            fullButtonsWidth = getButtonsWidth();
        }
示例#12
0
        private void setupControl(IEditControl Control, string Caption, bool MakeCheckbox)
        {
            QLabel label = new QLabel(Caption, Styles.FontSmaller);

            this.Controls.Add(label);

            labels.Add(Control, label);
            label.ShowAccellerator();

            if (MakeCheckbox)
            {
                QCheckBox cb = new QCheckBox(String.Empty, this.BackColor);
                cb.CheckedChanged += (s, e) =>
                {
                    updateColor(s, e);
                    Dirty = true;
                };
                this.Controls.Add(cb);
                checkboxes.Add(Control, cb);
                Control.ForeColor = Styles.Watermark;
            }

            this.Controls.Add(Control as Control);

            if (Control is QTextBox)
            {
                Control.TextChanged += textChanged;
                QTextBox tb = Control as QTextBox;
                tb.GotFocus += (s, e) => { Clock.DoOnMainThread(tb.SelectAll, 30); };
                if (tb.Text == VARIES_TOKEN)
                {
                    tb.EnableWatermark(this, MULTIPLE_VALUES, String.Empty);
                    tb.Text = String.Empty;
                }
                editControls.Add(tb);
            }
            else if (Control is QComboBox)
            {
                QComboBox cb = Control as QComboBox;

                // need both, depends on editable vs. uneditable
                cb.TextChanged          += textChanged;
                cb.SelectedIndexChanged += textChanged;

                if (cb.Text == VARIES_TOKEN)
                {
                    cb.EnableWatermark(this, MULTIPLE_VALUES, String.Empty);
                    cb.Text = String.Empty;
                }
                cb.DropDown += (s, e) =>
                {
                    if (isMultiple)
                    {
                        cb.ForeColor = Color.Black;
                    }
                };
                cb.DropDownClosed += (s, e) =>
                {
                    if (isMultiple)
                    {
                        updateColor(cb, checkboxes[cb]);
                    }
                    else
                    {
                        updateColor(cb, EventArgs.Empty);
                    }
                };
                editControls.Add(cb);
            }
        }
示例#13
0
        public Organizer(Callback DoneCallback) : base()
        {
            TrackWriter.Stop();

            done = DoneCallback;

            invalidPath      = Localization.Get(UI_Key.Organize_Invalid_Path);
            sample           = Localization.Get(UI_Key.Organize_Sample);
            tokenMyMusic     = Localization.Get(UI_Key.Organize_Token_My_Music);
            tokenMyDocuments = Localization.Get(UI_Key.Organize_Token_My_Documents);
            tokenDesktop     = Localization.Get(UI_Key.Organize_Token_Desktop);

            font     = Styles.FontSmaller;
            boldFont = new Font(font, FontStyle.Bold);

            btnOK     = new QButton(Localization.OK, false, true);
            btnCancel = new QButton(Localization.CANCEL, false, true);

            btnHelp = new QButton(Localization.Get(UI_Key.Organize_Help), false, true);
            AddButton(btnHelp, help);

            lblTitle = new QLabel(Localization.Get(UI_Key.Organize_Title), font);
            this.Controls.Add(lblTitle);
            lblTitle.Location = new System.Drawing.Point(MARGIN, MARGIN);

            lblDirectory = new QLabel(Localization.Get(UI_Key.Organize_Top_Folder), font);
            lblDirectory.ShowAccellerator();
            this.Controls.Add(lblDirectory);

            txtDirectory      = new QTextBox();
            txtDirectory.Font = font;
            this.Controls.Add(txtDirectory);

            if (Setting.TopLevelDirectory.Length == 0)
            {
                Setting.TopLevelDirectory = Environment.GetFolderPath(Environment.SpecialFolder.MyMusic);
            }

            oldRoot           = Setting.TopLevelDirectory;
            txtDirectory.Text = simplify(oldRoot);

            btnBrowse = new QButton(Localization.Get(UI_Key.Organize_Browse), false, false);
            btnBrowse.ShowAccellerator(Keys.B);
            AddButton(btnBrowse, browse);

            lblSubdirectory = new QLabel(Localization.Get(UI_Key.Organize_Folder_Structure), font);
            lblSubdirectory.ShowAccellerator();
            this.Controls.Add(lblSubdirectory);

            cboSubdirectory      = new QComboBox(false);
            cboSubdirectory.Font = font;
            cboSubdirectory.Items.AddRange(TrackWriter.GetDirFormats().ToArray());
            string sub = TrackWriter.GetDirFormat(Setting.DefaultDirectoryFormat);

            if (cboSubdirectory.Items.Contains(sub))
            {
                cboSubdirectory.SelectedIndex = cboSubdirectory.FindStringExact(sub);
            }
            else
            {
                cboSubdirectory.SelectedIndex = 0;
            }
            this.Controls.Add(cboSubdirectory);
            cboSubdirectory.AutoSetWidth();

            lblRename = new QLabel(Localization.Get(UI_Key.Organize_Rename), font);
            lblRename.ShowAccellerator();
            this.Controls.Add(lblRename);

            cboRename      = new QComboBox(false);
            cboRename.Font = font;
            string[] renames = TrackWriter.GetRenames().ToArray();
            renames[0] = Localization.Get(UI_Key.Organize_Dont_Change);
            cboRename.Items.AddRange(renames);
            string ren = TrackWriter.GetRenameFormat(Setting.DefaultRenameFormat);

            if (cboRename.Items.Contains(ren))
            {
                cboRename.SelectedIndex = cboRename.FindStringExact(ren);
            }
            else
            {
                cboRename.SelectedIndex = 0;
            }
            this.Controls.Add(cboRename);

            cboRename.AutoSetWidth();

            chkKeepOrganized = new QCheckBox(Localization.Get(UI_Key.Organize_Keep_Organized), this.BackColor);
            chkKeepOrganized.ShowAccellerator();
            chkKeepOrganized.Font    = font;
            chkKeepOrganized.Checked = Setting.KeepOrganized;
            this.Controls.Add(chkKeepOrganized);

            chkMoveIntoTopFolder         = new QCheckBox(Localization.Get(UI_Key.Organize_Move_Into_Top_Folder), this.BackColor);
            chkMoveIntoTopFolder.Font    = font;
            chkMoveIntoTopFolder.Checked = Setting.MoveNewFilesIntoMain;
            this.Controls.Add(chkMoveIntoTopFolder);

            btnOK.Text     = Localization.Get(UI_Key.Organize_Organize);
            btnCancel.Text = Localization.Get(UI_Key.Organize_Dont_Organize);
            btnOK.ShowAccellerator(Keys.O);
            btnCancel.ShowAccellerator(Keys.D);

            AddButton(btnOK, ok);
            AddButton(btnCancel, cancel);

            sampleTrack = new Track(-1,
                                    Localization.Get(UI_Key.Organize_Sample_Track_Path),
                                    Track.FileType.MP3,
                                    Localization.Get(UI_Key.Organize_Sample_Track_Title),
                                    Localization.Get(UI_Key.Organize_Sample_Track_Album),
                                    Localization.Get(UI_Key.Organize_Sample_Track_Artist),
                                    String.Empty,
                                    String.Empty,
                                    Localization.Get(UI_Key.Organize_Sample_Track_Grouping),
                                    Localization.Get(UI_Key.Organize_Sample_Track_Genre),
                                    (6 * 60 + 24) * 1000,
                                    5,
                                    0,
                                    1973,
                                    0,
                                    5,
                                    320000,
                                    0,
                                    false,
                                    DateTime.Today,
                                    DateTime.Today,
                                    DateTime.Today,
                                    String.Empty,
                                    2,
                                    44100,
                                    ChangeType.None,
                                    null,
                                    float.MinValue,
                                    float.MinValue);

            resize();
            this.Height = chkKeepOrganized.Bottom + MARGIN;

            cboSubdirectory.SelectedIndexChanged += (s, e) => { updateSample(); };
            cboRename.SelectedIndexChanged       += (s, e) => { updateSample(); };
            txtDirectory.TextChanged             += (s, e) => { updateSample(); };

            updateSample();

            int tabIndex = 0;

            lblDirectory.TabIndex         = tabIndex++;
            txtDirectory.TabIndex         = tabIndex++;
            btnBrowse.TabIndex            = tabIndex++;
            lblSubdirectory.TabIndex      = tabIndex++;
            cboSubdirectory.TabIndex      = tabIndex++;
            lblRename.TabIndex            = tabIndex++;
            cboRename.TabIndex            = tabIndex++;
            chkKeepOrganized.TabIndex     = tabIndex++;
            chkMoveIntoTopFolder.TabIndex = tabIndex++;
            btnHelp.TabIndex   = tabIndex++;
            btnCancel.TabIndex = tabIndex++;
            btnOK.TabIndex     = tabIndex++;

            setWrapAroundTabControl(tabIndex, txtDirectory, null);

            initialized = true;
        }