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

Showing song length and elapsed time in notification #24

Open
wants to merge 10 commits into
base: main
Choose a base branch
from

Conversation

Poroing
Copy link

@Poroing Poroing commented Aug 26, 2018

I wanted to know easily the length and the elapsed time of the song I am currently listening to. Therefore I modified the code to show the length of the song when mpd state changed and to show elapsed time and length of the song when the signal SIGHUP is sent to mpd-notification.

The information on the length and elapsed time of the song is not shown by default. It can be activated in the configuration file with show-time = true.

Since the notification object was not updated when a signal was sent to mpd-notification, I factorized out of the main function the update of the notification object and called the newly created function from the signal handler. This way, the correct elapsed time is shown when a signal is sent to the process. Some variable, such as music_dir, were made global to make them accessible from the function that update the notification.

If something must be changed in my code, I will gladly modify it.

@Poroing
Copy link
Author

Poroing commented Apr 19, 2020

I've made the pull request ready for merge in the base branch again.

@eworm-de I hope you can go over it and tell me what needs to be changed or what you don't like about the change. Would you like me to change the README.md in the pull request to let the user know about this change?

@eworm-de eworm-de changed the base branch from master to main January 1, 2024 21:46
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.

1 participant