mainform: playback: Move song track position to mouse position on click
Allows for smoother track seeking when the song is paused. For now, we keep the current behavior of disabling all track seeking while the song is playing.
This commit is contained in:
Generated
+1
@@ -753,6 +753,7 @@
|
||||
this.songTrackBar.TabIndex = 2;
|
||||
this.songTrackBar.TickStyle = System.Windows.Forms.TickStyle.None;
|
||||
this.songTrackBar.ValueChanged += new System.EventHandler(this.songTrackBar_ValueChanged);
|
||||
this.songTrackBar.MouseDown += new System.Windows.Forms.MouseEventHandler(this.songTrackBar_MouseDown);
|
||||
//
|
||||
// selectSongButton
|
||||
//
|
||||
|
||||
@@ -1976,5 +1976,12 @@ namespace BAKKA_Editor
|
||||
File.Delete(file);
|
||||
}
|
||||
}
|
||||
|
||||
private void songTrackBar_MouseDown(object sender, MouseEventArgs e)
|
||||
{
|
||||
float val = ((float)e.Location.X / (float)songTrackBar.Width) *
|
||||
(songTrackBar.Maximum - songTrackBar.Minimum);
|
||||
songTrackBar.Value = (int)val;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user