Exemple #1
0
        private void link_ButtonPressed(QButton Button)
        {
            switch (this.View)
            {
            case AlbumDetailView.AlbumInfo:
            case AlbumDetailView.Lyrics:
                if (albumURL.Length > 0)
                {
                    Net.BrowseTo(albumURL);
                }
                else
                {
                    Net.BrowseTo(LastFM.GetLastFMAlbumURL(CurrentTrack));
                }
                break;

            case AlbumDetailView.ArtistInfo:
                if (artistURL.Length > 0)
                {
                    Net.BrowseTo(artistURL);
                }
                else
                {
                    Net.BrowseTo(LastFM.GetLastFMArtistURL(CurrentTrack));
                }
                break;
            }
        }
Exemple #2
0
        public frmMonitor() : base(Localization.Get(UI_Key.Auto_Monitor_Title), ButtonCreateType.OKAndCancel)
        {
            initialized = false;

            this.ClientSize = new System.Drawing.Size(590, 300);

            lblInstructions         = new QLabel(Localization.Get(UI_Key.Auto_Monitor_Instructions, Application.ProductName));
            lblInstructions.Visible = true;

            this.Controls.Add(lblInstructions);

            lstDirectories = new QListBox(true);
            this.Controls.Add(lstDirectories);

            btnAdd = new QButton(Localization.Get(UI_Key.Auto_Monitor_Add_Folder), false, false);
            AddButton(btnAdd, add);

            btnRemove = new QButton(Localization.Get(UI_Key.Auto_Monitor_Remove_Folder), false, false);
            AddButton(btnRemove, remove);

            initialized = true;

            lstDirectories.TabStop = false;
            int tabIndex = 0;

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

            arrangeControls();
        }
Exemple #3
0
        private void btnNewPreset_ButtonPressed(QButton Button)
        {
            QInputBox ib = new QInputBox(this,
                                         Localization.Get(UI_Key.Dialog_Equalizer_New_Preset),
                                         Localization.Get(UI_Key.Dialog_Equalizer_New_Preset_Title),
                                         String.Empty,
                                         24,
                                         1);

            if (ib.DialogResult == DialogResult.OK)
            {
                if (equalizers.ContainsKey(ib.Value))
                {
                    QMessageBox.Show(this,
                                     Localization.Get(UI_Key.Dialog_Equalizer_Duplicate_Preset, ib.Value),
                                     Localization.Get(UI_Key.Dialog_Equalizer_Duplicate_Preset_Title),
                                     QMessageBoxIcon.Error);
                }
                else
                {
                    float[] d = new float[MAX_NUM_BANDS];
                    Array.Copy(CurrentEqualizer.Values, d, MAX_NUM_BANDS);
                    EqualizerSetting es = new EqualizerSetting(ib.Value, d, false);
                    equalizers.Add(ib.Value, es);
                    populateEqualizerList();
                    CurrentEqualizer = es;
                }
            }
        }
Exemple #4
0
        public frmFileInfo(Track Track) : base(Track.ToShortString(), ButtonCreateType.OKOnly)
        {
            this.ClientSize = new System.Drawing.Size(550, 400);

            SPACING = 4;

            this.KeyPreview = true;

            btnOK.Text = Localization.Get(UI_Key.File_Info_Done);

            track = Track;
            track.Load();

            art = new Artwork();
            art.CurrentTrack = track;
            art.Size         = new Size(ART_SIZE, ART_SIZE);
            art.Location     = new Point(this.ClientRectangle.Width - ART_SIZE - MARGIN, MARGIN);
            this.Controls.Add(art);

            if (track.ConfirmExists)
            {
                btnEdit = new QButton(Localization.Get(UI_Key.File_Info_Edit), false, false);
                btnEdit.ButtonPressed += (s) => { edit(); };
                this.Controls.Add(btnEdit);
            }

            this.EditFile = false;
        }
Exemple #5
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);
            }
Exemple #6
0
        protected QMessageBox(string Text, string Title, QMessageBoxButtons Buttons, QMessageBoxIcon Icon, QMessageBoxButton DefaultButton) : base(Title, (Buttons == QMessageBoxButtons.OK) ? ButtonCreateType.OKOnly : ButtonCreateType.OKAndCancel)
        {
            this.SPACING = 8;

            this.ClientSize = new Size(400, 300);

            icon = Icon;

            int textWidth = TextRenderer.MeasureText(Text, Styles.Font).Width;
            int iconWidth = (icon == QMessageBoxIcon.None) ? 0 : getIcon().Width + 5;

            int width;

            int baseWidth = textWidth + iconWidth;

            if (baseWidth < 300)
                width = Math.Max(150, baseWidth + 50);
            else if (baseWidth > 400)
                width = 400 + SPACING + iconWidth;
            else
                width = 350;

            lblMain = new QLabel(Text);
            this.Controls.Add(lblMain);
            lblMain.Location = new Point(SPACING + iconWidth, SPACING);
            lblMain.SetWidth(width - lblMain.Left - 2 * SPACING);

            iconTop = Math.Max(lblMain.Top, lblMain.Top + lblMain.Height / 2 - getIcon().Height);

            qmbButtons = Buttons;

            switch (qmbButtons)
            {
                case QMessageBoxButtons.OK:
                    btn1 = btnOK;
                    break;
                case QMessageBoxButtons.OKCancel:
                    btn1 = btnCancel;
                    btn2 = btnOK;
                    break;
                case QMessageBoxButtons.YesNo:
                    btn1 = btnCancel;
                    btn1.Text = Localization.NO;
                    btn2 = btnOK;
                    btn2.Text = Localization.YES;
                    break;
            }
            PlaceButtons(width, lblMain.Bottom + SPACING);
            this.ClientSize = new Size(width, btn1.Bottom + SPACING);

            Lib.DoEvents();
            Lib.Beep();

            defaultButton = DefaultButton;

            Clock.DoOnMainThread(doFocus);
        }
Exemple #7
0
 private void compress(QButton Sender)
 {
     for (int i = 0; i < numBands; i++)
     {
         CurrentEqualizer.Values[i] = Math.Max(-SCALE_FLOAT, Math.Min(SCALE_FLOAT, CurrentEqualizer.Values[i] * 0.9f));
         scrollBars[i].Value        = (int)CurrentEqualizer.Values[i];
     }
     EqChanged.Invoke();
 }
Exemple #8
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;
            }
Exemple #9
0
        private void clickTab(QButton Button)
        {
            foreach (KeyValuePair <QButton, List <Control> > kvp in tabs)
            {
                kvp.Key.Value = Button.Equals(kvp.Key);

                foreach (Control c in kvp.Value)
                {
                    c.Visible = kvp.Key.Value;
                }
            }
        }
Exemple #10
0
 private void clear(QButton Button)
 {
     genrePanel.Value = String.Empty;
     if (txtFilter.Text.Length > 0)
     {
         txtFilter.Text = String.Empty;
     }
     else
     {
         populateStations();
     }
 }
Exemple #11
0
        private void setupArtwork()
        {
            if (art == null)
            {
                art = new Artwork();

                art.BlankMessage = Localization.Get(UI_Key.Edit_Tags_Artwork_Blank_Message);

                art.DragEnter  += artDragEnter;
                art.DragDrop   += artDragDrop;
                art.MouseDown  += artDoDrag;
                art.AllowDrop   = true;
                art.OverlayInfo = true;

                this.Controls.Add(art);

                //if (isMultiple)
                {
                    chkArt = new QCheckBox(String.Empty, this.BackColor);
                    chkArt.CheckedChanged += (s, e) =>
                    {
                        ImageDirty = chkArt.Checked;
                        Dirty     |= chkArt.Checked;
                    };
                    this.Controls.Add(chkArt);
                }

                btnLoadArt = new QButton(Localization.Get(UI_Key.Edit_Tags_Load), false, true);
                btnLoadArt.ButtonPressed += (s) => { loadArt(); };
                this.Controls.Add(btnLoadArt);

                btnClearArt = new QButton(Localization.Get(UI_Key.Edit_Tags_Clear), false, true);
                btnClearArt.ButtonPressed += (s) => { clearArt(); };
                this.Controls.Add(btnClearArt);

                btnCopyArt = new QButton(Localization.Get(UI_Key.Edit_Tags_Copy), false, true);
                btnCopyArt.ButtonPressed += (s) => { copyArt(); };
                this.Controls.Add(btnCopyArt);

                btnPasteArt = new QButton(Localization.Get(UI_Key.Edit_Tags_Paste), false, true);
                btnPasteArt.ButtonPressed += (s) => { pasteArt(); };
                this.Controls.Add(btnPasteArt);
            }
            Image            = null;
            art.CurrentTrack = tracks[0];
        }
Exemple #12
0
        public AlbumDetails()
        {
            this.BackColor = Color.Black;

            this.Click += (s, e) => { this.RequestAction(QActionType.AdvanceScreen); };

            artwork                  = new Artwork();
            artwork.Click           += (s, e) => { this.RequestAction(QActionType.AdvanceScreen); };
            artwork.HideMousePointer = false;
            this.Controls.Add(artwork);

            txtDescription = new QTextArea();
            this.Controls.Add(txtDescription);

            btnLink                = new QButton(Localization.Get(UI_Key.Album_Details_View_On_Web), false, false);
            btnLink.BackColor      = this.BackColor;
            btnLink.ButtonPressed += new QButton.ButtonDelegate(link_ButtonPressed);
            btnLink.Enabled        = false;
            this.Controls.Add(btnLink);

            btnPlay                = new QButton(Localization.Get(UI_Key.Album_Details_Play_This_Album), false, false);
            btnPlay.BackColor      = this.BackColor;
            btnPlay.ButtonPressed += new QButton.ButtonDelegate(btnLink_ButtonPressed);
            btnPlay.Enabled        = true;
            this.Controls.Add(btnPlay);

            btnNext                = new QButton(Localization.Get(UI_Key.Album_Details_Next_Screen), false, false);
            btnNext.BackColor      = this.BackColor;
            btnNext.ButtonPressed += new QButton.ButtonDelegate(btnNext_ButtonPressed);
            btnNext.Enabled        = true;
            this.Controls.Add(btnNext);

            btnCopyToClipboard                = new QButton(Localization.Get(UI_Key.Album_Details_Copy_Info_To_Clipboard), false, false);
            btnCopyToClipboard.BackColor      = this.BackColor;
            btnCopyToClipboard.ButtonPressed += new QButton.ButtonDelegate(btnCopyToClipboard_ButtonPressed);
            btnCopyToClipboard.Enabled        = true;
            this.Controls.Add(btnCopyToClipboard);

            this.view = AlbumDetailView.Lyrics;

            artwork.SendToBack();

            txtDescription.Focus();
        }
Exemple #13
0
        private void btnCopyToClipboard_ButtonPressed(QButton Button)
        {
            if (currentTrack != null)
            {
                string text = currentTrack.Artist +
                              Environment.NewLine +
                              Environment.NewLine +
                              ((view == AlbumDetailView.Lyrics) ? currentTrack.Title : currentTrack.Album) +
                              Environment.NewLine +
                              Environment.NewLine +
                              txtDescription.Text;

                text = text.Replace(Environment.NewLine, "{{newline}}");
                text = text.Replace("\r", Environment.NewLine);
                text = text.Replace("\n", Environment.NewLine);
                text = text.Replace("{{newline}}", Environment.NewLine);
                Clipboard.SetText(text, TextDataFormat.UnicodeText);
            }
        }
Exemple #14
0
        public frmFindFile() : base(String.Empty, ButtonCreateType.OKAndCancel)
        {
            initialized = false;

            lblInstructions           = new Label();
            lblInstructions.Text      = Localization.Get(UI_Key.Find_File_Instructions, Application.ProductName);
            lblInstructions.AutoSize  = false;
            lblInstructions.Visible   = true;
            lblInstructions.ForeColor = Styles.LightText;
            this.Controls.Add(lblInstructions);

            lblFileInfo           = new Label();
            lblFileInfo.AutoSize  = false;
            lblFileInfo.Visible   = true;
            lblFileInfo.ForeColor = Styles.LightText;
            this.Controls.Add(lblFileInfo);

            btnFind = new QButton(Localization.Get(UI_Key.Find_File_Find), false, false);
            AddButton(btnFind, btnFind_Click);

            btnThisOnly = new QButton(Localization.Get(UI_Key.Find_File_This_Track_Only), false, false);
            AddButton(btnThisOnly, btnThisOnly_Click);

            txtFilePath             = new TextBox();
            txtFilePath.Visible     = true;
            txtFilePath.BorderStyle = BorderStyle.FixedSingle;
            this.Controls.Add(txtFilePath);

            btnOK.Text = Localization.Get(UI_Key.Find_File_All_Tracks);

            lblInstructions.Font = Styles.Font;
            lblFileInfo.Font     = Styles.FontItalic;
            txtFilePath.Font     = Styles.Font;
            this.font            = Styles.Font;

            int tabIndex = 0;

            btnFind.TabIndex     = tabIndex++;
            btnOK.TabIndex       = tabIndex++;
            btnThisOnly.TabIndex = tabIndex++;
            btnCancel.TabIndex   = tabIndex++;
            txtFilePath.TabIndex = tabIndex++;
        }
Exemple #15
0
        internal QFixedDialog(string Title, ButtonCreateType CreateButtons)
        {
            this.StartPosition   = FormStartPosition.CenterParent;
            this.DialogResult    = DialogResult.Cancel;
            this.Text            = Title;
            this.ShowIcon        = false;
            this.SizeGripStyle   = SizeGripStyle.Hide;
            this.MinimizeBox     = false;
            this.MaximizeBox     = false;
            this.ShowInTaskbar   = false;
            this.BackColor       = Styles.Dark;
            this.ForeColor       = Styles.LightText;
            this.FormBorderStyle = FormBorderStyle.FixedSingle;
            this.DoubleBuffered  = true;
            this.AutoScaleMode   = AutoScaleMode.None;
            this.KeyPreview      = true;
            switch (CreateButtons)
            {
            case ButtonCreateType.OKOnly:
                btnOK = new QButton(Localization.OK, false, false);
                AddButton(btnOK, ok);
                break;

            case ButtonCreateType.OKAndCancel:
                btnOK = new QButton(Localization.OK, false, false);
                AddButton(btnOK, ok);
                btnCancel = new QButton(Localization.CANCEL, false, false);
                AddButton(btnCancel, cancel);
                break;

            case ButtonCreateType.OKAndCancelReverse:
                btnCancel = new QButton(Localization.OK, false, false);
                AddButton(btnCancel, cancel);
                btnOK = new QButton(String.Empty, false, false);
                AddButton(btnOK, ok);
                break;
            }
        }
Exemple #16
0
        private void btnRemovePreset_ButtonPressed(QButton Button)
        {
            if (cboName.Text != DEFAULT_EQ_NAME)
            {
                if (QMessageBox.Show(this,
                                     Localization.Get(UI_Key.Dialog_Equalizer_Remove_Preset, cboName.Text),
                                     Localization.Get(UI_Key.Dialog_Equalizer_Remove_Preset_Title),
                                     QMessageBoxButtons.OKCancel,
                                     QMessageBoxIcon.Question,
                                     QMessageBoxButton.NoCancel)
                    == DialogResult.OK)
                {
                    string s = cboName.Text;

                    cboName.SelectedItem = DEFAULT_EQ_NAME;
                    cboName.Items.Remove(s);
                    if (equalizers.ContainsKey(s))
                    {
                        equalizers.Remove(s);
                    }
                }
            }
        }
Exemple #17
0
        public frmEditAutoPlaylist() : base(Localization.Get(UI_Key.Edit_Auto_Playlist_Title), ButtonCreateType.OKAndCancel)
        {
            btnSaveAndConvert = new QButton(Localization.Get(UI_Key.Edit_Auto_Playlist_Save_As_Standard), false, true);
            btnSaveAndConvert.ButtonPressed += (s) => { btnSaveAndConvert_Click(); };
            this.Controls.Add(btnSaveAndConvert);

            btnOK.Text = Localization.Get(UI_Key.Edit_Auto_Playlist_Save);

            btnTest = new QButton(Localization.Get(UI_Key.Edit_Auto_Playlist_Test), false, false);
            AddButton(btnTest, btnTest_Click);

            btnHelp = new QButton(Localization.Get(UI_Key.Edit_Auto_Playlist_Help), false, false);
            AddButton(btnHelp, btnHelp_Click);

            lblOK             = new Label();
            lblOK.BorderStyle = BorderStyle.FixedSingle;
            lblOK.BackColor   = Color.Green;
            lblOK.ForeColor   = Styles.LightText;
            lblOK.Size        = new Size(12, 12);
            this.Controls.Add(lblOK);

            lblMessage = new QLabel(String.Empty);
            this.Controls.Add(lblMessage);

            textbox.CaretLocationChanged         += (dl) => { };
            textbox.SelectionChanged             += (s, e) => { };
            textbox.DocumentChangedChanged       += (s, e) => { };
            textbox.BeforeShowIntellisense       += new QuuxControls.BeforeShowIntellisense(textbox_BeforeShowIntellisense);
            textbox.NeedWordsBeforeCursorRefresh += (s, e) => { textbox.WordsBeforeCursor = getWordsBeforeCursor(); };
            textbox.Location = new Point(MARGIN, MARGIN + Styles.TextHeight + MARGIN);

            this.Controls.Add(textbox);

            currentInstance = this;

            this.ClientSize = new System.Drawing.Size(580, 360);
        }
Exemple #18
0
        private void reset(QButton Sender)
        {
            EqualizerSetting es = DefaultEqualizerSettings.FirstOrDefault(s => s.Name == CurrentEqualizer.Name);

            if (es == null)
            {
                for (int i = 0; i < numBands; i++)
                {
                    scrollBars[i].Value        = 0;
                    CurrentEqualizer.Values[i] = 0;
                }
            }
            else
            {
                float[] f = (numBands == 10) ? compressBands(es.Values) : es.Values;

                for (int i = 0; i < numBands; i++)
                {
                    scrollBars[i].Value        = (int)f[i];
                    CurrentEqualizer.Values[i] = f[i];
                }
            }
            EqChanged.Invoke();
        }
Exemple #19
0
 private void btnNext_ButtonPressed(QButton Button)
 {
     this.RequestAction(QActionType.AdvanceScreen);
 }
Exemple #20
0
        public PodcastManager()
        {
            this.BackColor = Color.Black;
            instance       = this;

            List <string> subHeadings = new List <string>()
            {
                "Podcast Name", "Genre", "Last Download", "Count", "Status", "Reload", "Get All", "Edit", "Remove"
            };
            List <QListView <PodcastSubscription> .ClickDelegate> subActions = new List <QListView <PodcastSubscription> .ClickDelegate>()
            {
                checkForNewEpisodes,
                downloadSubscription,
                showSubscriptionEditPanel,
                removeSubscription
            };

            lvwSubscriptions = new QListView <PodcastSubscription>(subHeadings,
                                                                   subActions,
                                                                   new string[] { String.Empty, "GenreXXXXXX", "Last DownloadXX", "XXXX / XXXX", "XXXX Available", "Reload", "Get All", "Edit", "Remove" },
                                                                   PodcastSubscription.Compare);

            lvwSubscriptions.ContextMenuHook += new QListView <PodcastSubscription> .ContextMenuHookDelegate(lvwSubscriptions_ContextMenuHook);

            lvwSubscriptions.Sort((int)(PodcastSubscription.Columns.Name), true);
            this.Controls.Add(lvwSubscriptions);

            List <string> epHeadings = new List <string>()
            {
                "Title", "Description", "Episode Date", "Status", "Duration", "Download", "Play", "Remove"
            };

            lvwEpisodes = new QListView <PodcastEpisode>(epHeadings,
                                                         new List <QListView <PodcastEpisode> .ClickDelegate>()
            {
                downloadEpisode, playEpisode, removeEpisode
            },
                                                         new string[] { string.Empty, String.Empty, "Episode DateXX", "Downloading XXX%", "DurationXX", "Download", "Play", "Remove" },
                                                         PodcastEpisode.Compare);

            lvwEpisodes.ContextMenuHook += new QListView <PodcastEpisode> .ContextMenuHookDelegate(lvwEpisodes_ContextMenuHook);

            lvwEpisodes.Sort((int)(PodcastEpisode.Columns.Date), false);
            this.Controls.Add(lvwEpisodes);

            btnDone           = new QButton("Done", false, false);
            btnDone.BackColor = this.BackColor;
            this.Controls.Add(btnDone);
            btnDone.ButtonPressed += (s) => { controller.RequestAction(QActionType.AdvanceScreen); };

            btnStopDownloads           = new QButton("Stop Downloads", false, false);
            btnStopDownloads.BackColor = this.BackColor;
            this.Controls.Add(btnStopDownloads);
            btnStopDownloads.Enabled        = false;
            btnStopDownloads.ButtonPressed += (s) => { if (!Locked)
                                                       {
                                                           stopDownloads();
                                                       }
            };

            btnSetDownloadFolder           = new QButton("Set Download Folder...", false, false);
            btnSetDownloadFolder.BackColor = this.BackColor;
            this.Controls.Add(btnSetDownloadFolder);
            btnSetDownloadFolder.ButtonPressed += (s) => { if (!Locked)
                                                           {
                                                               setDownloadFolder();
                                                           }
            };

            btnRefreshAll           = new QButton("Refresh All Subscriptions", false, false);
            btnRefreshAll.BackColor = this.BackColor;
            this.Controls.Add(btnRefreshAll);
            btnRefreshAll.ButtonPressed += (s) => { if (!Locked)
                                                    {
                                                        Clock.DoOnNewThread(autoRefreshSubscriptions);
                                                    }
            };

            btnAutoManage           = new QButton("Auto Manage Options...", false, false);
            btnAutoManage.BackColor = this.BackColor;
            this.Controls.Add(btnAutoManage);
            btnAutoManage.ButtonPressed += (s) => { if (!Locked)
                                                    {
                                                        showAutoManageOptions();
                                                    }
            };

            txtURL = new QTextBoxFocusOnClick();
            this.Controls.Add(txtURL);
            txtURL.MaxLength = 2048;
            txtURL.Enter    += (s, e) => { keyPreviewChange(); };
            txtURL.Leave    += (s, e) => { keyPreviewChange(); };
            txtURL.KeyPress += (s, e) =>
            {
                if (!Locked)
                {
                    switch (e.KeyChar)
                    {
                    case '\r':
                        if (txtURL.Text.Length > 0)
                        {
                            btnGetInfo_ButtonPressed(btnGo);
                        }
                        e.Handled = true;
                        break;
                    }
                }
            };

            txtURL.EnableWatermark(this, "[Type or drag a podcast feed here.]", String.Empty);

            btnGo = new QButton("Add Podcast", false, true);
            btnGo.ButtonPressed += new QButton.ButtonDelegate(btnGetInfo_ButtonPressed);
            btnGo.BackColor      = this.BackColor;
            this.Controls.Add(btnGo);

            lblSubscriptions = new QLabel("Subscriptions", Styles.FontBold);
            this.Controls.Add(lblSubscriptions);

            lblEpisodes = new QLabel("Episodes", Styles.FontBold);
            this.Controls.Add(lblEpisodes);

            txtURL.DragEnter           += (s, e) => { onDragEnter(e); };
            txtURL.DragDrop            += (s, e) => { onDragDrop(e); };
            txtURL.AllowDrop            = true;
            txtURL.Watermark.DragEnter += (s, e) => { onDragEnter(e); };
            txtURL.Watermark.DragDrop  += (s, e) => { onDragDrop(e); };
            txtURL.Watermark.AllowDrop  = true;

            lvwSubscriptions.ClickCallback += new QListView <PodcastSubscription> .ClickDelegate(populateEpisodes);

            lvwSubscriptions.DoubleClickCallback += new QListView <PodcastSubscription> .ClickDelegate(lvwSubscriptions_DoubleClickCallback);

            lvwSubscriptions.DragEnter += (s, e) => { onDragEnter(e); };
            lvwSubscriptions.DragDrop  += (s, e) => { onDragDrop(e); };
            lvwSubscriptions.AllowDrop  = true;

            lvwEpisodes.DoubleClickCallback += new QListView <PodcastEpisode> .ClickDelegate(lvwEpisodes_DoubleClickCallback);

            lvwEpisodes.ClickCallback += new QListView <PodcastEpisode> .ClickDelegate(lvwEpisodes_ClickCallback);
        }
Exemple #21
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();
        }
Exemple #22
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;
        }
Exemple #23
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();
        }
Exemple #24
0
        public Radio()
        {
            this.Visible        = false;
            this.DoubleBuffered = true;

            stationPanel = new StationPanel();
            this.Panel2.Controls.Add(stationPanel);
            stationPanel.AllowDrop = true;

            instance              = this;
            scrollBar             = new QScrollBar(false);
            scrollBar.Width       = SCROLL_BAR_WIDTH;
            scrollBar.UserScroll += new QScrollBar.ScrollDelegate(scroll);
            stationPanel.Controls.Add(scrollBar);

            txtURL = new QTextBoxFocusOnClick();
            stationPanel.Controls.Add(txtURL);
            txtURL.EnableWatermark(stationPanel, Localization.Get(UI_Key.Radio_URL_Watermark), String.Empty);
            txtURL.MaxLength = 2048;
            txtURL.Enter    += (s, e) => { keyPreviewChange(); };
            txtURL.Leave    += (s, e) => { keyPreviewChange(); };
            txtURL.KeyPress += (s, e) =>
            {
                switch (e.KeyChar)
                {
                case '\r':
                    if (txtURL.Text.Length > 0)
                    {
                        go(btnGo);
                    }
                    e.Handled = true;
                    break;
                }
            };

            txtFilter = new QTextBox();
            stationPanel.Controls.Add(txtFilter);
            txtFilter.EnableWatermark(stationPanel, Localization.Get(UI_Key.Radio_Filter_Watermark), String.Empty);
            txtFilter.Enter       += (s, e) => { keyPreviewChange(); };
            txtFilter.Leave       += (s, e) => { keyPreviewChange(); };
            txtFilter.TextChanged += (s, e) => { populateStations(); };

            btnClear = new QButton("X", false, true);
            btnClear.ButtonPressed += new QButton.ButtonDelegate(clear);
            btnClear.BackColor      = stationPanel.BackColor;
            stationPanel.Controls.Add(btnClear);

            btnGo = new QButton(Localization.Get(UI_Key.Radio_Add_And_Play), false, true);
            btnGo.ButtonPressed += new QButton.ButtonDelegate(go);
            btnGo.BackColor      = stationPanel.BackColor;
            stationPanel.Controls.Add(btnGo);

            genrePanel            = new RadioGenreSelectPanel();
            genrePanel.Location   = Point.Empty;
            genrePanel.HeaderText = Localization.Get(UI_Key.Radio_Genres);
            this.Panel1.Controls.Add(genrePanel);

            cells = new List <Cell>();
            setupCells();

            this.Panel1.Resize += (s, e) => { arrangeSelectPanel(); };
            this.Panel2.Resize += (s, e) => { arrangeStationPanel(); };

            stationPanel.MouseMove        += new MouseEventHandler(stationPanelMouseMove);
            stationPanel.MouseDown        += new MouseEventHandler(stationPanelMouseDown);
            stationPanel.MouseUp          += new MouseEventHandler(stationPanelMouseUp);
            stationPanel.Paint            += new PaintEventHandler(stationPanelPaint);
            stationPanel.MouseDoubleClick += new MouseEventHandler(stationPanelDoubleClick);
            stationPanel.MouseWheel       += new MouseEventHandler(stationPanelMouseWheel);
            stationPanel.MouseEnter       += (s, e) => { if (!txtURL.Focused && !txtFilter.Focused)
                                                         {
                                                             stationPanel.Focus();
                                                         }
            };
            stationPanel.MouseLeave += (s, e) => { hoverCell = null; };
            stationPanel.Resize     += (s, e) => { setupCells(); };
            stationPanel.GotFocus   += (s, e) => { stationPanel.Active = true; keyPreviewChange(); };
            stationPanel.LostFocus  += (s, e) => { stationPanel.Active = false; };
            stationPanel.DragEnter  += (s, e) => { onDragEnter(e); };
            stationPanel.DragDrop   += (s, e) => { onDragDrop(e, true); };

            txtURL.DragEnter += (s, e) => { onDragEnter(e); };
            txtURL.DragDrop  += (s, e) => { onDragDrop(e, false); };
            txtURL.AllowDrop  = true;

            txtURL.Watermark.DragEnter += (s, e) => { onDragEnter(e); };
            txtURL.Watermark.DragDrop  += (s, e) => { onDragDrop(e, false); };
            txtURL.Watermark.AllowDrop  = true;

            genrePanel.AllowDrop             = true;
            genrePanel.SelectedIndexChanged += () => { populateStations(); };
            genrePanel.ValueChanged         += new QSelectPanel.ValueEditDelegate(selectPanel_ValueChanged);
            genrePanel.DragEnter            += (s, e) =>
            {
                onDragEnter(e);
            };
            genrePanel.DragDrop         += (s, e) => { onDragDropGenre(e); };
            this.genrePanel.MouseEnter  += (s, e) => { genrePanel.Focus(); };
            this.genrePanel.GotFocus    += (s, e) => { genrePanel.Active = true; };
            this.genrePanel.LostFocus   += (s, e) => { genrePanel.Active = false; };
            this.genrePanel.DoubleClick += (s, e) => { genreDoubleClick(); };

            int tabIndex = 0;

            txtFilter.TabIndex = tabIndex++;
            btnClear.TabIndex  = tabIndex++;
            txtURL.TabIndex    = tabIndex++;
            btnGo.TabIndex     = tabIndex++;
        }
Exemple #25
0
 private void btnLink_ButtonPressed(QButton Button)
 {
     controller.RequestAction(new QAction(QActionType.PlayThisAlbum, CurrentTrack));
 }
Exemple #26
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();
        }
Exemple #27
0
 protected void AddButton(QButton Button, Callback Function)
 {
     addedButtons.Add(Button, Function);
     this.Controls.Add(Button);
     Button.ButtonPressed += (s) => { Function(); };
 }
Exemple #28
0
 private void go(QButton Button)
 {
     AddStation(txtURL.Text.Trim(), String.Empty, true);
 }
Exemple #29
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);
        }
        public frmFileAssociations() : base(Localization.Get(UI_Key.File_Associations_Title), ButtonCreateType.OKAndCancel)
        {
            this.Size = new System.Drawing.Size(430, this.Size.Height);

            lblInstructions = new QLabel(Localization.Get(UI_Key.File_Associations_Instructions));
            this.Controls.Add(lblInstructions);
            lblInstructions.Location = new System.Drawing.Point(MARGIN, MARGIN);
            lblInstructions.SetWidth(this.Width - MARGIN - MARGIN);

            int x = MARGIN * 3;

            lblAudioFiles = new QLabel("Audio Files", Styles.FontBold);
            this.Controls.Add(lblAudioFiles);
            lblAudioFiles.Location = new System.Drawing.Point(MARGIN, lblInstructions.Bottom + MARGIN + MARGIN);

            chkMP3 = new QCheckBox(Localization.Get(UI_Key.File_Associations_MP3), this.BackColor);
            this.Controls.Add(chkMP3);
            chkMP3.Location = new System.Drawing.Point(x, lblAudioFiles.Bottom + MARGIN);

            chkWMA = new QCheckBox(Localization.Get(UI_Key.File_Associations_WMA), this.BackColor);
            this.Controls.Add(chkWMA);
            chkWMA.Location = new System.Drawing.Point(x, chkMP3.Bottom + MARGIN);

            chkOGG = new QCheckBox(Localization.Get(UI_Key.File_Associations_OGG), this.BackColor);
            this.Controls.Add(chkOGG);
            chkOGG.Location = new System.Drawing.Point(x, chkWMA.Bottom + MARGIN);

            chkFLAC = new QCheckBox(Localization.Get(UI_Key.File_Associations_FLAC), this.BackColor);
            this.Controls.Add(chkFLAC);
            chkFLAC.Location = new System.Drawing.Point(x, chkOGG.Bottom + MARGIN);

            chkM4A = new QCheckBox(Localization.Get(UI_Key.File_Associations_iTunes), this.BackColor);
            this.Controls.Add(chkM4A);
            chkM4A.Location = new System.Drawing.Point(x, chkFLAC.Bottom + MARGIN);

            chkWV = new QCheckBox(Localization.Get(UI_Key.File_Associations_WV), this.BackColor);
            this.Controls.Add(chkWV);
            chkWV.Location = new System.Drawing.Point(x, chkM4A.Bottom + MARGIN);

            chkAPE = new QCheckBox(Localization.Get(UI_Key.File_Associations_APE), this.BackColor);
            this.Controls.Add(chkAPE);
            chkAPE.Location = new System.Drawing.Point(x, chkWV.Bottom + MARGIN);

            lblPlaylistFiles = new QLabel("Playlist Files", Styles.FontBold);
            this.Controls.Add(lblPlaylistFiles);
            lblPlaylistFiles.Location = new System.Drawing.Point(MARGIN, chkAPE.Bottom + MARGIN + MARGIN);

            x = this.Width / 2;

            chkWAV = new QCheckBox(Localization.Get(UI_Key.File_Associations_WAV), this.BackColor);
            this.Controls.Add(chkWAV);
            chkWAV.Location = new System.Drawing.Point(x, chkMP3.Top);

            chkAC3 = new QCheckBox(Localization.Get(UI_Key.File_Associations_AC3), this.BackColor);
            this.Controls.Add(chkAC3);
            chkAC3.Location = new System.Drawing.Point(x, chkWAV.Bottom + MARGIN);

            chkMPC = new QCheckBox(Localization.Get(UI_Key.File_Associations_MPC), this.BackColor);
            this.Controls.Add(chkMPC);
            chkMPC.Location = new System.Drawing.Point(x, chkAC3.Bottom + MARGIN);

            chkALAC = new QCheckBox(Localization.Get(UI_Key.File_Associations_ALAC), this.BackColor);
            this.Controls.Add(chkALAC);
            chkALAC.Location = new System.Drawing.Point(x, chkMPC.Bottom + MARGIN);

            chkAIFF = new QCheckBox(Localization.Get(UI_Key.File_Associations_AIFF), this.BackColor);
            this.Controls.Add(chkAIFF);
            chkAIFF.Location = new System.Drawing.Point(x, chkALAC.Bottom + MARGIN);

            chkPLS = new QCheckBox(Localization.Get(UI_Key.File_Associations_PLS), this.BackColor);
            this.Controls.Add(chkPLS);
            chkPLS.Location = new System.Drawing.Point(chkWV.Left, lblPlaylistFiles.Bottom + MARGIN);

            chkM3U = new QCheckBox("M3U Files", this.BackColor);
            this.Controls.Add(chkM3U);
            chkM3U.Location = new System.Drawing.Point(chkAIFF.Left, chkPLS.Top);

            btnNone = new QButton(Localization.Get(UI_Key.File_Associations_Check_None), false, false);
            AddButton(btnNone, none);

            btnAll = new QButton(Localization.Get(UI_Key.File_Associations_Check_All), false, false);
            AddButton(btnAll, all);

            PlaceButtons(this.ClientRectangle.Width, chkPLS.Bottom + MARGIN, btnCancel, btnOK, btnNone, btnAll);

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

            int tabIndex = 0;

            chkMP3.TabIndex  = tabIndex++;
            chkWMA.TabIndex  = tabIndex++;
            chkOGG.TabIndex  = tabIndex++;
            chkFLAC.TabIndex = tabIndex++;
            chkM4A.TabIndex  = tabIndex++;
            chkWV.TabIndex   = tabIndex++;
            chkWAV.TabIndex  = tabIndex++;
            chkAC3.TabIndex  = tabIndex++;
            chkMPC.TabIndex  = tabIndex++;
            chkALAC.TabIndex = tabIndex++;
            chkAIFF.TabIndex = tabIndex++;
            chkAPE.TabIndex  = tabIndex++;
            chkPLS.TabIndex  = tabIndex++;
            chkM3U.TabIndex  = tabIndex++;

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

            updateCheckboxes();
        }