home *** CD-ROM | disk | FTP | other *** search
/ Windows 95 Secrets / Secrets2.iso / Audio / WAV / MaplayP / _SETUP.1 / linux_obuffer.h < prev    next >
Encoding:
C/C++ Source or Header  |  1997-07-08  |  1.5 KB  |  56 lines

  1. /* linux_obuffer.h
  2.  
  3.    Output buffer for Linux written by
  4.    Louis P. Kruger (lpkruger@phoenix.princeton.edu)
  5.  
  6.    This program is free software; you can redistribute it and/or modify
  7.    it under the terms of the GNU General Public License as published by
  8.    the Free Software Foundation; either version 2 of the License, or
  9.    (at your option) any later version.
  10.  
  11.    This program is distributed in the hope that it will be useful,
  12.    but WITHOUT ANY WARRANTY; without even the implied warranty of
  13.    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  14.    GNU General Public License for more details.
  15.  
  16.    You should have received a copy of the GNU General Public License
  17.    along with this program; if not, write to the Free Software
  18.    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
  19.  
  20. #ifndef LINUX_OBUFFER_H
  21. #define LINUX_OBUFFER_H
  22.  
  23. #if defined(LINUX) || defined(__FreeBSD__)
  24.  
  25. #include "all.h"
  26. #include "args.h"
  27. #include "obuffer.h"
  28.  
  29. class LinuxObuffer : public Obuffer
  30. {
  31.   int16  buffer[OBUFFERSIZE];
  32.   int16 *bufferp[MAXCHANNELS];
  33.   uint32 channels;
  34.   static int audio_fd;
  35.  
  36.   static int open_audio_device();
  37.  
  38. public:
  39.     LinuxObuffer (uint32 number_of_channels, MPEG_Args *maplay_args);
  40.    ~LinuxObuffer ();
  41.  
  42.   void    append (uint32 channel, int16 value);
  43.   void    write_buffer (int dummy);
  44.  
  45. #ifdef SEEK_STOP
  46.   void clear_buffer();
  47.   void set_stop_flag();
  48. #endif // SEEK_STOP
  49.  
  50.   static BOOL class_suitable (uint32 number_of_channels);
  51. };
  52.  
  53. #endif // LINUX || __FreeBSD__
  54.  
  55. #endif // LINUX_OBUFFER_H
  56.