Merge remote-tracking branch 'origin/gui' into developer
This commit is contained in:
@@ -49,6 +49,11 @@ namespace MusicPlayer
|
|||||||
return GetSongsByArgs("album=" + year);
|
return GetSongsByArgs("album=" + year);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public List<Song> GetSongsBySearch(string search)
|
||||||
|
{
|
||||||
|
return GetSongsByArgs("search=" + search);
|
||||||
|
}
|
||||||
|
|
||||||
public List<Song> GetAllSongs()
|
public List<Song> GetAllSongs()
|
||||||
{
|
{
|
||||||
List<Song> allsongslist = new List<Song>();
|
List<Song> allsongslist = new List<Song>();
|
||||||
@@ -109,7 +114,7 @@ namespace MusicPlayer
|
|||||||
{
|
{
|
||||||
List<Album> albumlist = new List<Album>();
|
List<Album> albumlist = new List<Album>();
|
||||||
|
|
||||||
JObject o = nw.SendString("getalbums?id=hallo");
|
JObject o = nw.SendString("getalbums?");
|
||||||
if (o["result"].ToString() == "OK")
|
if (o["result"].ToString() == "OK")
|
||||||
{
|
{
|
||||||
for (int i = 0; i < o["albums"].Count(); i++)
|
for (int i = 0; i < o["albums"].Count(); i++)
|
||||||
@@ -124,7 +129,7 @@ namespace MusicPlayer
|
|||||||
public List<Year> GetYears()
|
public List<Year> GetYears()
|
||||||
{
|
{
|
||||||
List<Year> yearlist = new List<Year> ();
|
List<Year> yearlist = new List<Year> ();
|
||||||
JObject o = nw.SendString("getyears?id=hallo");
|
JObject o = nw.SendString("getyears?");
|
||||||
if (o["result"].ToString() == "OK")
|
if (o["result"].ToString() == "OK")
|
||||||
{
|
{
|
||||||
for (int i = 0; i < o["years"].Count(); i++)
|
for (int i = 0; i < o["years"].Count(); i++)
|
||||||
@@ -138,7 +143,7 @@ namespace MusicPlayer
|
|||||||
public List<Genre> GetGenres()
|
public List<Genre> GetGenres()
|
||||||
{
|
{
|
||||||
List<Genre> genreslist = new List<Genre>();
|
List<Genre> genreslist = new List<Genre>();
|
||||||
JObject o = nw.SendString("getgenres?id=hallo");
|
JObject o = nw.SendString("getgenres?");
|
||||||
if (o["result"].ToString() == "OK")
|
if (o["result"].ToString() == "OK")
|
||||||
{
|
{
|
||||||
for (int i = 0; i < o["genres"].Count(); i++)
|
for (int i = 0; i < o["genres"].Count(); i++)
|
||||||
|
|||||||
@@ -17,7 +17,13 @@ namespace MusicPlayer
|
|||||||
public AudioState AState { get; set; }
|
public AudioState AState { get; set; }
|
||||||
public BufferState BState { get; set; }
|
public BufferState BState { get; set; }
|
||||||
|
|
||||||
public int Buffered { get { return Math.Min((int)((bufpos / (double)LengthBuffer) * 1000), 1000); } }
|
public int Buffered { get
|
||||||
|
{
|
||||||
|
if(CurrentSong is RadioStation)
|
||||||
|
return Math.Min((int)((bufpos - ms.Position) / 1000), 1000);
|
||||||
|
else
|
||||||
|
return Math.Min((int)((bufpos / (double)LengthBuffer) * 1000), 1000);
|
||||||
|
} }
|
||||||
private long LengthBuffer { get; set; }
|
private long LengthBuffer { get; set; }
|
||||||
private long bufpos = 0;
|
private long bufpos = 0;
|
||||||
|
|
||||||
@@ -33,7 +39,7 @@ namespace MusicPlayer
|
|||||||
|
|
||||||
private long seek = 0;
|
private long seek = 0;
|
||||||
|
|
||||||
private Stream ms;
|
private MemoryStream ms;
|
||||||
|
|
||||||
private Thread network;
|
private Thread network;
|
||||||
private Thread audio;
|
private Thread audio;
|
||||||
@@ -121,6 +127,7 @@ namespace MusicPlayer
|
|||||||
}
|
}
|
||||||
catch(Exception e)
|
catch(Exception e)
|
||||||
{
|
{
|
||||||
|
Console.WriteLine(e.StackTrace);
|
||||||
AState = AudioState.STOPPED;
|
AState = AudioState.STOPPED;
|
||||||
main.form.SongFinished();
|
main.form.SongFinished();
|
||||||
return;
|
return;
|
||||||
@@ -135,6 +142,9 @@ namespace MusicPlayer
|
|||||||
waveOut.Init(blockAlignedStream);
|
waveOut.Init(blockAlignedStream);
|
||||||
waveOut.Play();
|
waveOut.Play();
|
||||||
|
|
||||||
|
if (CurrentSong.Seconds == 0)
|
||||||
|
Length = ms.Length / waveOut.OutputWaveFormat.AverageBytesPerSecond;
|
||||||
|
else
|
||||||
Length = CurrentSong.Seconds * waveOut.OutputWaveFormat.AverageBytesPerSecond;
|
Length = CurrentSong.Seconds * waveOut.OutputWaveFormat.AverageBytesPerSecond;
|
||||||
CurrentTime = (int)(ms.Position / waveOut.OutputWaveFormat.AverageBytesPerSecond);
|
CurrentTime = (int)(ms.Position / waveOut.OutputWaveFormat.AverageBytesPerSecond);
|
||||||
|
|
||||||
@@ -163,19 +173,26 @@ namespace MusicPlayer
|
|||||||
waveOut.Stop();
|
waveOut.Stop();
|
||||||
}
|
}
|
||||||
if (BState == BufferState.DONE && firstrun )
|
if (BState == BufferState.DONE && firstrun )
|
||||||
|
{
|
||||||
|
if( ! (CurrentSong is RadioStation))
|
||||||
{
|
{
|
||||||
position = mp3fr.Position;
|
position = mp3fr.Position;
|
||||||
mp3fr.Close();
|
mp3fr.Close();
|
||||||
StreamFromMP3(ms, position, false);
|
StreamFromMP3(ms, position, false);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
AState = AudioState.STOPPED;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
playpos = blockAlignedStream.Position;
|
playpos = blockAlignedStream.Position;
|
||||||
CurrentTime = (int)(playpos / waveOut.OutputWaveFormat.AverageBytesPerSecond);
|
CurrentTime = (int)(playpos / waveOut.OutputWaveFormat.AverageBytesPerSecond);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if(AState == AudioState.PLAYING)
|
if(AState == AudioState.PLAYING && !firstrun)
|
||||||
main.form.SongFinished();
|
main.form.SongFinished();
|
||||||
AState = AudioState.STOPPED;
|
AState = AudioState.STOPPED;
|
||||||
playpos = 0;
|
playpos = 0;
|
||||||
@@ -187,7 +204,14 @@ namespace MusicPlayer
|
|||||||
private void PlayAudio()
|
private void PlayAudio()
|
||||||
{
|
{
|
||||||
AState = AudioState.WAITING;
|
AState = AudioState.WAITING;
|
||||||
while (ms.Length < 65536 * 10 && BState != BufferState.DONE)
|
|
||||||
|
int buffertime = 0;
|
||||||
|
if (CurrentSong is RadioStation)
|
||||||
|
buffertime = 32768 * 10;
|
||||||
|
else
|
||||||
|
buffertime = 65536 * 10;
|
||||||
|
|
||||||
|
while (ms.Length < buffertime && BState != BufferState.DONE)
|
||||||
Thread.Sleep(1000);
|
Thread.Sleep(1000);
|
||||||
AState = AudioState.PLAYING;
|
AState = AudioState.PLAYING;
|
||||||
|
|
||||||
@@ -206,6 +230,7 @@ namespace MusicPlayer
|
|||||||
}
|
}
|
||||||
catch(Exception e)
|
catch(Exception e)
|
||||||
{
|
{
|
||||||
|
Console.WriteLine(e.StackTrace);
|
||||||
BState = BufferState.EMPTY;
|
BState = BufferState.EMPTY;
|
||||||
AState = AudioState.STOPPED;
|
AState = AudioState.STOPPED;
|
||||||
main.form.SongFinished();
|
main.form.SongFinished();
|
||||||
@@ -217,8 +242,8 @@ namespace MusicPlayer
|
|||||||
LengthBuffer = response.ContentLength;
|
LengthBuffer = response.ContentLength;
|
||||||
using (var stream = response.GetResponseStream())
|
using (var stream = response.GetResponseStream())
|
||||||
{
|
{
|
||||||
byte[] buffer = new byte[65536]; // 64KB chunks
|
byte[] buffer = new byte[65536]; // 32KB chunks
|
||||||
//byte[] buffer = new byte[65536*4]; // 256KB chunks
|
|
||||||
int read;
|
int read;
|
||||||
BState = BufferState.BUFFERING;
|
BState = BufferState.BUFFERING;
|
||||||
AState = AudioState.WAITING;
|
AState = AudioState.WAITING;
|
||||||
@@ -230,7 +255,6 @@ namespace MusicPlayer
|
|||||||
ms.Write(buffer, 0, read);
|
ms.Write(buffer, 0, read);
|
||||||
ms.Position = pos;
|
ms.Position = pos;
|
||||||
|
|
||||||
|
|
||||||
this.bufpos = ms.Length;
|
this.bufpos = ms.Length;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,48 @@
|
|||||||
|
namespace MusicPlayer
|
||||||
|
{
|
||||||
|
partial class Form1
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Required designer variable.
|
||||||
|
/// </summary>
|
||||||
|
private System.ComponentModel.IContainer components = null;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Clean up any resources being used.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
|
||||||
|
protected override void Dispose(bool disposing)
|
||||||
|
{
|
||||||
|
if (disposing && (components != null))
|
||||||
|
{
|
||||||
|
components.Dispose();
|
||||||
|
}
|
||||||
|
base.Dispose(disposing);
|
||||||
|
}
|
||||||
|
|
||||||
|
#region Windows Form Designer generated code
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Required method for Designer support - do not modify
|
||||||
|
/// the contents of this method with the code editor.
|
||||||
|
/// </summary>
|
||||||
|
private void InitializeComponent()
|
||||||
|
{
|
||||||
|
this.SuspendLayout();
|
||||||
|
//
|
||||||
|
// Form1
|
||||||
|
//
|
||||||
|
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||||
|
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||||
|
this.ClientSize = new System.Drawing.Size(284, 261);
|
||||||
|
this.Name = "Form1";
|
||||||
|
this.Text = "Form1";
|
||||||
|
this.Load += new System.EventHandler(this.Form1_Load);
|
||||||
|
this.ResumeLayout(false);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@@ -0,0 +1,39 @@
|
|||||||
|
namespace MusicPlayer
|
||||||
|
{
|
||||||
|
partial class Form1
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Required designer variable.
|
||||||
|
/// </summary>
|
||||||
|
private System.ComponentModel.IContainer components = null;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Clean up any resources being used.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
|
||||||
|
protected override void Dispose(bool disposing)
|
||||||
|
{
|
||||||
|
if (disposing && (components != null))
|
||||||
|
{
|
||||||
|
components.Dispose();
|
||||||
|
}
|
||||||
|
base.Dispose(disposing);
|
||||||
|
}
|
||||||
|
|
||||||
|
#region Windows Form Designer generated code
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Required method for Designer support - do not modify
|
||||||
|
/// the contents of this method with the code editor.
|
||||||
|
/// </summary>
|
||||||
|
private void InitializeComponent()
|
||||||
|
{
|
||||||
|
this.components = new System.ComponentModel.Container();
|
||||||
|
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||||
|
this.Text = "Form1";
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@@ -0,0 +1,48 @@
|
|||||||
|
namespace MusicPlayer
|
||||||
|
{
|
||||||
|
partial class Form1
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Required designer variable.
|
||||||
|
/// </summary>
|
||||||
|
private System.ComponentModel.IContainer components = null;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Clean up any resources being used.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
|
||||||
|
protected override void Dispose(bool disposing)
|
||||||
|
{
|
||||||
|
if (disposing && (components != null))
|
||||||
|
{
|
||||||
|
components.Dispose();
|
||||||
|
}
|
||||||
|
base.Dispose(disposing);
|
||||||
|
}
|
||||||
|
|
||||||
|
#region Windows Form Designer generated code
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Required method for Designer support - do not modify
|
||||||
|
/// the contents of this method with the code editor.
|
||||||
|
/// </summary>
|
||||||
|
private void InitializeComponent()
|
||||||
|
{
|
||||||
|
this.SuspendLayout();
|
||||||
|
//
|
||||||
|
// Form1
|
||||||
|
//
|
||||||
|
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||||
|
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||||
|
this.ClientSize = new System.Drawing.Size(284, 261);
|
||||||
|
this.Name = "Form1";
|
||||||
|
this.Text = "Form1";
|
||||||
|
this.Load += new System.EventHandler(this.Form1_Load);
|
||||||
|
this.ResumeLayout(false);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@@ -0,0 +1,48 @@
|
|||||||
|
namespace MusicPlayer
|
||||||
|
{
|
||||||
|
partial class Form1
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Required designer variable.
|
||||||
|
/// </summary>
|
||||||
|
private System.ComponentModel.IContainer components = null;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Clean up any resources being used.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
|
||||||
|
protected override void Dispose(bool disposing)
|
||||||
|
{
|
||||||
|
if (disposing && (components != null))
|
||||||
|
{
|
||||||
|
components.Dispose();
|
||||||
|
}
|
||||||
|
base.Dispose(disposing);
|
||||||
|
}
|
||||||
|
|
||||||
|
#region Windows Form Designer generated code
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Required method for Designer support - do not modify
|
||||||
|
/// the contents of this method with the code editor.
|
||||||
|
/// </summary>
|
||||||
|
private void InitializeComponent()
|
||||||
|
{
|
||||||
|
this.SuspendLayout();
|
||||||
|
//
|
||||||
|
// Form1
|
||||||
|
//
|
||||||
|
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||||
|
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||||
|
this.ClientSize = new System.Drawing.Size(284, 261);
|
||||||
|
this.Name = "Form1";
|
||||||
|
this.Text = "Form1";
|
||||||
|
this.Load += new System.EventHandler(this.Form1_Load);
|
||||||
|
this.ResumeLayout(false);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@@ -29,6 +29,8 @@ namespace MusicPlayer
|
|||||||
this.api = api;
|
this.api = api;
|
||||||
this.form = form;
|
this.form = form;
|
||||||
form.main = this;
|
form.main = this;
|
||||||
|
pl.main = this;
|
||||||
|
pl.Populate();
|
||||||
this.pl = pl;
|
this.pl = pl;
|
||||||
|
|
||||||
audio = new AudioHandler(this);
|
audio = new AudioHandler(this);
|
||||||
@@ -77,15 +79,27 @@ namespace MusicPlayer
|
|||||||
{
|
{
|
||||||
BackgroundWorker b = o as BackgroundWorker;
|
BackgroundWorker b = o as BackgroundWorker;
|
||||||
ImageList imagelist = new ImageList();
|
ImageList imagelist = new ImageList();
|
||||||
|
List<string> templist = new List<string>();
|
||||||
|
Action action = () =>
|
||||||
|
{
|
||||||
foreach (ListViewItem item in form.AlbumListView.Items)
|
foreach (ListViewItem item in form.AlbumListView.Items)
|
||||||
{
|
{
|
||||||
imagelist.Images.Add(item.ToString(), api.getAlbumCover(item.Text));
|
templist.Add(item.Text);
|
||||||
|
Console.WriteLine(item.Text);
|
||||||
}
|
}
|
||||||
Action action = () => {
|
};
|
||||||
|
form.Invoke(action);
|
||||||
|
|
||||||
|
foreach (string item in templist)
|
||||||
|
{
|
||||||
|
imagelist.Images.Add(item, api.getAlbumCover(item));
|
||||||
|
}
|
||||||
|
|
||||||
|
action = () => {
|
||||||
form.AlbumListView.LargeImageList = imagelist;
|
form.AlbumListView.LargeImageList = imagelist;
|
||||||
foreach (ListViewItem item in form.AlbumListView.Items)
|
foreach (ListViewItem item in form.AlbumListView.Items)
|
||||||
{
|
{
|
||||||
item.ImageKey = item.ToString();
|
item.ImageKey = item.Text;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
form.Invoke(action);
|
form.Invoke(action);
|
||||||
@@ -114,6 +128,15 @@ namespace MusicPlayer
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void SearchFilter(string search)
|
||||||
|
{
|
||||||
|
table.Clear();
|
||||||
|
api.GetSongsBySearch(search).ForEach(s =>
|
||||||
|
{
|
||||||
|
table.Add(s);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
public void FilterCurrentPlaying()
|
public void FilterCurrentPlaying()
|
||||||
{
|
{
|
||||||
table.Clear();
|
table.Clear();
|
||||||
@@ -214,6 +237,18 @@ namespace MusicPlayer
|
|||||||
|
|
||||||
return str;
|
return str;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static bool CheckURLValid(string source)
|
||||||
|
{
|
||||||
|
Uri uriResult;
|
||||||
|
return Uri.TryCreate(source, UriKind.Absolute, out uriResult) && uriResult.Scheme == Uri.UriSchemeHttp;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static string GetDomain(string url)
|
||||||
|
{
|
||||||
|
Uri uri = new Uri(url);
|
||||||
|
return uri.Host;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
+161
-28
@@ -52,13 +52,15 @@ namespace MusicPlayer
|
|||||||
this.overviewToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
this.overviewToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||||
this.playlistsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
this.playlistsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||||
this.toolStripSeparator4 = new System.Windows.Forms.ToolStripSeparator();
|
this.toolStripSeparator4 = new System.Windows.Forms.ToolStripSeparator();
|
||||||
this.ViewCurrentPlaylistButton = new System.Windows.Forms.ToolStripMenuItem();
|
this.ViewQueueButton = new System.Windows.Forms.ToolStripMenuItem();
|
||||||
this.playbackToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
this.playbackToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||||
this.PlayNextSongButton = new System.Windows.Forms.ToolStripMenuItem();
|
this.PlayNextSongButton = new System.Windows.Forms.ToolStripMenuItem();
|
||||||
this.LoopSongButton = new System.Windows.Forms.ToolStripMenuItem();
|
this.LoopSongButton = new System.Windows.Forms.ToolStripMenuItem();
|
||||||
this.ShuffleSongButton = new System.Windows.Forms.ToolStripMenuItem();
|
this.ShuffleSongButton = new System.Windows.Forms.ToolStripMenuItem();
|
||||||
this.playlistToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
this.playlistToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||||
this.makeToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
this.makeToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||||
|
this.toolStripSeparator6 = new System.Windows.Forms.ToolStripSeparator();
|
||||||
|
this.viewPlaylistToolstripMenuButton = new System.Windows.Forms.ToolStripMenuItem();
|
||||||
this.searchToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
this.searchToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||||
this.SearchGenresToolStripLabel = new System.Windows.Forms.ToolStripMenuItem();
|
this.SearchGenresToolStripLabel = new System.Windows.Forms.ToolStripMenuItem();
|
||||||
this.SearchGenresTextBox = new System.Windows.Forms.ToolStripTextBox();
|
this.SearchGenresTextBox = new System.Windows.Forms.ToolStripTextBox();
|
||||||
@@ -69,6 +71,15 @@ namespace MusicPlayer
|
|||||||
this.serverToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
this.serverToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||||
this.SelectServerJancoButton = new System.Windows.Forms.ToolStripMenuItem();
|
this.SelectServerJancoButton = new System.Windows.Forms.ToolStripMenuItem();
|
||||||
this.SelectServerYorickButton = new System.Windows.Forms.ToolStripMenuItem();
|
this.SelectServerYorickButton = new System.Windows.Forms.ToolStripMenuItem();
|
||||||
|
this.radioToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||||
|
this.toolStripMenuItem2 = new System.Windows.Forms.ToolStripMenuItem();
|
||||||
|
this.fMToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||||
|
this.slamFMToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||||
|
this.qDanceToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||||
|
this.toolStripSeparator5 = new System.Windows.Forms.ToolStripSeparator();
|
||||||
|
this.customToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||||
|
this.RadioStationTextBox = new System.Windows.Forms.ToolStripTextBox();
|
||||||
|
this.SetRadioStationButton = new System.Windows.Forms.ToolStripMenuItem();
|
||||||
this.ControlsPanel = new System.Windows.Forms.Panel();
|
this.ControlsPanel = new System.Windows.Forms.Panel();
|
||||||
this.NextButton = new System.Windows.Forms.Button();
|
this.NextButton = new System.Windows.Forms.Button();
|
||||||
this.PreviousButton = new System.Windows.Forms.Button();
|
this.PreviousButton = new System.Windows.Forms.Button();
|
||||||
@@ -93,6 +104,9 @@ namespace MusicPlayer
|
|||||||
this.toolStripSeparator3 = new System.Windows.Forms.ToolStripSeparator();
|
this.toolStripSeparator3 = new System.Windows.Forms.ToolStripSeparator();
|
||||||
this.NotifyMenuStripNextButton = new System.Windows.Forms.ToolStripMenuItem();
|
this.NotifyMenuStripNextButton = new System.Windows.Forms.ToolStripMenuItem();
|
||||||
this.NotifyMenuStripPreviousButton = new System.Windows.Forms.ToolStripMenuItem();
|
this.NotifyMenuStripPreviousButton = new System.Windows.Forms.ToolStripMenuItem();
|
||||||
|
this.songsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||||
|
this.SearchSongsTextBox = new System.Windows.Forms.ToolStripTextBox();
|
||||||
|
this.SearchSongsButton = new System.Windows.Forms.ToolStripMenuItem();
|
||||||
((System.ComponentModel.ISupportInitialize)(this.SongsTableView)).BeginInit();
|
((System.ComponentModel.ISupportInitialize)(this.SongsTableView)).BeginInit();
|
||||||
this.MainPanel.SuspendLayout();
|
this.MainPanel.SuspendLayout();
|
||||||
((System.ComponentModel.ISupportInitialize)(this.SplitContainer)).BeginInit();
|
((System.ComponentModel.ISupportInitialize)(this.SplitContainer)).BeginInit();
|
||||||
@@ -144,7 +158,7 @@ namespace MusicPlayer
|
|||||||
this.GenreListBox.FormattingEnabled = true;
|
this.GenreListBox.FormattingEnabled = true;
|
||||||
this.GenreListBox.Location = new System.Drawing.Point(0, 0);
|
this.GenreListBox.Location = new System.Drawing.Point(0, 0);
|
||||||
this.GenreListBox.Name = "GenreListBox";
|
this.GenreListBox.Name = "GenreListBox";
|
||||||
this.GenreListBox.Size = new System.Drawing.Size(150, 121);
|
this.GenreListBox.Size = new System.Drawing.Size(175, 121);
|
||||||
this.GenreListBox.Sorted = true;
|
this.GenreListBox.Sorted = true;
|
||||||
this.GenreListBox.TabIndex = 1;
|
this.GenreListBox.TabIndex = 1;
|
||||||
this.GenreListBox.SelectedIndexChanged += new System.EventHandler(this.GenreListBox_SelectedIndexChanged);
|
this.GenreListBox.SelectedIndexChanged += new System.EventHandler(this.GenreListBox_SelectedIndexChanged);
|
||||||
@@ -155,13 +169,13 @@ namespace MusicPlayer
|
|||||||
| System.Windows.Forms.AnchorStyles.Left)
|
| System.Windows.Forms.AnchorStyles.Left)
|
||||||
| System.Windows.Forms.AnchorStyles.Right)));
|
| System.Windows.Forms.AnchorStyles.Right)));
|
||||||
this.AlbumListView.BackColor = System.Drawing.SystemColors.Control;
|
this.AlbumListView.BackColor = System.Drawing.SystemColors.Control;
|
||||||
this.AlbumListView.Location = new System.Drawing.Point(312, 0);
|
this.AlbumListView.Location = new System.Drawing.Point(362, 0);
|
||||||
this.AlbumListView.MultiSelect = false;
|
this.AlbumListView.MultiSelect = false;
|
||||||
this.AlbumListView.Name = "AlbumListView";
|
this.AlbumListView.Name = "AlbumListView";
|
||||||
this.AlbumListView.Size = new System.Drawing.Size(448, 121);
|
this.AlbumListView.Size = new System.Drawing.Size(398, 121);
|
||||||
this.AlbumListView.Sorting = System.Windows.Forms.SortOrder.Ascending;
|
this.AlbumListView.Sorting = System.Windows.Forms.SortOrder.Ascending;
|
||||||
this.AlbumListView.TabIndex = 2;
|
this.AlbumListView.TabIndex = 2;
|
||||||
this.AlbumListView.TileSize = new System.Drawing.Size(140, 30);
|
this.AlbumListView.TileSize = new System.Drawing.Size(185, 30);
|
||||||
this.AlbumListView.UseCompatibleStateImageBehavior = false;
|
this.AlbumListView.UseCompatibleStateImageBehavior = false;
|
||||||
this.AlbumListView.View = System.Windows.Forms.View.Tile;
|
this.AlbumListView.View = System.Windows.Forms.View.Tile;
|
||||||
this.AlbumListView.SelectedIndexChanged += new System.EventHandler(this.AlbumListView_SelectedIndexChanged);
|
this.AlbumListView.SelectedIndexChanged += new System.EventHandler(this.AlbumListView_SelectedIndexChanged);
|
||||||
@@ -172,9 +186,9 @@ namespace MusicPlayer
|
|||||||
| System.Windows.Forms.AnchorStyles.Left)));
|
| System.Windows.Forms.AnchorStyles.Left)));
|
||||||
this.ArtistListBox.BackColor = System.Drawing.SystemColors.Control;
|
this.ArtistListBox.BackColor = System.Drawing.SystemColors.Control;
|
||||||
this.ArtistListBox.FormattingEnabled = true;
|
this.ArtistListBox.FormattingEnabled = true;
|
||||||
this.ArtistListBox.Location = new System.Drawing.Point(156, 0);
|
this.ArtistListBox.Location = new System.Drawing.Point(181, 0);
|
||||||
this.ArtistListBox.Name = "ArtistListBox";
|
this.ArtistListBox.Name = "ArtistListBox";
|
||||||
this.ArtistListBox.Size = new System.Drawing.Size(150, 121);
|
this.ArtistListBox.Size = new System.Drawing.Size(175, 121);
|
||||||
this.ArtistListBox.Sorted = true;
|
this.ArtistListBox.Sorted = true;
|
||||||
this.ArtistListBox.TabIndex = 3;
|
this.ArtistListBox.TabIndex = 3;
|
||||||
this.ArtistListBox.SelectedIndexChanged += new System.EventHandler(this.ArtistListBox_SelectedIndexChanged);
|
this.ArtistListBox.SelectedIndexChanged += new System.EventHandler(this.ArtistListBox_SelectedIndexChanged);
|
||||||
@@ -234,7 +248,7 @@ namespace MusicPlayer
|
|||||||
// AlbumListLabel
|
// AlbumListLabel
|
||||||
//
|
//
|
||||||
this.AlbumListLabel.AutoSize = true;
|
this.AlbumListLabel.AutoSize = true;
|
||||||
this.AlbumListLabel.Location = new System.Drawing.Point(321, 8);
|
this.AlbumListLabel.Location = new System.Drawing.Point(371, 9);
|
||||||
this.AlbumListLabel.Name = "AlbumListLabel";
|
this.AlbumListLabel.Name = "AlbumListLabel";
|
||||||
this.AlbumListLabel.Size = new System.Drawing.Size(36, 13);
|
this.AlbumListLabel.Size = new System.Drawing.Size(36, 13);
|
||||||
this.AlbumListLabel.TabIndex = 6;
|
this.AlbumListLabel.TabIndex = 6;
|
||||||
@@ -243,7 +257,7 @@ namespace MusicPlayer
|
|||||||
// ArtistListLabel
|
// ArtistListLabel
|
||||||
//
|
//
|
||||||
this.ArtistListLabel.AutoSize = true;
|
this.ArtistListLabel.AutoSize = true;
|
||||||
this.ArtistListLabel.Location = new System.Drawing.Point(165, 8);
|
this.ArtistListLabel.Location = new System.Drawing.Point(190, 9);
|
||||||
this.ArtistListLabel.Name = "ArtistListLabel";
|
this.ArtistListLabel.Name = "ArtistListLabel";
|
||||||
this.ArtistListLabel.Size = new System.Drawing.Size(30, 13);
|
this.ArtistListLabel.Size = new System.Drawing.Size(30, 13);
|
||||||
this.ArtistListLabel.TabIndex = 5;
|
this.ArtistListLabel.TabIndex = 5;
|
||||||
@@ -252,7 +266,7 @@ namespace MusicPlayer
|
|||||||
// GenreListLabel
|
// GenreListLabel
|
||||||
//
|
//
|
||||||
this.GenreListLabel.AutoSize = true;
|
this.GenreListLabel.AutoSize = true;
|
||||||
this.GenreListLabel.Location = new System.Drawing.Point(9, 8);
|
this.GenreListLabel.Location = new System.Drawing.Point(9, 9);
|
||||||
this.GenreListLabel.Name = "GenreListLabel";
|
this.GenreListLabel.Name = "GenreListLabel";
|
||||||
this.GenreListLabel.Size = new System.Drawing.Size(36, 13);
|
this.GenreListLabel.Size = new System.Drawing.Size(36, 13);
|
||||||
this.GenreListLabel.TabIndex = 4;
|
this.GenreListLabel.TabIndex = 4;
|
||||||
@@ -270,14 +284,15 @@ namespace MusicPlayer
|
|||||||
//
|
//
|
||||||
// MenuStrip
|
// MenuStrip
|
||||||
//
|
//
|
||||||
this.MenuStrip.BackColor = System.Drawing.SystemColors.WindowFrame;
|
this.MenuStrip.BackColor = System.Drawing.SystemColors.GrayText;
|
||||||
this.MenuStrip.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
|
this.MenuStrip.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
|
||||||
this.fileToolStripMenuItem,
|
this.fileToolStripMenuItem,
|
||||||
this.viewToolStripMenuItem,
|
this.viewToolStripMenuItem,
|
||||||
this.playbackToolStripMenuItem,
|
this.playbackToolStripMenuItem,
|
||||||
this.playlistToolStripMenuItem,
|
this.playlistToolStripMenuItem,
|
||||||
this.searchToolStripMenuItem,
|
this.searchToolStripMenuItem,
|
||||||
this.serverToolStripMenuItem});
|
this.serverToolStripMenuItem,
|
||||||
|
this.radioToolStripMenuItem});
|
||||||
this.MenuStrip.Location = new System.Drawing.Point(0, 0);
|
this.MenuStrip.Location = new System.Drawing.Point(0, 0);
|
||||||
this.MenuStrip.Name = "MenuStrip";
|
this.MenuStrip.Name = "MenuStrip";
|
||||||
this.MenuStrip.Size = new System.Drawing.Size(784, 24);
|
this.MenuStrip.Size = new System.Drawing.Size(784, 24);
|
||||||
@@ -311,7 +326,7 @@ namespace MusicPlayer
|
|||||||
this.overviewToolStripMenuItem,
|
this.overviewToolStripMenuItem,
|
||||||
this.playlistsToolStripMenuItem,
|
this.playlistsToolStripMenuItem,
|
||||||
this.toolStripSeparator4,
|
this.toolStripSeparator4,
|
||||||
this.ViewCurrentPlaylistButton});
|
this.ViewQueueButton});
|
||||||
this.viewToolStripMenuItem.Name = "viewToolStripMenuItem";
|
this.viewToolStripMenuItem.Name = "viewToolStripMenuItem";
|
||||||
this.viewToolStripMenuItem.Size = new System.Drawing.Size(44, 20);
|
this.viewToolStripMenuItem.Size = new System.Drawing.Size(44, 20);
|
||||||
this.viewToolStripMenuItem.Text = "View";
|
this.viewToolStripMenuItem.Text = "View";
|
||||||
@@ -319,28 +334,28 @@ namespace MusicPlayer
|
|||||||
// overviewToolStripMenuItem
|
// overviewToolStripMenuItem
|
||||||
//
|
//
|
||||||
this.overviewToolStripMenuItem.Name = "overviewToolStripMenuItem";
|
this.overviewToolStripMenuItem.Name = "overviewToolStripMenuItem";
|
||||||
this.overviewToolStripMenuItem.Size = new System.Drawing.Size(154, 22);
|
this.overviewToolStripMenuItem.Size = new System.Drawing.Size(123, 22);
|
||||||
this.overviewToolStripMenuItem.Text = "Overview";
|
this.overviewToolStripMenuItem.Text = "Overview";
|
||||||
this.overviewToolStripMenuItem.Click += new System.EventHandler(this.overviewToolStripMenuItem_Click);
|
this.overviewToolStripMenuItem.Click += new System.EventHandler(this.overviewToolStripMenuItem_Click);
|
||||||
//
|
//
|
||||||
// playlistsToolStripMenuItem
|
// playlistsToolStripMenuItem
|
||||||
//
|
//
|
||||||
this.playlistsToolStripMenuItem.Name = "playlistsToolStripMenuItem";
|
this.playlistsToolStripMenuItem.Name = "playlistsToolStripMenuItem";
|
||||||
this.playlistsToolStripMenuItem.Size = new System.Drawing.Size(154, 22);
|
this.playlistsToolStripMenuItem.Size = new System.Drawing.Size(123, 22);
|
||||||
this.playlistsToolStripMenuItem.Text = "Playlists";
|
this.playlistsToolStripMenuItem.Text = "Playlists";
|
||||||
this.playlistsToolStripMenuItem.Click += new System.EventHandler(this.playlistsToolStripMenuItem_Click);
|
this.playlistsToolStripMenuItem.Click += new System.EventHandler(this.playlistsToolStripMenuItem_Click);
|
||||||
//
|
//
|
||||||
// toolStripSeparator4
|
// toolStripSeparator4
|
||||||
//
|
//
|
||||||
this.toolStripSeparator4.Name = "toolStripSeparator4";
|
this.toolStripSeparator4.Name = "toolStripSeparator4";
|
||||||
this.toolStripSeparator4.Size = new System.Drawing.Size(151, 6);
|
this.toolStripSeparator4.Size = new System.Drawing.Size(120, 6);
|
||||||
//
|
//
|
||||||
// ViewCurrentPlaylistButton
|
// ViewQueueButton
|
||||||
//
|
//
|
||||||
this.ViewCurrentPlaylistButton.Name = "ViewCurrentPlaylistButton";
|
this.ViewQueueButton.Name = "ViewQueueButton";
|
||||||
this.ViewCurrentPlaylistButton.Size = new System.Drawing.Size(154, 22);
|
this.ViewQueueButton.Size = new System.Drawing.Size(123, 22);
|
||||||
this.ViewCurrentPlaylistButton.Text = "Current Playlist";
|
this.ViewQueueButton.Text = "Queue";
|
||||||
this.ViewCurrentPlaylistButton.Click += new System.EventHandler(this.ViewCurrentPlaylistButton_Click);
|
this.ViewQueueButton.Click += new System.EventHandler(this.ViewCurrentPlaylistButton_Click);
|
||||||
//
|
//
|
||||||
// playbackToolStripMenuItem
|
// playbackToolStripMenuItem
|
||||||
//
|
//
|
||||||
@@ -381,7 +396,9 @@ namespace MusicPlayer
|
|||||||
// playlistToolStripMenuItem
|
// playlistToolStripMenuItem
|
||||||
//
|
//
|
||||||
this.playlistToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
|
this.playlistToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
|
||||||
this.makeToolStripMenuItem});
|
this.makeToolStripMenuItem,
|
||||||
|
this.toolStripSeparator6,
|
||||||
|
this.viewPlaylistToolstripMenuButton});
|
||||||
this.playlistToolStripMenuItem.Name = "playlistToolStripMenuItem";
|
this.playlistToolStripMenuItem.Name = "playlistToolStripMenuItem";
|
||||||
this.playlistToolStripMenuItem.Size = new System.Drawing.Size(56, 20);
|
this.playlistToolStripMenuItem.Size = new System.Drawing.Size(56, 20);
|
||||||
this.playlistToolStripMenuItem.Text = "Playlist";
|
this.playlistToolStripMenuItem.Text = "Playlist";
|
||||||
@@ -393,11 +410,24 @@ namespace MusicPlayer
|
|||||||
this.makeToolStripMenuItem.Text = "Create / Edit";
|
this.makeToolStripMenuItem.Text = "Create / Edit";
|
||||||
this.makeToolStripMenuItem.Click += new System.EventHandler(this.makeToolStripMenuItem_Click);
|
this.makeToolStripMenuItem.Click += new System.EventHandler(this.makeToolStripMenuItem_Click);
|
||||||
//
|
//
|
||||||
|
// toolStripSeparator6
|
||||||
|
//
|
||||||
|
this.toolStripSeparator6.Name = "toolStripSeparator6";
|
||||||
|
this.toolStripSeparator6.Size = new System.Drawing.Size(136, 6);
|
||||||
|
//
|
||||||
|
// viewPlaylistToolstripMenuButton
|
||||||
|
//
|
||||||
|
this.viewPlaylistToolstripMenuButton.Name = "viewPlaylistToolstripMenuButton";
|
||||||
|
this.viewPlaylistToolstripMenuButton.Size = new System.Drawing.Size(139, 22);
|
||||||
|
this.viewPlaylistToolstripMenuButton.Text = "View";
|
||||||
|
this.viewPlaylistToolstripMenuButton.Click += new System.EventHandler(this.playlistsToolStripMenuItem_Click);
|
||||||
|
//
|
||||||
// searchToolStripMenuItem
|
// searchToolStripMenuItem
|
||||||
//
|
//
|
||||||
this.searchToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
|
this.searchToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
|
||||||
this.SearchGenresToolStripLabel,
|
this.SearchGenresToolStripLabel,
|
||||||
this.SearchArtistToolStripLabel});
|
this.SearchArtistToolStripLabel,
|
||||||
|
this.songsToolStripMenuItem});
|
||||||
this.searchToolStripMenuItem.Name = "searchToolStripMenuItem";
|
this.searchToolStripMenuItem.Name = "searchToolStripMenuItem";
|
||||||
this.searchToolStripMenuItem.Size = new System.Drawing.Size(54, 20);
|
this.searchToolStripMenuItem.Size = new System.Drawing.Size(54, 20);
|
||||||
this.searchToolStripMenuItem.Text = "Search";
|
this.searchToolStripMenuItem.Text = "Search";
|
||||||
@@ -408,7 +438,7 @@ namespace MusicPlayer
|
|||||||
this.SearchGenresTextBox,
|
this.SearchGenresTextBox,
|
||||||
this.ClearGenreSearchButton});
|
this.ClearGenreSearchButton});
|
||||||
this.SearchGenresToolStripLabel.Name = "SearchGenresToolStripLabel";
|
this.SearchGenresToolStripLabel.Name = "SearchGenresToolStripLabel";
|
||||||
this.SearchGenresToolStripLabel.Size = new System.Drawing.Size(110, 22);
|
this.SearchGenresToolStripLabel.Size = new System.Drawing.Size(152, 22);
|
||||||
this.SearchGenresToolStripLabel.Text = "Genres";
|
this.SearchGenresToolStripLabel.Text = "Genres";
|
||||||
//
|
//
|
||||||
// SearchGenresTextBox
|
// SearchGenresTextBox
|
||||||
@@ -431,7 +461,7 @@ namespace MusicPlayer
|
|||||||
this.SearchArtistsTextBox,
|
this.SearchArtistsTextBox,
|
||||||
this.ClearArtistSearchButton});
|
this.ClearArtistSearchButton});
|
||||||
this.SearchArtistToolStripLabel.Name = "SearchArtistToolStripLabel";
|
this.SearchArtistToolStripLabel.Name = "SearchArtistToolStripLabel";
|
||||||
this.SearchArtistToolStripLabel.Size = new System.Drawing.Size(110, 22);
|
this.SearchArtistToolStripLabel.Size = new System.Drawing.Size(152, 22);
|
||||||
this.SearchArtistToolStripLabel.Text = "Artists";
|
this.SearchArtistToolStripLabel.Text = "Artists";
|
||||||
//
|
//
|
||||||
// SearchArtistsTextBox
|
// SearchArtistsTextBox
|
||||||
@@ -471,9 +501,76 @@ namespace MusicPlayer
|
|||||||
this.SelectServerYorickButton.Text = "imegumii.nl";
|
this.SelectServerYorickButton.Text = "imegumii.nl";
|
||||||
this.SelectServerYorickButton.Click += new System.EventHandler(this.SelectServerYorickButton_Click);
|
this.SelectServerYorickButton.Click += new System.EventHandler(this.SelectServerYorickButton_Click);
|
||||||
//
|
//
|
||||||
|
// radioToolStripMenuItem
|
||||||
|
//
|
||||||
|
this.radioToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
|
||||||
|
this.toolStripMenuItem2,
|
||||||
|
this.fMToolStripMenuItem,
|
||||||
|
this.slamFMToolStripMenuItem,
|
||||||
|
this.qDanceToolStripMenuItem,
|
||||||
|
this.toolStripSeparator5,
|
||||||
|
this.customToolStripMenuItem});
|
||||||
|
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(122, 22);
|
||||||
|
this.toolStripMenuItem2.Text = "538";
|
||||||
|
this.toolStripMenuItem2.Click += new System.EventHandler(this.toolStripMenuItem2_Click);
|
||||||
|
//
|
||||||
|
// fMToolStripMenuItem
|
||||||
|
//
|
||||||
|
this.fMToolStripMenuItem.Name = "fMToolStripMenuItem";
|
||||||
|
this.fMToolStripMenuItem.Size = new System.Drawing.Size(122, 22);
|
||||||
|
this.fMToolStripMenuItem.Text = "3FM";
|
||||||
|
this.fMToolStripMenuItem.Click += new System.EventHandler(this.fMToolStripMenuItem_Click);
|
||||||
|
//
|
||||||
|
// slamFMToolStripMenuItem
|
||||||
|
//
|
||||||
|
this.slamFMToolStripMenuItem.Name = "slamFMToolStripMenuItem";
|
||||||
|
this.slamFMToolStripMenuItem.Size = new System.Drawing.Size(122, 22);
|
||||||
|
this.slamFMToolStripMenuItem.Text = "Slam-FM";
|
||||||
|
this.slamFMToolStripMenuItem.Click += new System.EventHandler(this.slamFMToolStripMenuItem_Click);
|
||||||
|
//
|
||||||
|
// qDanceToolStripMenuItem
|
||||||
|
//
|
||||||
|
this.qDanceToolStripMenuItem.Name = "qDanceToolStripMenuItem";
|
||||||
|
this.qDanceToolStripMenuItem.Size = new System.Drawing.Size(122, 22);
|
||||||
|
this.qDanceToolStripMenuItem.Text = "Q-Dance";
|
||||||
|
this.qDanceToolStripMenuItem.Click += new System.EventHandler(this.qDanceToolStripMenuItem_Click);
|
||||||
|
//
|
||||||
|
// toolStripSeparator5
|
||||||
|
//
|
||||||
|
this.toolStripSeparator5.Name = "toolStripSeparator5";
|
||||||
|
this.toolStripSeparator5.Size = new System.Drawing.Size(119, 6);
|
||||||
|
//
|
||||||
|
// customToolStripMenuItem
|
||||||
|
//
|
||||||
|
this.customToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
|
||||||
|
this.RadioStationTextBox,
|
||||||
|
this.SetRadioStationButton});
|
||||||
|
this.customToolStripMenuItem.Name = "customToolStripMenuItem";
|
||||||
|
this.customToolStripMenuItem.Size = new System.Drawing.Size(122, 22);
|
||||||
|
this.customToolStripMenuItem.Text = "Custom";
|
||||||
|
//
|
||||||
|
// RadioStationTextBox
|
||||||
|
//
|
||||||
|
this.RadioStationTextBox.Name = "RadioStationTextBox";
|
||||||
|
this.RadioStationTextBox.Size = new System.Drawing.Size(100, 23);
|
||||||
|
//
|
||||||
|
// SetRadioStationButton
|
||||||
|
//
|
||||||
|
this.SetRadioStationButton.Name = "SetRadioStationButton";
|
||||||
|
this.SetRadioStationButton.Size = new System.Drawing.Size(160, 22);
|
||||||
|
this.SetRadioStationButton.Text = "Set";
|
||||||
|
this.SetRadioStationButton.Click += new System.EventHandler(this.SetRadioStationButton_Click);
|
||||||
|
//
|
||||||
// ControlsPanel
|
// ControlsPanel
|
||||||
//
|
//
|
||||||
this.ControlsPanel.BackColor = System.Drawing.SystemColors.WindowFrame;
|
this.ControlsPanel.BackColor = System.Drawing.SystemColors.GrayText;
|
||||||
this.ControlsPanel.Controls.Add(this.NextButton);
|
this.ControlsPanel.Controls.Add(this.NextButton);
|
||||||
this.ControlsPanel.Controls.Add(this.PreviousButton);
|
this.ControlsPanel.Controls.Add(this.PreviousButton);
|
||||||
this.ControlsPanel.Controls.Add(this.CurrentSongLabel);
|
this.ControlsPanel.Controls.Add(this.CurrentSongLabel);
|
||||||
@@ -611,7 +708,7 @@ namespace MusicPlayer
|
|||||||
//
|
//
|
||||||
this.NotifyIcon.ContextMenuStrip = this.NotifyMenuStrip;
|
this.NotifyIcon.ContextMenuStrip = this.NotifyMenuStrip;
|
||||||
this.NotifyIcon.Icon = ((System.Drawing.Icon)(resources.GetObject("NotifyIcon.Icon")));
|
this.NotifyIcon.Icon = ((System.Drawing.Icon)(resources.GetObject("NotifyIcon.Icon")));
|
||||||
this.NotifyIcon.Text = "NotifyIcon";
|
this.NotifyIcon.Text = "YJMPD Music Player";
|
||||||
this.NotifyIcon.Visible = true;
|
this.NotifyIcon.Visible = true;
|
||||||
this.NotifyIcon.MouseUp += new System.Windows.Forms.MouseEventHandler(this.NotifyIcon_Click);
|
this.NotifyIcon.MouseUp += new System.Windows.Forms.MouseEventHandler(this.NotifyIcon_Click);
|
||||||
//
|
//
|
||||||
@@ -693,6 +790,28 @@ namespace MusicPlayer
|
|||||||
this.NotifyMenuStripPreviousButton.Text = "Previous";
|
this.NotifyMenuStripPreviousButton.Text = "Previous";
|
||||||
this.NotifyMenuStripPreviousButton.Click += new System.EventHandler(this.NotifyMenuStripPreviousButton_Click);
|
this.NotifyMenuStripPreviousButton.Click += new System.EventHandler(this.NotifyMenuStripPreviousButton_Click);
|
||||||
//
|
//
|
||||||
|
// songsToolStripMenuItem
|
||||||
|
//
|
||||||
|
this.songsToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
|
||||||
|
this.SearchSongsTextBox,
|
||||||
|
this.SearchSongsButton});
|
||||||
|
this.songsToolStripMenuItem.Name = "songsToolStripMenuItem";
|
||||||
|
this.songsToolStripMenuItem.Size = new System.Drawing.Size(152, 22);
|
||||||
|
this.songsToolStripMenuItem.Text = "Songs";
|
||||||
|
//
|
||||||
|
// SearchSongsTextBox
|
||||||
|
//
|
||||||
|
this.SearchSongsTextBox.Name = "SearchSongsTextBox";
|
||||||
|
this.SearchSongsTextBox.Size = new System.Drawing.Size(100, 23);
|
||||||
|
//
|
||||||
|
// SearchSongsButton
|
||||||
|
//
|
||||||
|
this.SearchSongsButton.Enabled = false;
|
||||||
|
this.SearchSongsButton.Name = "SearchSongsButton";
|
||||||
|
this.SearchSongsButton.Size = new System.Drawing.Size(160, 22);
|
||||||
|
this.SearchSongsButton.Text = "Search";
|
||||||
|
this.SearchSongsButton.Click += new System.EventHandler(this.SearchSongsButton_Click);
|
||||||
|
//
|
||||||
// MainForm
|
// MainForm
|
||||||
//
|
//
|
||||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||||
@@ -784,10 +903,24 @@ namespace MusicPlayer
|
|||||||
private System.Windows.Forms.ToolStripMenuItem NotifyMenuStripNextButton;
|
private System.Windows.Forms.ToolStripMenuItem NotifyMenuStripNextButton;
|
||||||
private System.Windows.Forms.ToolStripMenuItem NotifyMenuStripPreviousButton;
|
private System.Windows.Forms.ToolStripMenuItem NotifyMenuStripPreviousButton;
|
||||||
private System.Windows.Forms.ToolStripSeparator toolStripSeparator4;
|
private System.Windows.Forms.ToolStripSeparator toolStripSeparator4;
|
||||||
private System.Windows.Forms.ToolStripMenuItem ViewCurrentPlaylistButton;
|
private System.Windows.Forms.ToolStripMenuItem ViewQueueButton;
|
||||||
private System.Windows.Forms.ToolStripMenuItem serverToolStripMenuItem;
|
private System.Windows.Forms.ToolStripMenuItem serverToolStripMenuItem;
|
||||||
private System.Windows.Forms.ToolStripMenuItem SelectServerJancoButton;
|
private System.Windows.Forms.ToolStripMenuItem SelectServerJancoButton;
|
||||||
private System.Windows.Forms.ToolStripMenuItem SelectServerYorickButton;
|
private System.Windows.Forms.ToolStripMenuItem SelectServerYorickButton;
|
||||||
|
private System.Windows.Forms.ToolStripMenuItem radioToolStripMenuItem;
|
||||||
|
private System.Windows.Forms.ToolStripMenuItem toolStripMenuItem2;
|
||||||
|
private System.Windows.Forms.ToolStripMenuItem qDanceToolStripMenuItem;
|
||||||
|
private System.Windows.Forms.ToolStripMenuItem customToolStripMenuItem;
|
||||||
|
private System.Windows.Forms.ToolStripTextBox RadioStationTextBox;
|
||||||
|
private System.Windows.Forms.ToolStripMenuItem SetRadioStationButton;
|
||||||
|
private System.Windows.Forms.ToolStripMenuItem fMToolStripMenuItem;
|
||||||
|
private System.Windows.Forms.ToolStripSeparator toolStripSeparator5;
|
||||||
|
private System.Windows.Forms.ToolStripMenuItem slamFMToolStripMenuItem;
|
||||||
|
private System.Windows.Forms.ToolStripSeparator toolStripSeparator6;
|
||||||
|
private System.Windows.Forms.ToolStripMenuItem viewPlaylistToolstripMenuButton;
|
||||||
|
private System.Windows.Forms.ToolStripMenuItem songsToolStripMenuItem;
|
||||||
|
private System.Windows.Forms.ToolStripTextBox SearchSongsTextBox;
|
||||||
|
private System.Windows.Forms.ToolStripMenuItem SearchSongsButton;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -92,6 +92,7 @@ namespace MusicPlayer
|
|||||||
PositionTrackBar.Value = Math.Max(main.audio.Position, 0);
|
PositionTrackBar.Value = Math.Max(main.audio.Position, 0);
|
||||||
|
|
||||||
//Buffer display
|
//Buffer display
|
||||||
|
if(main.audio.Buffered / 10 >= BufferBar.Minimum && main.audio.Buffered / 10 <= BufferBar.Maximum)
|
||||||
BufferBar.Value = main.audio.Buffered / 10;
|
BufferBar.Value = main.audio.Buffered / 10;
|
||||||
|
|
||||||
//Time labels
|
//Time labels
|
||||||
@@ -136,6 +137,11 @@ namespace MusicPlayer
|
|||||||
else
|
else
|
||||||
SelectServerYorickButton.Enabled = true;
|
SelectServerYorickButton.Enabled = true;
|
||||||
|
|
||||||
|
if (SearchSongsTextBox.Text.Length == 0)
|
||||||
|
SearchSongsButton.Enabled = false;
|
||||||
|
else
|
||||||
|
SearchSongsButton.Enabled = true;
|
||||||
|
|
||||||
if (main.audio.AState == AudioHandler.AudioState.PAUSED)
|
if (main.audio.AState == AudioHandler.AudioState.PAUSED)
|
||||||
{
|
{
|
||||||
PauseButton.Enabled = false;
|
PauseButton.Enabled = false;
|
||||||
@@ -166,6 +172,11 @@ namespace MusicPlayer
|
|||||||
NotifyMenuStripStopButton.Enabled = true;
|
NotifyMenuStripStopButton.Enabled = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (RadioStationTextBox.Text.Length <= 10)
|
||||||
|
SetRadioStationButton.Enabled = false;
|
||||||
|
else
|
||||||
|
SetRadioStationButton.Enabled = true;
|
||||||
|
|
||||||
if(PlayNextSongButton.Checked)
|
if(PlayNextSongButton.Checked)
|
||||||
{
|
{
|
||||||
ShuffleSongButton.Enabled = true;
|
ShuffleSongButton.Enabled = true;
|
||||||
@@ -184,6 +195,12 @@ namespace MusicPlayer
|
|||||||
NotifyMenuStripNextButton.Enabled = false;
|
NotifyMenuStripNextButton.Enabled = false;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
{
|
||||||
|
if (main.audio.CurrentSong is RadioStation)
|
||||||
|
{
|
||||||
|
main.currentPlayingList.Clear();
|
||||||
|
}
|
||||||
|
else
|
||||||
{
|
{
|
||||||
NextButton.Enabled = true;
|
NextButton.Enabled = true;
|
||||||
NotifyMenuStripNextButton.Enabled = true;
|
NotifyMenuStripNextButton.Enabled = true;
|
||||||
@@ -199,8 +216,11 @@ namespace MusicPlayer
|
|||||||
NotifyMenuStripPreviousButton.Enabled = true;
|
NotifyMenuStripPreviousButton.Enabled = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (songFinished)
|
if (songFinished)
|
||||||
|
{
|
||||||
|
if (! (main.audio.CurrentSong is RadioStation) )
|
||||||
{
|
{
|
||||||
Thread.Sleep(20);
|
Thread.Sleep(20);
|
||||||
|
|
||||||
@@ -212,6 +232,7 @@ namespace MusicPlayer
|
|||||||
{
|
{
|
||||||
main.audio.Play(main.audio.CurrentSong);
|
main.audio.Play(main.audio.CurrentSong);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
songFinished = false;
|
songFinished = false;
|
||||||
}
|
}
|
||||||
@@ -522,5 +543,46 @@ namespace MusicPlayer
|
|||||||
{
|
{
|
||||||
main.SwitchServer("http://imegumii.nl");
|
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("Q-Dance", main.api, "http://stream01.platform02.true.nl:8000/qdance-hard"));
|
||||||
|
}
|
||||||
|
|
||||||
|
private void fMToolStripMenuItem_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
main.audio.Play(new RadioStation("3FM", main.api, "http://icecast.omroep.nl:80/3fm-bb-mp3"));
|
||||||
|
}
|
||||||
|
|
||||||
|
private void slamFMToolStripMenuItem_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
main.audio.Play(new RadioStation("Slam-FM", main.api, "http://vip-icecast.538.lw.triple-it.nl/SLAMFM_MP3"));
|
||||||
|
}
|
||||||
|
|
||||||
|
private void SetRadioStationButton_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
string input = RadioStationTextBox.Text;
|
||||||
|
|
||||||
|
if(Main.CheckURLValid(input))
|
||||||
|
{
|
||||||
|
main.audio.Play(new RadioStation(Main.GetDomain(input), main.api, input));
|
||||||
|
}
|
||||||
|
|
||||||
|
RadioStationTextBox.Text = "";
|
||||||
|
}
|
||||||
|
|
||||||
|
private void SearchSongsButton_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
if(SearchSongsTextBox.Text.Length > 0)
|
||||||
|
{
|
||||||
|
main.SearchFilter(SearchSongsTextBox.Text);
|
||||||
|
SearchSongsTextBox.Text = "";
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -85,6 +85,7 @@
|
|||||||
</Compile>
|
</Compile>
|
||||||
<Compile Include="Program.cs" />
|
<Compile Include="Program.cs" />
|
||||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||||
|
<Compile Include="RadioStation.cs" />
|
||||||
<Compile Include="Song.cs" />
|
<Compile Include="Song.cs" />
|
||||||
<Compile Include="SongsTable.cs">
|
<Compile Include="SongsTable.cs">
|
||||||
<SubType>Component</SubType>
|
<SubType>Component</SubType>
|
||||||
|
|||||||
@@ -0,0 +1,99 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||||
|
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
|
||||||
|
<PropertyGroup>
|
||||||
|
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||||
|
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||||
|
<ProjectGuid>{E2B99339-3251-48BE-91C9-FAB21CD07A39}</ProjectGuid>
|
||||||
|
<OutputType>WinExe</OutputType>
|
||||||
|
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||||
|
<RootNamespace>MusicPlayer</RootNamespace>
|
||||||
|
<AssemblyName>MusicPlayer</AssemblyName>
|
||||||
|
<TargetFrameworkVersion>v4.5.2</TargetFrameworkVersion>
|
||||||
|
<FileAlignment>512</FileAlignment>
|
||||||
|
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||||
|
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||||
|
<DebugSymbols>true</DebugSymbols>
|
||||||
|
<DebugType>full</DebugType>
|
||||||
|
<Optimize>false</Optimize>
|
||||||
|
<OutputPath>bin\Debug\</OutputPath>
|
||||||
|
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||||
|
<ErrorReport>prompt</ErrorReport>
|
||||||
|
<WarningLevel>4</WarningLevel>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||||
|
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||||
|
<DebugType>pdbonly</DebugType>
|
||||||
|
<Optimize>true</Optimize>
|
||||||
|
<OutputPath>bin\Release\</OutputPath>
|
||||||
|
<DefineConstants>TRACE</DefineConstants>
|
||||||
|
<ErrorReport>prompt</ErrorReport>
|
||||||
|
<WarningLevel>4</WarningLevel>
|
||||||
|
</PropertyGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<Reference Include="System" />
|
||||||
|
<Reference Include="System.Core" />
|
||||||
|
<Reference Include="System.Xml.Linq" />
|
||||||
|
<Reference Include="System.Data.DataSetExtensions" />
|
||||||
|
<Reference Include="Microsoft.CSharp" />
|
||||||
|
<Reference Include="System.Data" />
|
||||||
|
<Reference Include="System.Deployment" />
|
||||||
|
<Reference Include="System.Drawing" />
|
||||||
|
<Reference Include="System.Net.Http" />
|
||||||
|
<Reference Include="System.Windows.Forms" />
|
||||||
|
<Reference Include="System.Xml" />
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<Compile Include="MainForm.cs" >
|
||||||
|
<SubType>Form</SubType>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="Album.cs" />
|
||||||
|
<Compile Include="APIHandler.cs" />
|
||||||
|
<Compile Include="Artist.cs" />
|
||||||
|
<Compile Include="MainForm.Designer.cs">
|
||||||
|
<DependentUpon>MainForm.cs</DependentUpon>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="NetworkHandler.cs" />
|
||||||
|
<Compile Include="Program.cs" />
|
||||||
|
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||||
|
<<<<<<< HEAD
|
||||||
|
<EmbeddedResource Include="MainForm.resx">
|
||||||
|
<DependentUpon>MainForm.cs</DependentUpon>
|
||||||
|
=======
|
||||||
|
<EmbeddedResource Include="Form1.resx">
|
||||||
|
<DependentUpon>Form1.cs</DependentUpon>
|
||||||
|
>>>>>>> origin/api
|
||||||
|
</EmbeddedResource>
|
||||||
|
<EmbeddedResource Include="Properties\Resources.resx">
|
||||||
|
<Generator>ResXFileCodeGenerator</Generator>
|
||||||
|
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
|
||||||
|
<SubType>Designer</SubType>
|
||||||
|
</EmbeddedResource>
|
||||||
|
<Compile Include="Properties\Resources.Designer.cs">
|
||||||
|
<AutoGen>True</AutoGen>
|
||||||
|
<DependentUpon>Resources.resx</DependentUpon>
|
||||||
|
</Compile>
|
||||||
|
<None Include="Properties\Settings.settings">
|
||||||
|
<Generator>SettingsSingleFileGenerator</Generator>
|
||||||
|
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
|
||||||
|
</None>
|
||||||
|
<Compile Include="Properties\Settings.Designer.cs">
|
||||||
|
<AutoGen>True</AutoGen>
|
||||||
|
<DependentUpon>Settings.settings</DependentUpon>
|
||||||
|
<DesignTimeSharedInput>True</DesignTimeSharedInput>
|
||||||
|
</Compile>
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<None Include="App.config" />
|
||||||
|
</ItemGroup>
|
||||||
|
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||||
|
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
||||||
|
Other similar extension points exist, see Microsoft.Common.targets.
|
||||||
|
<Target Name="BeforeBuild">
|
||||||
|
</Target>
|
||||||
|
<Target Name="AfterBuild">
|
||||||
|
</Target>
|
||||||
|
-->
|
||||||
|
</Project>
|
||||||
@@ -27,6 +27,7 @@ namespace MusicPlayer
|
|||||||
Console.WriteLine(encodedstring);
|
Console.WriteLine(encodedstring);
|
||||||
HttpWebRequest server = (HttpWebRequest)WebRequest.Create(ip+":"+port+"/"+encodedstring);
|
HttpWebRequest server = (HttpWebRequest)WebRequest.Create(ip+":"+port+"/"+encodedstring);
|
||||||
server.KeepAlive = false;
|
server.KeepAlive = false;
|
||||||
|
try {
|
||||||
HttpWebResponse respond = (HttpWebResponse)server.GetResponse();
|
HttpWebResponse respond = (HttpWebResponse)server.GetResponse();
|
||||||
Stream streamResponse = respond.GetResponseStream();
|
Stream streamResponse = respond.GetResponseStream();
|
||||||
StreamReader streamRead = new StreamReader(streamResponse);
|
StreamReader streamRead = new StreamReader(streamResponse);
|
||||||
@@ -45,12 +46,24 @@ namespace MusicPlayer
|
|||||||
streamRead.Close();
|
streamRead.Close();
|
||||||
return o;
|
return o;
|
||||||
}
|
}
|
||||||
|
catch(WebException e)
|
||||||
|
{
|
||||||
|
Console.WriteLine("Server is offline");
|
||||||
|
}
|
||||||
|
catch(Exception e)
|
||||||
|
{
|
||||||
|
Console.WriteLine("Er is iets fout gegaan bij het communiceren met de server.");
|
||||||
|
}
|
||||||
|
|
||||||
|
return null;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
public MemoryStream downloadArtwork(string album)
|
public MemoryStream downloadArtwork(string album)
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
WebRequest req = WebRequest.Create((ip + "/music/artwork/"+album).Replace(" ", "%20"));
|
WebRequest req = WebRequest.Create((ip + "/music/.artwork/"+album).Replace(" ", "%20"));
|
||||||
WebResponse response = req.GetResponse();
|
WebResponse response = req.GetResponse();
|
||||||
Stream stream = response.GetResponseStream();
|
Stream stream = response.GetResponseStream();
|
||||||
|
|
||||||
|
|||||||
@@ -9,14 +9,16 @@ namespace MusicPlayer
|
|||||||
public string name { get; }
|
public string name { get; }
|
||||||
private string basedir;
|
private string basedir;
|
||||||
public List<Song> songs;
|
public List<Song> songs;
|
||||||
|
public string server;
|
||||||
|
|
||||||
private APIHandler api;
|
private APIHandler api;
|
||||||
public Playlist(string name, string basedir, APIHandler api)
|
public Playlist(string name, string basedir, string server, APIHandler api)
|
||||||
{
|
{
|
||||||
this.songs = new List<Song>();
|
this.songs = new List<Song>();
|
||||||
this.name = name;
|
this.name = name;
|
||||||
this.api = api;
|
this.api = api;
|
||||||
this.basedir = basedir;
|
this.basedir = basedir;
|
||||||
|
this.server = server;
|
||||||
this.ReadFromFile();
|
this.ReadFromFile();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -35,6 +37,8 @@ namespace MusicPlayer
|
|||||||
try {
|
try {
|
||||||
using (StreamReader str = new StreamReader(basedir + name + ".txt"))
|
using (StreamReader str = new StreamReader(basedir + name + ".txt"))
|
||||||
{
|
{
|
||||||
|
server = str.ReadLine();
|
||||||
|
|
||||||
string readline;
|
string readline;
|
||||||
while ((readline = str.ReadLine()) != null)
|
while ((readline = str.ReadLine()) != null)
|
||||||
{
|
{
|
||||||
@@ -48,6 +52,7 @@ namespace MusicPlayer
|
|||||||
{
|
{
|
||||||
FileStream fs = new FileStream(basedir + name + ".txt", FileMode.CreateNew);
|
FileStream fs = new FileStream(basedir + name + ".txt", FileMode.CreateNew);
|
||||||
fs.Close();
|
fs.Close();
|
||||||
|
File.WriteAllText(basedir + name + ".txt", server);
|
||||||
ReadFromFile();
|
ReadFromFile();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -57,6 +62,8 @@ namespace MusicPlayer
|
|||||||
{
|
{
|
||||||
using (StreamWriter stw = new StreamWriter(basedir + name + ".txt"))
|
using (StreamWriter stw = new StreamWriter(basedir + name + ".txt"))
|
||||||
{
|
{
|
||||||
|
stw.WriteLine(server.ToString());
|
||||||
|
|
||||||
this.songs.ForEach(s =>
|
this.songs.ForEach(s =>
|
||||||
{
|
{
|
||||||
stw.WriteLine(s.ToString());
|
stw.WriteLine(s.ToString());
|
||||||
|
|||||||
@@ -8,23 +8,24 @@ namespace MusicPlayer
|
|||||||
public class PlaylistHandler
|
public class PlaylistHandler
|
||||||
{
|
{
|
||||||
private List<Playlist> playlists;
|
private List<Playlist> playlists;
|
||||||
private APIHandler api;
|
public Main main
|
||||||
|
{
|
||||||
|
get; set;
|
||||||
|
}
|
||||||
private readonly string basedir = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments) + "\\.mpplaylists\\";
|
private readonly string basedir = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments) + "\\.mpplaylists\\";
|
||||||
public PlaylistHandler(APIHandler api)
|
public PlaylistHandler()
|
||||||
{
|
{
|
||||||
this.playlists = new List<Playlist>();
|
this.playlists = new List<Playlist>();
|
||||||
this.api = api;
|
|
||||||
Populate();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void Populate()
|
public void Populate()
|
||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
Directory.GetFiles(basedir).ToList().ForEach(f =>
|
Directory.GetFiles(basedir).ToList().ForEach(f =>
|
||||||
{
|
{
|
||||||
if (f.EndsWith(".txt"))
|
if (f.EndsWith(".txt"))
|
||||||
{
|
{
|
||||||
playlists.Add(new Playlist(Path.GetFileName(f.Replace(".txt","")) ,basedir, api));
|
playlists.Add(new Playlist(Path.GetFileName(f.Replace(".txt","")) ,basedir, main.nw.ip, main.api));
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -39,7 +40,7 @@ namespace MusicPlayer
|
|||||||
|
|
||||||
public void MakeNewPlaylistByName(string name)
|
public void MakeNewPlaylistByName(string name)
|
||||||
{
|
{
|
||||||
playlists.Add(new Playlist(name, basedir, api));
|
playlists.Add(new Playlist(name, basedir, main.nw.ip, main.api));
|
||||||
}
|
}
|
||||||
|
|
||||||
public Playlist GetPlaylistByName(string name)
|
public Playlist GetPlaylistByName(string name)
|
||||||
@@ -54,7 +55,13 @@ namespace MusicPlayer
|
|||||||
|
|
||||||
public List<Playlist> GetPlaylists()
|
public List<Playlist> GetPlaylists()
|
||||||
{
|
{
|
||||||
return playlists;
|
List<Playlist> currentPlaylists = new List<Playlist>();
|
||||||
|
foreach(Playlist pl in playlists)
|
||||||
|
{
|
||||||
|
if (pl.server == main.nw.ip)
|
||||||
|
currentPlaylists.Add(pl);
|
||||||
|
}
|
||||||
|
return currentPlaylists;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -17,11 +17,11 @@ namespace MusicPlayer
|
|||||||
Application.EnableVisualStyles();
|
Application.EnableVisualStyles();
|
||||||
Application.SetCompatibleTextRenderingDefault(false);
|
Application.SetCompatibleTextRenderingDefault(false);
|
||||||
|
|
||||||
NetworkHandler nw = new NetworkHandler("http://jancokock.me");
|
// NetworkHandler nw = new NetworkHandler("http://jancokock.me");
|
||||||
//NetworkHandler nw = new NetworkHandler("http://imegumii.nl");
|
NetworkHandler nw = new NetworkHandler("http://imegumii.nl");
|
||||||
APIHandler api = new APIHandler(nw);
|
APIHandler api = new APIHandler(nw);
|
||||||
MainForm form = new MainForm();
|
MainForm form = new MainForm();
|
||||||
PlaylistHandler pl = new PlaylistHandler(api);
|
PlaylistHandler pl = new PlaylistHandler();
|
||||||
new Main(nw, api, form,pl);
|
new Main(nw, api, form,pl);
|
||||||
|
|
||||||
Application.Run(form);
|
Application.Run(form);
|
||||||
|
|||||||
@@ -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;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
Executable → Regular
+1
-1
@@ -34,7 +34,7 @@ namespace MusicPlayer
|
|||||||
url = "";
|
url = "";
|
||||||
}
|
}
|
||||||
|
|
||||||
private string GetURL()
|
protected virtual string GetURL()
|
||||||
{
|
{
|
||||||
if (url == "")
|
if (url == "")
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -12,9 +12,9 @@ namespace MusicPlayer
|
|||||||
public SongsTable() : base()
|
public SongsTable() : base()
|
||||||
{
|
{
|
||||||
this.Columns.Clear();
|
this.Columns.Clear();
|
||||||
this.Columns.Add("Naam", typeof(string));
|
this.Columns.Add("Name", typeof(string));
|
||||||
this.Columns.Add("Album", typeof(string));
|
this.Columns.Add("Album", typeof(string));
|
||||||
this.Columns.Add("Artiest", typeof(string));
|
this.Columns.Add("Artist", typeof(string));
|
||||||
this.Columns.Add("Genre", typeof(string));
|
this.Columns.Add("Genre", typeof(string));
|
||||||
this.Columns.Add("Duration", typeof(string));
|
this.Columns.Add("Duration", typeof(string));
|
||||||
this.Columns.Add("song", typeof(Song));
|
this.Columns.Add("song", typeof(Song));
|
||||||
|
|||||||
Reference in New Issue
Block a user