[Live-devel] interactive support

Ross Finlayson finlayson at live555.com
Thu Sep 29 12:46:13 PDT 2005


>I'm having little trouble to understand the watchVariable variable.

Remember, You Have Complete Source Code.

>But how then I get that a or b is pressed, do I have to use another function
>like control.keydown event (in windows world) but for linux ?? or is it
>already implemented with this watchVariable thing?
>
> > Then, elsewhere in your program, do
> >          if (/* key 'a' is pressed*/) {
> >                  watchVariable = 'a';
> >          }

That's something you're going to have to figure out - it depends on your OS.

One thing you *could* do is start a new thread that waits for key 
presses, and then sets "watchVariable" as appropriate when a key 
press is noticed.  (Because this thread would interact with the 
"LIVE555 Streaming Media" code only via setting "watchVariable", this 
would be an acceptable use of threads.)

Alternatively, you could write your own event loop ("TaskScheduler" 
subclass) that includes key presses among the events to be acted 
upon.  But, as I noted earlier, that would be more work.


	Ross Finlayson
	Live Networks, Inc. (LIVE555.COM)
	<http://www.live555.com/>



More information about the live-devel mailing list