INTERACT FORUM
Windows => JRiver Media Center 33 for Windows => Topic started by: smart on January 02, 2025, 07:15:03 pm
-
Next Track Time function, please add
(https://i124.fastpic.org/big/2025/0103/4d/4a311f326b3784d05173658dee6f374d.jpg)
-
This can be done with PlaylistTime() function:
https://wiki.jriver.com/index.php/Date_and_Time_Functions#PlaylistTime
https://yabb.jriver.com/interact/index.php/topic,129172.msg896419.html#msg896419
https://yabb.jriver.com/interact/index.php/topic,133477.0.html
-
not added
formatdate(math(PlaylistTime(0,0) + replace(now(), /,, .)), H:mm:s)
-
That's because Now() and FormatDate() work with "number of days since 1900", but PlaylistTime() returns values in milliseconds. A conversion is needed:
formatdate(math(PlaylistTime(0,0)/86400000 + replace(now(), /,, .)), HH:mm:ss)
This however doesn't really work well as the timestamps keep advancing while the current track is playing. This is because PlaylistTime() doesn't take into consideration the current track elapsed time. A Feature request is needed, perhaps a new mode for PlaylistTime().
-
@Matt
It looks like a new PlaylistTime() mode is needed to estimate a track start time on a playlist. This needs to take into consideration the current playback position on the current track.
I see 2 ways to do this:
1. Add a mode 5 that returns the current position (total elapsed time) on the playlist. This would be the sum of all previous playlist entries, plus the current track play position.
2. Add a mode 5 (or 6) that returns the track start time relative to the current play position. This would be negative for all tracks up to (and including) the currently playing track, and positive for the subsequent tracks.
I also added a couple of related feature requests.
-
A Feature request is needed, perhaps a new mode for PlaylistTime().
Yes, you're right
-
maybe
PlaylistTime + fix (record) the first track start time
-
All we have today is the set of files in the current view and the selected file number. We're not tracking the actual "playback track". This makes adding modes that return the current play position tricky. I sort of think a discrete expression function should be used for that. Thanks.
-
I sort of think a discrete expression function should be used for that.
It won't be possible to calculate the next track starting time without knowing how long the current track still has to play.
-
need a new function
record the playback time of the first track in the playlist
FirstTrackTime() + PlaylistTime()
-
need a new function
record the playback time of the first track in the playlist
FirstTrackTime() + PlaylistTime()
Predictions of the future based on FirstTrackTime (or any Start time for that matter) will be inaccurate if playback has been paused and then continued. You need to calculate estimated times forward from current moment, assuming no interruptions in the future. That requires durations of the remaining tracks and position (hence remaining time) in currently playing (or paused) track, as zybex succinctly pointed out. Since MC displays live position in the Playerbar Position Slider, one might think that piece could be made available. But you also need to know which track is currently playing in order to calculate remaining time of currently playing track (if not available directly from Position Slider) and current position in the Playlist. Matt suggested a separate function to identify currently playing (or paused :) ) track, which might be generally useful. It could then be called internally as well by the function which the OP requested.
-
You need to calculate estimated times forward from current moment, assuming no interruptions in the future. That requires durations of the remaining tracks and position (hence remaining time) in currently playing (or paused) track, as zybex succinctly pointed out.
Yes, you're right
-
Hello, is the solution still not found?