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
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)
DDIRS = src
MODULES = delicate_oooz!.mod

@ -1,6 +1,7 @@
___ ___ ____________
\ \/ // ____ \
> <| Y Y \ |_> >
@ -51,7 +52,8 @@ directly to cmatsuoka@gmail.com.
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
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(" 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];
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("Mixer set to %d Hz, %dbit, %s%s%s\n", options.rate,
options.format & XMP_FORMAT_8BIT ? 8 : 16,
options.format & XMP_FORMAT_NEAREST ? "" : "interpolated ",
options.format & XMP_FORMAT_MONO ? "mono" : "stereo",
options.format & XMP_FORMAT_NOFILTER ? " (no filter)" : "");
options.format & XMP_MIX_8BIT ? 8 : 16,
options.format & XMP_MIX_NEAREST ? "" : "interpolated ",
options.format & XMP_MIX_MONO ? "mono" : "stereo",
options.format & XMP_MIX_NOFILTER ? " (no filter)" : "");
}
if (options.probeonly) {

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

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

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

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

@ -54,7 +54,7 @@ static int to_fmt(struct options *options)
{
int fmt;
if (options->format & XMP_FORMAT_8BIT) {
if (options->format & XMP_MIX_8BIT) {
fmt = SND_PCM_SFMT_U8 | SND_PCM_SFMT_S8;
} else {
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;
} else {
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.format = to_fmt(o);
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) {
printf("Unable to set output parameters: %s\n",

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

@ -34,18 +34,18 @@ static int init(struct options *options)
AUDIO_INITINFO(&ainfo);
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.buffer_size = bsize;
if (options->format & XMP_FORMAT_8BIT) {
if (options->format & XMP_MIX_8BIT) {
ainfo.play.precision = 8;
ainfo.play.encoding = AUDIO_ENCODING_ULINEAR;
options->format |= XMP_FORMAT_UNSIGNED;
options->format |= XMP_MIX_UNSIGNED;
} else {
ainfo.play.precision = 16;
ainfo.play.encoding = AUDIO_ENCODING_SLINEAR;
options->format &= ~XMP_FORMAT_UNSIGNED;
options->format &= ~XMP_MIX_UNSIGNED;
}
if (ioctl(audio_fd, AUDIO_SETINFO, &ainfo) == -1) {

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

@ -110,10 +110,10 @@ static int init(struct options *options)
memset(&MixSetupParms, 0, sizeof(MCI_MIXSETUP_PARMS));
MixSetupParms.ulBitsPerSample =
options->format & XMP_FORMAT_8BIT ? 8 : 16;
options->format & XMP_MIX_8BIT ? 8 : 16;
MixSetupParms.ulFormatTag = MCI_WAVE_FORMAT_PCM;
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.ulDeviceType = MCI_DEVTYPE_WAVEFORM_AUDIO;
MixSetupParms.pmixEvent = OS2_Dart_UpdateBuffers;

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

@ -61,16 +61,16 @@ static int init(struct options *options)
AUDIO_INITINFO(&ainfo);
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 = AUDIO_ENCODING_ULINEAR;
options->format |= XMP_FORMAT_UNSIGNED;
options->format |= XMP_MIX_UNSIGNED;
} else {
ainfo.play.precision = 16;
ainfo.play.precision = AUDIO_ENCODING_SLINEAR;
options->format &= ~XMP_FORMAT_UNSIGNED;
options->format &= ~XMP_MIX_UNSIGNED;
}
ainfo.play.gain = gain;

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

@ -11,10 +11,10 @@ static int init(struct options *options)
pa_sample_spec ss;
int error;
options->format &= ~(XMP_FORMAT_UNSIGNED | XMP_FORMAT_8BIT);
options->format &= ~(XMP_MIX_UNSIGNED | XMP_MIX_8BIT);
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;
s = pa_simple_new(NULL, /* Use the default server */

@ -20,7 +20,7 @@ static int init(struct options *options)
parm_end();
rate = options->rate;
bits = options->format & XMP_FORMAT_8BIT ? 8 : 16;
bits = options->format & XMP_MIX_8BIT ? 8 : 16;
stereo = 1;
bufsize = 32 * 1024;
@ -30,7 +30,7 @@ static int init(struct options *options)
return -1;
}
if (options->outfmt & XMP_FORMAT_MONO)
if (options->outfmt & XMP_MIX_MONO)
stereo = 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
*/
if (options->format & XMP_FORMAT_8BIT) {
if (options->format & XMP_MIX_8BIT) {
if (ALsetwidth(config, AL_SAMPLE_8) < 0) {
if (ALsetwidth(config, AL_SAMPLE_16) < 0)
return -1;
options->format &= ~XMP_FORMAT_8BIT;
options->format &= ~XMP_MIX_8BIT;
} else {
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_8) < 0)
return -1;
options->format |= XMP_FORMAT_8BIT;
options->format |= XMP_MIX_8BIT;
} else {
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
*/
if (options->format & XMP_FORMAT_MONO) {
if (options->format & XMP_MIX_MONO) {
if (ALsetchannels(config, AL_MONO) < 0) {
if (ALsetchannels(config, AL_STEREO) < 0)
return -1;
options->format &= ~XMP_FORMAT_MONO;
options->format &= ~XMP_MIX_MONO;
}
} else {
if (ALsetchannels(config, AL_STEREO) < 0) {
if (ALsetchannels(config, AL_MONO) < 0)
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);
par.pchan = options->format & XMP_FORMAT_MONO ? 1 : 2;
par.pchan = options->format & XMP_MIX_MONO ? 1 : 2;
par.rate = options->rate;
par.le = SIO_LE_NATIVE;
par.appbufsz = par.rate / 4;
if (options->format & XMP_FORMAT_8BIT) {
if (options->format & XMP_MIX_8BIT) {
par.bits = 8;
par.sig = 0;
options->format |= XMP_FORMAT_UNSIGNED;
options->format |= XMP_MIX_UNSIGNED;
} else {
par.bits = 16;
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 */
ainfo.play.sample_rate = options->rate;
ainfo.play.channels = options->format & XMP_FORMAT_MONO ? 1 : 2;
ainfo.play.precision = options->format & XMP_FORMAT_8BIT ? 8 : 16;
ainfo.play.channels = options->format & XMP_MIX_MONO ? 1 : 2;
ainfo.play.precision = options->format & XMP_MIX_8BIT ? 8 : 16;
ainfo.play.encoding = AUDIO_ENCODING_LINEAR;
ainfo2.play.gain = ainfo.play.gain = gain;
ainfo2.play.port = ainfo.play.port = port;

@ -85,15 +85,15 @@ static int init(struct options *options)
write_32l(fd, len);
write(fd, "WAVE", 4);
chan = options->format & XMP_FORMAT_MONO ? 1 : 2;
chan = options->format & XMP_MIX_MONO ? 1 : 2;
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) {
options->format |= XMP_FORMAT_UNSIGNED;
options->format |= XMP_MIX_UNSIGNED;
format_16bit = 0;
} else {
options->format &= ~XMP_FORMAT_UNSIGNED;
options->format &= ~XMP_MIX_UNSIGNED;
format_16bit = 1;
}

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

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

Loading…
Cancel
Save