MCI_CONNECTORINFO
Appearance
This message is used to determine the total number of connectors on a device, the number of connectors of a specific type, the type of each connector, and whether or not a particular type of connection is valid for a connector.
Syntax
param1 ULONG ulParam1; /* Flags for connector information. */ param2 PMCI_CONNECTORINFO_PARMS pParam2; /* Pointer to the MCI_CONNECTORINFO_PARMS data structure. */
Parameters
- ulParam1 (ULONG) - input
- The parameter can contain any of the following flags with the following exceptions: The **MCI_ENUMERATE_CONNECTORS**, **MCI_QUERY_CONNECTOR_TYPE**, and **MCI_QUERY_VALID_CONNECTION** flags are mutually exclusive. In addition, **MCI_ENUMERATE_CONNECTORS** and **MCI_CONNECTOR_INDEX** are mutually exclusive, and the error MCIERR_FLAGS_NOT_COMPATIBLE is returned if these flags are used together.
- 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_CONNECTOR_TYPE This flag indicates that the connector type (ulConnectorType field) for the primary device is to be used for the query. When this flag is used then the ulConnectorIndex field is used as a relative index rather than an absolute index.
- MCI_CONNECTOR_INDEX This flag indicates that the ulConnectorIndex field contains the connector index for the primary device. If this flag is not specified, an index of 1 is assumed.
- MCI_QUERY_CONNECTOR_TYPE This flag returns connector type in the ulReturn field. To specify the connector to query, use the MCI_CONNECTOR_INDEX flag.
- MCI_ENUMERATE_CONNECTORS This flag returns the number of connectors for the given device. If the MCI_CONNECTOR_TYPE flag is also specified, the number of connectors for the specified type is returned. The value is returned in the ulReturn field.
- MCI_QUERY_VALID_CONNECTION This flag determines if the specified connection is possible. MCI_TRUE is returned if the connector types specified in the ulConnectorType and ulToConnectorType fields are compatible, resulting in a valid connection. Otherwise, MCI_FALSE is returned.
- MCI_TO_CONNECTOR_TYPE This flag specifies that the connector type (ulToConnectorType field) for the primary device is to be used for the query. When this flag is used, the ulConnectorIndex field is used as a relative index rather than an absolute index.
- pParam2 (PMCI_CONNECTORINFO_PARMS) - input
- A pointer to the MCI_CONNECTORINFO_PARMS data structure.
Returns
- rc (ULONG) - returns
- Return codes indicating success or type of failure:
- MCIERR_SUCCESS If the function succeeds, 0 is returned.
- MCIERR_INVALID_DEVICE_ORDINAL The device ordinal given is invalid.
- MCIERR_INVALID_DEVICE_TYPE The device type given is invalid.
- MCIERR_MISSING_FLAG A required flag is missing.
- MCIERR_INVALID_FLAG Given flag is invalid.
- MCIERR_UNSUPPORTED_FLAG Given flag is unsupported for this device.
- MCIERR_INVALID_CALLBACK_HANDLE Given callback handle is invalid.
- MCIERR_INVALID_CONNECTOR_TYPE The given connector type is invalid.
- MCIERR_INVALID_CONNECTOR_INDEX Invalid connector index given.
- MCIERR_MISSING_PARAMETER Required parameter is missing.
- MCIERR_FLAGS_NOT_COMPATIBLE Flags cannot be used together.
Remarks
This message does not require a device instance to be open.
The following is a list of connector types supported by each OS/2 multimedia device:
Amplifier Mixer Device
- MCI_AMP_STREAM_CONNECTOR
- MCI_HEADPHONES_CONNECTOR
- MCI_LINE_IN_CONNECTOR
- MCI_LINE_OUT_CONNECTOR
- MCI_MICROPHONE_CONNECTOR
- MCI_SPEAKERS_CONNECTOR
CD Audio Device
- MCI_CD_STREAM_CONNECTOR
- MCI_HEADPHONES_CONNECTOR
CD/XA Device
- MCI_XA_STREAM_CONNECTOR
Sequencer Device
- MCI_MIDI_STREAM_CONNECTOR
- (The sequencer also attempts to access the following on its associated amp/mixer): MCI_HEADPHONES_CONNECTOR, MCI_LINE_OUT_CONNECTOR, MCI_SPEAKERS_CONNECTOR.
Waveform Audio Device
- MCI_WAVE_STREAM_CONNECTOR
- (The waveform device also attempts to access the following on its associated amp/mixer): MCI_HEADPHONES_CONNECTOR, MCI_LINE_IN_CONNECTOR, MCI_LINE_OUT_CONNECTOR, MCI_MICROPHONE_CONNECTOR, MCI_SPEAKERS_CONNECTOR.
Videodisc Device
- MCI_LINE_OUT_CONNECTOR
- MCI_VIDEO_OUT_CONNECTOR
Digital Video Device
- MCI_WAVE_STREAM_CONNECTOR
- (The digital video device also attempts to access the following on its associated amp/mixer): MCI_HEADPHONES_CONNECTOR, MCI_LINE_IN_CONNECTOR, MCI_LINE_OUT_CONNECTOR, MCI_MICROPHONE_CONNECTOR, MCI_SPEAKERS_CONNECTOR, MCI_VIDEO_IN_CONNECTOR, MCI_VIDEO_OUT_CONNECTOR.
Note: MCI_VIDEO_IN_CONNECTOR and MCI_VIDEO_OUT_CONNECTOR types are only supported in recording environments.
Default Processing
If the MCI_CONNECTOR_INDEX flag is not specified, the connector index will default to 1.
Example Code
/* Determine if amp/mixer device has a microphone input */
MCI_CONNECTORINFO_PARMS conninfoparms;
ULONG rc;
ULONG NumMicConns;
conninfoparms.ulDeviceTypeID = MCI_DEVTYPE_AUDIO_AMPMIX;
conninfoparms.ulConnectorType = MCI_MICROPHONE_CONNECTOR;
rc = mciSendCommand (0, /* Ignored field */
MCI_CONNECTORINFO, /* Connectorinfo message */
MCI_ENUMERATE_CONNECTORS | MCI_WAIT | MCI_CONNECTOR_TYPE,
/* Flags for this message */
(PVOID) &conninfoparms, /* Data structure */
0); /* No user parm */
if (LOUSHORT(rc) == MCIERR_SUCCESS)
{
NumMicConns = conninfoparms.ulReturn; /* Return information */
}