Hey guys, I have hard time configuring the autorepeat function just right.
Currently I am using (among many other commands) this Macro:
(Macro)Volume +
>(Event)Egon.001000 (Ir receiver - Event fires when receiving Volume+ Code)
>(Action)Serial Port Write Data (Sends Ir code to TV so it knows it has to increase Volume - this actually only shows volume bar on TV, because I have TV speakers muted)
>(Action)Wait 0.05s (TV 232 interface is kinda slow)
>(Action)Serial Port Write Data (Sends TV a query asking what is the current volume - TV answers via Event TV.f 01 OKxx, where xx is current volume)
I also have 26 Macros for each volume level:
(Macro)Set Volume xx
>(Event)TV.f 01 OKxx
>(Action)Set Master Volume to xx%
So basically I send IR command to TV via 232, TV responds with "OK, the volume is set to xx" and displays volume level on screen. This response Event fires a Macro which increases system volume in PC (this PC is connected to amplifier, which has no remote volume control).
But I have to press Volume+ (or Volume-) button on remote many times to raise/lower the volume level. Using the Autorepeat function works, but it repeats the Volume+ macro for time the button is pressed and sends commands to TV. After releasing the button, I get many Events from TV and then they are processed - let's say 10 Set Volume Macros are fired consecutively.
Is there a possibility to stop queing the Events, so they don't fire after the button is released? I simply want the EventGhost to check after each autorepeat if there is new Event present and fire corresponding macro with it.
I hope I described my situation clearly, as my English language is not as good.
Thanks for any reply, I would really appreciate any suggestions.
Notice: This forum has been recovered from an old backup, so some content, links, and dates may be outdated. The forum is currently read-only while we restore sign-in and registration functionality. Details
If you find this forum valuable and would like to help keep it online, donations to help cover hosting and domain costs are greatly appreciated, but never expected. You can support the forum through Buy Me a Coffee or Ko-fi. Thank you for helping preserve the EventGhost community.
If you find this forum valuable and would like to help keep it online, donations to help cover hosting and domain costs are greatly appreciated, but never expected. You can support the forum through Buy Me a Coffee or Ko-fi. Thank you for helping preserve the EventGhost community.
Immediate event firing when autorepeating
- kgschlosser
- Site Admin
- Posts: 5190
- Joined: Fri Jun 05, 2015 5:43 am
- Location: Rocky Mountains, Colorado USA
Re: Immediate event firing when autorepeating
ok, here goes,
i will give you the very simple version
when something is running like a script or a plugin is processing unless the plugin or script has been coded to add threads what happens is.
just because you stopped pressing the button doesn't mean that an event hasn't fired.
you just haven't seen it yet because the EG system was busy.
so there is a Que if you will of all the events that haven't fired yet.
ecample. since you are using that wait.05
that stalls the system for .05 seconds, now if you manage to fire off 2 remote codes in that time. the 2nd code gets stored and when that .05 passes then it fires
so what i would do after all of those .05's is add a Clear Pending Events
that will remove those buggers that are in the Que.
this feature is also handy for say like a projector when it's turning on and your waiting for a reply form it.
they can take up to a minute. and if you get some happy ding dong with your remote and doesn't know any better they would start massing all kinds of buttons..
and once the projector fires up your system would go bananas
there are lots of things that slow down the event process..
like excessive jumping about..
or misplaced items in the tree hierarchy
the closer you place a macro to the base of the tree the faster it will be
example
you have 4 actions fired form the same event.
now you can do some jumping about with the jump feature.
or you can place the same event in multiple macros
now from my understanding of how EG works (never tested it)
if you have something like this
from my understanding the macro closest to the base will fire it's action first.
and i am sure if scans the tree from the top down or some sorts like that.
possibly alphabetical
i would have to go and read the code to find out
now are you using the serial port plugin or a specific plugin designed for your device???
i will give you the very simple version
when something is running like a script or a plugin is processing unless the plugin or script has been coded to add threads what happens is.
just because you stopped pressing the button doesn't mean that an event hasn't fired.
you just haven't seen it yet because the EG system was busy.
so there is a Que if you will of all the events that haven't fired yet.
ecample. since you are using that wait.05
that stalls the system for .05 seconds, now if you manage to fire off 2 remote codes in that time. the 2nd code gets stored and when that .05 passes then it fires
so what i would do after all of those .05's is add a Clear Pending Events
that will remove those buggers that are in the Que.
this feature is also handy for say like a projector when it's turning on and your waiting for a reply form it.
they can take up to a minute. and if you get some happy ding dong with your remote and doesn't know any better they would start massing all kinds of buttons..
and once the projector fires up your system would go bananas
there are lots of things that slow down the event process..
like excessive jumping about..
or misplaced items in the tree hierarchy
the closer you place a macro to the base of the tree the faster it will be
example
you have 4 actions fired form the same event.
now you can do some jumping about with the jump feature.
or you can place the same event in multiple macros
now from my understanding of how EG works (never tested it)
if you have something like this
Code: Select all
---base------folder1-----folder2------folder3-----macro1
---base------folder1-----macro2
and i am sure if scans the tree from the top down or some sorts like that.
possibly alphabetical
i would have to go and read the code to find out
now are you using the serial port plugin or a specific plugin designed for your device???
- kgschlosser
- Site Admin
- Posts: 5190
- Joined: Fri Jun 05, 2015 5:43 am
- Location: Rocky Mountains, Colorado USA
Re: Immediate event firing when autorepeating
one other thing, the fastest remote out there spits out ir sequences at 45ms apart and that's a remote that uses the sony12 or sony15 set.
and a lot of remotes will also spit out the code more than once time on a press of the button to make sure it gets where it's going. you the programmer have to account for that.
the other thing you can do if you want something like this to work awesome is do what i did.
i set mine up so that if a remote code came in at more than 75 ms apart and it was the same code it would reduce a delay on firing an event
delay starts at 180ms then goes down in increments of 15 milliseconds until it reaches 0
delay is a bad work. it would close the door on triggering events for remote codes until that 75ms has passed (that takes care of any repeat codes i don't want from accidentally holding the button a hair bit to long or from the remote sending more than one code)
if the code is different it resets the time back to the 180 ms
it's nice because it controls the speed too slowly ramping up or down. idk about you but moving the volume 22 positions a second is an awful lot but very nice to have when ya want it.
ya just don't want it to go out of control (especially on the up)
and a lot of remotes will also spit out the code more than once time on a press of the button to make sure it gets where it's going. you the programmer have to account for that.
the other thing you can do if you want something like this to work awesome is do what i did.
i set mine up so that if a remote code came in at more than 75 ms apart and it was the same code it would reduce a delay on firing an event
delay starts at 180ms then goes down in increments of 15 milliseconds until it reaches 0
delay is a bad work. it would close the door on triggering events for remote codes until that 75ms has passed (that takes care of any repeat codes i don't want from accidentally holding the button a hair bit to long or from the remote sending more than one code)
if the code is different it resets the time back to the 180 ms
it's nice because it controls the speed too slowly ramping up or down. idk about you but moving the volume 22 positions a second is an awful lot but very nice to have when ya want it.
ya just don't want it to go out of control (especially on the up)
