Documente Academic
Documente Profesional
Documente Cultură
m.meyer@fh-aargau.ch
Two modules have been changed: introduction of new variables and modification of existing
ones. The same holds true for subroutines. Below you find a list with the modifications. You
find the details and the explanations in the code-files.
1. Module frmConsole
New variables:
InBuffBlocks
OutBuffBlocks
InBufferUsage
OutBufferUsage
InPtrHead
InPtrTail
mixW Object, type = mixW-application
MixWIsLoaded shows wether the mixW-application has been started
oldFqA contains the frequency of the console
Modified variables:
Modified subroutines:
SetEvents
No more notification points, but arrays instead
DirectXEvent8_DXCallback
An event from DirectX starts this routine automatically. There is no more a switch back and
forth between write and read. New: the actual position of the pointer is evaluated from the
Event-ID. The pointer InPtrTail is decremented by 1 after each block read. This gives an
information about the used space of the buffer. The maximum value is read every half a
second and visualized by the bar graph (see page 28 of the .pdf-file).
EraseSoundBuff
This routine erases the output buffer when the console is stopped. The constant value of the
buffer size has been replaced by the variable OutBuffBlocks.
Form_Load
The variables InBuffBlocks and OutBuffBlocks are initialized here. This prevents from a
division by zero, in case of a call of the Options-window without having switched on the
console. The object mixW is also initialized here. It is important, that MixW has been started
before the console. Otherwise, the variable „MisIsLoaded“ is set to zero and the „Timer2“
remains switched off.
CreateBuffers
The values for the buffer size and block size have been modified.
KillEvents
erasing of the DirectX-events has been expanded to the whole array of events.
SaveState
Now also the state of the checkbox „Data Buffer enable“ is stored.
GetState
Reads the stored values, including the checkbox.
itmOtions_Click
new: also „Timer2“ from the module „frmOptions“ is started.
In the setup-window of the console two registers „DRM-Buffer“ and „Data-Buffer“ have
been introduced (see the copies of the screens above). The following subroutines have been
modified:
Info1_Click
Buffer size in DRM-mode
Info2_Click
Buffer size in Data-mode
Sl2InputBuffer_MouseDown / sl2OutputBuffer_MouseDown
Data-mode: the values of the faders for the input buffer size and output buffer size are given
to the module frmConsole. Prior, the process is stopped to avoid a buffer underrun.
Timer2_Timer
This routine is activated every 0.5 seconds and shows the buffer usage with a bar graph
(mentioned above). The Timer is deactivated when the DRM-window is closed. This saves
ressources.
SaveOptions: modified: to keep the settings for the next start of the program, they are stored
in the registry.
Maybe the server-application has not been started yet, an error handler deals with this.
After this object has been created, you have admission to methods and variables of the other
application:
object.Method
object.Variable.
To connect another Software than MixW, two methods in the module frmConsole need to be
adapted:
Subroutine Form_Load()
Invoked at the start, this method creates the object mixw. If it is succesfull (the program
MixW is already running), the Timer2 is started, which polls the variables periodically.
Instead of "MixW.Application" you simply write "DigiPan.Application" (example, I hope
DigiPan supports ActiveX!!).
Subroutine Timer2_Timer()
This method is invoked every 200 ms and checks first, wether MixW is up and running. If
yes, the frequency and the PTT-state are read from MixW and transferred to the console. If
MixW has been terminated, the user is informed with a message box.
Adaption to another Program: change the names of the variables and methods (mixw.FqA
and mixw.PTT).