Unoffical empeg BBS

Quick Links: Empeg FAQ | RioCar.Org | Hijack | BigDisk Builder | jEmplode | emphatic
Repairs: Repairs

Topic Options
#263048 - 21/08/2005 17:44 How to give display back to the player
Andre81
new poster

Registered: 13/08/2005
Posts: 28
Loc: Germany
I've attached my own menu item to the hijack menu and if i select the item i can take over the display and draw on it, but how do i give the display back to the player?

I've cleared and closed the display, but than it's just black. Actually my process has even terminated. How do i tell hijack that i don't want the display any longer?

Thanks

Top
#263049 - 21/08/2005 20:24 Re: How to give display back to the player [Re: Andre81]
tonyc
carpal tunnel

Registered: 27/06/1999
Posts: 7058
Loc: Pittsburgh, PA
rc = ioctl(fd, EMPEG_HIJACK_WAITMENU, NULL);

is the way to unbind from the display and menus. If you need to re-bind to the menus (so the app can be selected from the menu again) you need to do the above call followed by:

rc = ioctl(fd, EMPEG_HIJACK_WAITMENU, &menulabels);

But the latter is going to block your app until selected again. If you need stuff to happen in the background, you'll have to spawn a detached thread to do it.
_________________________
- Tony C
my empeg stuff

Top
#263050 - 22/08/2005 08:31 Re: How to give display back to the player [Re: tonyc]
Andre81
new poster

Registered: 13/08/2005
Posts: 28
Loc: Germany
In Antwort auf:
rc = ioctl(fd, EMPEG_HIJACK_WAITMENU, NULL);



Thanks, that works. Although it is not very intuitive.

Top
#263051 - 22/08/2005 10:44 Re: How to give display back to the player [Re: Andre81]
tonyc
carpal tunnel

Registered: 27/06/1999
Posts: 7058
Loc: Pittsburgh, PA
Quote:
Thanks, that works. Although it is not very intuitive.


Mark accepts patches...
_________________________
- Tony C
my empeg stuff

Top
#263052 - 22/08/2005 10:49 Re: How to give display back to the player [Re: tonyc]
Andre81
new poster

Registered: 13/08/2005
Posts: 28
Loc: Germany
In Antwort auf:
Mark accepts patches...


Code:
ioctl(fd, EMPEG_HIJACK_EXIT, NULL);



Could unbind the buttons, menus and display.

Hijack could also detect if a process has terminated and then call this automatically.

Top
#263053 - 22/08/2005 19:57 Re: How to give display back to the player [Re: Andre81]
tfabris
carpal tunnel

Registered: 20/12/1999
Posts: 31563
Loc: Seattle, WA
That reads more like a suggestion than a patch.

Fortunately, Mark has occasionally been known to listen to suggestions, too.
_________________________
Tony Fabris

Top
#263054 - 22/08/2005 20:12 Re: How to give display back to the player [Re: Andre81]
wfaulk
carpal tunnel

Registered: 25/12/2000
Posts: 16706
Loc: Raleigh, NC US
The way it's done now is
Quote:
ioctl(fd, EMPEG_HIJACK_WAITMENU, NULL);

and you want it to look like this:
Quote:
ioctl(fd, EMPEG_HIJACK_EXIT, NULL);

?

I can fix that for you right now:
Quote:
#define EMPEG_HIJACK_EXIT EMPEG_HIJACK_WAITMENU
_________________________
Bitt Faulk

Top
#263055 - 22/08/2005 21:43 Re: How to give display back to the player [Re: wfaulk]
tonyc
carpal tunnel

Registered: 27/06/1999
Posts: 7058
Loc: Pittsburgh, PA
No, I get what he's saying. Your #define solution would break the existing WAITMENU ioctl. He wants a separate ioctl() for this particular situation. I just don't think it's that confusing as-is, so I'm not doing it.
_________________________
- Tony C
my empeg stuff

Top