Return Values
The following are the values typically returned by DirectMusic interface methods. For a list of the error codes that each method can return, see the individual method descriptions. These lists are not necessarily comprehensive.
- DMUS_E_ALL_TOOLS_FAILED
- The graph object was unable to load all tools from the IStream object data, perhaps because of errors in the stream or because the tools are incorrectly registered on the client.
- DMUS_E_ALL_TRACKS_FAILED
- The segment object was unable to load all tracks from the IStream object data, perhaps because of errors in the stream or because the tracks are incorrectly registered on the client.
- DMUS_E_ALREADY_ACTIVATED
- The port has been activated, and the parameter cannot be changed.
- DMUS_E_ALREADY_DOWNLOADED
- The buffer has already been downloaded.
- DMUS_E_ALREADY_EXISTS
- The tool is already contained in the graph. You must create a new instance.
- DMUS_E_ALREADY_INITED
- The object has already been initialized.
- DMUS_E_ALREADY_LOADED
- A DLS collection is already open.
- DMUS_E_ALREADY_SENT
- The message has already been sent.
- DMUS_E_ALREADYCLOSED
- The port is not open.
- DMUS_E_ALREADYOPEN
- The port was already opened.
- DMUS_E_BADARTICULATION
- Invalid articulation chunk in DLS collection.
- DMUS_E_BADINSTRUMENT
- Invalid instrument chunk in DLS collection.
- DMUS_E_BADOFFSETTABLE
- The offset table has errors.
- DMUS_E_BADWAVE
- Corrupt wave header.
- DMUS_E_BADWAVELINK
- The wave-link chunk in DLS collection points to invalid wave.
- DMUS_E_BUFFER_EMPTY
- There is no data in the buffer.
- DMUS_E_BUFFER_FULL
- The specified number of bytes exceeds the maximum buffer size.
- DMUS_E_BUFFERNOTAVAILABLE
- The buffer is not available for download.
- DMUS_E_BUFFERNOTSET
- No buffer was prepared for the data.
- DMUS_E_CANNOT_CONVERT
- The requested conversion between music and MIDI values could not be made. This usually occurs when the provided DMUS_CHORD_KEY structure has an invalid chord or scale pattern.
- DMUS_E_CANNOT_FREE
- The message could not be freed, either because it was not allocated or because it has already been freed.
- DMUS_E_CANNOT_OPEN_PORT
- The default system port could not be opened.
- DMUS_E_CANNOTREAD
- An error occurred when trying to read from the IStream object.
- DMUS_E_CANNOTSEEK
- The IStream object does not support Seek.
- DMUS_E_CANNOTWRITE
- The IStream object does not support Write.
- DMUS_E_CHUNKNOTFOUND
- A chunk with the specified header could not be found.
- DMUS_E_DESCEND_CHUNK_FAIL
- An attempt to descend into a chunk failed.
- DMUS_E_DEVICE_IN_USE
- The device is already in use (possibly by a non-DirectMusic client) and cannot be opened again.
- DMUS_E_DMUSIC_RELEASED
- The operation cannot be performed because the final instance of the DirectMusic object was released. Ports cannot be used after final release of the DirectMusic object.
- DMUS_E_DRIVER_FAILED
- An unexpected error was returned from a device driver, indicating possible failure of the driver or hardware.
- DMUS_E_DSOUND_ALREADY_SET
- A DirectSound object has already been set.
- DMUS_E_DSOUND_NOT_SET
- The port could not be created because no DirectSound object has been specified.
- DMUS_E_GET_UNSUPPORTED
- Getting the parameter is not supported.
- DMUS_E_INSUFFICIENTBUFFER
- The buffer is not large enough for the requested operation.
- DMUS_E_INVALID_BAND
- The file does not contain a valid band.
- DMUS_E_INVALID_DOWNLOADID
- An invalid download identifier was used in the process of creating a download buffer.
- DMUS_E_INVALID_EVENT
- The event either is not a valid MIDI message or makes use of running status and cannot be packed into the buffer.
- DMUS_E_INVALID_TOOL_HDR
- The IStream object's data contains an invalid tool header and, therefore, cannot be read by the graph object.
- DMUS_E_INVALID_TRACK_HDR
- The IStream object's data contains an invalid track header and, therefore, cannot be read by the segment object.
- DMUS_E_INVALIDBUFFER
- An invalid DirectSound buffer was handed to a port.
- DMUS_E_INVALIDFILE
- Not a valid file.
- DMUS_E_INVALIDOFFSET
- Wave chunks in the DLS collection file are at incorrect offsets.
- DMUS_E_INVALIDPATCH
- No instrument in the collection matches the patch number.
- DMUS_E_INVALIDPOS
- Error reading wave data from a DLS collection. Indicates bad file.
- DMUS_E_LOADER_BADPATH
- The file path is invalid.
- DMUS_E_LOADER_FAILEDCREATE
- The object could not be found or created.
- DMUS_E_LOADER_FAILEDOPEN
- File open failed because the file does not exist or is locked.
- DMUS_E_LOADER_FORMATNOTSUPPORTED
- The object cannot be loaded because the data format is not supported.
- DMUS_E_LOADER_NOCLASSID
- No class ID was supplied in DMUS_OBJECTDESC.
- DMUS_E_LOADER_NOFILENAME
- No file name was supplied in DMUS_OBJECTDESC.
- DMUS_E_LOADER_OBJECTNOTFOUND
- The object was not found.
- DMUS_E_NO_MASTER_CLOCK
- There is no master clock in the performance. Be sure to call the IDirectMusicPerformance::Init method.
- DMUS_E_NOARTICULATION
- Articulation missing from an instrument in the DLS collection.
- DMUS_E_NOSYNTHSINK
- No sink is connected to the synthesizer.
- DMUS_E_NOT_DOWNLOADED_TO_PORT
- The object cannot be unloaded because it is not present on the port.
- DMUS_E_NOT_FOUND
- The requested item is not contained by the object.
- DMUS_E_NOT_INIT
- A required object is not initialized or failed to initialize.
- DMUS_E_NOTADLSCOL
- The object being loaded is not a valid DLS collection.
- DMUS_E_NOTMONO
- The wave chunk has more than one interleaved channel. DLS format requires mono.
- DMUS_E_NOTPCM
- Wave data is not in PCM format.
- DMUS_E_OUT_OF_RANGE
- The requested time is outside the range of the segment.
- DMUS_E_PORT_NOT_CAPTURE
- Not a capture port.
- DMUS_E_PORT_NOT_RENDER
- Not an output port.
- DMUS_E_PORTS_OPEN
- The requested operation cannot be performed while there are instantiated ports in any process in the system.
- DMUS_E_SEGMENT_INIT_FAILED
- Segment initialization failed, probably because of a critical memory situation.
- DMUS_E_SET_UNSUPPORTED
- Setting the parameter is not supported.
- DMUS_E_SYNTHACTIVE
- The synthesizer has been activated, and the parameter cannot be changed.
- DMUS_E_SYNTHINACTIVE
- The synthesizer has not been activated and cannot process data.
- DMUS_E_SYNTHNOTCONFIGURED
- The synthesizer is not properly configured or opened.
- DMUS_E_TIME_PAST
- The time requested is in the past.
- DMUS_E_TOOL_HDR_NOT_FIRST_CK
- The IStream object's data does not have a tool header as the first chunk and, therefore, cannot be read by the graph object.
- DMUS_E_TRACK_HDR_NOT_FIRST_CK
- The IStream object's data does not have a track header as the first chunk and, therefore, cannot be read by the segment object.
- DMUS_E_TRACK_NOT_FOUND
- There is no track of the requested type.
- DMUS_E_TYPE_DISABLED
- A track parameter is unavailable because it has been disabled.
- DMUS_E_TYPE_UNSUPPORTED
- Parameter is unsupported on this track.
- DMUS_E_UNKNOWNDOWNLOAD
- The synthesizer does not support this type of download.
- DMUS_E_UNKNOWN_PROPERTY
- The property set or item is not implemented by this port.
- DMUS_E_UNSUPPORTED_STREAM
- The IStream object does not contain data supported by the loading object.
- DMUS_E_WAVEFORMATNOTSUPPORTED
- Invalid buffer format was handed to the synthesizer sink.
- DMUS_S_DOWN_OCTAVE
- The note has been lowered by one or more octaves to fit within the range of MIDI values.
- DMUS_S_END
- The operation succeeded and reached the end of the data.
- DMUS_S_FREE
- The allocated memory should be freed.
- DMUS_S_LAST_TOOL
- There are no more tools in the graph.
- DMUS_S_NOBUFFERCONTROL
- Although the audio output from the port is routed to the same device as the given DirectSound buffer, buffer controls such as pan and volume do not affect the output.
- DMUS_S_OVER_CHORD
- No MIDI values have been calculated because the music value has the note at a position higher than the top note of the chord.
- DMUS_S_PARTIALDOWNLOAD
- Some instruments could not be downloaded to the port.
- DMUS_S_PARTIALLOAD
- The object could only load partially. This can happen if some components, such as embedded tracks and tools, are not registered properly.
- DMUS_S_REQUEUE
- The message should be passed to the next tool.
- DMUS_S_STRING_TRUNCATED
- The method succeeded, but the returned string had to be truncated.
- DMUS_S_UP_OCTAVE
- The note has been raised by one or more octaves to fit within the range of MIDI values.
- E_FAIL
- The method did not succeed.
- E_INVALIDARG
- Invalid argument. Often, this error results from failing to initialize the dwSize member of a structure before passing it to the method.
- E_NOAGGREGATION
- Aggregation is not supported. The LPUNKNOWN parameter should be set to NULL.
- E_NOINTERFACE
- No object interface is available.
- E_NOTIMPL
- The method is not implemented. This value might be returned if a driver does not support a feature necessary for the operation.
- E_OUTOFMEMORY
- Insufficient memory to complete the task.
- E_POINTER
- An invalid pointer (usually NULL) was passed as a parameter.
- REGDB_E_CLASSNOTREG
- The object class is not registered.
- S_FALSE
- The method succeeded, but there was nothing to do.
- S_OK
- The operation was completed successfully.