MIDIsvc


MIDIsvc is the class which handles basic MIDI services. There is only one MIDIsvc, which is created by the Rogus_McBogus object. You can access it through Rogus_McBogus' member variable o.

class MIDIsvc {
public:
  ioref open_input(const char*, Bool allow_sysex=False);
  ioref open_output(const char* );
  ioref open_input(ioref n, Bool allow_sysex=False);
  ioref open_output(ioref n);
  ioref open_input(Bool allow_sysex=False);
  ioref open_output();

  ioref output_refnum( const char* );
  
  void closeAllInputs();
  void closeAllOutputs();
  
  ioref howManyOutputNodes();
  ioref howManyInputNodes();

  const char* getOutputNodeName(ioref);
  const char* getInputNodeName(ioref);
  
  static long time();
  
  err_ind setTimecodeInput(ioref, Bool);
  err_ind unsetTimecodeInput();

  void write(const MIDI_msg *m);
};
ioref open_input(const char* x, Bool allow_sysex=False)
Opens the input node named x. The matching is done as a case-insensitive substring search. Once the node is open, the active parser can receive MIDI messages from the node. Returns the ioref of the node. The allow_sysex parameter determines whether System Exclusive input will be allowed on this input node.
ioref open_output(const char* x)
Opens the output node named x. The matching is done as a case-insensitive substring search. Once the node is open, MIDI messages can be sent to the node with write(). Returns the ioref of the node.
ioref open_input(ioref n, Bool allow_sysex=False)
Same as above, but opens by input node number rather than name. This is useful if the ioref has already been obtained, by using the howManyInputNodes() and getInputNodeName() functions (for example, to present the user with a menu of nodes). Returns the ioref of the node. (Not too useful, since you already knew it.)
ioref open_output( ioref n )
Same as above, but opens by output node number rather than name. This is useful if the ioref has already been obtained, by using the howManyOutputNodes() and getOutputNodeName() functions (for example, to present the user with a menu of nodes). Returns the ioref of the node. (Not too useful, since you already knew it.)
ioref open_input(Bool allow_sysex=False)
Same as above, but opens the default input node (specified by the Rogus_McBogus user_prefs).
ioref open_output()
Same as above, but opens the default output node (specified by the Rogus_McBogus user_prefs).
ioref output_refnum( const char* x)
This is the same thing as open_output, and is provided for compatibility with older Rogus code.
void closeAllInputs()
Closes all open input nodes.
void closeAllOutputs()
Closes all open output nodes.
ioref howManyOutputNodes()
Returns the number of output nodes in the system. Valid output iorefs range from zero to this number minus one.
ioref howManyInputNodes()
Same as howManyOutputNodes(), but for inputs.
char* getOutputNodeName(ioref i)
Returns the name of output node i.
char* getInputNodeName(ioref i)
Returns the name of input node i.
static long time()
Returns the current time, as the number of half-milliseconds since Rogus was started.
err_ind setTimecodeInput(ioref i, Bool eat)
Causes input node i, which must already be open, to be listened to for MIDI Time Code messages. If eat is True Rogus will eat the MIDI Time Code messages after it processes them. (i. e. prevent them from being passed to a parser which is listening for system messages.) For more information, see Using Rogus with MIDI Time Code.
err_ind unsetTimecodeInput()
Stops Rogus from syncing to any external MIDI Time Code source.
void write(const MIDI_msg *m)
Sends m to the appropriate output node. The output node must have already been opened.