#pragma optimize -1 #pragma noroot #include "defines.h" #include "extern.h" #include #include #include #include extern pascal void SetPort(GrafPortPtr) inline(0x1B04,dispatcher); extern int Active; extern int Quit; extern int newnotes; extern int notes; extern int key; WmTaskRec MyEvent; GrafPortPtr ChordWinPtr; /* window pointer */ GrafPortPtr OptionWinPtr; /* tuning, etc controls */ void OpenWindows(void) { Active++; ChordWinPtr=NewWindow2(NIL, NIL,DrawWindow, NIL,refIsResource,MyWindow, rWindParam1); SetPort(ChordWinPtr); OptionWinPtr=NewWindow2(NIL, NIL, DrawOptions, NIL, refIsResource, kOptionsWindow, rWindParam1); } void Update(void) { newnotes = Adjust (key, notes); if (Active) DrawWindow (); else { ChordWinPtr = NewWindow2( NIL, NIL, DrawWindow, NIL, refIsResource, MyWindow, rWindParam1); SetPort (ChordWinPtr); Active++; } } void MainEvent (void){ word myTaskCode; MyEvent.wmTaskMask = kMyTaskMask; while (!Quit) { myTaskCode = TaskMaster (kMyEventMask, &MyEvent); switch (myTaskCode){ /* case wInGoAway: DoClose(); break; */ case wInSpecial: case wInMenuBar:MenuEvents(); break; case wInControl: if (DoControls( (word)(MyEvent.wmTaskData4), MyEvent.wmTaskData2)) Update(); break; default:; } } }