Hydrogen - Linux Drum Machine
Main Page | Class Hierarchy | Compound List | File List | Compound Members

DiskWriterDriver.h

00001 /*
00002  * Hydrogen
00003  * Copyright(c) 2002-2003 by Alex >Comix< Cominu [comix@users.sourceforge.net]
00004  *
00005  * http://hydrogen.sourceforge.net
00006  *
00007  * This program is free software; you can redistribute it and/or modify
00008  * it under the terms of the GNU General Public License as published by
00009  * the Free Software Foundation; either version 2 of the License, or
00010  * (at your option) any later version.
00011  *
00012  * This program is distributed in the hope that it will be useful,
00013  * but WITHOUT ANY WARRANTY, without even the implied warranty of
00014  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
00015  * GNU General Public License for more details.
00016  *
00017  * You should have received a copy of the GNU General Public License
00018  * along with this program; if not, write to the Free Software
00019  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00020  *
00021  * $Id: DiskWriterDriver.h,v 1.13 2003/02/13 23:06:27 comix Exp $
00022  *
00023  */
00024 
00025 #ifndef DISK_WRITER_DRIVER_H
00026 #define DISK_WRITER_DRIVER_H
00027 
00028 
00029 #include "GenericDriver.h"
00030 #include <audiofile.h>
00031 #include "Hydrogen.h"
00032 
00033 typedef int  (*audioProcessCallback)(unsigned long, void *);
00034 
00035 //----------------------------------------------------------------------------
00039 class DiskWriterDriver : public GenericDriver {
00040     private:
00041         audioProcessCallback processCallback;
00042         AFfilehandle outputFile;
00043         uint bufferSize;
00044         short *saveBuffer;
00045         string filename;
00046         
00047     public:
00048         virtual string getClassName() { return "DiskWriterDriver";  }
00049 
00051         DiskWriterDriver(audioProcessCallback processCallback);
00052 
00054         ~DiskWriterDriver();
00055 
00056         int connect();
00057 
00058         void disconnect();
00059 
00060         void write(float* buffer_L, float* buffer_R, unsigned int bufferSize);
00061 
00063         void setBufferSize(uint bufferSize);
00064         
00066         uint getBufferSize();
00067         
00068         void setFilename(string filename) { this->filename = filename;  }
00069         uint getSampleRate();
00070 };
00071 
00072 
00073 
00074 #endif

 
 
Hydrogen (c) 2002..2003 Comix