From 416bd737074a287ea47106c73ea6bcfde40a75a8 Mon Sep 17 00:00:00 2001 From: John Glover Date: Fri, 24 Jun 2011 18:17:23 +0100 Subject: Change to using distutils. Currently only builds the simplsndobj module --- sndobj/SndIO.cpp | 154 ------------------------------------------------------- 1 file changed, 154 deletions(-) delete mode 100644 sndobj/SndIO.cpp (limited to 'sndobj/SndIO.cpp') diff --git a/sndobj/SndIO.cpp b/sndobj/SndIO.cpp deleted file mode 100644 index 6f79feb..0000000 --- a/sndobj/SndIO.cpp +++ /dev/null @@ -1,154 +0,0 @@ - -//////////////////////////////////////////////////////////////////////// -// This file is part of the SndObj library -// -// 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -// Copyright (c)Victor Lazzarini, 1997-2004 -// See License.txt for a disclaimer of all warranties -// and licensing information - -///////////////////////////////////////////////////////// -// SndIO.cpp: implementation of the SndIO class -// -// -// -// - -#include "SndIO.h" - - -SndIO::SndIO(short channels, short bits, SndObj** inputlist, - int vecsize, double sr){ - - int n; - m_channels = channels; - m_bits = bits; - m_sampsize = bits/8; - m_vecpos = 0; - m_sr = sr; - - if(m_channels){ - if(!(m_IOobjs = new SndObj*[m_channels])){ - m_error = 2; -#ifdef DEBUG - cout << ErrorMessage(); -#endif - return; - } - - if(inputlist) // if an array of input objects exists - for(n=0;nOutput(m_vecpos) << "\n"; - return 1; - } - else{ - m_error = 4; - return 0; - } - } - - short - SndIO::Read(){ - for(m_vecpos = 0; m_vecpos < m_samples; m_vecpos+=m_channels) - for(int n = 0; n < m_channels; n++) - cin >> m_output[n+m_vecpos]; - return 1; - } - - char* SndIO::ErrorMessage(){ - - char* message; - - switch(m_error){ - - case 0: - message = "No error\n"; - break; - - case 1: - message = "Failed to allocate vector memory\n"; - break; - - case 2: - message = "Failed to allocate input object memory\n"; - break; - - case 3: - message = "Sampling rate mismatch\n"; - break; - - case 4: - message = "No input objects \n"; - break; - - default: - message = "Undefined error\n"; - break; - - } - - return message; - - } - - -- cgit v1.2.3