diff --git a/MusicPlayer/MusicPlayer/MainForm.Designer.cs b/MusicPlayer/MusicPlayer/MainForm.Designer.cs index 0ca4874..51cdfaa 100644 --- a/MusicPlayer/MusicPlayer/MainForm.Designer.cs +++ b/MusicPlayer/MusicPlayer/MainForm.Designer.cs @@ -31,7 +31,7 @@ namespace MusicPlayer private void InitializeComponent() { this.components = new System.ComponentModel.Container(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle1 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle2 = new System.Windows.Forms.DataGridViewCellStyle(); System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(MainForm)); this.SongsTableView = new System.Windows.Forms.DataGridView(); this.GenreListBox = new System.Windows.Forms.ListBox(); @@ -93,6 +93,9 @@ namespace MusicPlayer this.toolStripSeparator3 = new System.Windows.Forms.ToolStripSeparator(); this.NotifyMenuStripNextButton = new System.Windows.Forms.ToolStripMenuItem(); this.NotifyMenuStripPreviousButton = new System.Windows.Forms.ToolStripMenuItem(); + this.radioToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.toolStripMenuItem2 = new System.Windows.Forms.ToolStripMenuItem(); + this.qDanceToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); ((System.ComponentModel.ISupportInitialize)(this.SongsTableView)).BeginInit(); this.MainPanel.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.SplitContainer)).BeginInit(); @@ -112,14 +115,14 @@ namespace MusicPlayer this.SongsTableView.AllowUserToResizeRows = false; this.SongsTableView.AutoSizeColumnsMode = System.Windows.Forms.DataGridViewAutoSizeColumnsMode.Fill; this.SongsTableView.BackgroundColor = System.Drawing.SystemColors.Control; - dataGridViewCellStyle1.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft; - dataGridViewCellStyle1.BackColor = System.Drawing.SystemColors.ControlLight; - dataGridViewCellStyle1.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - dataGridViewCellStyle1.ForeColor = System.Drawing.SystemColors.WindowText; - dataGridViewCellStyle1.SelectionBackColor = System.Drawing.SystemColors.Highlight; - dataGridViewCellStyle1.SelectionForeColor = System.Drawing.SystemColors.HighlightText; - dataGridViewCellStyle1.WrapMode = System.Windows.Forms.DataGridViewTriState.True; - this.SongsTableView.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle1; + dataGridViewCellStyle2.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft; + dataGridViewCellStyle2.BackColor = System.Drawing.SystemColors.ControlLight; + dataGridViewCellStyle2.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + dataGridViewCellStyle2.ForeColor = System.Drawing.SystemColors.WindowText; + dataGridViewCellStyle2.SelectionBackColor = System.Drawing.SystemColors.Highlight; + dataGridViewCellStyle2.SelectionForeColor = System.Drawing.SystemColors.HighlightText; + dataGridViewCellStyle2.WrapMode = System.Windows.Forms.DataGridViewTriState.True; + this.SongsTableView.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle2; this.SongsTableView.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize; this.SongsTableView.Dock = System.Windows.Forms.DockStyle.Fill; this.SongsTableView.Location = new System.Drawing.Point(0, 0); @@ -276,6 +279,7 @@ namespace MusicPlayer this.viewToolStripMenuItem, this.playbackToolStripMenuItem, this.playlistToolStripMenuItem, + this.radioToolStripMenuItem, this.searchToolStripMenuItem, this.serverToolStripMenuItem}); this.MenuStrip.Location = new System.Drawing.Point(0, 0); @@ -693,6 +697,29 @@ namespace MusicPlayer this.NotifyMenuStripPreviousButton.Text = "Previous"; this.NotifyMenuStripPreviousButton.Click += new System.EventHandler(this.NotifyMenuStripPreviousButton_Click); // + // radioToolStripMenuItem + // + this.radioToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.toolStripMenuItem2, + this.qDanceToolStripMenuItem}); + this.radioToolStripMenuItem.Name = "radioToolStripMenuItem"; + this.radioToolStripMenuItem.Size = new System.Drawing.Size(49, 20); + this.radioToolStripMenuItem.Text = "Radio"; + // + // toolStripMenuItem2 + // + this.toolStripMenuItem2.Name = "toolStripMenuItem2"; + this.toolStripMenuItem2.Size = new System.Drawing.Size(152, 22); + this.toolStripMenuItem2.Text = "538"; + this.toolStripMenuItem2.Click += new System.EventHandler(this.toolStripMenuItem2_Click); + // + // qDanceToolStripMenuItem + // + this.qDanceToolStripMenuItem.Name = "qDanceToolStripMenuItem"; + this.qDanceToolStripMenuItem.Size = new System.Drawing.Size(152, 22); + this.qDanceToolStripMenuItem.Text = "Q-Dance"; + this.qDanceToolStripMenuItem.Click += new System.EventHandler(this.qDanceToolStripMenuItem_Click); + // // MainForm // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); @@ -788,6 +815,9 @@ namespace MusicPlayer private System.Windows.Forms.ToolStripMenuItem serverToolStripMenuItem; private System.Windows.Forms.ToolStripMenuItem SelectServerJancoButton; private System.Windows.Forms.ToolStripMenuItem SelectServerYorickButton; + private System.Windows.Forms.ToolStripMenuItem radioToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem toolStripMenuItem2; + private System.Windows.Forms.ToolStripMenuItem qDanceToolStripMenuItem; } } diff --git a/MusicPlayer/MusicPlayer/MainForm.cs b/MusicPlayer/MusicPlayer/MainForm.cs index e003ed0..0a496ad 100644 --- a/MusicPlayer/MusicPlayer/MainForm.cs +++ b/MusicPlayer/MusicPlayer/MainForm.cs @@ -92,7 +92,8 @@ namespace MusicPlayer PositionTrackBar.Value = Math.Max(main.audio.Position, 0); //Buffer display - BufferBar.Value = main.audio.Buffered / 10; + if(main.audio.Buffered / 10 > BufferBar.Minimum && main.audio.Buffered / 10 < BufferBar.Maximum) + BufferBar.Value = main.audio.Buffered / 10; //Time labels if (!clicked) @@ -522,5 +523,15 @@ namespace MusicPlayer { main.SwitchServer("http://imegumii.nl"); } + + private void toolStripMenuItem2_Click(object sender, EventArgs e) + { + main.audio.Play(new RadioStation("538", main.api, "http://vip-icecast.538.lw.triple-it.nl:80/RADIO538_MP3")); + } + + private void qDanceToolStripMenuItem_Click(object sender, EventArgs e) + { + main.audio.Play(new RadioStation("538", main.api, " http://stream01.platform02.true.nl:8000/qdance-hard")); + } } } diff --git a/MusicPlayer/MusicPlayer/MusicPlayer.csproj b/MusicPlayer/MusicPlayer/MusicPlayer.csproj index 46eace5..8dc830c 100755 --- a/MusicPlayer/MusicPlayer/MusicPlayer.csproj +++ b/MusicPlayer/MusicPlayer/MusicPlayer.csproj @@ -85,6 +85,7 @@ + Component diff --git a/MusicPlayer/MusicPlayer/RadioStation.cs b/MusicPlayer/MusicPlayer/RadioStation.cs new file mode 100644 index 0000000..48c7ea0 --- /dev/null +++ b/MusicPlayer/MusicPlayer/RadioStation.cs @@ -0,0 +1,23 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace MusicPlayer +{ + class RadioStation :Song + { + string radiourl; + public RadioStation(string name, APIHandler api, string url):base("-1", name,"","","",0,api) + { + radiourl = url; + } + + protected override string GetURL() + { + return radiourl; + } + + } +} diff --git a/MusicPlayer/MusicPlayer/Song.cs b/MusicPlayer/MusicPlayer/Song.cs old mode 100755 new mode 100644 index d698b3f..59e87d4 --- a/MusicPlayer/MusicPlayer/Song.cs +++ b/MusicPlayer/MusicPlayer/Song.cs @@ -34,7 +34,7 @@ namespace MusicPlayer url = ""; } - private string GetURL() + protected virtual string GetURL() { if (url == "") {