home *** CD-ROM | disk | FTP | other *** search
- midi.library - October 27, 1988
-
- TABLE OF CONTENTS
-
- midi.library/CreateMDest
- midi.library/CreateMListSignal
- midi.library/CreateMRoute
- midi.library/CreateMSource
- midi.library/DeleteMDest
- midi.library/DeleteMListSignal
- midi.library/DeleteMRoute
- midi.library/DeleteMSource
- midi.library/FindMDest
- midi.library/FindMSource
- midi.library/FlushMDest
- midi.library/FreeMidiMsg
- midi.library/FreeMidiPacket
- midi.library/GetMidiMsg
- midi.library/GetMidiPacket
- midi.library/LockMidiBase
- midi.library/LockMRoutes
- midi.library/MidiMsgLength
- midi.library/MidiMsgType
- midi.library/ModifyMRoute
- midi.library/MRouteDest
- midi.library/MRoutePublic
- midi.library/MRouteSource
- midi.library/PutMidiMsg
- midi.library/PutMidiStream
- midi.library/SetDefaultMRouteInfo
- midi.library/UnlockMidiBase
- midi.library/UnlockMRoutes
- midi.library/CreateMDest midi.library/CreateMDest
-
- NAME
- CreateMDest -- Create a MIDI destination node
-
- SYNOPSIS
- dest = CreateMDest (name,image)
- d0 a0 a1
- struct MDest *dest;
- char *name;
- struct Image *image;
-
- FUNCTION
- Creates a new MIDI destination node. A MsgPort is created and
- linked into the new MDest that will signal you when this MDest gets
- a message (see msg routines for more info). If a name is given,
- this node will be placed in the library's public destination list
- (so it can be located with FindMDest()). If name is NULL a private
- node is created. The image supplied can be used by graphics-based
- patch bay applications and will only be used for public nodes. image
- may be NULL if no image is to be supplied. You are responsible for
- deleting any nodes you create when you are done with them.
-
- The default MRouteInfo structure attached to the new MDest is
- iniitialized to pass all normal messages (MMF_ALL) and all channels
- w/o any processing. You can modify the default MRouteInfo by
- calling SetDefaultMRouteInfo().
-
- INPUTS
- name - pointer to a null-terminated string or NULL
- image - pointer to an Intuition Image structure or NULL
-
- RESULTS
- dest - pointer to the new MDest node or NULL on failure.
-
- SEE ALSO
- DeleteMDest, FindMDest, SetDefaultMRouteInfo
- midi.library/CreateMListSignal midi.library/CreateMListSignal
-
- NAME
- CreateMListSignal -- Create a signal to inform caller of public list
- changes
-
- SYNOPSIS
- signal = CreateMListSignal (flags)
- d0 d0
- struct MListSignal *signal;
- ULONG flags;
-
- FUNCTION
- Creates a new MListSignal structure to inform the caller of changes
- made to the public node list (by itself or other programs).
-
- The flags specify which list(s) to watch:
-
- MLSF_SOURCE to watch SourceList
- MLSF_DEST to watch DestList
-
- They may be combined to watch both lists.
-
- A new signal bit will be allocated (if available) and the caller's
- task will be used. Interrogate signal->Sigbit to find out the
- signal bit in use.
-
- Wait (1L << signal->SigBit);
-
- Your task is not informed of what changed, just merely that
- something changed. It's your tasks responsibility, if it's
- interested, to scan the public node lists to find out what changed.
-
- The intent of this is to provide a mechanism to synchronize public
- node changes with patch bay systems that need to be kept informed of
- the currently available public nodes. By using this system, a patch
- bay system need only scan the lists when it gets signalled rather
- than having to poll it periodically.
-
- Be sure to call DeleteMListSignal() when you are done using the
- signal provided by this function.
-
- INPUTS
- flags - flags indicating which list(s) to watch
-
- RESULTS
- signal - pointer to the new MListSignal or NULL on failure.
-
- SEE ALSO
- DeleteMListSignal
- midi.library/CreateMRoute midi.library/CreateMRoute
-
- NAME
- CreateMRoute -- Create an MRoute
-
- SYNOPSIS
- route = CreateMRoute (source,dest,routeinfo)
- d0 a0 a1 a2
- struct MRoute *route;
- struct MSource *source;
- struct MDest *dest;
- struct MRouteInfo *routeinfo;
-
- FUNCTION
- Creates and links a new MRoute into an MSource node and an MDest
- node. This routine assumes that both source and dest are private
- nodes that you created or that you have called LockMidiBase() to
- prevent public nodes from moving around. To route to public nodes
- use one of the other MRoute creation routines. The MRouteInfo
- structure defines the new connection. You need not preserve the
- MRouteInfo structure after calling this routine since it is copied
- into the newly created MRoute structure. You are responsible for
- deleting any MRoute's you create.
-
- routeinfo may be NULL which indicates that dest->DefaultRouteInfo
- should be used instead.
-
- INPUT
- source - pointer to an MSource node
- dest - pointer to an MDest node
- routeinfo - pointer to an MRouteInfo structure defining this MRoute
- (or NULL to use dest->DefaultRouteInfo)
-
- RESULTS
- route - a pointer to a new MRoute structure or NULL on failure.
-
- SEE ALSO
- MRouteSource, MRouteDest, MRoutePublic, ModifyMRoute, DeleteMRoute
- midi.library/CreateMSource midi.library/CreateMSource
-
- NAME
- CreateMSource -- Create a MIDI source node
-
- SYNOPSIS
- source = CreateMSource (name,image)
- d0 a0 a1
- struct MSource *source;
- char *name;
- struct Image *image;
-
- FUNCTION
- Creates a new MIDI source node. If a name is given, this node will
- be placed in the library's public source list (so it can be located
- with FindMSource()). If name is NULL a private node is created. The
- image supplied can be used by graphics-based patch bay applications
- and will only be used for public nodes. image may be NULL if no
- image is to be supplied. You are responsible for deleting any nodes
- you create when you are done with them.
-
- INPUTS
- name - pointer to a null-terminated string or NULL
- image - pointer to an Intuition Image structure or NULL
-
- RESULTS
- source - pointer to the new MSource node or NULL on failure.
-
- SEE ALSO
- DeleteMSource, FindMSource
- midi.library/DeleteMDest midi.library/DeleteMDest
-
- NAME
- DeleteMDest -- Delete a MIDI destination node
-
- SYNOPSIS
- DeleteMDest (dest)
- a0
- struct MDest *dest;
-
- FUNCTION
- Removes and frees an MDest created by CreateMDest(). Any MRoute's
- connected to this MDest will be unlinked. Any messages waiting at
- this MDest will be freed. You should only delete nodes that you
- created.
-
- INPUTS
- dest - pointer to the MDest node to delete
-
-
- RESULTS
- none
-
- SEE ALSO
- CreateMDest, FindMDest
- midi.library/DeleteMListSignal midi.library/DeleteMListSignal
-
- NAME
- DeleteMListSignal -- Delete a signal created by CreateMListSignal
-
- SYNOPSIS
- DeleteMListSignal (signal)
- a0
- struct MListSignal *signal;
-
- FUNCTION
- Removes and frees an MListSignal created by CreateMListSignal().
- You must call this to free any MListSignals that you have allocated
- when you are done with them.
-
- INPUTS
- signal - pointer to MListSignal to delete
-
- RESULTS
- none
-
- SEE ALSO
- CreateMListSignal
- midi.library/DeleteMRoute midi.library/DeleteMRoute
-
- NAME
- DeleteMRoute -- Delete an MRoute
-
- SYNOPSIS
- DeleteMRoute (route)
- a0
- struct MRoute *route;
-
- FUNCTION
- Unlinks and frees a route previously created with one of the routing
- functions. You should only delete routes that you created. You
- will still need to do this even if both the source and dest have
- been deleted in order to free up the memory allocated to the route.
-
- INPUTS
- route - pointer to the MRoute to delete
-
- RESULTS
- none
-
- SEE ALSO
- CreateMRoute, MRouteSource, MRouteDest, MRoutePublic, ModifyMRoute
- midi.library/DeleteMSource midi.library/DeleteMSource
-
- NAME
- DeleteMSource -- Delete a MIDI source node
-
- SYNOPSIS
- DeleteMSource (source)
- a0
- struct MSource *source;
-
- FUNCTION
- Removes and frees an MSource created by CreateMSource(). Any
- MRoute's connected to this MSource will be unlinked. You should
- only delete nodes that you created.
-
- INPUTS
- source - pointer to the MSource node to delete
-
- RESULTS
- none
-
- SEE ALSO
- CreateMSource, FindMSource
- midi.library/FindMDest midi.library/FindMDest
-
- NAME
- FindMDest -- Find a public MIDI destination node
-
- SYNOPSIS
- dest = FindMDest (name)
- d0 a0
- struct MDest *dest;
- char *name;
-
- FUNCTION
- Finds a public MIDI destination node by name if it exists. In
- order to ensure that this node remains valid you should call
- LockMidiBase() prior to calling this routine.
-
- INPUTS
- name - pointer to the null-terminated name to find
-
- RESULTS
- dest - pointer to the requested MDest node or NULL if not found.
-
- SEE ALSO
- CreateMDest, DeleteMDest, LockMidiBase, UnlockMidiBase
- midi.library/FindMSource midi.library/FindMSource
-
- NAME
- FindMSource -- Find a public MIDI source node
-
- SYNOPSIS
- source = FindMSource (name)
- d0 a0
- struct MSource *source;
- char *name;
-
- FUNCTION
- Finds a public MIDI source node by name if it exists. In order to
- ensure that this node remains valid you should call LockMidiBase()
- prior to calling this routine.
-
- INPUTS
- name - pointer to the null-terminated name to find
-
- RESULTS
- source - pointer to the requested MSource node or NULL if not found.
-
- SEE ALSO
- CreateMSource, DeleteMSource, LockMidiBase, UnlockMidiBase
- midi.library/FlushMDest midi.library/FlushMDest
-
- NAME
- FlushMDest -- Flush MIDI messages
-
- SYNOPSIS
- FlushMDest (dest)
- a0
- struct MDest *dest;
-
- FUNCTION
- Disploses of all MidiPackets (or messages) pending at a MIDI
- destination node. Additionally causes the expunging any currently
- unused PacketArrays which may free some memory depending on prior
- message traffic. This gets called automatically by DeleteMDest().
-
- INPUTS
- dest - pointer to MDest to flush
-
- RESULTS
- none
-
- SEE ALSO
- GetMidiMsg, FreeMidiMsg
- midi.library/FreeMidiMsg midi.library/FreeMidiMsg
-
- NAME
- FreeMidiMsg -- Free a MIDI message returned by GetMidiMsg
-
- SYNOPSIS
- FreeMidiMsg (msg)
- a0
- UBYTE *msg;
-
- FUNCTION
- Frees a message returned by GetMidiMsg().
-
- INPUTS
- msg - pointer to a UBYTE array containing one MIDI message
-
- RESULTS
- none
-
- SEE ALSO
- GetMidiMsg
- midi.library/FreeMidiPacket midi.library/FreeMidiPacket
-
- NAME
- FreeMidiPacket -- Free a MIDI packet message returned by
- GetMidiPacket
-
- SYNOPSIS
- FreeMidiPacket (packet)
- a0
- struct MidiPacket *packet;
-
- FUNCTION
- Frees a MidiPacket returned by GetMidiPacket().
-
- INPUTS
- packet - pointer to a MidiPacket structure
-
- RESULTS
- none
-
- SEE ALSO
- GetMidiPacket, FreeMidiMsg
- midi.library/GetMidiMsg midi.library/GetMidiMsg
-
- NAME
- GetMidiMsg -- Get the next MIDI message from an MDest
-
- SYNOPSIS
- msg = GetMidiMsg (dest)
- d0 a0
- UBYTE *msg;
- struct MDest *dest;
-
- FUNCTION
- Returns the next message received at a MIDI destination or NULL if
- no more messages are present.
-
- This function does little more than call GetMidiPacket() and offset
- the return value to the address of the contained MidiMsg. It exists
- mainly for backwards compatibility and for some simple cases.
- Chances are that you'll want to know more about messages that you
- receive; you can save yourself the trouble of calling MidiMsgType()
- and MidiMsgLength() by receiving MidiPackets with GetMidiPacket()
- instead.
-
- Once you have dealt with the messages you have received you should
- dispose of them by calling FreeMidiMsg(). midi.library is not
- halted until you free these messages so you can hang on to them as
- long as you like. Just free them when you are done with them.
-
- Be aware that the more messages you keep without freeing the more
- fragmented the Amiga's memory will become. If you plan to keep a
- large number of messages you are probably better off allocating a
- buffer and copying the messages to it.
-
- The recommended approach to dealing with messages is:
-
- Wait (1L << dest->DestPort->mp_SigBit);
-
- /* loop to pick up all messages for this signal */
- while (msg = GetMidiMsg(dest)) {
-
- /* do something with message. for example: */
- length = MidiMsgLength(msg);
- type = MidiMsgType(msg);
-
- /* then free the message when done */
- FreeMidiMsg (msg);
- }
-
- INPUTS
- dest - pointer to the MDest node to receive from
-
- RESULTS
- msg - pointer to a UBYTE array containing one MIDI message or NULL
- if there are no more messages at this MDest
-
- SEE ALSO
- GetMidiPacket, FreeMidiMsg, MidiMsgType, MidiMsgLength, PutMidiMsg
- midi.library/GetMidiPacket midi.library/GetMidiPacket
-
- NAME
- GetMidiPacket -- Get the next MIDI packet from an MDest
-
- SYNOPSIS
- packet = GetMidiPacket (dest)
- d0 a0
- struct MidiPacket *packet;
- struct MDest *dest;
-
- FUNCTION
- Returns the next packet received at a MIDI destination or NULL if
- no more packets are present.
-
- This is the new preferred method of receiving MIDI messages since
- the packet contains information about the message (type and length)
- that already had to be determined prior to sending it to you. See
- midi.h and midi.i for descriptions of the MidiPacket structure.
-
- As previously permitted with messages returned by GetMidiMsg(), you
- are permitted to cache as many MidiPackets as you like. Just
- remember to free them when you are done (call FreeMidiPacket()).
- MidiPackets for short messages are managed in groups known as
- PacketArrays rather than singly. Because of this, caching them may
- have a performance impact on message routing.
-
- NOTE: You must consider the entire contents of the MidiPacket to be
- READ ONLY! The only exception is that packet->MidiMsg may be
- changed as long as it doesn't affect the type or length of the
- message.
-
- The recommended approach to dealing with MidiPackets is:
-
- Wait (1L << dest->DestPort->mp_SigBit);
-
- /* loop to pick up all messages for this signal */
- while (packet = GetMidiPacket(dest)) {
-
- /*
- Do something with packet like examine packet->Type and
- packet->Length to read the message type or length. The
- actual message is pointed to by packet->MidiMsg.
- */
-
- /* then free the message when done */
- FreeMidiPacket (packet);
- }
-
- INPUTS
- dest - pointer to the MDest node to receive from
-
- RESULTS
- packet - pointer to a MidiPacket structure or NULL if there are no
- more messages at this MDest
-
- SEE ALSO
- FreeMidiPacket, FreeMidiMsg, MidiMsgType, MidiMsgLength, PutMidiRaw
- midi.library/LockMidiBase midi.library/LockMidiBase
-
- NAME
- LockMidiBase -- lock the lists in the library base
-
- SYNOPSIS
- LockMidiBase()
-
- FUNCTION
- Gains exclusive access to the Source and Dest lists in the library
- base. This will block any other tasks attempts to Create, Delete,
- or Find MSource and MDest nodes. Use this if you wish to examine a
- public node. The route linkages within the nodes are not protected
- by this. Use LockMRoutes() to block message routining and route
- management.
-
- Calls to LockMidiBase() may be nested, but each call must be matched
- with a call to UnlockMidiBase().
-
- INPUTS
- none
-
- RESULTS
- none
-
- SEE ALSO
- UnlockMidiBase, LockMRoutes
- midi.library/LockMRoutes midi.library/LockMRoutes
-
- NAME
- LockMRoutes -- locks routes (blocks msg routing and route
- management)
-
- SYNOPSIS
- LockMRoutes()
-
- FUNCTION
- Blocks all message routing and route management activity so that the
- routes may be inspected. Calls to LockMRoutes() may be nested, but
- each call must be matched with a call to UnlockMRoutes().
-
- Calling this routine implies that you also want to lock the public
- node list, thus effectively disabling all operation performed by the
- MIDI Library.
-
- If you just wish to examine the public node list without blocking
- messages, use LockMidiBase().
-
- INPUTS
- none
-
- RESULTS
- none
-
- SEE ALSO
- UnlockMRoutes, LockMidiBase
- midi.library/MidiMsgLength midi.library/MidiMsgLength
-
- NAME
- MidiMsgLength -- Determine the length of a MIDI message
-
- SYNOPSIS
- length = MidiMsgLength(msg)
- d0 a0
- ULONG length;
- UBYTE *msg;
-
- FUNCTION
- Returns the length in bytes of a MIDI message. The message length
- includes the status byte. For system exclusive messages the EOX
- status byte at the end is also included.
-
- INPUTS
- msg - pointer to a UBYTE array containing one MIDI message
-
- RESULTS
- length - length of the message in bytes. For valid messages this
- will be at least 1. 0 is returned for invalid messages.
- The maximum length permitted here is 65535 bytes although
- the return value is packed into a long (ie the upper word
- is always 0)
-
- SEE ALSO
- MidiMsgType
- midi.library/MidiMsgType midi.library/MidiMsgType
-
- NAME
- MidiMsgType -- Determine the type of a MIDI message
-
- SYNOPSIS
- type = MidiMsgType(msg)
- d0 a0
- UWORD type;
- UBYTE *msg;
-
- FUNCTION
- Returns the type a MIDI message. The flags are defined in
- midi/midi.h (or midi/midi.i) and are the same ones used in
- MRouteInfo.MsgFlags. Other than the obvious, some special message
- handling takes place:
-
- Controller changes for ctrl # 121 - 127 return MMF_MODE.
-
- Note On messages with velocity == 0 return MMF_NOTEOFF.
-
- EOX and all invalid messages return 0 (an EOX by itself is not
- considered a valid message)
-
- INPUTS
- msg - pointer to a UBYTE array containing one MIDI message
-
- RESULTS
- type - message type
-
- SEE ALSO
- MidiMsgLength
- midi.library/ModifyMRoute midi.library/ModifyMRoute
-
- NAME
- ModifyMRoute -- Modify an existing an MRoute
-
- SYNOPSIS
- ModifyMRoute (route,newrouteinfo)
- a0 a1
- struct MRoute *route;
- struct MRouteInfo *newrouteinfo;
-
- FUNCTION
- Modifies the MRouteInfo structure in an existing route. Any
- messages already delivered to this MRoute's MDest, whether received
- or not, are not affected. As with CreateMRoute, the supplied
- MRouteInfo structure need not be kept after calling this routine:
- it is merely a template that is copied to the MRoute.
-
- INPUT
- route - pointer to an MRoute to modify
- routeinfo - pointer to the new MRouteInfo for this MRoute
-
- RESULTS
- none
-
- SEE ALSO
- CreateMRoute, MRouteSource, MRouteDest, MRoutePublic, DeleteMRoute
- midi.library/MRouteDest midi.library/MRouteDest
-
- NAME
- MRouteDest -- Create an MRoute from a public MSource to a private
- MDest
-
- SYNOPSIS
- route = MRouteDest (sourcename,dest,routeinfo)
- d0 a0 a1 a2
- struct MRoute *route;
- char *sourcename;
- struct MDest *dest;
- struct MRouteInfo *routeinfo;
-
- FUNCTION
- Routes an MDest to a public MSource. This is shorthand for:
-
- LockMidiBase();
- if (source = FindMSource(sourcename))
- route = CreateMRoute(source,dest,routeinfo);
- UnlockMidiBase();
-
- INPUT
- sourcename - pointer to null-terminated name of a public MSource
- dest - pointer to an MDest node
- routeinfo - pointer to an MRouteInfo structure defining this MRoute
- (or NULL to use dest->DefaultRouteInfo)
-
- RESULTS
- route - a pointer to a new MRoute structure or NULL on failure.
-
- SEE ALSO
- CreateMRoute, MRouteSource, MRoutePublic, ModifyMRoute, DeleteMRoute
- midi.library/MRoutePublic midi.library/MRoutePublic
-
- NAME
- MRoutePublic -- Create an MRoute from a public MSource to a public
- MDest
-
- SYNOPSIS
- route = MRoutePublic (sourcename,destname,routeinfo)
- d0 a0 a1 a2
- struct MRoute *route;
- char *sourcename;
- char *destname;
- struct MRouteInfo *routeinfo;
-
- FUNCTION
- Routes a public MSource to a public MDest. This is shorthand for:
-
- LockMidiBase();
- if ( (source = FindMSource(sourcename) &&
- (dest = FindMDest(destname)) )
- route = CreateMRoute(source,dest,routeinfo);
- UnlockMidiBase();
-
- INPUT
- sourcename - pointer to null-terminated name of a public MSource
- destname - pointer to null-terminated name of a public MDest
- routeinfo - pointer to an MRouteInfo structure defining this MRoute
- (or NULL to use dest->DefaultRouteInfo)
-
- RESULTS
- route - a pointer to a new MRoute structure or NULL on failure.
-
- SEE ALSO
- CreateMRoute, MRouteSource, MRouteDest, ModifyMRoute, DeleteMRoute
- midi.library/MRouteSource midi.library/MRouteSource
-
- NAME
- MRouteSource -- Create an MRoute from a private MSource to a public
- MDest
-
- SYNOPSIS
- route = MRouteSource (source,destname,routeinfo)
- d0 a0 a1 a2
- struct MRoute *route;
- struct MSource *source;
- char *destname;
- struct MRouteInfo *routeinfo;
-
- FUNCTION
- Routes an MSource to a public MDest. This is shorthand for:
-
- LockMidiBase();
- if (dest = FindMDest(destname))
- route = CreateMRoute(source,dest,routeinfo);
- UnlockMidiBase();
-
- INPUT
- source - pointer to an MSource node
- destname - pointer to null-terminated name of a public MDest
- routeinfo - pointer to an MRouteInfo structure defining this MRoute
- (or NULL to use dest->DefaultRouteInfo)
-
- RESULTS
- route - a pointer to a new MRoute structure or NULL on failure.
-
- SEE ALSO
- CreateMRoute, MRouteDest, MRoutePublic, ModifyMRoute, DeleteMRoute
- midi.library/PutMidiMsg midi.library/PutMidiMsg
-
- NAME
- PutMidiMsg -- Place a MIDI message at an MSource
-
- SYNOPSIS
- PutMidiMsg (source,msg)
- a0 a1
- struct MSource *source;
- UBYTE *msg;
-
- FUNCTION
- Sends a MIDI message off to an MSource to be distributed to any
- MDest's that are routed to this source. Once sent the message
- buffer can be recycled since copies are made of it as necessary.
- This routine assumes that it is getting a valid message. If you
- wish to send data that is not necessarily valid (and don't wish to
- process it yourself) or your message buffer contains more than one
- message you should consider using PutMidiStream() instead.
-
- INPUTS
- source - pointer to the MSource node to place the message at
- msg - pointer to a UBYTE array containing one MIDI message
-
- RESULTS
- none
-
- SEE ALSO
- PutMidiStream, MidiMsgLength, MidiMsgType, GetMidiMsg
- midi.library/PutMidiStream midi.library/PutMidiStream
-
- NAME
- PutMidiStream -- Send an unformatted stream
-
- SYNOPSIS
- PutMidiStream (source,fillbuffer,buf,bufsize,cursize)
- a0 a1 a2 d0 d1
- struct MSource *source;
- ULONG (*fillbuffer)();
- UBYTE *buf;
- ULONG bufsize,cursize;
-
- FUNCTION
- Converts an unformatted stream into MIDI messages and calls
- PutMidiMsg() to the specified MSource for each one.
-
- The user supplied fillbuffer routine is called to place data in the
- user supplied buffer. It can be written in C, assembly or whatever
- as long as it abides by the rules:
-
- On entry the following registers will be set:
-
- D0 - indicates the size of user supplied buffer
- A0 - points to the user supplied buffer
- A4 - contains its value prior to calling PutMidiStream()
- (useful for Aztec C small data model)
- A6 - MidiBase
-
- On return D0 should be set to the number of bytes placed in the
- buffer. A value of 0 indicates the end of the stream has been
- reached and that PutMidiStream() should return.
-
- Any registers that the PutMidiStream() needs are preserved
- before calling the user's fillbuffer routine so fillbuffer need
- not preserve any registers.
-
- In C the routine should be declared something like:
-
- long fillbuffer()
- {
- long len;
- .
- . /* whatever it takes to fill up */
- . /* buffer and set len */
- .
- return len; /* sets D0 accordingly */
- }
-
- There are two basic ways of using calling PutMidiStream:
-
- 1. The stream length is unknown or just simply too large to put
- into a single buffer (like transferring from a file to an
- MSource).
-
- Assuming that the buffer is initially empty you would use a call
- similar to:
-
- PutMidiStream (source, fillmybuf, mybuf,
- (long)sizeof mybuf, 0L);
-
- fillmybuf() will be called immediately to put some data into the
- buffer (mybuf). Processing will continue until fillmybuf()
- indicates that it's time to quit by returning a 0.
-
- 2. The stream length is known and it is small enough to place in
- the buffer.
-
- PutMidiStream (source,NULL,mybuf,(long)sizeof mybuf,
- (long)sizeof mybuf);
-
- The NULL fillbuffer routine indicates that the buffer contains
- all it's ever going to. The current size is set to the size of
- the buffer to indicate that the buffer is full of data to be
- processed. Once the buffer is exhausted, PutMidiStream will
- return.
-
- INPUTS
- source - pointer to the MSource to send messages to
- fillbuffer - user supplied routine to fill the user supplied buffer
- can be NULL if no buffer filling is to be done
- buf - user supplied buffer
- bufsize - size of user supplied buffer
- cursize - amount of data currently in the buffer upon entry to this
- function. If non-zero this data will be processed before
- trying to call (*fillbuffer)().
-
- RESULTS
- none
-
- SEE ALSO
- PutMidiMsg
- midi.library/SetDefaultMRouteInfo midi.library/SetDefaultMRouteInfo
-
- NAME
- SetDefaultMRouteInfo -- Set default MRouteInfo in an MDest
-
- SYNOPSIS
- SetDefaultMRouteInfo (dest,routeinfo)
- a0 a1
- struct MDest *dest;
- struct MRouteInfo *routeinfo;
-
- FUNCTION
- Copies the supplied routeinfo into dest->DefaultRouteInfo. Any new
- routes created w/o a RouteInfo structure will use this RouteInfo
- structure instead. The source routeinfo structure need not be
- preserved after calling this since it's copied.
-
- INPUTS
- dest - MDest to modify
- routeinfo - new default MRouteInfo for MDest
-
- RESULTS
- none
-
- SEE ALSO
- CreateMRoute
-
- midi.library/UnlockMidiBase midi.library/UnlockMidiBase
-
- NAME
- UnlockMidiBase -- unlock the lists in the library base
-
- SYNOPSIS
- UnlockMidiBase()
-
- FUNCTION
- Releases exclusive access to the Source and Dest lists in the
- library base. Each call to this must be matched with a call to
- LockMidiBase().
-
- INPUTS
- none
-
- RESULTS
- none
-
- SEE ALSO
- LockMidiBase
- midi.library/UnlockMRoutes midi.library/UnlockMRoutes
-
- NAME
- UnlockMRoutes -- unlocks routes
-
- SYNOPSIS
- UnlockMRoutes()
-
- FUNCTION
- Unblocks message routing and route management activity.
-
- INPUTS
- none
-
- RESULTS
- none
-
- SEE ALSO
- LockMRoutes
-