MCI_CONNECTOR
This message is used to enable, disable or query the status of a particular connector for a device instance. The connector can be specified either absolutely or as a relative offset within a specified connector type.
Syntax
param1 ULONG ulParam1; /* Flags for connector operation. */ param2 PMCI_CONNECTOR_PARMS pParam2; /* Pointer to the MCI_CONNECTOR_PARMS data structure. */
Parameters
- ulParam1 (ULONG) - input
- This parameter can contain any of the following flags:
- MCI_NOTIFY A notification message will be posted to the window specified in the hwndCallback parameter of the data structure pointed to by the pParam2 parameter. The notification will be posted when the action indicated by this message is completed or when an error occurs.
- MCI_WAIT Control is not to be returned until the action indicated by this message is completed or an error occurs.
- MCI_ENABLE_CONNECTOR Enables input or output through the specified connector.
- MCI_DISABLE_CONNECTOR Disables input or output through the specified connector.
- MCI_QUERY_CONNECTOR_STATUS Queries the status of the specified connector and returns the result in the ulReturn field of the parameter data structure pointed to by pParam2. The possible states are enabled or disabled.
- MCI_CONNECTOR_TYPE Indicates that the connector type (ulConnectorType field) for the primary device is to be used for the query. When this flag is used, the ulConnectorIndex field is interpreted as a relative index rather than an absolute index. The following connector types are currently defined:
- **MCI_MIDI_STREAM_CONNECTOR** Digital input or output for the sequencer device. This data typically is streamed to an amplifier mixer device.
- **MCI_CD_STREAM_CONNECTOR** Digital output for a CD audio device capable of reading the data directly off a disc. The data typically is streamed to an amplifier mixer device.
- **MCI_WAVE_STREAM_CONNECTOR** Digital input or output for the waveform audio device. The data typically is streamed to an amplifier mixer device. (This connector type is not supported by the digital video MCD.)
- **MCI_XA_STREAM_CONNECTOR** Digital output for the CD XA device. The data typically is streamed to an amplifier mixer device.
- **MCI_AMP_STREAM_CONNECTOR** Digital input or output for an amplifier mixer device.
- **MCI_HEADPHONES_CONNECTOR** The connector on the device that is typically used to attach headphones to the device.
- **MCI_SPEAKERS_CONNECTOR** The connector on the device that is typically used to attach speakers to the device.
- **MCI_MICROPHONE_CONNECTOR** The connector on the device that is typically used to attach a microphone to the device.
- **MCI_LINE_IN_CONNECTOR** The connector on the device that is typically used to provide line level input to the device.
- **MCI_LINE_OUT_CONNECTOR** The connector on the device that is typically used to provide line level output from the device.
- **MCI_AUDIO_IN_CONNECTOR** The connector on the device that is typically used to provide audio input to the device.
- **MCI_AUDIO_OUT_CONNECTOR** The connector on the device that is typically used to provide audio output from the device.
- **MCI_VIDEO_IN_CONNECTOR** The connector on the device that is typically used to provide video input to the device.
- **MCI_VIDEO_OUT_CONNECTOR** The connector on the device that is typically used to provide video output from the device.
- **MCI_UNIVERSAL_CONNECTOR** A connector on a device that does not fall into any of the other categories. This connector type can be used to access a device-dependent function. The manufacturer of the device should define the exact use of this connector.
- MCI_CONNECTOR_INDEX Indicates that the ulConnectorIndex field contains the connector index for the primary device. If this flag is not specified then an index of 1 is assumed.
- pParam2 (PMCI_CONNECTOR_PARMS) - input
- A pointer to the MCI_CONNECTOR_PARMS data structure.
Returns
- rc (ULONG) - returns
- Return codes indicating success or type of failure:
- MCIERR_SUCCESS MMPM/2 command completed successfully.
- MCIERR_OUT_OF_MEMORY System out of memory.
- MCIERR_INVALID_DEVICE_ID Invalid device ID given.
- MCIERR_MISSING_PARAMETER Missing parameter for this command.
- MCIERR_DRIVER Internal MMPM/2 driver error.
- MCIERR_INVALID_FLAG Invalid flag specified for this command.
- MCIERR_MISSING_FLAG Flag missing for this MMPM/2 command.
- MCIERR_FLAGS_NOT_COMPATIBLE Flags not compatible.
- MCIERR_INSTANCE_INACTIVE Instance inactive.
- MCIERR_INVALID_CONNECTOR_INDEX Invalid connector index.
- MCIERR_INVALID_CONNECTOR_TYPE Invalid connector type given.
- MCIERR_UNSUPPORTED_CONN_TYPE Connector type is not supported by this device.
- MCIERR_CANNOT_MODIFY_CONNECTOR Cannot enable or disable this connector.
Remarks
It is recommended that all applications refer to connectors using the **MCI_CONNECTOR_TYPE** flag. This provides device independence from differences in connector numbering for various devices. Additionally, the **MCI_CONNECTOR_INDEX** flag can be used to address more than one connector of the same type.
If only the **MCI_CONNECTOR_INDEX** flag is used, the referenced connector is device dependent. The connector type of a particular connector index, as well as the number of connectors, can be retrieved using the MCI_CONNECTORINFO message.
The amplifier-mixer device for the M-Audio Adapter does not have a headphone connector.
Disabling a connector on a device can terminate an active command.
For a list of connector types which are supported by various device types, see the **Remarks** section for MCI_CONNECTORINFO.
Example Code
USHORT usAmpDeviceID;
MCI_CONNECTOR_PARMS connectorparms;
connectorparms.ulConnectorType = MCI_MICROPHONE_CONNECTOR;
/* Enable microphone input on */
/* the audio device */
mciSendCommand (usAmpDeviceID, /* Amp/mixer device ID */
MCI_CONNECTOR, /* CONNECTOR message */
MCI_ENABLE_CONNECTOR | MCI_CONNECTOR_TYPE | MCI_WAIT,
/* Flags for this message */
(PVOID) &connectorparms, /* Data structure */
0 ); /* No user parm */