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

Remember volume across multiple songs #720

Merged
merged 3 commits into from Dec 9, 2017

Conversation

tommysolsen
Copy link
Member

I figured we should find a more consistent way of dealing with volume changes across different songs.
Since we use the volume when we draw the player, I've started storing that in a global variable and
use that value to set the player volume between songs.

I've only tested and implemented this for mpv and will implement this for mplayer as well.

Improvements & Testing

What other things should we do to make this a robust feature? Hopefully without adding much complexity for the user. There are some questions that I would like to raise and discuss.

  • Does there need to be setting to turn this feature on or off?
  • Should the volume level persist between sessions?
  • Should we expose the variable to the playerargs function?
  • Are there generic ways to get the volume of non supported players?

If anyone has some ideas regarding how this functionality should work feel free to raise them as well.

@ids1024
Copy link
Contributor

ids1024 commented Nov 12, 2017

This is probably a good idea.

Are there generic ways to get the volume of non supported players?

Not really; nor would there be a generic way to set the volume.

@tommysolsen
Copy link
Member Author

tommysolsen commented Nov 13, 2017

On my setup, mplayer would remember volume by itself.
I've added the code to control it via mpsyt anyways, in case this is some kind of version specific setting etc.

generic ways to get the volume

It might be too "hacky", but we could potentially use windows built in volume mixer to get/set the volume, and just bypass the in client volume selector altogether, but it would be pretty hard to reliably have the same functionality on Linux, and I wouldn't know about OS X.

@tommysolsen tommysolsen changed the title Remember volume across multiple songs [WIP] Remember volume across multiple songs Nov 14, 2017
if softrepeat:
util.list_update("--loop-file", args)

elif "vlc" in config.PLAYER.get:
util.list_update("--play-and-exit", args)

print("args: " + str(config.PLAYER.get) + str(args) + str(stream['url']))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There probably shouldn't be a print here.

Signed-off-by: Tommy Stigen Olsen <tommysolsen@gmail.com>
Volume control for mplayer

Signed-off-by: Tommy Stigen Olsen <tommysolsen@gmail.com>
Signed-off-by: Tommy Stigen Olsen <tommysolsen@gmail.com>
@ids1024 ids1024 merged commit 7b24d6e into mps-youtube:develop Dec 9, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants