Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Seeking #12

Open
danielwerg opened this issue Jan 13, 2025 · 16 comments
Open

Seeking #12

danielwerg opened this issue Jan 13, 2025 · 16 comments
Assignees
Labels
enhancement New feature or request partially fixed Partially done or fixed

Comments

@danielwerg
Copy link
Contributor

2025-01-13_15-55-15.mp4
@qxb3
Copy link
Owner

qxb3 commented Jan 13, 2025

Can you clarify? Do you mean that you can click on the progress bar to control the player progress?

@danielwerg
Copy link
Contributor Author

yep

@qxb3 qxb3 self-assigned this Jan 13, 2025
@qxb3 qxb3 added the enhancement New feature or request label Jan 13, 2025
@qxb3
Copy link
Owner

qxb3 commented Jan 20, 2025

Added forward() and backward() actions on #33 for now.

Having skill issues finding a way to do it on progress bar using mouse

@qxb3 qxb3 added the partially fixed Partially done or fixed label Jan 20, 2025
@danielwerg
Copy link
Contributor Author

Just updated to 0.6.1 and tried #33, works well but found these small issues:

  1. Incorrect error message when no ms provided with backward() or forward() actions:
Error: "Failed to parse config: Unknown action: backward() at line 10 column 24"
  1. Player progress doesn't update on backward(), works fine with forward()

@danielwerg
Copy link
Contributor Author

danielwerg commented Jan 22, 2025

Also would be nice to have an action to set progress to 0 or any other absolute value, for now really high value could be used (ex: backward(86400000) 24h), maybe accept -1 for this case?.

@qxb3
Copy link
Owner

qxb3 commented Jan 22, 2025

Player progress doesn't update on backward(), works fine with forward()

doesn't update or just have a delay on it?

@qxb3
Copy link
Owner

qxb3 commented Jan 22, 2025

I maked it so it will immediately redraw when the action is triggered

@qxb3
Copy link
Owner

qxb3 commented Jan 22, 2025

Now it supports for -1 values for both forward() and backward().

if -1 used in forward(-1) it will go to the end of the track.
if -1 used in backward(-1) it will go to the start of the track.

@danielwerg
Copy link
Contributor Author

backward() still lags behind one step in UI, ncmpcpp doesn't have this issue.

watch -n1 -t playerctl metadata --format "{{position}}" at the bottom

2025-01-23_09-04-25.mp4

@qxb3
Copy link
Owner

qxb3 commented Jan 23, 2025

I actually have no clue what is going on. it might be a problem on mpris-rs itself. both forward() and backward() actions has similar implementation code:

            Action::Forward(offset)     => if_player!(&fum.player, |player: &Player| {
                fum.redraw = true;

                if let Some(track_id) = &fum.meta.track_id {
                    match offset {
                        -1  => return player.set_position(track_id.clone(), &fum.meta.length),
                        _   => return player.seek_forwards(&Duration::from_millis(*offset as u64))
                    }
                }

                unreachable!()
            }),
            Action::Backward(offset)     => if_player!(&fum.player, |player: &Player| {
                fum.redraw = true;

                if let Some(track_id) = &fum.meta.track_id {
                    match offset {
                        -1  => return player.set_position(track_id.clone(), &Duration::from_secs(0)),
                        _   => return player.seek_backwards(&Duration::from_millis(*offset as u64))
                    }
                }

                unreachable!()
            })

@qxb3
Copy link
Owner

qxb3 commented Jan 23, 2025

I also notice a slight delay when i manually manipulate spotify, if i go forwards thru the track the ui updates pretty fast, when going back there is a slight delay.

2025-01-23_19-19-35.mp4

@danielwerg
Copy link
Contributor Author

playerctl position 5- doesn't update fum UI at all, while 5+ works as expected with no delay.

I never had big delay issues with fum+mpd.

@qxb3
Copy link
Owner

qxb3 commented Jan 23, 2025

what player are currently using to test this?

also doing playerctl position 5+/5- doesnt even do anything on spotify itself not fum, the hell is going on. EDIT: altdesktop/playerctl#156

@danielwerg
Copy link
Contributor Author

mpd

@qxb3
Copy link
Owner

qxb3 commented Jan 23, 2025

There is a couple of things might be happening in here:

Either:

  1. Thats just how mpris works seeing as both mpd and spotify has the same problem.
  2. Thats just how specific media players implement seeking operations there might be some internal things that is going on with the player when seeking backward causing the delay but probably not as you said ncmpcpp doesnt have this?.
  3. I am a dumbass and just overlooked something

for now i will try the solution of instead of using the seek function mpris provides i will use the set_progress

@qxb3
Copy link
Owner

qxb3 commented Jan 23, 2025

Tried, same issue. Fast updating when going forward, slight delay when going backward.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request partially fixed Partially done or fixed
Projects
None yet
Development

No branches or pull requests

2 participants