home
products
contribute
download
documentation
forum
Home
Forums
New posts
Search forums
What's new
New posts
All posts
Latest activity
Members
Registered members
Current visitors
Donate
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Search forums
Search titles only
By:
Menu
Log in
Register
Navigation
Install the app
Install
More options
Contact us
Close Menu
Forums
Products
IR Server Suite (IRSS)
IR Server Suite for Media Center
Contact us
RSS
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
<blockquote data-quote="tadr" data-source="post: 343104" data-attributes="member: 83083"><p>Actually, steps 1 and 2 in the above post should read:</p><p></p><p>1) Computer is brought out of suspend</p><p>2) Check if resume event was triggered by remote receiver. If yes, power on amp and END. If no, goto step 3</p><p></p><p>My suspend task (powering off the amp) is powered using the IR server suite translator app.</p><p></p><p>Here is my resume-from-suspend approach:</p><p></p><p>I have two scripts: resume.bat and suspend.bat.</p><p>Resume.bat contains my Amp-ON command: </p><p>"C:\Program Files\IR Server Suite\IR Blast\IRBlast.exe" multich.ir</p><p></p><p>Suspend.bat contains my Amp-OFF command:</p><p>"C:\Program Files\IR Server Suite\IR Blast\IRBlast.exe" ampOff.ir</p><p></p><p>In the Vista task scheduler I have two event-triggered tasks:</p><p>ReturnFromStandby-OtherThanByRemote (triggered on wake-on-lan, scheduled wakeup, etc)</p><p>This task is set to launch the Watcher app I wrote.</p><p>When you create the task, you have to use a custom filter for the trigger. The filter I use is:</p><p>[CODE]<QueryList></p><p> <Query Id="0" Path="System"></p><p> <Select Path="System">*[System[(Keywords='0x8000000000000000') and (EventID=1)]]</Select></p><p> <Suppress Path="System">*[EventData[Data[@Name="WakeSourceText"] = "USB Root Hub"]]</Suppress></p><p> </Query></p><p></QueryList>[/CODE]</p><p></p><p>ReturnFromStandby-byRemote (triggered by the USB remote receiver)</p><p>This task is set to launch resume.bat (which turns on the amp)</p><p>Here is the filter:</p><p>[CODE]<QueryList></p><p> <Query Id="0" Path="System"></p><p> <Select Path="System">*[ System[(Keywords='0x8000000000000000') and (EventID=1)] and EventData[Data[@Name="WakeSourceText"] = "USB Root Hub"] ]</Select></p><p> </Query></p><p></QueryList>[/CODE]</p><p></p><p>-----------------------------</p><p>Watcher app</p><p>This is a VB .NET 2003 application. It works as I described in the steps in the last post. Nothing fancy, AT ALL. Let me know if you want me to send you a compiled version. Here is the code: </p><p></p><p></p><p>[CODE]Imports Microsoft.Win32</p><p>Imports System.IO</p><p></p><p>Module Module1</p><p> Dim enteringSuspendScript As String = "c:\Users\Tad\Desktop\scripts\enter_standby.bat"</p><p> Dim resumingSuspendScript As String = "c:\Users\Tad\Desktop\scripts\return_from_standby.bat"</p><p> Public Function IsProcessRunning(ByVal ProcessName As String) As Boolean</p><p> Return (Process.GetProcessesByName(ProcessName).Length > 0)</p><p> End Function</p><p> Private Sub powerStateChangeHandler(ByVal sender As Object, ByVal e As PowerModeChangedEventArgs)</p><p> If e.Mode = PowerModes.Suspend Then</p><p> Console.Write("Entering suspend. Exiting")</p><p> Environment.Exit(0)</p><p> 'Shell(enteringSuspendScript)</p><p> 'Whatever you want to happen when it goes in standby/hibernate goes here</p><p> 'NOTE: This does NOT work reliably to call IRSS functions, as it only gets triggered RIGHT when the system goes into suspend.</p><p> End If</p><p> If e.Mode = PowerModes.Resume Then</p><p> 'MessageBox.Show("Return from suspend")</p><p> 'If you want something to happen when it wakes back up, put it here</p><p> End If</p><p> End Sub</p><p> Sub Main()</p><p> AddHandler SystemEvents.PowerModeChanged, AddressOf powerStateChangeHandler</p><p> Console.WriteLine("Waiting for MCE to start...")</p><p></p><p> While (1)</p><p> If (IsProcessRunning("ehshell")) Then</p><p> 'MCE interface is running - </p><p> Console.WriteLine(ControlChars.NewLine + "MCE running")</p><p> Console.WriteLine("Turning on amplifer...")</p><p> If (System.IO.File.Exists(resumingSuspendScript)) Then</p><p> Shell(resumingSuspendScript)</p><p> Console.WriteLine("Exiting...")</p><p> Environment.Exit(0)</p><p> Else</p><p> Console.WriteLine(resumingSuspendScript + " not found!")</p><p> End If</p><p> Else</p><p> Console.Write(".")</p><p> End If</p><p> 'wait 2 seconds before checking again</p><p> System.Threading.Thread.Sleep(2000)</p><p> End While</p><p> End Sub</p><p>End Module[/CODE]</p></blockquote><p></p>
[QUOTE="tadr, post: 343104, member: 83083"] Actually, steps 1 and 2 in the above post should read: 1) Computer is brought out of suspend 2) Check if resume event was triggered by remote receiver. If yes, power on amp and END. If no, goto step 3 My suspend task (powering off the amp) is powered using the IR server suite translator app. Here is my resume-from-suspend approach: I have two scripts: resume.bat and suspend.bat. Resume.bat contains my Amp-ON command: "C:\Program Files\IR Server Suite\IR Blast\IRBlast.exe" multich.ir Suspend.bat contains my Amp-OFF command: "C:\Program Files\IR Server Suite\IR Blast\IRBlast.exe" ampOff.ir In the Vista task scheduler I have two event-triggered tasks: ReturnFromStandby-OtherThanByRemote (triggered on wake-on-lan, scheduled wakeup, etc) This task is set to launch the Watcher app I wrote. When you create the task, you have to use a custom filter for the trigger. The filter I use is: [CODE]<QueryList> <Query Id="0" Path="System"> <Select Path="System">*[System[(Keywords='0x8000000000000000') and (EventID=1)]]</Select> <Suppress Path="System">*[EventData[Data[@Name="WakeSourceText"] = "USB Root Hub"]]</Suppress> </Query> </QueryList>[/CODE] ReturnFromStandby-byRemote (triggered by the USB remote receiver) This task is set to launch resume.bat (which turns on the amp) Here is the filter: [CODE]<QueryList> <Query Id="0" Path="System"> <Select Path="System">*[ System[(Keywords='0x8000000000000000') and (EventID=1)] and EventData[Data[@Name="WakeSourceText"] = "USB Root Hub"] ]</Select> </Query> </QueryList>[/CODE] ----------------------------- Watcher app This is a VB .NET 2003 application. It works as I described in the steps in the last post. Nothing fancy, AT ALL. Let me know if you want me to send you a compiled version. Here is the code: [CODE]Imports Microsoft.Win32 Imports System.IO Module Module1 Dim enteringSuspendScript As String = "c:\Users\Tad\Desktop\scripts\enter_standby.bat" Dim resumingSuspendScript As String = "c:\Users\Tad\Desktop\scripts\return_from_standby.bat" Public Function IsProcessRunning(ByVal ProcessName As String) As Boolean Return (Process.GetProcessesByName(ProcessName).Length > 0) End Function Private Sub powerStateChangeHandler(ByVal sender As Object, ByVal e As PowerModeChangedEventArgs) If e.Mode = PowerModes.Suspend Then Console.Write("Entering suspend. Exiting") Environment.Exit(0) 'Shell(enteringSuspendScript) 'Whatever you want to happen when it goes in standby/hibernate goes here 'NOTE: This does NOT work reliably to call IRSS functions, as it only gets triggered RIGHT when the system goes into suspend. End If If e.Mode = PowerModes.Resume Then 'MessageBox.Show("Return from suspend") 'If you want something to happen when it wakes back up, put it here End If End Sub Sub Main() AddHandler SystemEvents.PowerModeChanged, AddressOf powerStateChangeHandler Console.WriteLine("Waiting for MCE to start...") While (1) If (IsProcessRunning("ehshell")) Then 'MCE interface is running - Console.WriteLine(ControlChars.NewLine + "MCE running") Console.WriteLine("Turning on amplifer...") If (System.IO.File.Exists(resumingSuspendScript)) Then Shell(resumingSuspendScript) Console.WriteLine("Exiting...") Environment.Exit(0) Else Console.WriteLine(resumingSuspendScript + " not found!") End If Else Console.Write(".") End If 'wait 2 seconds before checking again System.Threading.Thread.Sleep(2000) End While End Sub End Module[/CODE] [/QUOTE]
Insert quotes…
Verification
Post reply
Forums
Products
IR Server Suite (IRSS)
IR Server Suite for Media Center
Contact us
RSS
Top
Bottom