summaryrefslogtreecommitdiff
path: root/audio/maplay
diff options
context:
space:
mode:
authoraugustss <augustss>1997-10-28 23:18:20 +0000
committeraugustss <augustss>1997-10-28 23:18:20 +0000
commitf8e906be96435c1ec9f3f8dba3ab6d8698cb08be (patch)
treecc8ee8439ae9a5d7d4a09af2bda1536118792658 /audio/maplay
parent3492a1d2d3c36ad01439a85ba2bad6462bb0288d (diff)
downloadpkgsrc-f8e906be96435c1ec9f3f8dba3ab6d8698cb08be.tar.gz
Initial import of FreeBSD audio packages.
Diffstat (limited to 'audio/maplay')
-rw-r--r--audio/maplay/Makefile23
-rw-r--r--audio/maplay/files/md51
-rw-r--r--audio/maplay/patches/patch-aa745
-rw-r--r--audio/maplay/patches/patch-ab31
-rw-r--r--audio/maplay/patches/patch-ac22
-rw-r--r--audio/maplay/pkg/COMMENT1
-rw-r--r--audio/maplay/pkg/DESCR186
-rw-r--r--audio/maplay/pkg/PLIST1
8 files changed, 1010 insertions, 0 deletions
diff --git a/audio/maplay/Makefile b/audio/maplay/Makefile
new file mode 100644
index 00000000000..ddbab2f3af6
--- /dev/null
+++ b/audio/maplay/Makefile
@@ -0,0 +1,23 @@
+# New ports collection makefile for: maplay
+# Version required: 1.2
+# Date created: Feb 13 1995
+# Whom: jkh
+#
+# $Id: Makefile,v 1.1.1.1 1997/10/28 23:18:31 augustss Exp $
+#
+
+DISTNAME= maplay1_2
+PKGNAME= maplay-1.2
+CATEGORIES= audio
+MASTER_SITES= ftp://ftp.iuma.com/audio_utils/mpeg_players/Workstations/
+EXTRACT_SUFX= .tar.Z
+
+MAINTAINER= torstenb@FreeBSD.org
+
+NO_WRKSUBDIR= yes
+PATCH_STRIP= -p2
+
+pre-configure:
+ @(cd ${WRKSRC}; make pre-install)
+
+.include <bsd.port.mk>
diff --git a/audio/maplay/files/md5 b/audio/maplay/files/md5
new file mode 100644
index 00000000000..96dfaae0aef
--- /dev/null
+++ b/audio/maplay/files/md5
@@ -0,0 +1 @@
+MD5 (maplay1_2.tar.Z) = 2e3e0cd4d200fa476360eda0c9195ea1
diff --git a/audio/maplay/patches/patch-aa b/audio/maplay/patches/patch-aa
new file mode 100644
index 00000000000..bc08c5fdb6c
--- /dev/null
+++ b/audio/maplay/patches/patch-aa
@@ -0,0 +1,745 @@
+Only in maplay.new: .extract_done
+diff -c -r maplay/all.h maplay.new/all.h
+*** maplay/all.h Thu Jun 23 12:14:39 1994
+--- maplay.new/all.h Tue Feb 14 07:50:56 1995
+***************
+*** 22,28 ****
+ #define ALL_H
+
+ typedef float real; // float should be enough
+! typedef short bool;
+ typedef unsigned uint32; // 32 Bit unsigned integer
+ // some compilers may need "typedef unsigned long uint32" instead
+ typedef int int32; // 32 Bit signed integer
+--- 22,28 ----
+ #define ALL_H
+
+ typedef float real; // float should be enough
+! typedef short boolean;
+ typedef unsigned uint32; // 32 Bit unsigned integer
+ // some compilers may need "typedef unsigned long uint32" instead
+ typedef int int32; // 32 Bit signed integer
+diff -c -r maplay/configuration.sh maplay.new/configuration.sh
+*** maplay/configuration.sh Thu Jun 23 12:14:46 1994
+--- maplay.new/configuration.sh Tue Feb 14 07:46:52 1995
+***************
+*** 72,77 ****
+--- 72,83 ----
+ INCLUDEDIRS=
+ LIBRARIES=
+ AUDIO_INCLUDES='#include <sys/audioio.h>' ;;
++ FreeBSD*)
++ COMPILER=g++
++ COMPILERFLAGS='-O2 -m486 -DLINUX -DDAMN_INTEL_BYTE_ORDER'
++ INCLUDEDIRS=
++ LIBRARIES=
++ AUDIO_INCLUDES='#include <machine/soundcard.h>' ;;
+ Linux*)
+ COMPILER=g++
+ COMPILERFLAGS='-O2 -m486 -funroll-loops -DLINUX -DDAMN_INTEL_BYTE_ORDER'
+diff -c -r maplay/header.cc maplay.new/header.cc
+*** maplay/header.cc Thu Jun 23 12:14:35 1994
+--- maplay.new/header.cc Tue Feb 14 07:52:56 1995
+***************
+*** 36,42 ****
+ const uint32 Header::frequencies[3] = { 44100, 48000, 32000 };
+
+
+! bool Header::read_header (Ibitstream *stream, Crc16 **crcp)
+ {
+ uint32 headerstring;
+
+--- 36,42 ----
+ const uint32 Header::frequencies[3] = { 44100, 48000, 32000 };
+
+
+! boolean Header::read_header (Ibitstream *stream, Crc16 **crcp)
+ {
+ uint32 headerstring;
+
+diff -c -r maplay/header.h maplay.new/header.h
+*** maplay/header.h Thu Jun 23 12:14:40 1994
+--- maplay.new/header.h Tue Feb 14 07:52:57 1995
+***************
+*** 39,45 ****
+ e_mode h_mode;
+ e_sample_frequency h_sample_frequency;
+ uint32 h_number_of_subbands, h_intensity_stereo_bound;
+! bool h_copyright, h_original;
+ Crc16 *crc;
+ uint16 checksum;
+
+--- 39,45 ----
+ e_mode h_mode;
+ e_sample_frequency h_sample_frequency;
+ uint32 h_number_of_subbands, h_intensity_stereo_bound;
+! boolean h_copyright, h_original;
+ Crc16 *crc;
+ uint16 checksum;
+
+***************
+*** 48,54 ****
+ public:
+ Header (void) { crc = (Crc16 *)0; }
+ ~Header (void) { if (crc) delete crc; }
+! bool read_header (Ibitstream *, Crc16 **);
+ // read a 32-bit header from the bitstream
+
+ // functions to query header contents:
+--- 48,54 ----
+ public:
+ Header (void) { crc = (Crc16 *)0; }
+ ~Header (void) { if (crc) delete crc; }
+! boolean read_header (Ibitstream *, Crc16 **);
+ // read a 32-bit header from the bitstream
+
+ // functions to query header contents:
+***************
+*** 58,68 ****
+ uint32 frequency (void) { return frequencies[h_sample_frequency]; }
+ static uint32 frequency (e_sample_frequency rate) { return frequencies[rate]; }
+ e_mode mode (void) { return h_mode; };
+! bool checksums (void) { return !h_protection_bit; }
+! bool copyright (void) { return h_copyright; }
+! bool original (void) { return h_original; }
+
+! bool checksum_ok (void) { return checksum == crc->checksum (); }
+ // compares computed checksum with stream checksum
+
+ // functions which return header informations as strings:
+--- 58,68 ----
+ uint32 frequency (void) { return frequencies[h_sample_frequency]; }
+ static uint32 frequency (e_sample_frequency rate) { return frequencies[rate]; }
+ e_mode mode (void) { return h_mode; };
+! boolean checksums (void) { return !h_protection_bit; }
+! boolean copyright (void) { return h_copyright; }
+! boolean original (void) { return h_original; }
+
+! boolean checksum_ok (void) { return checksum == crc->checksum (); }
+ // compares computed checksum with stream checksum
+
+ // functions which return header informations as strings:
+diff -c -r maplay/ibitstream.cc maplay.new/ibitstream.cc
+*** maplay/ibitstream.cc Thu Jun 23 12:14:35 1994
+--- maplay.new/ibitstream.cc Tue Feb 14 07:52:56 1995
+***************
+*** 64,70 ****
+ }
+
+
+! bool Ibitstream::get_header (uint32 *headerstring)
+ {
+ int readvalue;
+
+--- 64,70 ----
+ }
+
+
+! boolean Ibitstream::get_header (uint32 *headerstring)
+ {
+ int readvalue;
+
+***************
+*** 102,108 ****
+ }
+
+
+! bool Ibitstream::read_frame (uint32 bytesize)
+ {
+ int readvalue;
+
+--- 102,108 ----
+ }
+
+
+! boolean Ibitstream::read_frame (uint32 bytesize)
+ {
+ int readvalue;
+
+diff -c -r maplay/ibitstream.h maplay.new/ibitstream.h
+*** maplay/ibitstream.h Thu Jun 23 12:14:40 1994
+--- maplay.new/ibitstream.h Tue Feb 14 07:52:58 1995
+***************
+*** 43,52 ****
+ ~Ibitstream (void);
+ int filedescriptor (void) { return fd; };
+
+! bool get_header (uint32 *);
+ // get next 32 bits from bitstream in an unsigned int,
+ // returned value False => end of stream
+! bool read_frame (uint32 bytesize);
+ // fill buffer with data from bitstream, returned value False => end of stream
+ uint32 get_bits (uint32 number_of_bits);
+ // read bits (1 <= number_of_bits <= 16) from buffer into the lower bits
+--- 43,52 ----
+ ~Ibitstream (void);
+ int filedescriptor (void) { return fd; };
+
+! boolean get_header (uint32 *);
+ // get next 32 bits from bitstream in an unsigned int,
+ // returned value False => end of stream
+! boolean read_frame (uint32 bytesize);
+ // fill buffer with data from bitstream, returned value False => end of stream
+ uint32 get_bits (uint32 number_of_bits);
+ // read bits (1 <= number_of_bits <= 16) from buffer into the lower bits
+diff -c -r maplay/maplay.cc maplay.new/maplay.cc
+*** maplay/maplay.cc Thu Jun 23 12:14:36 1994
+--- maplay.new/maplay.cc Tue Feb 14 07:52:57 1995
+***************
+*** 54,67 ****
+
+ // data extracted from commandline arguments:
+ static char *filename;
+! static bool verbose_mode = False, filter_check = False;
+! static bool stdout_mode = False;
+ static enum e_channels which_channels = both;
+! static bool use_speaker = False, use_headphone = False, use_line_out = False;
+ #ifdef ULAW
+! static bool force_amd = False;
+ #endif
+! static bool use_own_scalefactor = False;
+ static real scalefactor;
+
+ // data extracted from header of first frame:
+--- 54,67 ----
+
+ // data extracted from commandline arguments:
+ static char *filename;
+! static boolean verbose_mode = False, filter_check = False;
+! static boolean stdout_mode = False;
+ static enum e_channels which_channels = both;
+! static boolean use_speaker = False, use_headphone = False, use_line_out = False;
+ #ifdef ULAW
+! static boolean force_amd = False;
+ #endif
+! static boolean use_own_scalefactor = False;
+ static real scalefactor;
+
+ // data extracted from header of first frame:
+***************
+*** 93,99 ****
+ main (int argc, char *argv[])
+ {
+ int i;
+! bool read_ready = False, write_ready = False;
+
+ if (argc < 2 || !strncmp (argv[1], "-h", 2))
+ {
+--- 93,99 ----
+ main (int argc, char *argv[])
+ {
+ int i;
+! boolean read_ready = False, write_ready = False;
+
+ if (argc < 2 || !strncmp (argv[1], "-h", 2))
+ {
+***************
+*** 146,151 ****
+--- 146,154 ----
+ #ifdef Solaris
+ "SPARC Solaris 2.x"
+ #else
++ #ifdef __FreeBSD__
++ "FreeBSD"
++ #else
+ #ifdef LINUX
+ "Linux"
+ #else
+***************
+*** 153,158 ****
+--- 156,162 ----
+ "RISC ULTRIX 4.x"
+ #else
+ "unknown"
++ #endif
+ #endif
+ #endif
+ #endif
+diff -c -r maplay/obuffer.cc maplay.new/obuffer.cc
+*** maplay/obuffer.cc Thu Jun 23 12:14:36 1994
+--- maplay.new/obuffer.cc Tue Feb 14 07:52:57 1995
+***************
+*** 217,226 ****
+ int SparcObuffer::audio_fd = -1;
+
+ #ifdef ULAW
+! SparcObuffer::SparcObuffer (Header *header, bool use_speaker, bool use_headphone, bool use_line_out)
+ #else
+ SparcObuffer::SparcObuffer (uint32 number_of_channels, Header *header,
+! bool use_speaker, bool use_headphone, bool use_line_out)
+ #endif
+ {
+ #ifndef ULAW
+--- 217,226 ----
+ int SparcObuffer::audio_fd = -1;
+
+ #ifdef ULAW
+! SparcObuffer::SparcObuffer (Header *header, boolean use_speaker, boolean use_headphone, boolean use_line_out)
+ #else
+ SparcObuffer::SparcObuffer (uint32 number_of_channels, Header *header,
+! boolean use_speaker, boolean use_headphone, boolean use_line_out)
+ #endif
+ {
+ #ifndef ULAW
+***************
+*** 406,414 ****
+
+
+ #ifdef ULAW
+! bool SparcObuffer::class_suitable (uint32 number_of_channels, bool force_amd)
+ #else
+! bool SparcObuffer::class_suitable (void)
+ #endif
+ {
+ #ifdef ULAW
+--- 406,414 ----
+
+
+ #ifdef ULAW
+! boolean SparcObuffer::class_suitable (uint32 number_of_channels, boolean force_amd)
+ #else
+! boolean SparcObuffer::class_suitable (void)
+ #endif
+ {
+ #ifdef ULAW
+***************
+*** 629,635 ****
+ }
+
+
+! bool LinuxObuffer::class_suitable (uint32 number_of_channels)
+ {
+ // open the dsp audio device:
+ audio_fd = open_audio_device ();
+--- 629,635 ----
+ }
+
+
+! boolean LinuxObuffer::class_suitable (uint32 number_of_channels)
+ {
+ // open the dsp audio device:
+ audio_fd = open_audio_device ();
+diff -c -r maplay/obuffer.h maplay.new/obuffer.h
+*** maplay/obuffer.h Thu Jun 23 12:14:40 1994
+--- maplay.new/obuffer.h Tue Feb 14 07:52:58 1995
+***************
+*** 123,142 ****
+
+ public:
+ #ifdef ULAW
+! SparcObuffer (Header *, bool use_speaker, bool use_headphone, bool use_line_out);
+ #else
+ SparcObuffer (uint32 number_of_channels, Header *,
+! bool use_speaker, bool use_headphone, bool use_line_out);
+ #endif
+ ~SparcObuffer (void);
+ void append (uint32 channel, int16 value);
+ void write_buffer (int dummy);
+
+ #ifdef ULAW
+! static bool class_suitable (uint32 number_of_channels, bool force_amd);
+ // returnvalue == False: no u-law output possible (class unsuitable)
+ #else
+! static bool class_suitable (void);
+ // returnvalue == False: no 16-bit output possible (class unsuitable)
+ #endif
+ };
+--- 123,142 ----
+
+ public:
+ #ifdef ULAW
+! SparcObuffer (Header *, boolean use_speaker, boolean use_headphone, boolean use_line_out);
+ #else
+ SparcObuffer (uint32 number_of_channels, Header *,
+! boolean use_speaker, boolean use_headphone, boolean use_line_out);
+ #endif
+ ~SparcObuffer (void);
+ void append (uint32 channel, int16 value);
+ void write_buffer (int dummy);
+
+ #ifdef ULAW
+! static boolean class_suitable (uint32 number_of_channels, boolean force_amd);
+ // returnvalue == False: no u-law output possible (class unsuitable)
+ #else
+! static boolean class_suitable (void);
+ // returnvalue == False: no 16-bit output possible (class unsuitable)
+ #endif
+ };
+***************
+*** 159,165 ****
+ void append (uint32 channel, int16 value);
+ void write_buffer (int dummy);
+
+! static bool class_suitable (uint32 number_of_channels);
+ };
+ #endif // LINUX
+
+--- 159,165 ----
+ void append (uint32 channel, int16 value);
+ void write_buffer (int dummy);
+
+! static boolean class_suitable (uint32 number_of_channels);
+ };
+ #endif // LINUX
+
+diff -c -r maplay/subband.h maplay.new/subband.h
+*** maplay/subband.h Thu Jun 23 12:14:40 1994
+--- maplay.new/subband.h Tue Feb 14 07:52:58 1995
+***************
+*** 35,42 ****
+ public:
+ virtual void read_allocation (Ibitstream *, Header *, Crc16 *) = 0;
+ virtual void read_scalefactor (Ibitstream *, Header *) = 0;
+! virtual bool read_sampledata (Ibitstream *) = 0;
+! virtual bool put_next_sample (e_channels, SynthesisFilter *, SynthesisFilter *) = 0;
+ };
+
+ #endif
+--- 35,42 ----
+ public:
+ virtual void read_allocation (Ibitstream *, Header *, Crc16 *) = 0;
+ virtual void read_scalefactor (Ibitstream *, Header *) = 0;
+! virtual boolean read_sampledata (Ibitstream *) = 0;
+! virtual boolean put_next_sample (e_channels, SynthesisFilter *, SynthesisFilter *) = 0;
+ };
+
+ #endif
+diff -c -r maplay/subband_layer_1.cc maplay.new/subband_layer_1.cc
+*** maplay/subband_layer_1.cc Thu Jun 23 12:14:36 1994
+--- maplay.new/subband_layer_1.cc Tue Feb 14 07:52:57 1995
+***************
+*** 86,92 ****
+ }
+
+
+! bool SubbandLayer1::read_sampledata (Ibitstream *stream)
+ {
+ if (allocation)
+ {
+--- 86,92 ----
+ }
+
+
+! boolean SubbandLayer1::read_sampledata (Ibitstream *stream)
+ {
+ if (allocation)
+ {
+***************
+*** 105,111 ****
+ }
+
+
+! bool SubbandLayer1::put_next_sample (e_channels channels,
+ SynthesisFilter *filter1, SynthesisFilter *)
+ {
+ if (allocation && channels != right)
+--- 105,111 ----
+ }
+
+
+! boolean SubbandLayer1::put_next_sample (e_channels channels,
+ SynthesisFilter *filter1, SynthesisFilter *)
+ {
+ if (allocation && channels != right)
+***************
+*** 142,148 ****
+ }
+
+
+! bool SubbandLayer1IntensityStereo::put_next_sample (e_channels channels,
+ SynthesisFilter *filter1, SynthesisFilter *filter2)
+ {
+ if (allocation)
+--- 142,148 ----
+ }
+
+
+! boolean SubbandLayer1IntensityStereo::put_next_sample (e_channels channels,
+ SynthesisFilter *filter1, SynthesisFilter *filter2)
+ {
+ if (allocation)
+***************
+*** 231,239 ****
+ }
+
+
+! bool SubbandLayer1Stereo::read_sampledata (Ibitstream *stream)
+ {
+! bool returnvalue = SubbandLayer1::read_sampledata (stream);
+ if (channel2_allocation)
+ {
+ channel2_sample = real (stream->get_bits (channel2_samplelength));
+--- 231,239 ----
+ }
+
+
+! boolean SubbandLayer1Stereo::read_sampledata (Ibitstream *stream)
+ {
+! boolean returnvalue = SubbandLayer1::read_sampledata (stream);
+ if (channel2_allocation)
+ {
+ channel2_sample = real (stream->get_bits (channel2_samplelength));
+***************
+*** 246,252 ****
+ }
+
+
+! bool SubbandLayer1Stereo::put_next_sample (e_channels channels,
+ SynthesisFilter *filter1, SynthesisFilter *filter2)
+ {
+ SubbandLayer1::put_next_sample (channels, filter1, filter2);
+--- 246,252 ----
+ }
+
+
+! boolean SubbandLayer1Stereo::put_next_sample (e_channels channels,
+ SynthesisFilter *filter1, SynthesisFilter *filter2)
+ {
+ SubbandLayer1::put_next_sample (channels, filter1, filter2);
+diff -c -r maplay/subband_layer_1.h maplay.new/subband_layer_1.h
+*** maplay/subband_layer_1.h Thu Jun 23 12:14:40 1994
+--- maplay.new/subband_layer_1.h Tue Feb 14 07:52:58 1995
+***************
+*** 42,49 ****
+ SubbandLayer1 (uint32 subbandnumber);
+ void read_allocation (Ibitstream *, Header *, Crc16 *);
+ void read_scalefactor (Ibitstream *, Header *);
+! bool read_sampledata (Ibitstream *);
+! bool put_next_sample (e_channels, SynthesisFilter *, SynthesisFilter *);
+ };
+
+
+--- 42,49 ----
+ SubbandLayer1 (uint32 subbandnumber);
+ void read_allocation (Ibitstream *, Header *, Crc16 *);
+ void read_scalefactor (Ibitstream *, Header *);
+! boolean read_sampledata (Ibitstream *);
+! boolean put_next_sample (e_channels, SynthesisFilter *, SynthesisFilter *);
+ };
+
+
+***************
+*** 60,70 ****
+ SubbandLayer1::read_allocation (stream, header, crc);
+ }
+ void read_scalefactor (Ibitstream *, Header *);
+! bool read_sampledata (Ibitstream *stream)
+ {
+ return SubbandLayer1::read_sampledata (stream);
+ }
+! bool put_next_sample (e_channels, SynthesisFilter *, SynthesisFilter *);
+ };
+
+
+--- 60,70 ----
+ SubbandLayer1::read_allocation (stream, header, crc);
+ }
+ void read_scalefactor (Ibitstream *, Header *);
+! boolean read_sampledata (Ibitstream *stream)
+ {
+ return SubbandLayer1::read_sampledata (stream);
+ }
+! boolean put_next_sample (e_channels, SynthesisFilter *, SynthesisFilter *);
+ };
+
+
+***************
+*** 82,89 ****
+ SubbandLayer1Stereo (uint32 subbandnumber);
+ void read_allocation (Ibitstream *, Header *, Crc16 *);
+ void read_scalefactor (Ibitstream *, Header *);
+! bool read_sampledata (Ibitstream *);
+! bool put_next_sample (e_channels, SynthesisFilter *, SynthesisFilter *);
+ };
+
+ #endif
+--- 82,89 ----
+ SubbandLayer1Stereo (uint32 subbandnumber);
+ void read_allocation (Ibitstream *, Header *, Crc16 *);
+ void read_scalefactor (Ibitstream *, Header *);
+! boolean read_sampledata (Ibitstream *);
+! boolean put_next_sample (e_channels, SynthesisFilter *, SynthesisFilter *);
+ };
+
+ #endif
+diff -c -r maplay/subband_layer_2.cc maplay.new/subband_layer_2.cc
+*** maplay/subband_layer_2.cc Thu Jun 23 12:14:36 1994
+--- maplay.new/subband_layer_2.cc Tue Feb 14 07:52:57 1995
+***************
+*** 591,597 ****
+ }
+
+
+! bool SubbandLayer2::read_sampledata (Ibitstream *stream)
+ {
+ if (allocation)
+ if (groupingtable)
+--- 591,597 ----
+ }
+
+
+! boolean SubbandLayer2::read_sampledata (Ibitstream *stream)
+ {
+ if (allocation)
+ if (groupingtable)
+***************
+*** 633,639 ****
+ }
+
+
+! bool SubbandLayer2::put_next_sample (e_channels channels,
+ SynthesisFilter *filter1, SynthesisFilter *)
+ {
+ #ifdef DEBUG
+--- 633,639 ----
+ }
+
+
+! boolean SubbandLayer2::put_next_sample (e_channels channels,
+ SynthesisFilter *filter1, SynthesisFilter *)
+ {
+ #ifdef DEBUG
+***************
+*** 726,732 ****
+ }
+
+
+! bool SubbandLayer2IntensityStereo::put_next_sample (e_channels channels,
+ SynthesisFilter *filter1, SynthesisFilter *filter2)
+ {
+ #ifdef DEBUG
+--- 726,732 ----
+ }
+
+
+! boolean SubbandLayer2IntensityStereo::put_next_sample (e_channels channels,
+ SynthesisFilter *filter1, SynthesisFilter *filter2)
+ {
+ #ifdef DEBUG
+***************
+*** 880,888 ****
+ }
+
+
+! bool SubbandLayer2Stereo::read_sampledata (Ibitstream *stream)
+ {
+! bool returnvalue = SubbandLayer2::read_sampledata (stream);
+
+ if (channel2_allocation)
+ if (channel2_groupingtable)
+--- 880,888 ----
+ }
+
+
+! boolean SubbandLayer2Stereo::read_sampledata (Ibitstream *stream)
+ {
+! boolean returnvalue = SubbandLayer2::read_sampledata (stream);
+
+ if (channel2_allocation)
+ if (channel2_groupingtable)
+***************
+*** 919,928 ****
+ }
+
+
+! bool SubbandLayer2Stereo::put_next_sample (e_channels channels,
+ SynthesisFilter *filter1, SynthesisFilter *filter2)
+ {
+! bool returnvalue = SubbandLayer2::put_next_sample (channels, filter1, filter2);
+ if (channel2_allocation && channels != left)
+ {
+ register real sample = channel2_samples[samplenumber - 1];
+--- 919,928 ----
+ }
+
+
+! boolean SubbandLayer2Stereo::put_next_sample (e_channels channels,
+ SynthesisFilter *filter1, SynthesisFilter *filter2)
+ {
+! boolean returnvalue = SubbandLayer2::put_next_sample (channels, filter1, filter2);
+ if (channel2_allocation && channels != left)
+ {
+ register real sample = channel2_samples[samplenumber - 1];
+diff -c -r maplay/subband_layer_2.h maplay.new/subband_layer_2.h
+*** maplay/subband_layer_2.h Thu Jun 23 12:14:40 1994
+--- maplay.new/subband_layer_2.h Tue Feb 14 07:52:58 1995
+***************
+*** 55,62 ****
+ void read_allocation (Ibitstream *, Header *, Crc16 *);
+ virtual void read_scalefactor_selection (Ibitstream *, Crc16 *);
+ void read_scalefactor (Ibitstream *, Header *);
+! bool read_sampledata (Ibitstream *);
+! bool put_next_sample (e_channels, SynthesisFilter *, SynthesisFilter * = NULL);
+ };
+
+
+--- 55,62 ----
+ void read_allocation (Ibitstream *, Header *, Crc16 *);
+ virtual void read_scalefactor_selection (Ibitstream *, Crc16 *);
+ void read_scalefactor (Ibitstream *, Header *);
+! boolean read_sampledata (Ibitstream *);
+! boolean put_next_sample (e_channels, SynthesisFilter *, SynthesisFilter * = NULL);
+ };
+
+
+***************
+*** 75,85 ****
+ }
+ void read_scalefactor_selection (Ibitstream *, Crc16 *);
+ void read_scalefactor (Ibitstream *, Header *);
+! bool read_sampledata (Ibitstream *stream)
+ {
+ return SubbandLayer2::read_sampledata (stream);
+ }
+! bool put_next_sample (e_channels, SynthesisFilter *, SynthesisFilter *);
+ };
+
+
+--- 75,85 ----
+ }
+ void read_scalefactor_selection (Ibitstream *, Crc16 *);
+ void read_scalefactor (Ibitstream *, Header *);
+! boolean read_sampledata (Ibitstream *stream)
+ {
+ return SubbandLayer2::read_sampledata (stream);
+ }
+! boolean put_next_sample (e_channels, SynthesisFilter *, SynthesisFilter *);
+ };
+
+
+***************
+*** 90,96 ****
+ uint32 channel2_allocation;
+ uint32 channel2_scfsi;
+ real channel2_scalefactor1, channel2_scalefactor2, channel2_scalefactor3;
+! bool channel2_grouping;
+ uint32 channel2_codelength;
+ const real *channel2_groupingtable;
+ real channel2_factor;
+--- 90,96 ----
+ uint32 channel2_allocation;
+ uint32 channel2_scfsi;
+ real channel2_scalefactor1, channel2_scalefactor2, channel2_scalefactor3;
+! boolean channel2_grouping;
+ uint32 channel2_codelength;
+ const real *channel2_groupingtable;
+ real channel2_factor;
+***************
+*** 102,109 ****
+ void read_allocation (Ibitstream *, Header *, Crc16 *);
+ void read_scalefactor_selection (Ibitstream *, Crc16 *);
+ void read_scalefactor (Ibitstream *, Header *);
+! bool read_sampledata (Ibitstream *);
+! bool put_next_sample (e_channels, SynthesisFilter *, SynthesisFilter *);
+ };
+
+ #endif
+--- 102,109 ----
+ void read_allocation (Ibitstream *, Header *, Crc16 *);
+ void read_scalefactor_selection (Ibitstream *, Crc16 *);
+ void read_scalefactor (Ibitstream *, Header *);
+! boolean read_sampledata (Ibitstream *);
+! boolean put_next_sample (e_channels, SynthesisFilter *, SynthesisFilter *);
+ };
+
+ #endif
diff --git a/audio/maplay/patches/patch-ab b/audio/maplay/patches/patch-ab
new file mode 100644
index 00000000000..0007783c749
--- /dev/null
+++ b/audio/maplay/patches/patch-ab
@@ -0,0 +1,31 @@
+*** work/Makefile.orig Tue Feb 14 08:18:41 1995
+--- work/Makefile Tue Feb 14 08:19:52 1995
+***************
+*** 39,45 ****
+
+ .SUFFIXES: .cc
+
+! install:
+ @./configuration.sh
+
+ all: maplay
+--- 39,45 ----
+
+ .SUFFIXES: .cc
+
+! pre-install:
+ @./configuration.sh
+
+ all: maplay
+***************
+*** 47,52 ****
+--- 47,55 ----
+ maplay: $(OBJS)
+ $(COMPILER) $(CFLAGS) $(OBJS) -o $@ $(LIBRARIES) -lm
+ -strip $@
++
++ install: all
++ ${INSTALL} -s -c -m 755 maplay ${PREFIX}/bin
+
+ .cc.o:
+ $(COMPILER) -c $(CFLAGS) $(INCLUDEDIRS) $*.cc -o $@
diff --git a/audio/maplay/patches/patch-ac b/audio/maplay/patches/patch-ac
new file mode 100644
index 00000000000..3a6e29c92ce
--- /dev/null
+++ b/audio/maplay/patches/patch-ac
@@ -0,0 +1,22 @@
+*** obuffer.cc.orig Thu Jun 23 05:14:36 1994
+--- obuffer.cc Tue Feb 14 04:17:17 1995
+***************
+*** 537,542 ****
+--- 537,543 ----
+ }
+
+ // turn NDELAY mode off:
++ #ifndef __FreeBSD__ /* Our /dev/audio doesn't like non-blocking I/O */
+ int flags;
+ if ((flags = fcntl (fd, F_GETFL, 0)) < 0)
+ {
+***************
+*** 549,554 ****
+--- 550,556 ----
+ perror ("fcntl F_SETFL on /dev/audio failed");
+ exit (1);
+ }
++ #endif
+ return fd;
+ }
+
diff --git a/audio/maplay/pkg/COMMENT b/audio/maplay/pkg/COMMENT
new file mode 100644
index 00000000000..1fed7e98feb
--- /dev/null
+++ b/audio/maplay/pkg/COMMENT
@@ -0,0 +1 @@
+An MPEG audio player/decoder that decodes layer I and II MPEG audio streams.
diff --git a/audio/maplay/pkg/DESCR b/audio/maplay/pkg/DESCR
new file mode 100644
index 00000000000..5eb691764c0
--- /dev/null
+++ b/audio/maplay/pkg/DESCR
@@ -0,0 +1,186 @@
+/*
+ * @(#) MPEG Audio Player maplay 1.2, last edit of this file: 6/23/94 13:02:49
+ * @(#) Copyright (C) 1993, 1994 Tobias Bading (bading@cs.tu-berlin.de)
+ * @(#) Berlin University of Technology
+ *
+ * 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 Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+
+This is the README file of the MPEG Audio Player maplay, Version 1.2.
+Besides this file, you should now own a copy of the following files:
+
+ ANNOUNCEMENT the announcement for this release
+ INSTALL infos about compiling and installing the program
+ COPYING the GNU General Public License
+ Makefile a makefile
+ configuration.sh a shell script used by the makefile
+
+and the source files
+
+ all.h maplay.cc subband_layer_1.h
+ crc.cc obuffer.cc subband_layer_2.cc
+ crc.h obuffer.h subband_layer_2.h
+ header.cc scalefactors.cc synthesis_filter.cc
+ header.h scalefactors.h synthesis_filter.h
+ ibitstream.cc subband.h ulaw.cc
+ ibitstream.h subband_layer_1.cc ulaw.h
+
+-------------------------------------------------------------------------------
+
+0) Introduction
+
+MPEG is a standard created by the ISO (International Organization for
+Standardization) and the IEC (International Electrotechnical Commission).
+The full name of this standard is "ISO/IEC DIS 11172: Information
+Technology - Coding of moving pictures and associated audio for digital
+storage media ut to about 1.5 Mbit/s". As the name already states,
+it deals with digital video and audio. The video part of this standard has
+inspired many people to write decoders and a few encoders for it.
+Best known should be the Berkeley player. Players for the audio part on
+the other hand are very rare. The ones I know are the XING player for Windoze
+and a sample implementation of the ISO, which also includes an encoder.
+
+The audio part of the MPEG standard specifies three layers, whereat each
+layer specifies its own file format. All three layers are using similar
+audio coding techniques, but they vary in efficiency and complexity.
+Layer I needs the fewest calculation time for en-/decoding a stream, layer III
+the most. But a layer I MPEG audio stream is bigger than a layer III stream
+at the same quality. This program is able to decode and play only layer I
+and II streams, layer III is not supported (yet?!?).
+
+Like the MPEG video standard, the audio part also uses a lossy compression
+algorithm, which means that you can't get back 100% the original from a
+MPEG audio stream. Layer II MPEG audio streams are compressed by ratios
+from 1:3 up to 1:24 compared to raw PCM data, like on an audio CD.
+But the quality is still very (very) near to the original at ratios between
+1:5 and 1:12. You'll love it... :-)
+
+-------------------------------------------------------------------------------
+
+1) What does maplay?
+
+maplay version 1.2 is the second release of my MPEG audio player/decoder.
+It decodes layer I and layer II MPEG audio streams and plays them
+using a CD-quality audio device. Currently supported devices are the
+dbri device of SPARC 10 computers and the audio ports of Silicon
+Graphics Indigo machines. Thanks to Louis P. Kruger (lpkruger@phoenix.
+Princeton.EDU), maplay 1.2 can also use the /dev/dsp device under Linux.
+Louis has tested it with the Pro Audio Spectrum 16 soundcard. Sound Blaster 16
+and Gravis Ultrasound cards should also work, but a bug in the dsp driver
+prevents stereo playback on Gravis Ultrasound cards. An amd device of a
+SPARC 2/IPX/... machine can be used, too, but this device is only capable of
+producing audio output at 8 kHz in u-law format, which sounds like transmitted
+through a telephone. Other audio device are not supported directly, but can be
+used with the "decode to stdout" option and an audio format converter.
+Besides it shouldn't be a problem to adapt the program to other audio devices.
+
+The player supports all modes, which are single channel, stereo,
+joint stereo and dual channel, and all bitrates except free mode.
+The missing free mode support should not be a problem for now,
+because I haven't seen such a stream yet.
+
+maplay needs approximately 46% CPU time on SPARC 10/40 machines and 50%
+on Indigos for realtime stereo playback of a 44.1 kHz 128 kbit/s stream.
+Single channel playback needs about the half CPU time. On a SPARCstation IPX,
+maplay needs about 43% CPU time for realtime mono playback. Stereo playback
+is not possible via an amd device.
+
+Besides realtime playing of audio streams, maplay can decode streams to
+stdout for further conversions. The output consists of 16 bit signed PCM
+values. For stereo streams, the values are interleaved, which means that
+a value for the left channel is followed by a value for the right channel
+and so on. If maplay has been compiled for u-law output, the output consists
+of 8 bit u-law samples at a rate of 8 kHz, no matter what frequency the stream
+uses.
+
+-------------------------------------------------------------------------------
+
+2) How to create a maplay binary?
+
+Please read the install file for this topic.
+
+-------------------------------------------------------------------------------
+
+3) How to start the program?
+
+For a quick mono test enter "./maplay -v -l filename", where filename is the
+name of an audio stream, like "things.mp2". This stream has been posted along
+with the sources and is the beginning of Roxette's song "Things Will Never Be
+The Same". It is coded in joint stereo mode with 128 kbit/s, which is a
+compression ratio of 1:11. If the output is ok, you can test stereo playback
+by leaving out the -l option. If the stereo output stutters, the problem is
+not enough free CPU time in most cases. Stereo output is not possible when
+using an amd u-law device. If maplay shows error messages like
+"ioctl AUDIO_GETDEV on /dev/audio: ..."
+and maplay was compiled for u-law output, please try out the -amd option.
+This option forces maplay to treat /dev/audio as an amd device and may be
+required on SPARC clones.
+
+To convert a MPEG audio stream into other audio formats, you can use
+"maplay -v -s filename | your_converter". Unfortunately, I can't be of much
+help for you to find such a converter. The only good converter I know is the
+"soundfiler" on Indigos. But if you would have an Indigo, you wouldn't need a
+converter...
+
+-------------------------------------------------------------------------------
+
+4) Command line options
+
+maplay [-v] [-s] [-l] [-r] [-us] [-uh] [-ul] [-amd] [-c] [-f ushort] filename
+
+with these options:
+ filename filename of a MPEG audio stream or - for stdin
+ -h short help
+ -v verbose mode
+ You will get information about the stream, like mode, bitrate,
+ copyright etc., if you use this option.
+ -s stdout mode
+ This option tells the program to decode the stream to stdout.
+ The created output contains 16 bit signed PCM samples. If the
+ binary has been compiled for 8 kHz u-law format usage, the
+ output consists of 8 bit u-law samples at a 8 kHz rate. If the
+ stream is in stereo mode, the samples of both channels are
+ interleaved, the sample for the left channel first.
+ -l maplay decodes (and plays) the left channel of stereo streams
+ only. This option halves the required CPU time.
+ -r Same as above, but decodes the right channel only
+ -us, -uh These options are available on SPARCstations only.
+ They specify where the audio signal should be send to:
+ "-us" means speaker and "-uh" headphone jack.
+ -ul This option is available on machines with the dbri device
+ and sends the audio output to the line out jack.
+ -amd This option forces maplay to treat /dev/audio as an amd
+ device. Use it if your SPARC clone has an amd device, but
+ maplay doesn't recognize it. You may also use this option on a
+ machine with a dbri device, because the dbri device can also
+ produce u-law output. But I suggest to recompile the program
+ without the ULAW define in this case to get the CD-quality
+ output.
+ -c This option instructs the program to report filter range
+ violations to stderr. Sometimes PCM values calculated by
+ the synthesis filter exceede the 16 bit boundary and must
+ be mapped to these boundaries. If you can hear this, you
+ may use the next option.
+ -f ushort maplay uses this scalefactor instead of the default value 32768
+ for the synthesis filter. You can reduce or eliminate range
+ violations with this option, but lower scalefactor values
+ reduce the signal-to-noise ratio, too. I can't remember when
+ I used this option the last time myself.
+
+
+Ok, that's all for now and this release,
+I hope you like it,
+ Tobias Bading (bading@cs.tu-berlin.de)
diff --git a/audio/maplay/pkg/PLIST b/audio/maplay/pkg/PLIST
new file mode 100644
index 00000000000..2135816542b
--- /dev/null
+++ b/audio/maplay/pkg/PLIST
@@ -0,0 +1 @@
+bin/maplay