Merge branch 'master' of xmp.git.sf.net:/gitroot/xmp/xmp

master
Claudio Matsuoka 14 years ago
commit a521a6e273
  1. 2
      Makefile.in
  2. 4
      README
  3. 2
      src/info.c
  4. 8
      src/main.c
  5. 10
      src/options.c
  6. 4
      src/sound_ahi.c
  7. 4
      src/sound_aix.c
  8. 12
      src/sound_alsa.c
  9. 6
      src/sound_alsa05.c
  10. 4
      src/sound_beos.c
  11. 8
      src/sound_bsd.c
  12. 8
      src/sound_coreaudio.c
  13. 4
      src/sound_dart.c
  14. 8
      src/sound_hpux.c
  15. 8
      src/sound_netbsd.c
  16. 14
      src/sound_oss.c
  17. 4
      src/sound_pulseaudio.c
  18. 4
      src/sound_qnx.c
  19. 12
      src/sound_sgi.c
  20. 8
      src/sound_sndio.c
  21. 4
      src/sound_solaris.c
  22. 8
      src/sound_wav.c
  23. 4
      src/sound_win32.c
  24. 19
      src/xmp.1

@ -18,7 +18,7 @@ SHELL = /bin/sh
V = 0 V = 0
DIST = xmp-$(VERSION) DIST = xmp-$(VERSION)
DFILES = README configure config.sub config.guess install-sh \ DFILES = README INSTALL configure config.sub config.guess install-sh \
configure.ac Makefile.in $(MODULES) configure.ac Makefile.in $(MODULES)
DDIRS = src DDIRS = src
MODULES = delicate_oooz!.mod MODULES = delicate_oooz!.mod

@ -1,6 +1,7 @@
___ ___ ____________ ___ ___ ____________
\ \/ // ____ \ \ \/ // ____ \
> <| Y Y \ |_> > > <| Y Y \ |_> >
@ -51,7 +52,8 @@ directly to cmatsuoka@gmail.com.
LICENSE LICENSE
Extended Module Player (C) 1996-2012 Claudio Matsuoka and Hipolito Carraro Jr Extended Module Player
Copyright (C) 1996-2012 Claudio Matsuoka and Hipolito Carraro Jr
This program is free software; you can redistribute it and/or modify it under This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software the terms of the GNU General Public License as published by the Free Software

@ -227,7 +227,7 @@ void info_samples(struct xmp_module_info *mi)
report("Samples:\n"); report("Samples:\n");
report(" Sample name Length Start End Flags\n"); report(" Sample name Length Start End Flags\n");
for (i = 0; i < mod->ins; i++) { for (i = 0; i < mod->smp; i++) {
struct xmp_sample *smp = &mod->xxs[i]; struct xmp_sample *smp = &mod->xxs[i];
if (strlen(smp->name) == 0 && smp->len == 0) { if (strlen(smp->name) == 0 && smp->len == 0) {

@ -199,10 +199,10 @@ int main(int argc, char **argv)
report("Using %s\n", sound->description); report("Using %s\n", sound->description);
report("Mixer set to %d Hz, %dbit, %s%s%s\n", options.rate, report("Mixer set to %d Hz, %dbit, %s%s%s\n", options.rate,
options.format & XMP_FORMAT_8BIT ? 8 : 16, options.format & XMP_MIX_8BIT ? 8 : 16,
options.format & XMP_FORMAT_NEAREST ? "" : "interpolated ", options.format & XMP_MIX_NEAREST ? "" : "interpolated ",
options.format & XMP_FORMAT_MONO ? "mono" : "stereo", options.format & XMP_MIX_MONO ? "mono" : "stereo",
options.format & XMP_FORMAT_NOFILTER ? " (no filter)" : ""); options.format & XMP_MIX_NOFILTER ? " (no filter)" : "");
} }
if (options.probeonly) { if (options.probeonly) {

@ -143,7 +143,7 @@ void get_options(int argc, char **argv, struct options *options)
break; break;
case 'b': case 'b':
if (atoi(optarg) == 8) { if (atoi(optarg) == 8) {
options->format |= XMP_FORMAT_8BIT; options->format |= XMP_MIX_8BIT;
} }
break; break;
case 'c': case 'c':
@ -157,7 +157,7 @@ void get_options(int argc, char **argv, struct options *options)
options->driver_id = optarg; options->driver_id = optarg;
break; break;
case 'F': case 'F':
options->format |= XMP_FORMAT_NOFILTER; options->format |= XMP_MIX_NOFILTER;
break; break;
case 'f': case 'f':
options->rate = strtoul(optarg, NULL, 0); options->rate = strtoul(optarg, NULL, 0);
@ -182,13 +182,13 @@ void get_options(int argc, char **argv, struct options *options)
options->loop = 1; options->loop = 1;
break; break;
case 'm': case 'm':
options->format |= XMP_FORMAT_MONO; options->format |= XMP_MIX_MONO;
break; break;
case 'N': case 'N':
options->silent = 1; options->silent = 1;
break; break;
case 'n': case 'n':
options->format |= XMP_FORMAT_NEAREST; options->format |= XMP_MIX_NEAREST;
break; break;
case OPT_NOCMD: case OPT_NOCMD:
options->nocmd = 1; options->nocmd = 1;
@ -252,7 +252,7 @@ void get_options(int argc, char **argv, struct options *options)
options->max_time = strtoul(optarg, NULL, 0) * 1000; options->max_time = strtoul(optarg, NULL, 0) * 1000;
break; break;
case 'u': case 'u':
options->format |= XMP_FORMAT_UNSIGNED; options->format |= XMP_MIX_UNSIGNED;
break; break;
case 'V': case 'V':
puts("Extended Module Player " VERSION); puts("Extended Module Player " VERSION);

@ -16,8 +16,8 @@ static int init(struct options *options)
{ {
char **parm = options->driver_parm; char **parm = options->driver_parm;
char outfile[256]; char outfile[256];
int nch = options->format & XMP_FORMAT_MONO ? 1 : 2; int nch = options->format & XMP_MIX_MONO ? 1 : 2;
int res = options->format & XMP_FORMAT_8BIT ? 8 : 16; int res = options->format & XMP_MIX_8BIT ? 8 : 16;
int bsize = options->rate * nch * res / 4; int bsize = options->rate * nch * res / 4;
parm_init(parm); parm_init(parm);

@ -45,8 +45,8 @@ static int init(struct options *options)
init.mode = PCM; /* audio format */ init.mode = PCM; /* audio format */
init.srate = options->rate; /* sample rate */ init.srate = options->rate; /* sample rate */
init.operation = PLAY; /* PLAY or RECORD */ init.operation = PLAY; /* PLAY or RECORD */
init.channels = options->format & XMP_FORMAT_MONO ? 1 : 2; init.channels = options->format & XMP_MIX_MONO ? 1 : 2;
init.bits_per_sample = options->format & XMP_FORMAT_8BIT ? 8 : 16; init.bits_per_sample = options->format & XMP_MIX_8BIT ? 8 : 16;
init.flags = BIG_ENDIAN | TWOS_COMPLEMENT; init.flags = BIG_ENDIAN | TWOS_COMPLEMENT;
if (ioctl(audio_fd, AUDIO_INIT, &init) < 0) { if (ioctl(audio_fd, AUDIO_INIT, &init) < 0) {

@ -29,12 +29,12 @@ static int init(struct options *options)
return -1; return -1;
} }
channels = format & XMP_FORMAT_MONO ? 1 : 2; channels = format & XMP_MIX_MONO ? 1 : 2;
if (format & XMP_FORMAT_UNSIGNED) { if (format & XMP_MIX_UNSIGNED) {
fmt = format & XMP_FORMAT_8BIT ? fmt = format & XMP_MIX_8BIT ?
SND_PCM_FORMAT_U8 : SND_PCM_FORMAT_U16; SND_PCM_FORMAT_U8 : SND_PCM_FORMAT_U16;
} else { } else {
fmt = format & XMP_FORMAT_8BIT ? fmt = format & XMP_MIX_8BIT ?
SND_PCM_FORMAT_S8 : SND_PCM_FORMAT_S16; SND_PCM_FORMAT_S8 : SND_PCM_FORMAT_S16;
} }
@ -62,9 +62,9 @@ static int init(struct options *options)
} }
if (channels == 1) { if (channels == 1) {
format |= XMP_FORMAT_MONO; format |= XMP_MIX_MONO;
} else { } else {
format &= ~XMP_FORMAT_MONO; format &= ~XMP_MIX_MONO;
} }
options->rate = rate; options->rate = rate;

@ -54,7 +54,7 @@ static int to_fmt(struct options *options)
{ {
int fmt; int fmt;
if (options->format & XMP_FORMAT_8BIT) { if (options->format & XMP_MIX_8BIT) {
fmt = SND_PCM_SFMT_U8 | SND_PCM_SFMT_S8; fmt = SND_PCM_SFMT_U8 | SND_PCM_SFMT_S8;
} else { } else {
fmt = SND_PCM_SFMT_S16_LE | SND_PCM_SFMT_S16_BE | fmt = SND_PCM_SFMT_S16_LE | SND_PCM_SFMT_S16_BE |
@ -67,7 +67,7 @@ static int to_fmt(struct options *options)
} }
} }
if (options->format & XMP_FORMAT_UNSIGNED) { if (options->format & XMP_MIX_UNSIGNED) {
fmt &= SND_PCM_SFMT_U8|SND_PCM_SFMT_U16_LE|SND_PCM_SFMT_U16_BE; fmt &= SND_PCM_SFMT_U8|SND_PCM_SFMT_U16_LE|SND_PCM_SFMT_U16_BE;
} else { } else {
fmt &= SND_PCM_SFMT_S8|SND_PCM_SFMT_S16_LE|SND_PCM_SFMT_S16_BE; fmt &= SND_PCM_SFMT_S8|SND_PCM_SFMT_S16_LE|SND_PCM_SFMT_S16_BE;
@ -134,7 +134,7 @@ static int init(struct options *options)
params.format.interleave = 1; params.format.interleave = 1;
params.format.format = to_fmt(o); params.format.format = to_fmt(o);
params.format.rate = options->rate; params.format.rate = options->rate;
params.format.voices = (o->outfmt & XMP_FORMAT_MONO) ? 1 : 2; params.format.voices = (o->outfmt & XMP_MIX_MONO) ? 1 : 2;
if ((rc = snd_pcm_plugin_params(pcm_handle, &params)) < 0) { if ((rc = snd_pcm_plugin_params(pcm_handle, &params)) < 0) {
printf("Unable to set output parameters: %s\n", printf("Unable to set output parameters: %s\n",

@ -156,8 +156,8 @@ static int init(struct options *options)
sound_beos.description = desc; sound_beos.description = desc;
fmt.frame_rate = options->rate; fmt.frame_rate = options->rate;
fmt.channel_count = options->format & XMP_FORMAT_MONO ? 1 : 2; fmt.channel_count = options->format & XMP_MIX_MONO ? 1 : 2;
fmt.format = options->format & XMP_FORMAT_8BIT ? fmt.format = options->format & XMP_MIX_8BIT ?
B_AUDIO_CHAR : B_AUDIO_SHORT; B_AUDIO_CHAR : B_AUDIO_SHORT;
fmt.byte_order = B_HOST_IS_LENDIAN ? fmt.byte_order = B_HOST_IS_LENDIAN ?
B_MEDIA_LITTLE_ENDIAN : B_MEDIA_BIG_ENDIAN; B_MEDIA_LITTLE_ENDIAN : B_MEDIA_BIG_ENDIAN;

@ -34,18 +34,18 @@ static int init(struct options *options)
AUDIO_INITINFO(&ainfo); AUDIO_INITINFO(&ainfo);
ainfo.play.sample_rate = options->rate; ainfo.play.sample_rate = options->rate;
ainfo.play.channels = options->format & XMP_FORMAT_MONO ? 1 : 2; ainfo.play.channels = options->format & XMP_MIX_MONO ? 1 : 2;
ainfo.play.gain = gain; ainfo.play.gain = gain;
ainfo.play.buffer_size = bsize; ainfo.play.buffer_size = bsize;
if (options->format & XMP_FORMAT_8BIT) { if (options->format & XMP_MIX_8BIT) {
ainfo.play.precision = 8; ainfo.play.precision = 8;
ainfo.play.encoding = AUDIO_ENCODING_ULINEAR; ainfo.play.encoding = AUDIO_ENCODING_ULINEAR;
options->format |= XMP_FORMAT_UNSIGNED; options->format |= XMP_MIX_UNSIGNED;
} else { } else {
ainfo.play.precision = 16; ainfo.play.precision = 16;
ainfo.play.encoding = AUDIO_ENCODING_SLINEAR; ainfo.play.encoding = AUDIO_ENCODING_SLINEAR;
options->format &= ~XMP_FORMAT_UNSIGNED; options->format &= ~XMP_MIX_UNSIGNED;
} }
if (ioctl(audio_fd, AUDIO_SETINFO, &ainfo) == -1) { if (ioctl(audio_fd, AUDIO_SETINFO, &ainfo) == -1) {

@ -128,14 +128,14 @@ static int init(struct options *options)
ad.mFormatFlags = kAudioFormatFlagIsPacked /* | ad.mFormatFlags = kAudioFormatFlagIsPacked /* |
kAudioFormatFlagNativeEndian */; kAudioFormatFlagNativeEndian */;
if (~options->format & XMP_FORMAT_UNSIGNED) { if (~options->format & XMP_MIX_UNSIGNED) {
ad.mFormatFlags |= kAudioFormatFlagIsSignedInteger; ad.mFormatFlags |= kAudioFormatFlagIsSignedInteger;
} }
ad.mChannelsPerFrame = options->format & XMP_FORMAT_MONO ? 1 : 2; ad.mChannelsPerFrame = options->format & XMP_MIX_MONO ? 1 : 2;
ad.mBitsPerChannel = options->format & XMP_FORMAT_8BIT ? 8 : 16; ad.mBitsPerChannel = options->format & XMP_MIX_8BIT ? 8 : 16;
if (options->format & XMP_FORMAT_8BIT) { if (options->format & XMP_MIX_8BIT) {
ad.mBytesPerFrame = ad.mChannelsPerFrame; ad.mBytesPerFrame = ad.mChannelsPerFrame;
} else { } else {
ad.mBytesPerFrame = 2 * ad.mChannelsPerFrame; ad.mBytesPerFrame = 2 * ad.mChannelsPerFrame;

@ -110,10 +110,10 @@ static int init(struct options *options)
memset(&MixSetupParms, 0, sizeof(MCI_MIXSETUP_PARMS)); memset(&MixSetupParms, 0, sizeof(MCI_MIXSETUP_PARMS));
MixSetupParms.ulBitsPerSample = MixSetupParms.ulBitsPerSample =
options->format & XMP_FORMAT_8BIT ? 8 : 16; options->format & XMP_MIX_8BIT ? 8 : 16;
MixSetupParms.ulFormatTag = MCI_WAVE_FORMAT_PCM; MixSetupParms.ulFormatTag = MCI_WAVE_FORMAT_PCM;
MixSetupParms.ulSamplesPerSec = options->rate; MixSetupParms.ulSamplesPerSec = options->rate;
MixSetupParms.ulChannels = options->format & XMP_FORMAT_MONO ? 1 : 2; MixSetupParms.ulChannels = options->format & XMP_MIX_MONO ? 1 : 2;
MixSetupParms.ulFormatMode = MCI_PLAY; MixSetupParms.ulFormatMode = MCI_PLAY;
MixSetupParms.ulDeviceType = MCI_DEVTYPE_WAVEFORM_AUDIO; MixSetupParms.ulDeviceType = MCI_DEVTYPE_WAVEFORM_AUDIO;
MixSetupParms.pmixEvent = OS2_Dart_UpdateBuffers; MixSetupParms.pmixEvent = OS2_Dart_UpdateBuffers;

@ -23,7 +23,7 @@ static int init(struct options *options)
int gain = 128; int gain = 128;
int bsize = 32 * 1024; int bsize = 32 * 1024;
int port = AUDIO_OUT_SPEAKER; int port = AUDIO_OUT_SPEAKER;
int nch = options->format & XMP_FORMAT_MONO ? 1 : 2; int nch = options->format & XMP_MIX_MONO ? 1 : 2;
struct audio_gains agains; struct audio_gains agains;
struct audio_describe adescribe; struct audio_describe adescribe;
int i; int i;
@ -55,13 +55,13 @@ static int init(struct options *options)
if ((flags = fcntl(audio_fd, F_SETFL, flags)) < 0) if ((flags = fcntl(audio_fd, F_SETFL, flags)) < 0)
goto err1; goto err1;
options->format &= ~XMP_FORMAT_8BIT; options->format &= ~XMP_MIX_8BIT;
if (ioctl(audio_fd, AUDIO_SET_DATA_FORMAT, AUDIO_FORMAT_LINEAR16BIT) == -1) if (ioctl(audio_fd, AUDIO_SET_DATA_FORMAT, AUDIO_FORMAT_LINEAR16BIT) == -1)
goto err1; goto err1;
if (ioctl(audio_fd, AUDIO_SET_CHANNELS, nch) == -1) { if (ioctl(audio_fd, AUDIO_SET_CHANNELS, nch) == -1) {
options->format ^= XMP_FORMAT_MONO; options->format ^= XMP_MIX_MONO;
nch = options->format & XMP_FORMAT_MONO ? 1 : 2; nch = options->format & XMP_MIX_MONO ? 1 : 2;
if (ioctl(audio_fd, AUDIO_SET_CHANNELS, nch) == -1) { if (ioctl(audio_fd, AUDIO_SET_CHANNELS, nch) == -1) {
goto err1; goto err1;

@ -61,16 +61,16 @@ static int init(struct options *options)
AUDIO_INITINFO(&ainfo); AUDIO_INITINFO(&ainfo);
ainfo.play.sample_rate = options->rate; ainfo.play.sample_rate = options->rate;
ainfo.play.channels = options->format & XMP_FORMAT_MONO ? 1 : 2; ainfo.play.channels = options->format & XMP_MIX_MONO ? 1 : 2;
if (options->format & XMP_FORMAT_8BIT) { if (options->format & XMP_MIX_8BIT) {
ainfo.play.precision = 8; ainfo.play.precision = 8;
ainfo.play.precision = AUDIO_ENCODING_ULINEAR; ainfo.play.precision = AUDIO_ENCODING_ULINEAR;
options->format |= XMP_FORMAT_UNSIGNED; options->format |= XMP_MIX_UNSIGNED;
} else { } else {
ainfo.play.precision = 16; ainfo.play.precision = 16;
ainfo.play.precision = AUDIO_ENCODING_SLINEAR; ainfo.play.precision = AUDIO_ENCODING_SLINEAR;
options->format &= ~XMP_FORMAT_UNSIGNED; options->format &= ~XMP_MIX_UNSIGNED;
} }
ainfo.play.gain = gain; ainfo.play.gain = gain;

@ -39,13 +39,13 @@ static int to_fmt(int format)
{ {
int fmt; int fmt;
if (format & XMP_FORMAT_8BIT) if (format & XMP_MIX_8BIT)
fmt = AFMT_U8 | AFMT_S8; fmt = AFMT_U8 | AFMT_S8;
else { else {
fmt = AFMT_S16_NE | AFMT_U16_NE; fmt = AFMT_S16_NE | AFMT_U16_NE;
} }
if (format & XMP_FORMAT_UNSIGNED) if (format & XMP_MIX_UNSIGNED)
fmt &= AFMT_U8 | AFMT_U16_LE | AFMT_U16_BE; fmt &= AFMT_U8 | AFMT_U16_LE | AFMT_U16_BE;
else else
fmt &= AFMT_S8 | AFMT_S16_LE | AFMT_S16_BE; fmt &= AFMT_S8 | AFMT_S16_LE | AFMT_S16_BE;
@ -58,11 +58,11 @@ static int from_fmt(int fmt)
int format = 0; int format = 0;
if (!(fmt & (AFMT_S16_LE | AFMT_S16_BE | AFMT_U16_LE | AFMT_U16_BE))) { if (!(fmt & (AFMT_S16_LE | AFMT_S16_BE | AFMT_U16_LE | AFMT_U16_BE))) {
format |= XMP_FORMAT_8BIT; format |= XMP_MIX_8BIT;
} }
if (fmt & (AFMT_U8 | AFMT_U16_LE | AFMT_U16_BE)) { if (fmt & (AFMT_U8 | AFMT_U16_LE | AFMT_U16_BE)) {
format |= XMP_FORMAT_UNSIGNED; format |= XMP_MIX_UNSIGNED;
} }
return format; return format;
@ -80,12 +80,12 @@ static void setaudio(int *rate, int *format)
ioctl(audio_fd, SNDCTL_DSP_SETFMT, &fmt); ioctl(audio_fd, SNDCTL_DSP_SETFMT, &fmt);
*format = from_fmt(fmt); *format = from_fmt(fmt);
fmt = !(*format & XMP_FORMAT_MONO); fmt = !(*format & XMP_MIX_MONO);
ioctl(audio_fd, SNDCTL_DSP_STEREO, &fmt); ioctl(audio_fd, SNDCTL_DSP_STEREO, &fmt);
if (fmt) { if (fmt) {
*format &= ~XMP_FORMAT_MONO; *format &= ~XMP_MIX_MONO;
} else { } else {
*format |= XMP_FORMAT_MONO; *format |= XMP_MIX_MONO;
} }
ioctl(audio_fd, SNDCTL_DSP_SPEED, rate); ioctl(audio_fd, SNDCTL_DSP_SPEED, rate);

@ -11,10 +11,10 @@ static int init(struct options *options)
pa_sample_spec ss; pa_sample_spec ss;
int error; int error;
options->format &= ~(XMP_FORMAT_UNSIGNED | XMP_FORMAT_8BIT); options->format &= ~(XMP_MIX_UNSIGNED | XMP_MIX_8BIT);
ss.format = PA_SAMPLE_S16NE; ss.format = PA_SAMPLE_S16NE;
ss.channels = options->format & XMP_FORMAT_MONO ? 1 : 2; ss.channels = options->format & XMP_MIX_MONO ? 1 : 2;
ss.rate = options->rate; ss.rate = options->rate;
s = pa_simple_new(NULL, /* Use the default server */ s = pa_simple_new(NULL, /* Use the default server */

@ -20,7 +20,7 @@ static int init(struct options *options)
parm_end(); parm_end();
rate = options->rate; rate = options->rate;
bits = options->format & XMP_FORMAT_8BIT ? 8 : 16; bits = options->format & XMP_MIX_8BIT ? 8 : 16;
stereo = 1; stereo = 1;
bufsize = 32 * 1024; bufsize = 32 * 1024;
@ -30,7 +30,7 @@ static int init(struct options *options)
return -1; return -1;
} }
if (options->outfmt & XMP_FORMAT_MONO) if (options->outfmt & XMP_MIX_MONO)
stereo = 0; stereo = 0;
if (ioctl(fd_audio, SOUND_PCM_WRITE_BITS, &bits) < 0) { if (ioctl(fd_audio, SOUND_PCM_WRITE_BITS, &bits) < 0) {

@ -74,11 +74,11 @@ static int init(struct options *options)
* Set sample width; 24 bit samples are not currently supported by xmp * Set sample width; 24 bit samples are not currently supported by xmp
*/ */
if (options->format & XMP_FORMAT_8BIT) { if (options->format & XMP_MIX_8BIT) {
if (ALsetwidth(config, AL_SAMPLE_8) < 0) { if (ALsetwidth(config, AL_SAMPLE_8) < 0) {
if (ALsetwidth(config, AL_SAMPLE_16) < 0) if (ALsetwidth(config, AL_SAMPLE_16) < 0)
return -1; return -1;
options->format &= ~XMP_FORMAT_8BIT; options->format &= ~XMP_MIX_8BIT;
} else { } else {
al_sample_16 = 0; al_sample_16 = 0;
} }
@ -86,7 +86,7 @@ static int init(struct options *options)
if (ALsetwidth(config, AL_SAMPLE_16) < 0) { if (ALsetwidth(config, AL_SAMPLE_16) < 0) {
if (ALsetwidth(config, AL_SAMPLE_8) < 0) if (ALsetwidth(config, AL_SAMPLE_8) < 0)
return -1; return -1;
options->format |= XMP_FORMAT_8BIT; options->format |= XMP_MIX_8BIT;
} else { } else {
al_sample_16 = 1; al_sample_16 = 1;
} }
@ -96,17 +96,17 @@ static int init(struct options *options)
* Set number of channels; 4 channel output is not currently supported * Set number of channels; 4 channel output is not currently supported
*/ */
if (options->format & XMP_FORMAT_MONO) { if (options->format & XMP_MIX_MONO) {
if (ALsetchannels(config, AL_MONO) < 0) { if (ALsetchannels(config, AL_MONO) < 0) {
if (ALsetchannels(config, AL_STEREO) < 0) if (ALsetchannels(config, AL_STEREO) < 0)
return -1; return -1;
options->format &= ~XMP_FORMAT_MONO; options->format &= ~XMP_MIX_MONO;
} }
} else { } else {
if (ALsetchannels(config, AL_STEREO) < 0) { if (ALsetchannels(config, AL_STEREO) < 0) {
if (ALsetchannels(config, AL_MONO) < 0) if (ALsetchannels(config, AL_MONO) < 0)
return -1; return -1;
options->format |= XMP_FORMAT_MONO; options->format |= XMP_MIX_MONO;
} }
} }

@ -33,19 +33,19 @@ static int init(struct options *options)
} }
sio_initpar(&par); sio_initpar(&par);
par.pchan = options->format & XMP_FORMAT_MONO ? 1 : 2; par.pchan = options->format & XMP_MIX_MONO ? 1 : 2;
par.rate = options->rate; par.rate = options->rate;
par.le = SIO_LE_NATIVE; par.le = SIO_LE_NATIVE;
par.appbufsz = par.rate / 4; par.appbufsz = par.rate / 4;
if (options->format & XMP_FORMAT_8BIT) { if (options->format & XMP_MIX_8BIT) {
par.bits = 8; par.bits = 8;
par.sig = 0; par.sig = 0;
options->format |= XMP_FORMAT_UNSIGNED; options->format |= XMP_MIX_UNSIGNED;
} else { } else {
par.bits = 16; par.bits = 16;
par.sig = 1; par.sig = 1;
options->format &= ~XMP_FORMAT_UNSIGNED; options->format &= ~XMP_MIX_UNSIGNED;
} }

@ -108,8 +108,8 @@ static int init(struct options *options)
AUDIO_INITINFO(&ainfo2); /* For AMD 7930 if needed */ AUDIO_INITINFO(&ainfo2); /* For AMD 7930 if needed */
ainfo.play.sample_rate = options->rate; ainfo.play.sample_rate = options->rate;
ainfo.play.channels = options->format & XMP_FORMAT_MONO ? 1 : 2; ainfo.play.channels = options->format & XMP_MIX_MONO ? 1 : 2;
ainfo.play.precision = options->format & XMP_FORMAT_8BIT ? 8 : 16; ainfo.play.precision = options->format & XMP_MIX_8BIT ? 8 : 16;
ainfo.play.encoding = AUDIO_ENCODING_LINEAR; ainfo.play.encoding = AUDIO_ENCODING_LINEAR;
ainfo2.play.gain = ainfo.play.gain = gain; ainfo2.play.gain = ainfo.play.gain = gain;
ainfo2.play.port = ainfo.play.port = port; ainfo2.play.port = ainfo.play.port = port;

@ -85,15 +85,15 @@ static int init(struct options *options)
write_32l(fd, len); write_32l(fd, len);
write(fd, "WAVE", 4); write(fd, "WAVE", 4);
chan = options->format & XMP_FORMAT_MONO ? 1 : 2; chan = options->format & XMP_MIX_MONO ? 1 : 2;
sampling_rate = options->rate; sampling_rate = options->rate;
bits_per_sample = options->format & XMP_FORMAT_8BIT ? 8 : 16; bits_per_sample = options->format & XMP_MIX_8BIT ? 8 : 16;
if (bits_per_sample == 8) { if (bits_per_sample == 8) {
options->format |= XMP_FORMAT_UNSIGNED; options->format |= XMP_MIX_UNSIGNED;
format_16bit = 0; format_16bit = 0;
} else { } else {
options->format &= ~XMP_FORMAT_UNSIGNED; options->format &= ~XMP_MIX_UNSIGNED;
format_16bit = 1; format_16bit = 1;
} }

@ -78,8 +78,8 @@ static int init(struct options *options)
return -1; return -1;
wfe.wFormatTag = WAVE_FORMAT_PCM; wfe.wFormatTag = WAVE_FORMAT_PCM;
wfe.wBitsPerSample = options->format & XMP_FORMAT_8BIT ? 8 : 16; wfe.wBitsPerSample = options->format & XMP_MIX_8BIT ? 8 : 16;
wfe.nChannels = options->format & XMP_FORMAT_MONO ? 1 : 2; wfe.nChannels = options->format & XMP_MIX_MONO ? 1 : 2;
wfe.nSamplesPerSec = options->rate; wfe.nSamplesPerSec = options->rate;
wfe.nAvgBytesPerSec = wfe.nSamplesPerSec * wfe.nChannels * wfe.nAvgBytesPerSec = wfe.nSamplesPerSec * wfe.nChannels *
wfe.wBitsPerSample / 8; wfe.wBitsPerSample / 8;

@ -10,11 +10,11 @@ xmp - Extended Module Player
[\fB-c, --stdout\fP] [\fB-c, --stdout\fP]
[\fB-D\fP \fIdevice-specific parameters\fP] [\fB-D\fP \fIdevice-specific parameters\fP]
[\fB-d, --driver\fP \fIdriver\fP] [\fB-d, --driver\fP \fIdriver\fP]
[\fB--fix-sample-loop\fP]
[\fB-f, --frequency\fP \fIrate\fP] [\fB-f, --frequency\fP \fIrate\fP]
[\fB-h, --help\fP] [\fB-h, --help\fP]
[\fB-I, --instrument-path\fP] [\fB-I, --instrument-path\fP]
[\fB-i, --info\fP] [\fB-i, --info\fP]
[\fB-L, --list-formats\fP]
[\fB-l, --loop\fP] [\fB-l, --loop\fP]
[\fB-M, --mute\fP \fIchannel-list\fP] [\fB-M, --mute\fP \fIchannel-list\fP]
[\fB-m, --mono\fP] [\fB-m, --mono\fP]
@ -24,7 +24,8 @@ xmp - Extended Module Player
[\fB-o, --output-file\fP \fIfilename\fP] [\fB-o, --output-file\fP \fIfilename\fP]
[\fB-P, --pan\fP \fIpan\fP] [\fB-P, --pan\fP \fIpan\fP]
[\fB--probe-only\fP] [\fB--probe-only\fP]
[\fB-R --random\fP] [\fB-q, --quiet\fP]
[\fB-R, --random\fP]
[\fB-S, --solo\fP \fIchannel-list\fP] [\fB-S, --solo\fP \fIchannel-list\fP]
[\fB-s, --start\fP \fIpos\fP] [\fB-s, --start\fP \fIpos\fP]
[\fB-t, --time\fP \fItime\fP] [\fB-t, --time\fP \fItime\fP]
@ -36,12 +37,8 @@ xmp - Extended Module Player
.SH "DESCRIPTION" .SH "DESCRIPTION"
\fBxmp\fP is a tracked music module player\&. It plays many \fBxmp\fP is a tracked music module player\&. It plays many
module formats including Fasttracker II (XM), Noise/Fast/Protracker (MOD), module formats including Fasttracker II (XM), Noise/Fast/Protracker (MOD),
Scream Tracker 3 (S3M) and Impulse Tracker (IT)\&. Use \f(CWxmp --help\fP Scream Tracker 3 (S3M) and Impulse Tracker (IT)\&. Run
for a complete list of supported formats\&. \f(CWxmp --list-formats\fP for a complete list of supported formats\&.
.PP
\fBxmp\fP can play through several output devices including the Open
Sound System sequencer, linear and ulaw PCM audio devices or mixing
to a raw or WAV file\&.
.PP .PP
.SH "OPTIONS" .SH "OPTIONS"
.IP "\fB-a, --amplify\fP \fIfactor\fP" .IP "\fB-a, --amplify\fP \fIfactor\fP"
@ -141,14 +138,14 @@ Don\'t sync the OSS audio device between modules\&.
.PP .PP
BSD driver options: BSD driver options:
.IP "\fB-D\fP \fIgain=value\fP" .IP "\fB-D\fP \fIgain=value\fP"
Set the audio gain\&. Valid \fIvalue\fP goes from 0 to 255\&. Set the audio gain\&. Valid values range from 0 to 255\&.
The default is 128\&. The default is 128\&.
.IP "\fB-D\fP \fIbuffer=size\fP" .IP "\fB-D\fP \fIbuffer=size\fP"
Set the size in bytes of the audio buffer\&. Default value is 32 Kb\&. Set the size in bytes of the audio buffer\&. Default value is 32 Kb\&.
.PP .PP
HP-UX and Solaris driver options: HP-UX and Solaris driver options:
.IP "\fB-D\fP \fIgain=value\fP" .IP "\fB-D\fP \fIgain=value\fP"
Set the audio gain\&. Valid \fIvalue\fP goes from 0 to 255\&. Set the audio gain\&. Valid values range from 0 to 255\&.
The default is 128\&. The default is 128\&.
.IP "\fB-D\fP \fIport={s|h|l}\fP" .IP "\fB-D\fP \fIport={s|h|l}\fP"
Set the audio port\&. Valid arguments are \fIs\fP for the internal Set the audio port\&. Valid arguments are \fIs\fP for the internal
@ -210,6 +207,6 @@ random order\&:
.IP "" .IP ""
\f(CWxmp -R `find /mod -name "*\&.xm*" -print`\fP \f(CWxmp -R `find /mod -name "*\&.xm*" -print`\fP
.PP .PP
.SH "AUTHOR" .SH "AUTHORS"
Claudio Matsuoka and Hipolito Carraro Jr\&. Claudio Matsuoka and Hipolito Carraro Jr\&.
.PP .PP

Loading…
Cancel
Save