It is currently October 6th, 2024, 1:23 pm

[BUG] NowPlaying bug in handling Position and Progress

Report bugs with the Rainmeter application and suggest features.
User avatar
Yincognito
Rainmeter Sage
Posts: 8358
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

[BUG] NowPlaying bug in handling Position and Progress

Post by Yincognito »

This is more like a question than a report for now, because I'm not sure yet where it comes from, Winamp or NowPlaying. Has anyone encountered this (look at the Position and Progress measure values in the log)? Maybe in other players too?
PositionProgressBug.jpg
This happens for me after I click a simple progress Bar to jump at around 80% to 90% of the duration of the track, and then let the track end and replay (I set my Winamp to repeat the current track). The actual bug occurs for a very short time (a few milliseconds) right when the track ends and before it replays, i.e. between 100% progress and 0% progress of the track. The measures are regular ones like:

Code: Select all

[Status]
Group=PlayerGroup
Measure=NowPlaying
PlayerName=#Player#
PlayerType=Status
RegExpSubstitute=1
Substitute="^0$":"Closed","^1$":"Open"

[State]
Group=PlayerGroup
Measure=NowPlaying
PlayerName=[Status]
PlayerType=State
RegExpSubstitute=1
Substitute="^0$":"Stopped","^1$":"Playing","^2$":"Paused"

[Artist]
Group=PlayerGroup
Measure=NowPlaying
PlayerName=[Status]
PlayerType=Artist
RegExpSubstitute=1
Substitute="^$":"No Artist"

[Album]
Group=PlayerGroup
Measure=NowPlaying
PlayerName=[Status]
PlayerType=Album
RegExpSubstitute=1
Substitute="^$":"No Album"

[Title]
Group=PlayerGroup
Measure=NowPlaying
PlayerName=[Status]
PlayerType=Title
RegExpSubstitute=1
Substitute="^$":"No Title"

[Duration]
Group=PlayerGroup
Measure=NowPlaying
PlayerName=[Status]
PlayerType=Duration

[Position]
Group=PlayerGroup
Measure=NowPlaying
PlayerName=[Status]
PlayerType=Position

[Progress]
Group=PlayerGroup
Measure=NowPlaying
PlayerName=[Status]
PlayerType=Progress
and the progress Bar is wide but nothing out of the ordinary either:

Code: Select all

[ProgressBar]
Meter=Bar
MeasureName=Progress
X=...
Y=...
W=...
H=...
BarColor=...
SolidColor=...
BarOrientation=Horizontal
LeftMouseDownAction=[!CommandMeasure Progress "SetPosition $MouseX:%$"][!UpdateMeasureGroup PlayerGroup][!UpdateMeter *][!Redraw]
DynamicVariables=1
I don't know if it has anything to do with replaying the track, I only mentioned because that's what I do. I use Winamp 5.9.2 Build 10042 (x86) from 26 Apr 2023, if that matters. The bug lasts sufficient time to make a screenshot of it with the PrtSc key if your fingers are quick, and obviously the line where you display the position and progress values suddenly widens for a moment if you look carefully (that's how I noticed the bug, by the way, since that line width became wider than the skin).

EDIT: I also have the Shuffle enabled in the player, in case it might explain the large numbers there.
You do not have the required permissions to view the files attached to this post.
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth
poiru
Developer
Posts: 2873
Joined: April 17th, 2009, 12:18 pm

Re: [BUG] NowPlaying or Winamp bug in reporting Position and Progress

Post by poiru »

This should be fixed in: https://github.com/rainmeter/rainmeter/commit/f5c5487d1d7c9138ad4f763a4996c468b17aee2c

@jsmorley, can you share a dev build for testing?
User avatar
Yincognito
Rainmeter Sage
Posts: 8358
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: [BUG] NowPlaying or Winamp bug in reporting Position and Progress

Post by Yincognito »

Thanks, poiru! :rosegift:
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth
User avatar
jsmorley
Developer
Posts: 22823
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: [BUG] NowPlaying or Winamp bug in reporting Position and Progress

Post by jsmorley »

User avatar
Yincognito
Rainmeter Sage
Posts: 8358
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: [BUG] NowPlaying or Winamp bug in reporting Position and Progress

Post by Yincognito »

jsmorley wrote: August 12th, 2024, 6:18 pm New version with this fix is at:

https://forum.rainmeter.net/viewtopic.php?t=44413#p226341
Thanks! I've been testing the above version for a while and all seems to be fine, the issue didn't occur anymore, despite my efforts. That being said, before trying the version you linked above I also tried to replicate the problem with the version I was using, but without any success (similar code, same tracks, same steps), so one, the other or both apparently fixed the bug. By the way, the bug was already kind of difficult to reproduce before - in some cases, it occured after jumping to something like 98% and letting the track end, in other cases it occured only if jumping earlier at about 85% and letting the track end, for the same track (which is why I could't indicate a precise percent in the OP).

P.S. I posted this here instead of in the link you mentioned so that both you and poiru can see this easily. ;-)
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth
User avatar
Yincognito
Rainmeter Sage
Posts: 8358
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: [BUG] NowPlaying bug in handling Position and Progress

Post by Yincognito »

Alright, I discovered another "bug" in NowPlaying, which I'll post here as well, since I've adjusted the thread's title a bit to cover that: both the absolute and the relative [!CommandMeasure "SetPosition ..."] variants do not (internally) clamp the position percentage between 0 and 100, or, better said, they only clamp it at 0 and not at 100:

Code: Select all

[Variables]
Plugin=NowPlaying
Player=Winamp
ProBarC=0,255,0,255
ProBarS=128,128,128,255
ProBarP=1

[Rainmeter]
Update=1000
AccurateText=1
DynamicWindowSize=1

---Measures---

[Status]
Group=PlayerGroup
Measure=Plugin
Plugin=#Plugin#
PlayerName=#Player#
PlayerType=Status
RegExpSubstitute=1
Substitute="^0$":"Closed","^1$":"Open"
DynamicVariables=1

[State]
Group=PlayerGroup
Measure=Plugin
Plugin=#Plugin#
PlayerName=[Status]
PlayerType=State
RegExpSubstitute=1
Substitute="^0$":"Stopped","^1$":"Playing","^2$":"Paused"
DynamicVariables=1

[Artist]
Group=PlayerGroup
Measure=Plugin
Plugin=#Plugin#
PlayerName=[Status]
PlayerType=Artist
RegExpSubstitute=1
Substitute="^$":"No Artist"
DynamicVariables=1

[Album]
Group=PlayerGroup
Measure=Plugin
Plugin=#Plugin#
PlayerName=[Status]
PlayerType=Album
RegExpSubstitute=1
Substitute="^$":"No Album"
DynamicVariables=1

[Title]
Group=PlayerGroup
Measure=Plugin
Plugin=#Plugin#
PlayerName=[Status]
PlayerType=Title
RegExpSubstitute=1
Substitute="^$":"No Title"
DynamicVariables=1

[Duration]
Group=PlayerGroup
Measure=Plugin
Plugin=#Plugin#
PlayerName=[Status]
PlayerType=Duration
RegExpSubstitute=1
Substitute="(?<!\d)(\d)(?!\d)":"0\1"
DynamicVariables=1

[Position]
Group=PlayerGroup
Measure=Plugin
Plugin=#Plugin#
PlayerName=[Status]
PlayerType=Position
RegExpSubstitute=1
Substitute="(?<!\d)(\d)(?!\d)":"0\1"
DynamicVariables=1

[Progress]
Group=PlayerGroup
Measure=Plugin
Plugin=#Plugin#
PlayerName=[Status]
PlayerType=Progress
DynamicVariables=1

---Meters---

[ProgressBar]
Meter=Bar
X=(0)
Y=(0)
W=(100)
H=(20)
BarColor=#ProBarC#
SolidColor=#ProBarS#
BarOrientation=Horizontal
MeasureName=Progress
MouseScrollUpAction=[!CommandMeasure Progress "SetPosition +#ProBarP#"][!UpdateMeasureGroup PlayerGroup][!UpdateMeter *][!Redraw]
MouseScrollDownAction=[!CommandMeasure Progress "SetPosition -#ProBarP#"][!UpdateMeasureGroup PlayerGroup][!UpdateMeter *][!Redraw]
LeftMouseUpAction=[!CommandMeasure Progress "SetPosition $MouseX:%$"][!UpdateMeasureGroup PlayerGroup][!UpdateMeter *][!Redraw]
MiddleMouseUpAction=[!CommandMeasure Progress "SetPosition 150"][!UpdateMeasureGroup PlayerGroup][!UpdateMeter *][!Redraw]
DynamicVariables=1
Scroll up to see the values of the Progress and Position measures go past the 100 and Duration values when setting the position relatively, middle click to see both go to 150% of the supposed maximum of Progress and Position. Didn't test for other players, just for Winamp:
Relative.jpg
Absolute.jpg
I'm not sure if or how this should be tackled, since it only seems "strange" when the track is paused as you could go on forever past 100%, while when the track is playing, the effect is basically jumping to the 0% of the next track (albeit the measure values still go past the 100% equivalent value for a couple of milliseconds).

This is for the version above in which you guys fixed the previous bug. So, you might want to delay the release a little bit, until this new issue is handled, if that's the case.
You do not have the required permissions to view the files attached to this post.
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth