Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!usc!elroy.jpl.nasa.gov!decwrl!claris!claris.com From: wombat@claris.com (Scott Lindsey) Newsgroups: comp.sys.mac.programmer Subject: Re: Journaling (record & playback) of inputs Message-ID: <13112@claris.com> Date: 27 Jun 91 21:25:00 GMT References: <1991Jun26.162909.22605@newcastle.ac.uk> Sender: news@claris.com Organization: Claris Corporation, Santa Clara Lines: 47 Nntp-Posting-Host: lindsey In article <1991Jun26.162909.22605@newcastle.ac.uk> S.W.L.Yip@newcastle.ac.uk (S.W.Yip) writes: >I am stuck, desperate ... please HELP ! >How do I know the event manager knows the existence of my >DA/driver? The only link seems to be the JournalFlag global >variable. I have now found out the location for JournalFlag >is $8DE, and tried to change its value to 16 (playback) or >17 (record) using the in-line assembler within a C program, >but failed (its value remains as 0 after move.w #17, 0x8DE). Here's an exchange I had with Apple DTS: -I haven't found any documentation relating journaling and MultiFinder. -Here's the behavior I've observed: I open my driver and begin journaling. -During the process of a GetNextEvent (or WaitNextEvent), a background -program (e.g., FileMaker Pro) swaps in, having returned from -WaitNextEvent. Wanting to know whether or not it's time to flush its -internal disk cache, it calls TickCount. Either WaitNextEvent or -TickCount (probably the latter) CLEARS the journaling flag and doesn't -restore it. Is this expected behavior? While I don't expect to receive -journaling information for other applications, I do expect that the state -of the journaling flag to be restored by any who change it. To which DTS responded: -Scott, -This is one of the things that the MultiFInder hack missed. What you're -doing is the correct way to work around the problem. There are little -gems like this scattered about in MultiFinder, since MF is basically a -large patch on top of the system and the Finder. And we try and -document them when we can (Programmers Guide to MF and the tech notes) but -some of them only come up when a developer is using something, as in this -case, and we have to look at the source for the specific example. So, you may have to keep punching your control value into JournalFlag. JournalRef is 0x8E8, and that's how you tell the event mgr about your driver: you put the driver's refnum there. Note that you don't want to put 16 (specifically) into JournalFlag. According to p. I-261, "You control whether the journaling mechanism is playing or recording by setting the global variable JournalFlag to a negative or positive value [respectively] ... If you set the value of JournalFlag to 0, the Control call won't be made at all. 16 and 17 are jPlayCtl and jRecordCtl, values which can be passed in csCode in the Control call to your DA/driver. -- Scott Lindsey