require '_h2ph_pre.ph';

unless(defined(&_ULTRASOUND_H_)) {
    eval 'sub _ULTRASOUND_H_ () {1;}' unless defined(&_ULTRASOUND_H_);
    eval 'sub _GUS_NUMVOICES () {0x;}' unless defined(&_GUS_NUMVOICES);
    eval 'sub _GUS_VOICESAMPLE () {0x1;}' unless defined(&_GUS_VOICESAMPLE);
    eval 'sub _GUS_VOICEON () {0x2;}' unless defined(&_GUS_VOICEON);
    eval 'sub _GUS_VOICEOFF () {0x3;}' unless defined(&_GUS_VOICEOFF);
    eval 'sub _GUS_VOICEMODE () {0x4;}' unless defined(&_GUS_VOICEMODE);
    eval 'sub _GUS_VOICEBALA () {0x5;}' unless defined(&_GUS_VOICEBALA);
    eval 'sub _GUS_VOICEFREQ () {0x6;}' unless defined(&_GUS_VOICEFREQ);
    eval 'sub _GUS_VOICEVOL () {0x7;}' unless defined(&_GUS_VOICEVOL);
    eval 'sub _GUS_RAMPRANGE () {0x8;}' unless defined(&_GUS_RAMPRANGE);
    eval 'sub _GUS_RAMPRATE () {0x9;}' unless defined(&_GUS_RAMPRATE);
    eval 'sub _GUS_RAMPMODE () {0xa;}' unless defined(&_GUS_RAMPMODE);
    eval 'sub _GUS_RAMPON () {0xb;}' unless defined(&_GUS_RAMPON);
    eval 'sub _GUS_RAMPOFF () {0xc;}' unless defined(&_GUS_RAMPOFF);
    eval 'sub _GUS_VOICEFADE () {0xd;}' unless defined(&_GUS_VOICEFADE);
    eval 'sub _GUS_VOLUME_SCALE () {0xe;}' unless defined(&_GUS_VOLUME_SCALE);
    eval 'sub _GUS_VOICEVOL2 () {0xf;}' unless defined(&_GUS_VOICEVOL2);
    eval 'sub _GUS_VOICE_POS () {0x10;}' unless defined(&_GUS_VOICE_POS);
    eval 'sub _GUS_CMD {
        local($chn, $voice, $cmd, $p1, $p2) = @_;
	    eval q({ &_SEQ_NEEDBUF(8);  $_seqbuf[ &_seqbufptr] =  &SEQ_PRIVATE;  $_seqbuf[ &_seqbufptr+1] = ($chn);  $_seqbuf[ &_seqbufptr+2] = $cmd;  $_seqbuf[ &_seqbufptr+3] = $voice; *& $_seqbuf[ &_seqbufptr+4] = $p1; *& $_seqbuf[ &_seqbufptr+6] = $p2;  &_SEQ_ADVBUF(8);});
    }' unless defined(&_GUS_CMD);
    eval 'sub GUS_NUMVOICES {
        local($chn, $p1) = @_;
	    eval q( &_GUS_CMD($chn, 0,  &_GUS_NUMVOICES, ($p1), 0));
    }' unless defined(&GUS_NUMVOICES);
    eval 'sub GUS_VOICESAMPLE {
        local($chn, $voice, $p1) = @_;
	    eval q( &_GUS_CMD($chn, $voice,  &_GUS_VOICESAMPLE, ($p1), 0));
    }' unless defined(&GUS_VOICESAMPLE);
    eval 'sub GUS_VOICEON {
        local($chn, $voice, $p1) = @_;
	    eval q( &_GUS_CMD($chn, $voice,  &_GUS_VOICEON, ($p1), 0));
    }' unless defined(&GUS_VOICEON);
    eval 'sub GUS_VOICEOFF {
        local($chn, $voice) = @_;
	    eval q( &_GUS_CMD($chn, $voice,  &_GUS_VOICEOFF, 0, 0));
    }' unless defined(&GUS_VOICEOFF);
    eval 'sub GUS_VOICEFADE {
        local($chn, $voice) = @_;
	    eval q( &_GUS_CMD($chn, $voice,  &_GUS_VOICEFADE, 0, 0));
    }' unless defined(&GUS_VOICEFADE);
    eval 'sub GUS_VOICEMODE {
        local($chn, $voice, $p1) = @_;
	    eval q( &_GUS_CMD($chn, $voice,  &_GUS_VOICEMODE, ($p1), 0));
    }' unless defined(&GUS_VOICEMODE);
    eval 'sub GUS_VOICEBALA {
        local($chn, $voice, $p1) = @_;
	    eval q( &_GUS_CMD($chn, $voice,  &_GUS_VOICEBALA, ($p1), 0));
    }' unless defined(&GUS_VOICEBALA);
    eval 'sub GUS_VOICEFREQ {
        local($chn, $voice, $p) = @_;
	    eval q( &_GUS_CMD($chn, $voice,  &_GUS_VOICEFREQ, ($p) & 0xffff, (($p) >> 16) & 0xffff));
    }' unless defined(&GUS_VOICEFREQ);
    eval 'sub GUS_VOICEVOL {
        local($chn, $voice, $p1) = @_;
	    eval q( &_GUS_CMD($chn, $voice,  &_GUS_VOICEVOL, ($p1), 0));
    }' unless defined(&GUS_VOICEVOL);
    eval 'sub GUS_VOICEVOL2 {
        local($chn, $voice, $p1) = @_;
	    eval q( &_GUS_CMD($chn, $voice,  &_GUS_VOICEVOL2, ($p1), 0));
    }' unless defined(&GUS_VOICEVOL2);
    eval 'sub GUS_RAMPRANGE {
        local($chn, $voice, $low, $high) = @_;
	    eval q( &_GUS_CMD($chn, $voice,  &_GUS_RAMPRANGE, ($low), ($high)));
    }' unless defined(&GUS_RAMPRANGE);
    eval 'sub GUS_RAMPRATE {
        local($chn, $voice, $p1, $p2) = @_;
	    eval q( &_GUS_CMD($chn, $voice,  &_GUS_RAMPRATE, ($p1), ($p2)));
    }' unless defined(&GUS_RAMPRATE);
    eval 'sub GUS_RAMPMODE {
        local($chn, $voice, $p1) = @_;
	    eval q( &_GUS_CMD($chn, $voice,  &_GUS_RAMPMODE, ($p1), 0));
    }' unless defined(&GUS_RAMPMODE);
    eval 'sub GUS_RAMPON {
        local($chn, $voice, $p1) = @_;
	    eval q( &_GUS_CMD($chn, $voice,  &_GUS_RAMPON, ($p1), 0));
    }' unless defined(&GUS_RAMPON);
    eval 'sub GUS_RAMPOFF {
        local($chn, $voice) = @_;
	    eval q( &_GUS_CMD($chn, $voice,  &_GUS_RAMPOFF, 0, 0));
    }' unless defined(&GUS_RAMPOFF);
    eval 'sub GUS_VOLUME_SCALE {
        local($chn, $voice, $p1, $p2) = @_;
	    eval q( &_GUS_CMD($chn, $voice,  &_GUS_VOLUME_SCALE, ($p1), ($p2)));
    }' unless defined(&GUS_VOLUME_SCALE);
    eval 'sub GUS_VOICE_POS {
        local($chn, $voice, $p) = @_;
	    eval q( &_GUS_CMD($chn, $voice,  &_GUS_VOICE_POS, ($p) & 0xffff, (($p) >> 16) & 0xffff));
    }' unless defined(&GUS_VOICE_POS);
}
1;
