System.Volume - Trigger up-down

If you have a question or need help, this is the place to be.
Post Reply
MaxMan23
Posts: 19
Joined: Sat Jun 29, 2013 4:36 am

System.Volume - Trigger up-down

Post by MaxMan23 » Sun Dec 07, 2014 6:51 am

Hi,

is there a way to trigger System.Volume changes into up and down?
Sample for up:
07:35:17 System.Volume '78.05'
07:35:17 System.Volume '81.17'
07:35:17 System.Volume '84.29'
07:35:17 System.Volume '87.42'
07:35:17 System.Volume '90.54'
07:35:17 System.Volume '93.66'
07:35:18 System.Volume '96.79'
07:35:18 System.Volume '99.91'
07:35:18 System.Volume '100.00'

Is there a way to regognize the volume up changes? (like trigger: system.volume.up - but this does not work)

User avatar
Pako
Plugin Developer
Posts: 2294
Joined: Sat Nov 11, 2006 1:31 pm
Location: Czech Republic
Contact:

Re: System.Volume - Trigger up-down

Post by Pako » Sun Dec 07, 2014 7:09 am

MaxMan23 wrote:is there a way to trigger System.Volume changes into up and down?
I'm sure the answer is yes.
However, I do not understand your question.
Can you please explain? What is your intention?
Have you tried System.ChangeMasterVolume action with a positive/negative sign?

Pako

leothlon
Experienced User
Posts: 59
Joined: Tue Dec 17, 2013 6:29 pm

Re: System.Volume - Trigger up-down

Post by leothlon » Wed Dec 10, 2014 10:03 am

if i understand you want to check if the volume was turned down or up when it changes, and currently you only get the new volume value in payload?

you can do it with a script:

if eg.globals.volumeLevel > {eg.event.payload}
eg.TriggerEvent("system.volume.down", "volume turned down from + " eg.globals.volumeLevel + " to " + " {eg.event.payload})
else
eg.TriggerEvent("system.volume.up", "volume turned up from + " eg.globals.volumeLevel + " to " + " {eg.event.payload})

eg.globals.volumeLevel = {eg.event.payload}


now i'm not good at python so the above script will most likly not work as it is but it should give an idea about how to do it...
doing like that will take the old value (saved in variable) and check if it is higher or lower than the new value, depending on that it will trigger the corresponding event and also give some nice information about old and new value in the payload...
and then lastly it updates the volume level to your new volume so it can perform the same action again next time

Post Reply