Skip to content
This repository has been archived by the owner on Jul 14, 2018. It is now read-only.

Commit

Permalink
music trackOver offset bug [fixed]
Browse files Browse the repository at this point in the history
  • Loading branch information
HaCk3Dq committed Apr 26, 2016
1 parent 5c24708 commit 92696a9
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
1 change: 1 addition & 0 deletions source/app.d
Original file line number Diff line number Diff line change
Expand Up @@ -935,6 +935,7 @@ ListElement[] setCurrentTrack() {
else {
mplayer.userSelectTrack = true;
mplayer.play(win.active-5);
mplayer.trackNum += 5;
}
}
mplayer.offset = win.scrollOffset;
Expand Down
8 changes: 4 additions & 4 deletions source/musicplayer.d
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ class MusicPlayer : Thread {
dbm("catched trackOver");
trackOverStateCatched = true;
++trackNum;
auto track = api.getBufferedMusic(1, trackNum)[0];
auto track = api.getBufferedMusic(1, trackNum-5)[0];
currentTrack.artist = track.artist;
send("loadfile " ~ prepareTrackurl(track.url));
currentTrack = Track(track.artist, track.title, track.duration_str);
Expand All @@ -153,9 +153,9 @@ class MusicPlayer : Thread {
auto artistrepl = fcols/2-currentTrack.artist.utfLength/2;
auto titlerepl = fcols/2-currentTrack.title.utfLength/2;

if(fcols < 1) fcols = cols;
if(artistrepl < 1) artistrepl = 1;
if(titlerepl < 1) titlerepl = 1;
if (fcols < 1) fcols = cols;
if (artistrepl < 1) artistrepl = 1;
if (titlerepl < 1) titlerepl = 1;

playerUI ~= ListElement(" ".replicate(artistrepl)~currentTrack.artist);
playerUI ~= ListElement(" ".replicate(titlerepl)~currentTrack.title);
Expand Down

0 comments on commit 92696a9

Please sign in to comment.