mdInit, mdRegister, mdUnRegister - initialize MIDI system and register
char *mdRegister(const char *name);
int mdUnRegister(const char *name);
mdInit initializes the MIDI library and returns the current number of
configured MIDI interfaces. mdInit must be called before the application
calls any other MIDI library routines. mdInit returns 0 if no interfaces
An application may call mdInit multiple times to update the MIDI
library's internal list of available ports. Any interfaces configured
after the initial call to mdInit will be inaccessible by the application
until mdInit is called again; long-running applications which maintain a
list of active devices should call mdInit periodically to insure that
their device list is up-to-date. Calling mdInit multiple times has no
effect on previously opened ports.
mdRegister creates a new internal MIDI interface named name. If an
interface with the requested name is already configured, mdRegister will
generate a new unique name for the port and return the unique name (this
is done by appending a digit onto the end of the name). mdRegister
returns the name of the device or NULL in event of an error.
mdUnRegister removes the internal MIDI interface indicated by name.
mdUnRegister returns 0 if the interface is successfully removed. If an
error occurs, -1 will be returned instead. Internal interfaces must be
explicitly unregistered when an application is finished with them; they
are a limited resource and are not released when the application which
originally created them exits.
mdInit returns the number of valid devices on the system or -1 on
mdRegister returns the name used for the new interface; if the
registration fails, NULL is returned. The storage for the returned name
is allocated by malloc. The caller should call free() when it is done
with the name.
mdUnRegister returns 0 on success; if it fails, it returns -1.
PPPPaaaaggggeeee 2222 [ Back ]