From: Markus S. <fu...@fr...> - 2009-07-23 18:11:30
|
Hello lcd4linux-list, is it possible to define status icons at a identical defined place which switch depending on a status? In this case i have a mpd (music player daemon) running and want to show play/pause/stop. For each condition i have defined a icon. But how to show the different icons always at the same place on the display? (on different places at the display it's running), Currently there is shown: >: playing =: pause /: stop How to bind the icons to following expression? # # display playerstate (play, pause, stop, unknown) # Widget mpd-playerstatus { class 'Text' expression (mpd::getStateInt() == 1 ? '>' : '').(mpd::getStateInt() == 2 ? '=' : '').(mpd::getStateInt() == 3 ? '/' : '').(mpd::getStateInt() == 0 ? '?' : '') width 1 align 'L' update tick } Widget mpd-play{ class 'icon' bitmap { row1 '......' row2 '***...' row3 '****..' row4 '*****.' row5 '******' row6 '*****.' row7 '****..' row8 '***...' } visible ( mpd::getStateInt() == 1 ) } Widget mpd-pause { class 'icon' speed 800 update 800 bitmap { row1 '.....|.....' row2 '**.**|.....' row3 '**.**|.....' row4 '**.**|.....' row5 '**.**|.....' row6 '**.**|.....' row7 '**.**|.....' row8 '.....|.....' } visible ( mpd::getStateInt() == 2 ) } Widget mpd-stop { class 'icon' bitmap { row1 '......' row2 '......' row3 '.****.' row4 '.****.' row5 '.****.' row6 '.****.' row7 '.****.' row8 '......' } visible ( mpd::getStateInt() == 3 ) } Best regards Fux |
From: Michael R. <mi...@re...> - 2009-07-25 05:38:07
|
you could create one single "animated" icon with all three images in it, and further select the correct frame with a (new) parameter. Unfortunately I forgot how the parameter is called... but it should be documented in the wiki Markus S. schrieb: > Hello lcd4linux-list, > > is it possible to define status icons at a identical defined place which > switch depending on a status? In this case i have a mpd (music player > daemon) running and want to show play/pause/stop. For each condition i > have defined a icon. But how to show the different icons always at the > same place on the display? (on different places at the display it's > running), > > Currently there is shown: >>: playing > =: pause > /: stop > How to bind the icons to following expression? > > # > # display playerstate (play, pause, stop, unknown) > # > Widget mpd-playerstatus { > class 'Text' > expression (mpd::getStateInt() == 1 ? '>' : '').(mpd::getStateInt() > == 2 ? '=' : '').(mpd::getStateInt() == 3 ? '/' : > '').(mpd::getStateInt() == 0 ? '?' : '') > width 1 > align 'L' > update tick > } > > > Widget mpd-play{ > class 'icon' > bitmap { > row1 '......' > row2 '***...' > row3 '****..' > row4 '*****.' > row5 '******' > row6 '*****.' > row7 '****..' > row8 '***...' > } > visible ( mpd::getStateInt() == 1 ) > } > > Widget mpd-pause { > class 'icon' > speed 800 > update 800 > bitmap { > row1 '.....|.....' > row2 '**.**|.....' > row3 '**.**|.....' > row4 '**.**|.....' > row5 '**.**|.....' > row6 '**.**|.....' > row7 '**.**|.....' > row8 '.....|.....' > } > visible ( mpd::getStateInt() == 2 ) > } > > Widget mpd-stop { > class 'icon' > bitmap { > row1 '......' > row2 '......' > row3 '.****.' > row4 '.****.' > row5 '.****.' > row6 '.****.' > row7 '.****.' > row8 '......' > } > visible ( mpd::getStateInt() == 3 ) > } > > > Best regards > Fux > > > > ------------------------------------------------------------------------ > > ------------------------------------------------------------------------------ > > > ------------------------------------------------------------------------ > > _______________________________________________ > Lcd4linux-users mailing list > Lcd...@li... > https://lists.sourceforge.net/lists/listinfo/lcd4linux-users -- Michael Reinelt <mi...@re...> http://home.pages.at/reinelt GPG-Key 0xDF13BA50 ICQ #288386781 |
From: Fux <fu...@fr...> - 2009-07-25 11:40:08
|
Hello Michael, thanks for hint. Works fine with this config: Widget mpd-state { class 'Icon' speed 100 update 100 bitmap { row1 '......|......|.......|......' row2 '......|.*....|.......|......' row3 '......|.**...|.**..**|.*****' row4 '......|.***..|.**..**|.*****' row5 '......|.****.|.**..**|.*****' row6 '......|.***..|.**..**|.*****' row7 '......|.**...|.**..**|.*****' row8 '......|.*....|.......|......' } frame (mpd::getStateInt()) # blinking in pause state else static visible visible (mpd::getStateInt()==2 ? (test::onoff(0)) : '1') } Best regards Fux Am Samstag, den 25.07.2009, 07:05 +0200 schrieb Michael Reinelt: > you could create one single "animated" icon with all three images in it, and further select the correct frame with a > (new) parameter. Unfortunately I forgot how the parameter is called... but it should be documented in the wiki > > > Markus S. schrieb: > > Hello lcd4linux-list, > > > > is it possible to define status icons at a identical defined place which > > switch depending on a status? In this case i have a mpd (music player > > daemon) running and want to show play/pause/stop. For each condition i > > have defined a icon. But how to show the different icons always at the > > same place on the display? (on different places at the display it's > > running), > > > > Currently there is shown: > >>: playing > > =: pause > > /: stop > > How to bind the icons to following expression? > > > > # > > # display playerstate (play, pause, stop, unknown) > > # > > Widget mpd-playerstatus { > > class 'Text' > > expression (mpd::getStateInt() == 1 ? '>' : '').(mpd::getStateInt() > > == 2 ? '=' : '').(mpd::getStateInt() == 3 ? '/' : > > '').(mpd::getStateInt() == 0 ? '?' : '') > > width 1 > > align 'L' > > update tick > > } > > > > > > Widget mpd-play{ > > class 'icon' > > bitmap { > > row1 '......' > > row2 '***...' > > row3 '****..' > > row4 '*****.' > > row5 '******' > > row6 '*****.' > > row7 '****..' > > row8 '***...' > > } > > visible ( mpd::getStateInt() == 1 ) > > } > > > > Widget mpd-pause { > > class 'icon' > > speed 800 > > update 800 > > bitmap { > > row1 '.....|.....' > > row2 '**.**|.....' > > row3 '**.**|.....' > > row4 '**.**|.....' > > row5 '**.**|.....' > > row6 '**.**|.....' > > row7 '**.**|.....' > > row8 '.....|.....' > > } > > visible ( mpd::getStateInt() == 2 ) > > } > > > > Widget mpd-stop { > > class 'icon' > > bitmap { > > row1 '......' > > row2 '......' > > row3 '.****.' > > row4 '.****.' > > row5 '.****.' > > row6 '.****.' > > row7 '.****.' > > row8 '......' > > } > > visible ( mpd::getStateInt() == 3 ) > > } > > > > > > Best regards > > Fux > > > > > > > > ------------------------------------------------------------------------ > > > > ------------------------------------------------------------------------------ > > > > > > ------------------------------------------------------------------------ > > > > _______________________________________________ > > Lcd4linux-users mailing list > > Lcd...@li... > > https://lists.sourceforge.net/lists/listinfo/lcd4linux-users > |