Although I found another thread related to this at:
https://forum.videolan.org/viewtopic.ph ... ky#p209654
Didn't really accomplish anything so I thought I open a new discussion on the topic. I'm about to throw out both XMMS2 on linux and Winamp on windows and switch to VLC for both music and video playing.
My current XMMS2 Conky setup looks like this:
I would like to accomplish the same thing with VLC, preferably through socket communication since I use the RC interface for controlling VLC with a remote. The problem is that this RC interface does not support multiple clients so if conky would try to keep polling it through the tcp socket that would just yield that I can't control it with my remote.
I will share my findings and I looking to post a final solution later. If anybody interested to work with me on this just leave your suggestions/ideas here in this thread.
---
My current XMMS2 conky config looks like:
TEXT
${color1}${font :bold}Music${font}${color2} (${xmms2_status})
$xmms2_title
$xmms2_artist / $alignr$xmms2_album
${xmms2_bar 5}
$xmms2_percent%$alignr$xmms2_elapsed/$xmms2_duration
I would like to get the same out of VLC. Here is what I found out so far:
xmms2_status (playing/stopped) -
VLC equivalent: have to be extracted from status command
Type 'menu select' or 'pause' to continue. (Means Paused)
status change: ( new input: file: (Means it's playing something)
If there is none of the 2 that means stopped.
Alternatively:
| is_playing . . . . 1 if a stream plays, 0 otherwise
xmms2_title - VLC equivalent: get_title
xmms2_artist/xmms2_album - VLC equivalent: None, have to extract the info from the X window list:
xlsclients -l | grep "VLC media player" | cut -c -9 --complement | sed 's/ - VLC media player/\x08/'
The artist and the album are - separated. It can be cut apart with awk but this solution is not foolproof. If any has dash in their names for example:
Oasis - Soundtrack - (Full - Album) - Tangerine Dre - am
It will break.
xmms2_bar - VLC equivalent: If the "show stream position" option is set in the config vlc will echo the status change periodically like:
status change: ( time: 121s )
status change: ( time: 275s )
status change: ( time: 394s )
xmms2_percent/xmms2_elapsed/xmms2_duration - VLC equivalent:
get_length gives back the full length
Another alternative source would be to harvest information is the HTTP interface. By following this tutorial:
http://www.home.no/inf3rn0/NowPlaying/
It should give back:
=== DATA ===
ARTIST: %artist
ALBUM: %album
TITLE: %title
GENRE: %genre
DATE: %date
CODEC: %codec
LANGUAGE: %language
TYPE: %type
CHANNELS: %channels
SAMPLE RATE: %sampleRate
BITRATE: %bitrate
PERCENTAGE PLAYED: %percent
FILENAME: %filename
ELAPSED HOURS: %elapsedH
ELAPSED MINUTES: %elapsedM
ELAPSED SECONDS: %elapsedS
TOTAL TIME: %length
TRACK NR: %trackNr
ENCODED BY: %encoder
COPYRIGHT: %copyright
ORIGINAL ARTIST: %originalArtist
COMPOSER: %composer
DURATION: %duration
But this does not work anymore, the web interface have completely changed (at the time of writing I use VLC media player 2.0.3 Twoflower).
They moved forward jquery based interface so with curl/lynx you cannot even dump the page anymore.
Code: Select all
<div id="seekContainer">
<div id="seekSlider" title="<?vlc gettext("Seek Time") ?>"></div>
<div id="currentTime" class="dynamic">00:00:00</div>
<div id="totalTime" class="dynamic">00:00:00</div>
</div>