3 Ann Hell Ex Machina - Music Software
4 Copyright (C) 2003/2005 Angel Ortega <angel@triptico.com>
6 out_sgi.c - Output driver for SGI IRIX
8 This program is free software; you can redistribute it and/or
9 modify it under the terms of the GNU General Public License
10 as published by the Free Software Foundation; either version 2
11 of the License, or (at your option) any later version.
13 This program is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 GNU General Public License for more details.
18 You should have received a copy of the GNU General Public License
19 along with this program; if not, write to the Free Software
20 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
22 http://www.triptico.com
28 #include "ss_output.h"
32 #include <dmedia/audio.h>
39 /* audio configuration */
45 #ifndef SGI_BUFFER_SIZE
46 #define SGI_BUFFER_SIZE 2048
53 static int _out_open_sgi(char * file
)
61 if(alSetChannels(ac
, ss_nchannels
) == -1)
64 if(alSetWidth(ac
, AL_SAMPLE_16
) == -1)
67 if(alSetSampFmt(ac
, AL_SAMPFMT_TWOSCOMP
) == -1)
70 if(alSetQueueSize(ac
, SGI_BUFFER_SIZE
) == -1)
73 if(alSetDevice(ac
, AL_DEFAULT_OUTPUT
) == -1)
76 p
[0].param
=AL_MASTER_CLOCK
;
77 p
[0].value
.i
=AL_CRYSTAL_MCLK_TYPE
;
79 p
[1].value
.ll
=alDoubleToFixed((double) ss_frequency
);
81 if(alSetParams(alGetDevice(ac
), p
, 2) == -1)
84 ap
=alOpenPort("Ann Hell Ex Machina", "w", ac
);
88 return(SGI_BUFFER_SIZE
);
92 static int _out_write_sgi(short int * buffer
, int size
)
94 alWriteFrames(ap
, buffer
, size
/ ss_nchannels
);
99 static int _out_close_sgi(void)
110 struct _output_driver _out_driver_sgi
=
111 { "sgi", NULL
, _out_open_sgi
, _out_write_sgi
, _out_close_sgi
};
113 #else /* CONFOPT_SGI */
115 struct _output_driver _out_driver_sgi
=
116 { "sgi", NULL
, NULL
, NULL
, NULL
};
118 #endif /* CONFOPT_SGI */