Event Ghost: 0.3.6.1242
Windows XP SP2
USB-UIRT
Firefly remote
I have an Sony amp receiver that should be turned on whenever I fire up Winamp on my PC or listen to the radio through the receiver tuner. I am using the Firefly remote and programmed the A button turn on the amp and select the radio on the tuner. I then programmed the B button on the remote to turn on the amp and select video 1 input. Video 1's audio input is connected to the output of the PC, so that Winamp can be played through the amp's connected speakers.
What I have created so far is a Context Folder, called "Receiver", that has the various IR codes needed to turn on/off the receiver and to select the various inputs. Both Firefly.A and Firefly.B events are tied to macro within the context folder "Receiver".
The music button by default fires up Winamp. So within the included "Start Winamp" macro, I enabled a trigger event "Firefly.B", which is an event tied to a macro within the "Receiver" context folder.
Is this the cleanest way to organize macros and have one event trigger another that is located on a separate context folder? What is the proper syntax to call a macro within a context folder? Should trigger event "Firefly.B" be changed to something like "Receiver.Firefly.B" (I am uncertain of the syntax)?
I like organizing various device IR codes within it's own Context folder, I just would like to know is this is the correct approach and everytime an external event occurs, have that event call the various IR codes within the context folder.
CONCERNS:
The concern I have is if the tuner gets left on by accident. So ideally, I want to create some sort of state, such as a global variable called AMP_ON = true, if the AMP has been turned on. And I would set AMP_ON to true if the music button was pressed, or if Firefly.A (for receiver Tuner radio ON) is pressed since these two events cause the AMP to be turned on. If Winamp dies or closes by accident, obviously I won't be able to hear the music anymore, but there is no way for me to know if the amp is still on without opening the media cabinet in the media closet.
Do you think I can setup a macro tied to the Winamp kill event to turn send the receiver OFF IR signal. If that is the case, should I simply put int event Task.Destroyed.winamp within the "Receiver" context folder for the OFF macro that send the the OFF IR signals? Or is there a better method of handling this?
Or is there a way to monitor the AMP_ON variable via a loop to turn off the receiver if Winamp is no longer running.
Thanks and sorry for the lengthy email. I tried to make it as clear to understand as possible.
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.
Programming help needed
- Bitmonster
- Site Admin
- Posts: 2239
- Joined: Mon Feb 06, 2006 10:28 pm
Re: Programming help needed
I haven't fully understood your question, but I guess the safest way would be to use Task.Destroyed.winamp on a macro that is NOT in any context folder.
Please post software-related questions in the forum - PMs will only be answered, if really private, thanks!
-
thejipster
- Posts: 19
- Joined: Fri Sep 07, 2007 10:19 pm
Re: Programming help needed
When an exclusive is set for a particular context folder, and an event occurs, it only looks for the event defined in one of the macros within the particular exclusive context folder, right?
What if the event is defined also outside the context, can it also figure up the action tied to the event?
- J
What if the event is defined also outside the context, can it also figure up the action tied to the event?
- J
- Bitmonster
- Site Admin
- Posts: 2239
- Joined: Mon Feb 06, 2006 10:28 pm
Re: Programming help needed
Yes, the rule is:
Every macro gets called, that has a matching event and whose ancestors are all enabled.
Every macro gets called, that has a matching event and whose ancestors are all enabled.
Please post software-related questions in the forum - PMs will only be answered, if really private, thanks!
-
thejipster
- Posts: 19
- Joined: Fri Sep 07, 2007 10:19 pm
Re: Programming help needed
You lost me on the part about ancestors.
Can you please elaborate.
Can you please elaborate.
- Bitmonster
- Site Admin
- Posts: 2239
- Joined: Mon Feb 06, 2006 10:28 pm
Re: Programming help needed
Ancesters might be the wrong word. I mean the chain from the item to the root through all its parents. So if one of them is disabled, the macro won't get triggered.
Please post software-related questions in the forum - PMs will only be answered, if really private, thanks!