Need help on GUI update

General discussion about RuneAudio. Do not post any support or feature requests here.

Need help on GUI update

Postby mica » 03 Dec 2017, 00:37

I have attached a 2.4" touchscreen to a RPI2 and want to have some basic control there.
I have added the volume value to my small display via a new element
Code: Select all
<input id="volumevalue" readonly="" style="border:0; font-weight:bold;" type="text">

However, if the volume is changed by a second client, e.g. running on the PC, the volume value on my RPI-display is not updated.
What do I need to do to update the actual volume value on my RPI-display ?
Can somebody give me a hint, how this is done in Rune UI or point me to some files or code which is responsible to do this ?
mica
 
Posts: 2
Joined: 27 Nov 2017, 23:08
Location: Germany

Re: Need help on GUI update

Postby janui » 03 Dec 2017, 12:36

Hi mica,
You are starting something very complex, this is the heart of the Rune UI. If you want to take it further:
    1. Study how the following files work: /var/www/command/rune_SY_wrk and /var/www/command/rune_PL_wrk. These run in the background and carry out all the actions initiated from the user interface and all actions which are needed to refresh the user interface.
    2. The file /srv/http/app/libs/runeaudio.php contains subroutines/functions used by the above files.
    3. Each web page within the Rune UI has two files, one contains the presentation end the other contains the logic. An example is the /dev screen, see for presentation: /srv/http/app/templates/dev.php and for logic: /srv/http/app/dev_ctl.php
    For each Rune UI webpage there are pairs of files in the same directories.
    4. Summary: Actions from the Rune UI are initiated from the /srv/http/app/???_ctl.php files then actioned by /var/www/command/rune_SY_wrk and /var/www/command/rune_PL_wrk.
When modifying these files make sure that the file permissions of the modified files are correct. I find that debugging /var/www/command/rune_SY_wrk and /var/www/command/rune_PL_wrk is very challenging.
janui
User avatar
janui
 
Posts: 682
Joined: 20 Dec 2014, 12:55
Location: Ollanda

Re: Need help on GUI update

Postby hondagx35 » 03 Dec 2017, 13:23

Hi mica.

in addition to januis description:
The backend (MPD) and the frontend (browser) communicate through web sockets see "/srv/httpassets/js/runeui.js".

With such a small screen I wouldn't go the browser route.
I would write a python script and control the backend with the python-mpd2 library.

Frank
User avatar
hondagx35
 
Posts: 3039
Joined: 11 Sep 2014, 22:06
Location: Germany

Re: Need help on GUI update

Postby mica » 03 Dec 2017, 22:40

Thank you both,

I have changed from a Hifiberry DAC to a AMP and there I miss a simple method to change the volume.
This was the reason to add some small display to the RPI to change the volume locally without the PC / Laptop etc.
It is not intended to have the full features of the RuneUI on the small display, as this will make definitely no sense.
The picture gives you an impression on what I am trying to do:
runeaudio_ (1).png
runeaudio_ (1).png (39.2 KiB) Viewed 653 times

However there are further things, which I think of:
- Select one of (up to 6 or so) pre-defined radio stations.
- Select a playlist.
But back to the basics (one step after the other :roll:).
I see that the values are updated by a pushstream method from the server side (thank you Frank for pointing to the right direction). I assume that I need to put some code inside the function updateGUI in runeui.js to update my own volume display.

Michael
mica
 
Posts: 2
Joined: 27 Nov 2017, 23:08
Location: Germany

support RuneAudio Donate with PayPal


Return to General discussion

Who is online

Users browsing this forum: No registered users and 1 guest