Revision: 37714
          
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=37714
Author:   nexyon
Date:     2011-06-21 20:29:02 +0000 (Tue, 21 Jun 2011)
Log Message:
-----------
3D Audio GSoC:
- Converting AUD_SampleRate to a double
- Removing AUD_DefaultMixer
- Introducing AUD_ResampleReader as base class for all resampling readers.

Modified Paths:
--------------
    branches/soc-2011-pepper/intern/audaspace/CMakeLists.txt
    branches/soc-2011-pepper/intern/audaspace/FX/AUD_PitchReader.cpp
    branches/soc-2011-pepper/intern/audaspace/Python/AUD_PyAPI.cpp
    branches/soc-2011-pepper/intern/audaspace/SRC/AUD_SRCResampleReader.cpp
    branches/soc-2011-pepper/intern/audaspace/SRC/AUD_SRCResampleReader.h
    branches/soc-2011-pepper/intern/audaspace/intern/AUD_C-API.cpp
    branches/soc-2011-pepper/intern/audaspace/intern/AUD_C-API.h
    
branches/soc-2011-pepper/intern/audaspace/intern/AUD_LinearResampleReader.cpp
    branches/soc-2011-pepper/intern/audaspace/intern/AUD_LinearResampleReader.h
    branches/soc-2011-pepper/intern/audaspace/intern/AUD_Mixer.h
    branches/soc-2011-pepper/intern/audaspace/intern/AUD_ReadDevice.cpp
    branches/soc-2011-pepper/intern/audaspace/intern/AUD_SequencerReader.cpp
    branches/soc-2011-pepper/intern/audaspace/intern/AUD_SinusReader.cpp
    branches/soc-2011-pepper/intern/audaspace/intern/AUD_SoftwareDevice.cpp
    branches/soc-2011-pepper/intern/audaspace/intern/AUD_Space.h

Added Paths:
-----------
    branches/soc-2011-pepper/intern/audaspace/intern/AUD_ResampleReader.cpp
    branches/soc-2011-pepper/intern/audaspace/intern/AUD_ResampleReader.h

Removed Paths:
-------------
    branches/soc-2011-pepper/intern/audaspace/intern/AUD_DefaultMixer.cpp
    branches/soc-2011-pepper/intern/audaspace/intern/AUD_DefaultMixer.h

Modified: branches/soc-2011-pepper/intern/audaspace/CMakeLists.txt
===================================================================
--- branches/soc-2011-pepper/intern/audaspace/CMakeLists.txt    2011-06-21 
20:25:48 UTC (rev 37713)
+++ branches/soc-2011-pepper/intern/audaspace/CMakeLists.txt    2011-06-21 
20:29:02 UTC (rev 37714)
@@ -82,8 +82,6 @@
        intern/AUD_ConverterFunctions.h
        intern/AUD_ConverterReader.cpp
        intern/AUD_ConverterReader.h
-       intern/AUD_DefaultMixer.cpp
-       intern/AUD_DefaultMixer.h
        intern/AUD_FileFactory.cpp
        intern/AUD_FileFactory.h
        intern/AUD_I3DDevice.h
@@ -108,6 +106,8 @@
        intern/AUD_Reference.h
        intern/AUD_ReferenceHandler.cpp
        intern/AUD_ResampleFactory.h
+       intern/AUD_ResampleReader.cpp
+       intern/AUD_ResampleReader.h
        intern/AUD_SequencerFactory.cpp
        intern/AUD_SequencerFactory.h
        intern/AUD_SequencerReader.cpp

Modified: branches/soc-2011-pepper/intern/audaspace/FX/AUD_PitchReader.cpp
===================================================================
--- branches/soc-2011-pepper/intern/audaspace/FX/AUD_PitchReader.cpp    
2011-06-21 20:25:48 UTC (rev 37713)
+++ branches/soc-2011-pepper/intern/audaspace/FX/AUD_PitchReader.cpp    
2011-06-21 20:29:02 UTC (rev 37714)
@@ -39,6 +39,6 @@
 AUD_Specs AUD_PitchReader::getSpecs() const
 {
        AUD_Specs specs = m_reader->getSpecs();
-       specs.rate = (AUD_SampleRate)((int)(specs.rate * m_pitch));
+       specs.rate *= m_pitch;
        return specs;
 }

Modified: branches/soc-2011-pepper/intern/audaspace/Python/AUD_PyAPI.cpp
===================================================================
--- branches/soc-2011-pepper/intern/audaspace/Python/AUD_PyAPI.cpp      
2011-06-21 20:25:48 UTC (rev 37713)
+++ branches/soc-2011-pepper/intern/audaspace/Python/AUD_PyAPI.cpp      
2011-06-21 20:29:02 UTC (rev 37714)
@@ -2111,13 +2111,13 @@
 
        static const char *kwlist[] = {"type", "rate", "channels", "format", 
"buffer_size", "name", NULL};
        int device;
-       int rate = AUD_RATE_44100;
+       double rate = AUD_RATE_44100;
        int channels = AUD_CHANNELS_STEREO;
        int format = AUD_FORMAT_FLOAT32;
        int buffersize = AUD_DEFAULT_BUFFER_SIZE;
        const char* name = "Audaspace";
 
-       if(!PyArg_ParseTupleAndKeywords(args, kwds, "i|iiiis:Device", 
const_cast<char**>(kwlist),
+       if(!PyArg_ParseTupleAndKeywords(args, kwds, "i|diiis:Device", 
const_cast<char**>(kwlist),
                                                                        
&device, &rate, &channels, &format, &buffersize, &name))
                return NULL;
 

Modified: 
branches/soc-2011-pepper/intern/audaspace/SRC/AUD_SRCResampleReader.cpp
===================================================================
--- branches/soc-2011-pepper/intern/audaspace/SRC/AUD_SRCResampleReader.cpp     
2011-06-21 20:25:48 UTC (rev 37713)
+++ branches/soc-2011-pepper/intern/audaspace/SRC/AUD_SRCResampleReader.cpp     
2011-06-21 20:29:02 UTC (rev 37714)
@@ -45,8 +45,7 @@
 
 AUD_SRCResampleReader::AUD_SRCResampleReader(AUD_Reference<AUD_IReader> reader,
                                                                                
         AUD_Specs specs) :
-               AUD_EffectReader(reader),
-               m_rate(specs.rate),
+               AUD_ResampleReader(reader, specs.rate),
                m_channels(reader->getSpecs().channels),
                m_position(0)
 {

Modified: branches/soc-2011-pepper/intern/audaspace/SRC/AUD_SRCResampleReader.h
===================================================================
--- branches/soc-2011-pepper/intern/audaspace/SRC/AUD_SRCResampleReader.h       
2011-06-21 20:25:48 UTC (rev 37713)
+++ branches/soc-2011-pepper/intern/audaspace/SRC/AUD_SRCResampleReader.h       
2011-06-21 20:29:02 UTC (rev 37714)
@@ -32,7 +32,7 @@
 #ifndef AUD_SRCRESAMPLEREADER
 #define AUD_SRCRESAMPLEREADER
 
-#include "AUD_EffectReader.h"
+#include "AUD_ResampleReader.h"
 #include "AUD_Buffer.h"
 
 #include <samplerate.h>
@@ -40,7 +40,7 @@
 /**
  * This resampling reader uses libsamplerate for resampling.
  */
-class AUD_SRCResampleReader : public AUD_EffectReader
+class AUD_SRCResampleReader : public AUD_ResampleReader
 {
 private:
        /**
@@ -49,11 +49,6 @@
        AUD_Buffer m_buffer;
 
        /**
-        * The target sampling rate.
-        */
-       AUD_SampleRate m_rate;
-
-       /**
         * The reader channels.
         */
        AUD_Channels m_channels;

Modified: branches/soc-2011-pepper/intern/audaspace/intern/AUD_C-API.cpp
===================================================================
--- branches/soc-2011-pepper/intern/audaspace/intern/AUD_C-API.cpp      
2011-06-21 20:25:48 UTC (rev 37713)
+++ branches/soc-2011-pepper/intern/audaspace/intern/AUD_C-API.cpp      
2011-06-21 20:29:02 UTC (rev 37714)
@@ -795,7 +795,7 @@
 float* AUD_readSoundBuffer(const char* filename, float low, float high,
                                                   float attack, float release, 
float threshold,
                                                   int accumulate, int 
additive, int square,
-                                                  float sthreshold, int 
samplerate, int* length)
+                                                  float sthreshold, double 
samplerate, int* length)
 {
        AUD_Buffer buffer;
        AUD_DeviceSpecs specs;

Modified: branches/soc-2011-pepper/intern/audaspace/intern/AUD_C-API.h
===================================================================
--- branches/soc-2011-pepper/intern/audaspace/intern/AUD_C-API.h        
2011-06-21 20:25:48 UTC (rev 37713)
+++ branches/soc-2011-pepper/intern/audaspace/intern/AUD_C-API.h        
2011-06-21 20:29:02 UTC (rev 37714)
@@ -441,7 +441,7 @@
 extern float* AUD_readSoundBuffer(const char* filename, float low, float high,
                                                                  float attack, 
float release, float threshold,
                                                                  int 
accumulate, int additive, int square,
-                                                                 float 
sthreshold, int samplerate,
+                                                                 float 
sthreshold, double samplerate,
                                                                  int* length);
 
 /**

Deleted: branches/soc-2011-pepper/intern/audaspace/intern/AUD_DefaultMixer.cpp
===================================================================
--- branches/soc-2011-pepper/intern/audaspace/intern/AUD_DefaultMixer.cpp       
2011-06-21 20:25:48 UTC (rev 37713)
+++ branches/soc-2011-pepper/intern/audaspace/intern/AUD_DefaultMixer.cpp       
2011-06-21 20:29:02 UTC (rev 37714)
@@ -1,61 +0,0 @@
-/*
- * $Id$
- *
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * Copyright 2009-2011 Jörg Hermann Müller
- *
- * This file is part of AudaSpace.
- *
- * Audaspace 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.
- *
- * AudaSpace 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 Audaspace; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- * ***** END GPL LICENSE BLOCK *****
- */
-
-/** \file audaspace/intern/AUD_DefaultMixer.cpp
- *  \ingroup audaspaceintern
- */
-
-
-#include "AUD_DefaultMixer.h"
-#ifdef WITH_SAMPLERATE
-#include "AUD_SRCResampleReader.h"
-#else
-#include "AUD_LinearResampleReader.h"
-#endif
-#include "AUD_ChannelMapperReader.h"
-#include "AUD_ChannelMapperFactory.h"
-
-#include <cstring>
-
-AUD_DefaultMixer::AUD_DefaultMixer(AUD_DeviceSpecs specs) :
-       AUD_Mixer(specs)
-{
-}
-
-AUD_Reference<AUD_IReader> 
AUD_DefaultMixer::prepare(AUD_Reference<AUD_IReader> reader)
-{
-       // resample
-#ifdef WITH_SAMPLERATE
-       reader = new AUD_SRCResampleReader(reader, m_specs.specs);
-#else
-       reader = new AUD_LinearResampleReader(reader, m_specs.specs);
-#endif
-       
-       // rechannel
-       reader = new AUD_ChannelMapperReader(reader, m_specs.channels);
-
-       return reader;
-}

Deleted: branches/soc-2011-pepper/intern/audaspace/intern/AUD_DefaultMixer.h
===================================================================
--- branches/soc-2011-pepper/intern/audaspace/intern/AUD_DefaultMixer.h 
2011-06-21 20:25:48 UTC (rev 37713)
+++ branches/soc-2011-pepper/intern/audaspace/intern/AUD_DefaultMixer.h 
2011-06-21 20:29:02 UTC (rev 37714)
@@ -1,59 +0,0 @@
-/*
- * $Id$
- *
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * Copyright 2009-2011 Jörg Hermann Müller
- *
- * This file is part of AudaSpace.
- *
- * Audaspace 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.
- *
- * AudaSpace 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 Audaspace; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- * ***** END GPL LICENSE BLOCK *****
- */
-
-/** \file audaspace/intern/AUD_DefaultMixer.h
- *  \ingroup audaspaceintern
- */
-
-
-#ifndef AUD_DEFAULTMIXER
-#define AUD_DEFAULTMIXER
-
-#include "AUD_Mixer.h"
-
-/**
- * This class is able to mix audiosignals of different channel count and sample
- * rate and convert it to a specific output format.
- * It uses a default ChannelMapperFactory and a SRCResampleFactory for
- * the perparation.
- */
-class AUD_DefaultMixer : public AUD_Mixer
-{
-public:
-       /**
-        * Creates the mixer.
-        */
-       AUD_DefaultMixer(AUD_DeviceSpecs specs);
-
-       /**
-        * This funuction prepares a reader for playback.
-        * \param reader The reader to prepare.
-        * \return The reader that should be used for playback.
-        */
-       virtual AUD_Reference<AUD_IReader> prepare(AUD_Reference<AUD_IReader> 
reader);
-};
-
-#endif //AUD_DEFAULTMIXER

Modified: 
branches/soc-2011-pepper/intern/audaspace/intern/AUD_LinearResampleReader.cpp
===================================================================
--- 
branches/soc-2011-pepper/intern/audaspace/intern/AUD_LinearResampleReader.cpp   
    2011-06-21 20:25:48 UTC (rev 37713)
+++ 
branches/soc-2011-pepper/intern/audaspace/intern/AUD_LinearResampleReader.cpp   
    2011-06-21 20:29:02 UTC (rev 37714)
@@ -38,8 +38,7 @@
 
 AUD_LinearResampleReader::AUD_LinearResampleReader(AUD_Reference<AUD_IReader> 
reader,
                                                                                
                   AUD_Specs specs) :
-       AUD_EffectReader(reader),
-       m_rate(specs.rate),
+       AUD_ResampleReader(reader, specs.rate),
        m_channels(reader->getSpecs().channels),
        m_position(0),
        m_cache_pos(0),

Modified: 
branches/soc-2011-pepper/intern/audaspace/intern/AUD_LinearResampleReader.h
===================================================================

@@ Diff output truncated at 10240 characters. @@
_______________________________________________
Bf-blender-cvs mailing list
[email protected]
http://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to