Resume MOC with the current file selected

Hello everybody,

Is there a way to automate the `G` shortcut when resuming MOC. Here is a scenario where I want this behavior:

- I start MOC
- I play a random file
- I enable Shuffle
- I play the next (random) file
- I press `G` to go to that file
- I press `q` to quit the MOC interface (MOC is still running in the background)
- I relaunch MOC using the `mocp` command

At that point, I want MOC to be on the file that is currently playing, so that I don't have to press `G`.
It's a bit annoying to press `G` everytime I resume MOC...

If that feature/config is not available, it would definitely be nice to have it!

Thanks

Aziz Light

I had already identified the need for a more general option (as yet unnamed) which would have the cursor follow the currently playing file. I think that would do what you want, wouldn't it?

I still have to consider what should happen if the cursor is manually moved off the currently playing file and then the current file ends and a new one begins. That could give rise to more options and/or commands, but I don't really want that. Any ideas?

A good compromise would be to "remember" the cursor position. So that when you send MOC to the background, and then come back, the cursor would be in the same position.

What if there are multiple clients being started and stopped?

I know that I have to introduce a cross-session persistance mechanism to support some upcoming functionality, but some design work is still required on that.

But the question remains, how would MOC know whether you wanted the last displayed cursor position (your compromise) or the position of the currently playing file (your original request)?

I was thinking that a configuration variable would do the trick. On how you can implement this: Maybe you can create a file that tracks the cursor position and read that file when MOC is resumed.

I can see a lot of problems with that approach.

Let's just say that there are features in the pipeline which will allow you to make these sorts of customisations, but we need to get MOC 2.5.0 out first then put some mechanisms in place to support those upcoming features... and it all takes time.

Hi, I'm playing with moc again and was looking for an option that makes my cursor follow the playing file over a shuffled playlist that exceeds console dimensions. So I found this thread.
Reading the thread, my perfect solution would be to disable jumping whenever i am actually browsing my files, so, say 10 seconds after the last movement, I'd like the cursor to follow my jumping playlist.
As I have absolutely no knowledge of coding etc., I don't know whether thats a feasible approach. Just a thought.

Cheers,

kotzenhuber