RealVision home
   
  DxMidi - Sign In - Sign Out  
Summary

Implementation

Availability
Sign In/Out
Setting buffers
Sending events
Receiving events
OMS support
Sysex support
Result codes

MMconnect
DxMMdisconnect
DxOMSconnect
DxOMSdisconnect

result = MMconnect ( osType, name )
osType as string
name as string
result as Integer

Signing for the Midi Manager Interface. The signature is effective only if the Client ID and the Client Name are unique.
Sign before using any other specific Midi Manager method.
You must close the program with a MMdisconnect(), or you could keep the old instance of your client ID and name in the MidiManager Patch the next time you sign in.
You could connect to midi at the start of your app, and then close connection at end, even if you are not sure that the user will use the Midi.
osType is a 4 character code (of your program, to simplify) of the Midi signature connection. It must be unique. Contact Apple to get an unique OStype value for your program and apply this for the connection client ID.
name is the name of your program. In the Midi Manager, this name appears in the Patchbay program when your program is launched and a connection made.
The result code contains 0 if the connection is made, or a standard DxMidi result code for error.

example code :

the control name chosen is : midi

// create the property
dim p_MMavail as Boolean

// edit me.Open() event
Sub Open()
dim avail as Boolean
dim result as Integer

avail = DxMidiMMAvail
if avail = true then
// use a property to maintain the MM avail for closing at end
p_MMavail = avail
// try to connect and auto-patch
result = DxMMconnect («abcd», «Midi-Test»)
if result >= 0 then
// connection made
// don’t forget to disconnect at end in close() method
// ... put here some code to play notes
// but you can put this text anywhere in your program

end if
end if
End Sub

Sub Close()
dim avail as Boolean
dim result as Integer

if p_MMavail = true then
result = DxMMdisconnect()
// result code tell you if the disconnection is ok
p_MMavail = false
end if
End Sub



result = DxMMdisconnect ()

result as Integer

Use this method to disconnect the connections in the patchbay, and sign out to Midi Manager. Don’t forget to do it before quitting the application runtime (see MMconnect() example).

The result code contains 0 if the connection is made, or a standard DxMidi result code for error.



result = DxOMSconnect ( osType, name )
osType as String
name as String
result as Integer

Connect to OMS. You must disconnect at end the OMS signin, by an OMSdisconnect() method. If you don’t do it, you could generates an internal error into OMS. Result is <> 0 if there is an error. See the error codes list at the end of this manual. You can use the same procedure as MidiManager to sign in the OMS studio.

osType
is a 4 character code (of your program, to simplify) of the Midi signature connection. It must be unique. Contact Apple to get an unique OStype value for your program and apply this for the connection client ID.
name is the name of your program. In OMS, this name is used as a virtual node to other clients.
The result code contains 0 if the connection is made, or a standard DxMidi result code for error.


result = DxOMSdisconnect ()
result as Integer

Disconnect to OMS. This generates a signout applet to the OMS studio to disconnect the driver. None of the OMS methods should be used after this except DxMidiOMSAvail() or OMSConnect(). For result codes, see the error list codes at the end of this manual.

The result code contains 0 if the connection is made, or a standard DxMidi result code for error.