Merge remote-tracking branch 'origin/gui' into gui

This commit is contained in:
2015-11-01 00:22:33 +01:00
4 changed files with 82 additions and 44 deletions
+16 -14
View File
@@ -129,6 +129,9 @@ namespace MusicPlayer
this.SongsTableView.Size = new System.Drawing.Size(760, 174); this.SongsTableView.Size = new System.Drawing.Size(760, 174);
this.SongsTableView.TabIndex = 0; this.SongsTableView.TabIndex = 0;
this.SongsTableView.CellDoubleClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.SongsTableView_CellDoubleClick); this.SongsTableView.CellDoubleClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.SongsTableView_CellDoubleClick);
this.SongsTableView.MouseDown += new System.Windows.Forms.MouseEventHandler(this.SongsTableView_MouseDown);
this.SongsTableView.MouseMove += new System.Windows.Forms.MouseEventHandler(this.SongsTableView_MouseMove);
this.SongsTableView.MouseUp += new System.Windows.Forms.MouseEventHandler(this.SongsTableView_MouseUp);
// //
// GenreListBox // GenreListBox
// //
@@ -136,7 +139,7 @@ namespace MusicPlayer
| System.Windows.Forms.AnchorStyles.Left))); | System.Windows.Forms.AnchorStyles.Left)));
this.GenreListBox.BackColor = System.Drawing.SystemColors.Control; this.GenreListBox.BackColor = System.Drawing.SystemColors.Control;
this.GenreListBox.FormattingEnabled = true; this.GenreListBox.FormattingEnabled = true;
this.GenreListBox.Location = new System.Drawing.Point(3, 3); this.GenreListBox.Location = new System.Drawing.Point(148, 3);
this.GenreListBox.Name = "GenreListBox"; this.GenreListBox.Name = "GenreListBox";
this.GenreListBox.Size = new System.Drawing.Size(150, 121); this.GenreListBox.Size = new System.Drawing.Size(150, 121);
this.GenreListBox.Sorted = true; this.GenreListBox.Sorted = true;
@@ -149,10 +152,10 @@ 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(309, 3); this.AlbumListView.Location = new System.Drawing.Point(460, 3);
this.AlbumListView.MultiSelect = false; this.AlbumListView.MultiSelect = false;
this.AlbumListView.Name = "AlbumListView"; this.AlbumListView.Name = "AlbumListView";
this.AlbumListView.Size = new System.Drawing.Size(451, 121); this.AlbumListView.Size = new System.Drawing.Size(286, 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(140, 30);
@@ -166,7 +169,7 @@ 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, 3); this.ArtistListBox.Location = new System.Drawing.Point(304, 3);
this.ArtistListBox.Name = "ArtistListBox"; this.ArtistListBox.Name = "ArtistListBox";
this.ArtistListBox.Size = new System.Drawing.Size(150, 121); this.ArtistListBox.Size = new System.Drawing.Size(150, 121);
this.ArtistListBox.Sorted = true; this.ArtistListBox.Sorted = true;
@@ -200,10 +203,10 @@ namespace MusicPlayer
// //
// SplitContainer.Panel1 // SplitContainer.Panel1
// //
this.SplitContainer.Panel1.Controls.Add(this.PlaylistBox);
this.SplitContainer.Panel1.Controls.Add(this.AlbumListView); this.SplitContainer.Panel1.Controls.Add(this.AlbumListView);
this.SplitContainer.Panel1.Controls.Add(this.ArtistListBox); this.SplitContainer.Panel1.Controls.Add(this.ArtistListBox);
this.SplitContainer.Panel1.Controls.Add(this.GenreListBox); this.SplitContainer.Panel1.Controls.Add(this.GenreListBox);
this.SplitContainer.Panel1.Controls.Add(this.PlaylistBox);
// //
// SplitContainer.Panel2 // SplitContainer.Panel2
// //
@@ -215,29 +218,28 @@ namespace MusicPlayer
// //
// PlaylistBox // PlaylistBox
// //
this.PlaylistBox.Dock = System.Windows.Forms.DockStyle.Fill; this.PlaylistBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)));
this.PlaylistBox.FormattingEnabled = true; this.PlaylistBox.FormattingEnabled = true;
this.PlaylistBox.Location = new System.Drawing.Point(0, 0); this.PlaylistBox.Location = new System.Drawing.Point(3, 3);
this.PlaylistBox.Name = "PlaylistBox"; this.PlaylistBox.Name = "PlaylistBox";
this.PlaylistBox.Size = new System.Drawing.Size(760, 131); this.PlaylistBox.Size = new System.Drawing.Size(139, 121);
this.PlaylistBox.TabIndex = 4; this.PlaylistBox.TabIndex = 4;
this.PlaylistBox.Visible = false;
this.PlaylistBox.SelectedIndexChanged += new System.EventHandler(this.PlaylistBox_SelectedIndexChanged); this.PlaylistBox.SelectedIndexChanged += new System.EventHandler(this.PlaylistBox_SelectedIndexChanged);
// //
// PlaylistListLabel // PlaylistListLabel
// //
this.PlaylistListLabel.AutoSize = true; this.PlaylistListLabel.AutoSize = true;
this.PlaylistListLabel.Location = new System.Drawing.Point(12, 8); this.PlaylistListLabel.Location = new System.Drawing.Point(12, 9);
this.PlaylistListLabel.Name = "PlaylistListLabel"; this.PlaylistListLabel.Name = "PlaylistListLabel";
this.PlaylistListLabel.Size = new System.Drawing.Size(39, 13); this.PlaylistListLabel.Size = new System.Drawing.Size(39, 13);
this.PlaylistListLabel.TabIndex = 7; this.PlaylistListLabel.TabIndex = 7;
this.PlaylistListLabel.Text = "Playlist"; this.PlaylistListLabel.Text = "Playlist";
this.PlaylistListLabel.Visible = false;
// //
// AlbumListLabel // AlbumListLabel
// //
this.AlbumListLabel.AutoSize = true; this.AlbumListLabel.AutoSize = true;
this.AlbumListLabel.Location = new System.Drawing.Point(321, 9); this.AlbumListLabel.Location = new System.Drawing.Point(483, 8);
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;
@@ -246,7 +248,7 @@ namespace MusicPlayer
// ArtistListLabel // ArtistListLabel
// //
this.ArtistListLabel.AutoSize = true; this.ArtistListLabel.AutoSize = true;
this.ArtistListLabel.Location = new System.Drawing.Point(165, 9); this.ArtistListLabel.Location = new System.Drawing.Point(327, 8);
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;
@@ -255,7 +257,7 @@ namespace MusicPlayer
// GenreListLabel // GenreListLabel
// //
this.GenreListLabel.AutoSize = true; this.GenreListLabel.AutoSize = true;
this.GenreListLabel.Location = new System.Drawing.Point(12, 9); this.GenreListLabel.Location = new System.Drawing.Point(174, 8);
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;
+41
View File
@@ -19,6 +19,7 @@ namespace MusicPlayer
public partial class MainForm : Form public partial class MainForm : Form
{ {
bool songFinished; bool songFinished;
bool draggedstarted;
public Main main public Main main
{ {
@@ -442,5 +443,45 @@ namespace MusicPlayer
int selected = main.currentPlayingList.IndexOf(main.audio.CurrentSong); int selected = main.currentPlayingList.IndexOf(main.audio.CurrentSong);
SongsTableView.CurrentCell = SongsTableView.Rows[selected].Cells[0]; SongsTableView.CurrentCell = SongsTableView.Rows[selected].Cells[0];
} }
private void SongsTableView_MouseDown(object sender, MouseEventArgs e)
{
draggedstarted = true;
Cursor.Current = Cursors.Hand;
}
private void SongsTableView_MouseUp(object sender, MouseEventArgs e)
{
if (draggedstarted)
{
Cursor.Current = Cursors.Default;
Point point = PlaylistBox.PointToClient(Cursor.Position);
int index = PlaylistBox.IndexFromPoint(point);
if (index < 0) //nope, niet op een playlist gesleept
{
draggedstarted = false;
return;
}
Playlist currentPlaylist = main.pl.GetPlaylistByName(PlaylistBox.Items[index].ToString());
SongsTable s = new SongsTable();
if (SongsTableView.SelectedRows.Count > 0)
{
var drv = SongsTableView.SelectedRows[0].DataBoundItem as DataRowView;
var row = drv.Row as DataRow;
s.ImportRow(row);
currentPlaylist.AddSong((s.Rows[0][5] as Song));
currentPlaylist.WriteToFile();
}
}
}
private void SongsTableView_MouseMove(object sender, MouseEventArgs e)
{
if (draggedstarted)
{
Cursor.Current = Cursors.Hand;
}
}
} }
} }
+10 -18
View File
@@ -8,8 +8,8 @@
// </auto-generated> // </auto-generated>
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
namespace MusicPlayer.Properties namespace MusicPlayer.Properties {
{ using System;
/// <summary> /// <summary>
@@ -22,28 +22,23 @@ namespace MusicPlayer.Properties
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
internal class Resources internal class Resources {
{
private static global::System.Resources.ResourceManager resourceMan; private static global::System.Resources.ResourceManager resourceMan;
private static global::System.Globalization.CultureInfo resourceCulture; private static global::System.Globalization.CultureInfo resourceCulture;
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
internal Resources() internal Resources() {
{
} }
/// <summary> /// <summary>
/// Returns the cached ResourceManager instance used by this class. /// Returns the cached ResourceManager instance used by this class.
/// </summary> /// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Resources.ResourceManager ResourceManager internal static global::System.Resources.ResourceManager ResourceManager {
{ get {
get if (object.ReferenceEquals(resourceMan, null)) {
{
if ((resourceMan == null))
{
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("MusicPlayer.Properties.Resources", typeof(Resources).Assembly); global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("MusicPlayer.Properties.Resources", typeof(Resources).Assembly);
resourceMan = temp; resourceMan = temp;
} }
@@ -56,14 +51,11 @@ namespace MusicPlayer.Properties
/// resource lookups using this strongly typed resource class. /// resource lookups using this strongly typed resource class.
/// </summary> /// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Globalization.CultureInfo Culture internal static global::System.Globalization.CultureInfo Culture {
{ get {
get
{
return resourceCulture; return resourceCulture;
} }
set set {
{
resourceCulture = value; resourceCulture = value;
} }
} }
+8 -5
View File
@@ -46,7 +46,7 @@
mimetype: application/x-microsoft.net.object.binary.base64 mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with value : The object must be serialized with
: System.Serialization.Formatters.Binary.BinaryFormatter : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding. : and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64 mimetype: application/x-microsoft.net.object.soap.base64
@@ -60,6 +60,7 @@
: and then encoded with base64 encoding. : and then encoded with base64 encoding.
--> -->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata"> <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true"> <xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType> <xsd:complexType>
<xsd:choice maxOccurs="unbounded"> <xsd:choice maxOccurs="unbounded">
@@ -68,9 +69,10 @@
<xsd:sequence> <xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" /> <xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence> </xsd:sequence>
<xsd:attribute name="name" type="xsd:string" /> <xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" /> <xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" /> <xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType> </xsd:complexType>
</xsd:element> </xsd:element>
<xsd:element name="assembly"> <xsd:element name="assembly">
@@ -85,9 +87,10 @@
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" /> <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence> </xsd:sequence>
<xsd:attribute name="name" type="xsd:string" msdata:Ordinal="1" /> <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" /> <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" /> <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType> </xsd:complexType>
</xsd:element> </xsd:element>
<xsd:element name="resheader"> <xsd:element name="resheader">
@@ -109,9 +112,9 @@
<value>2.0</value> <value>2.0</value>
</resheader> </resheader>
<resheader name="reader"> <resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader> </resheader>
<resheader name="writer"> <resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader> </resheader>
</root> </root>