Fix seeking after SOMEONE broke it :p

This commit is contained in:
2015-10-30 15:14:32 +01:00
parent 8c988dd475
commit e6d4eacd1c
4 changed files with 55 additions and 25 deletions
+24
View File
@@ -26,6 +26,26 @@ namespace MusicPlayer
public MainForm() public MainForm()
{ {
InitializeComponent(); InitializeComponent();
PositionTrackBar.Scroll += (s, e) =>
{
if (clicked)
return;
this.PositionTrackBar_ValueChanged();
};
PositionTrackBar.MouseDown += (s, e) =>
{
clicked = true;
};
PositionTrackBar.MouseUp += (s, e) =>
{
if (!clicked)
return;
clicked = false;
this.PositionTrackBar_ValueChanged();
};
p = new NotificationPopup(this); p = new NotificationPopup(this);
} }
@@ -81,6 +101,8 @@ namespace MusicPlayer
private void SongsTableView_CellDoubleClick(object sender, DataGridViewCellEventArgs e) private void SongsTableView_CellDoubleClick(object sender, DataGridViewCellEventArgs e)
{ {
SongsTable s = new SongsTable(); SongsTable s = new SongsTable();
if(SongsTableView.SelectedRows.Count > 0)
{
var drv = SongsTableView.SelectedRows[0].DataBoundItem as DataRowView; var drv = SongsTableView.SelectedRows[0].DataBoundItem as DataRowView;
var row = drv.Row as DataRow; var row = drv.Row as DataRow;
s.ImportRow(row); s.ImportRow(row);
@@ -88,6 +110,8 @@ namespace MusicPlayer
main.audio.Play((s.Rows[0][3] as Song)); main.audio.Play((s.Rows[0][3] as Song));
} }
}
private void PositionTrackBar_ValueChanged() private void PositionTrackBar_ValueChanged()
{ {
main.audio.Seek(PositionTrackBar.Value); main.audio.Seek(PositionTrackBar.Value);
+11 -10
View File
@@ -30,15 +30,15 @@
{ {
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(NotificationPopup)); System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(NotificationPopup));
this.groupBox1 = new System.Windows.Forms.GroupBox(); this.groupBox1 = new System.Windows.Forms.GroupBox();
this.pictureBox4 = new System.Windows.Forms.PictureBox();
this.pictureBox3 = new System.Windows.Forms.PictureBox(); this.pictureBox3 = new System.Windows.Forms.PictureBox();
this.pictureBox2 = new System.Windows.Forms.PictureBox(); this.pictureBox2 = new System.Windows.Forms.PictureBox();
this.pictureBox1 = new System.Windows.Forms.PictureBox(); this.pictureBox1 = new System.Windows.Forms.PictureBox();
this.pictureBox4 = new System.Windows.Forms.PictureBox();
this.groupBox1.SuspendLayout(); this.groupBox1.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.pictureBox4)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.pictureBox3)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.pictureBox3)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.pictureBox2)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.pictureBox2)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.pictureBox4)).BeginInit();
this.SuspendLayout(); this.SuspendLayout();
// //
// groupBox1 // groupBox1
@@ -52,6 +52,13 @@
this.groupBox1.Name = "groupBox1"; this.groupBox1.Name = "groupBox1";
this.groupBox1.TabStop = false; this.groupBox1.TabStop = false;
// //
// pictureBox4
//
resources.ApplyResources(this.pictureBox4, "pictureBox4");
this.pictureBox4.Name = "pictureBox4";
this.pictureBox4.TabStop = false;
this.pictureBox4.Click += new System.EventHandler(this.pictureBox4_Click);
//
// pictureBox3 // pictureBox3
// //
resources.ApplyResources(this.pictureBox3, "pictureBox3"); resources.ApplyResources(this.pictureBox3, "pictureBox3");
@@ -70,13 +77,6 @@
this.pictureBox1.Name = "pictureBox1"; this.pictureBox1.Name = "pictureBox1";
this.pictureBox1.TabStop = false; this.pictureBox1.TabStop = false;
// //
// pictureBox4
//
resources.ApplyResources(this.pictureBox4, "pictureBox4");
this.pictureBox4.Name = "pictureBox4";
this.pictureBox4.TabStop = false;
this.pictureBox4.Click += new System.EventHandler(this.pictureBox4_Click);
//
// NotificationPopup // NotificationPopup
// //
resources.ApplyResources(this, "$this"); resources.ApplyResources(this, "$this");
@@ -90,11 +90,12 @@
this.ShowIcon = false; this.ShowIcon = false;
this.ShowInTaskbar = false; this.ShowInTaskbar = false;
this.Shown += new System.EventHandler(this.NotificationPopup_Shown); this.Shown += new System.EventHandler(this.NotificationPopup_Shown);
this.Leave += new System.EventHandler(this.NotificationPopup_Leave);
this.groupBox1.ResumeLayout(false); this.groupBox1.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.pictureBox4)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.pictureBox3)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.pictureBox3)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.pictureBox2)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.pictureBox2)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.pictureBox4)).EndInit();
this.ResumeLayout(false); this.ResumeLayout(false);
} }
@@ -31,5 +31,10 @@ namespace MusicPlayer
{ {
f.WindowState = FormWindowState.Normal; f.WindowState = FormWindowState.Normal;
} }
private void NotificationPopup_Leave(object sender, EventArgs e)
{
this.Visible = false;
}
} }
} }
+10 -10
View File
@@ -120,16 +120,16 @@
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" /> <assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<data name="pictureBox4.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> <data name="pictureBox4.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value> <value>
iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAAXNSR0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AtSe83z8lpLoiu3efq6DQI+XbqwHYK1Xuc2dqJnN2dWgmlj/6a6RBYA9JzV3kiAkhwCy fPyWkuiK7d5+roNAj5durAdgrVe5zZ2omc3Z1aCaWP/prpEFgD0nNXeSICSHALKaOxGEcDd7DgDoJdfK
mjsRhHA3ew4A6CXXypZ027sOPgLfJxqj4QsnOeYdyIJAXvupjTkKgJwCgb1myMQ4GoAcA0F7pFzZ1fYP lnTbuw4+At8nGqPhCyc55h3IgkBe+6mNOQqAnAKBvWbIxDgagBwDQXukXNnV9g9jjBoLjmDoxgAAAABJ
Y4waC45g6MYAAAAASUVORK5CYII= RU5ErkJggg==
</value> </value>
</data> </data>
<assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" /> <assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />