Yes it's messy. I am not finished cleaning it up yet.
I am still new to the syntax of FooBar and Python, sorry I'll try to do better in the future.
This snippet took me about 4 hours, I don't know if that is sad or not, but it was about twice as long with worse results.
I now appreciate much more the optimization process coders go through, and also see firsthand how the benefits are enormous.
Like most code it is forever a work in progress and optimizing.
For example I have an equation that should be simple, however I have been working on it for 4 hours and have managed to reduce it to 3 or 4 variable puts and gets but I still have the math wrong.
But, when I started it was a lot longer and a lot more variable puts. Les Sigh. That snippet is going to be posted after this one.
If you have any questions let me know and I will try to get back to you ASAP.
This script provides some of the file essentials and relevant current playback data of the currently playing song in Foobar using the foo_textdisplay component (see Line 12 for Download Link).
There are no other dependencies to use this script other than foo_playcount to retrieve the count and date data variables. See Line 11 For Download Link.
See the indicated URL posted along with this snippet for an example of FLAC output and MP3/VBR Output with this code, use the built in formatting for color and alignment at this time.
- If you like the status bar I will have that in a snippet as well just search my snips!
- [Last Played: '['$date(%last_played%)']' Total: %play_count%]$crlf()
- [$info(channel_mode)'CH - ']%channels%[' In '$info(MP3_STEREO_MODE)]$crlf()
- [%samplerate% Hz |][$info(bitspersample)-Bit|] %filesize_natural%$crlf()
- [$info(encoding)][' | '$info(codec)[' | '$info(codec_profile)]][ '|' $info(bitrate) Kpbs$crlf()]
- [Encoder: [$left(%__tool%,23)' '$crlf()]]
- [Tags: %__tagtype%$crlf()]
- $crlf()$tab()'Remaining: '%playback_time_remaining%$crlf()//adjust align by adding spaces between single quotes on each of next lines
- $tab()'Position: '%playback_time%$tab()$crlf()//adjust align by adding spaces
- $tab()'Total: ' %length%)$crlf()]
CommentsSubscribe to comments
You need to login to post a comment.