home *** CD-ROM | disk | FTP | other *** search
/ Windows 95 Secrets / Secrets2.iso / Audio / WAV / Maplay4 / _SETUP.1 / obuffer.h < prev    next >
Encoding:
C/C++ Source or Header  |  1997-06-17  |  2.8 KB  |  108 lines

  1. /* obuffer.h
  2.  
  3.    Declarations for output buffer, includes operating system
  4.    implementation of the virtual Obuffer. Optional routines
  5.    enabling seeks and stops add by Jeff Tsay. */
  6.  
  7. /*
  8.  *  @(#) obuffer.h 1.8, last edit: 6/15/94 16:51:56
  9.  *  @(#) Copyright (C) 1993, 1994 Tobias Bading (bading@cs.tu-berlin.de)
  10.  *  @(#) Berlin University of Technology
  11.  *
  12.  *  Idea and first implementation for u-law output with fast downsampling by
  13.  *  Jim Boucher (jboucher@flash.bu.edu)
  14.  *
  15.  *  LinuxObuffer class written by
  16.  *  Louis P. Kruger (lpkruger@phoenix.princeton.edu)
  17.  *
  18.  *  This program is free software; you can redistribute it and/or modify
  19.  *  it under the terms of the GNU General Public License as published by
  20.  *  the Free Software Foundation; either version 2 of the License, or
  21.  *  (at your option) any later version.
  22.  *
  23.  *  This program is distributed in the hope that it will be useful,
  24.  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
  25.  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  26.  *  GNU General Public License for more details.
  27.  *
  28.  *  You should have received a copy of the GNU General Public License
  29.  *  along with this program; if not, write to the Free Software
  30.  *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  31.  */
  32.  
  33. #ifndef OBUFFER_H
  34. #define OBUFFER_H
  35.  
  36. #include "all.h"
  37. #include <stdio.h> // needed for definition of NULL
  38. #include "args.h"
  39.  
  40. static const uint32 OBUFFERSIZE = 2 * 1152;    // max. 2 * 1152 samples per frame
  41. static const uint32 MAXCHANNELS = 2;        // max. number of channels
  42.  
  43. // Abstract base class for audio output classes:
  44. class Obuffer
  45. {
  46. public:
  47.  
  48.   virtual     ~Obuffer() {}        // dummy
  49.  
  50.   virtual void append(uint32 channel, int16 value) = 0;
  51.              // this function takes a 16 Bit PCM sample
  52.   virtual void write_buffer(int32 fd) = 0;
  53.              // this function should write the samples to the filedescriptor
  54.              // or directly to the audio hardware
  55.  
  56. #ifdef SEEK_STOP
  57.   virtual void clear_buffer() = 0;
  58.              // Clears all data in the buffer (for seeking)
  59.  
  60.   virtual void set_stop_flag() = 0;
  61.              // Notify the buffer that the user has stopped the stream
  62. #endif // SEEK_STOP
  63.  
  64. };
  65.  
  66. Obuffer *create_obuffer(MPEG_Args *maplay_args);
  67.  
  68. #include "fileobuf.h"
  69.  
  70. #ifdef IRIX
  71. #include "indigo_obuffer.h"
  72. #endif
  73.  
  74. #ifdef SPARC
  75. #include "sparc_obuffer.h"
  76. #endif
  77.  
  78. #ifdef HPUX
  79. #include "hpux_obuffer.h"
  80. #endif
  81.  
  82. #if defined(LINUX) || defined(__FreeBSD__)
  83. #include "linux_obuffer.h"
  84. #endif
  85.  
  86. #ifdef NeXT
  87. #include "NeXT_obuffer.h"
  88. #endif
  89.  
  90. #ifdef AIX
  91. #include "aix_obuffer.h"
  92. #endif
  93.  
  94. #ifdef __WIN32__
  95. #include "mci_obuf.h"
  96. #include "wavefile_obuffer.h"
  97. #endif
  98.  
  99. #ifdef BEOS
  100. #include "beos_obuffer.h"
  101. #endif
  102.  
  103. #ifdef OS2
  104. #include "os2_obuffer.h"
  105. #endif
  106.  
  107. #endif // OBUFFER_H
  108.