sound initialisation
Neil Walker

Hello,
A simple question, if either detect_digi_driver() or detect_midi_driver() fails, will calling install_sound(DIGI_AUTODETECT, MIDI_AUTODETECT) pass or fail?

There seems to be two different detection routines but only one install, so how do you know if either actually fails at the install_sound call?

Thanks.

Sirocco

From the manual:

Quote:

Returns zero if the sound is successfully installed, and -1 on failure. If it fails it will store a description of the problem in allegro_error.

Hopefully that will be enough to work with, but I understand where you're coming from. Seems like if either one fails, install_sound fails.

scriptX

Is this what you're asking?

if (detect_digi_driver(ABC) && detect_digi_driver(ABCD)) {
  install_sound(ABC, ABCD);
} else if (detect_digi_driver(ABC)) {
  install_sound(ABC, MIDI_NONE);
} else if (detect_digi_driver(ABCD)) {
  install_sound(DIGI_NONE, ABCD);
}

Might be wrong, I've never done that before.. just thought of it on the spot.

Synapse Jumps

can you pass DIGITAL_AUTODETECT to detect_digi_driver?

If you can, I'd say that a call to install_sound with any paramter as the digital (save DIGI_NONE) paramter would fail.

Same goes for MIDI.

Neil Walker

Cheers, never thought of reading the manual to see if there was a MIDI_NONE :)

Thread #554047. Printed from Allegro.cc