Showing song length and elapsed time in notification#24
Open
Poroing wants to merge 10 commits intoeworm-de:mainfrom
Open
Showing song length and elapsed time in notification#24Poroing wants to merge 10 commits intoeworm-de:mainfrom
Poroing wants to merge 10 commits intoeworm-de:mainfrom
Conversation
added 10 commits
August 11, 2018 15:27
…ent song in the notification
Author
|
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? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
mainfunction 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 asmusic_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.