[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [10936] branches/soc-2007-hcube: my firts commit.

Csaba Hruska csaba.hruska at gmail.com
Fri Jun 15 14:08:30 CEST 2007


Revision: 10936
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=10936
Author:   hcube
Date:     2007-06-15 14:08:29 +0200 (Fri, 15 Jun 2007)

Log Message:
-----------
my firts commit.

Modified Paths:
--------------
    branches/soc-2007-hcube/config/linux2-config.py
    branches/soc-2007-hcube/intern/SConscript
    branches/soc-2007-hcube/source/blender/blenkernel/intern/writeffmpeg.c
    branches/soc-2007-hcube/source/blender/include/BIF_editsound.h
    branches/soc-2007-hcube/source/blender/include/BSE_seqaudio.h
    branches/soc-2007-hcube/source/blender/python/api2_2x/Sound.c
    branches/soc-2007-hcube/source/blender/python/api2_2x/bpy_data.c
    branches/soc-2007-hcube/source/blender/src/SConscript
    branches/soc-2007-hcube/source/blender/src/buttons_logic.c
    branches/soc-2007-hcube/source/blender/src/buttons_scene.c
    branches/soc-2007-hcube/source/blender/src/drawseq.c
    branches/soc-2007-hcube/source/blender/src/drawsound.c
    branches/soc-2007-hcube/source/blender/src/drawview.c
    branches/soc-2007-hcube/source/blender/src/editscreen.c
    branches/soc-2007-hcube/source/blender/src/editseq.c
    branches/soc-2007-hcube/source/blender/src/editsound.c
    branches/soc-2007-hcube/source/blender/src/hddaudio.c
    branches/soc-2007-hcube/source/blender/src/header_sound.c
    branches/soc-2007-hcube/source/blender/src/header_time.c
    branches/soc-2007-hcube/source/blender/src/headerbuttons.c
    branches/soc-2007-hcube/source/blender/src/seqaudio.c
    branches/soc-2007-hcube/source/blender/src/sequence.c
    branches/soc-2007-hcube/source/blender/src/space.c
    branches/soc-2007-hcube/source/blender/src/toets.c
    branches/soc-2007-hcube/source/blender/src/usiblender.c
    branches/soc-2007-hcube/source/creator/SConscript
    branches/soc-2007-hcube/source/creator/creator.c
    branches/soc-2007-hcube/source/gameengine/Ketsji/KX_CDActuator.h

Added Paths:
-----------
    branches/soc-2007-hcube/intern/tinySND/
    branches/soc-2007-hcube/intern/tinySND/SConscript
    branches/soc-2007-hcube/intern/tinySND/SND_DataProvider.h
    branches/soc-2007-hcube/intern/tinySND/SND_Defines.h
    branches/soc-2007-hcube/intern/tinySND/SND_Device.h
    branches/soc-2007-hcube/intern/tinySND/SND_FXSample.h
    branches/soc-2007-hcube/intern/tinySND/SND_SoundInterface.h
    branches/soc-2007-hcube/intern/tinySND/blender/
    branches/soc-2007-hcube/intern/tinySND/blender/SND_C-api.cpp
    branches/soc-2007-hcube/intern/tinySND/blender/SND_C-api.h
    branches/soc-2007-hcube/intern/tinySND/intern/
    branches/soc-2007-hcube/intern/tinySND/intern/SND_FXSample.cpp
    branches/soc-2007-hcube/intern/tinySND/portaudio/
    branches/soc-2007-hcube/intern/tinySND/portaudio/portaudioDevice.cpp
    branches/soc-2007-hcube/intern/tinySND/portaudio/portaudioDevice.h
    branches/soc-2007-hcube/intern/tinySND/samplerate/
    branches/soc-2007-hcube/intern/tinySND/samplerate/SND_FXSRC.cpp
    branches/soc-2007-hcube/intern/tinySND/samplerate/SND_FXSRC.h
    branches/soc-2007-hcube/intern/tinySND/sdl/
    branches/soc-2007-hcube/intern/tinySND/sdl/SDLDevice.cpp
    branches/soc-2007-hcube/intern/tinySND/sdl/SDLDevice.h
    branches/soc-2007-hcube/intern/tinySND/sndfile/
    branches/soc-2007-hcube/intern/tinySND/sndfile/sndfileProvider.cpp
    branches/soc-2007-hcube/intern/tinySND/sndfile/sndfileProvider.h

Removed Paths:
-------------
    branches/soc-2007-hcube/intern/SoundSystem/

Modified: branches/soc-2007-hcube/config/linux2-config.py
===================================================================
--- branches/soc-2007-hcube/config/linux2-config.py	2007-06-15 06:37:21 UTC (rev 10935)
+++ branches/soc-2007-hcube/config/linux2-config.py	2007-06-15 12:08:29 UTC (rev 10936)
@@ -22,7 +22,7 @@
 WITH_BF_SDL = 'true'
 BF_SDL = '/usr' #$(shell sdl-config --prefix)
 BF_SDL_INC = '${BF_SDL}/include/SDL' #$(shell $(BF_SDL)/bin/sdl-config --cflags)
-BF_SDL_LIB = 'SDL' #BF_SDL #$(shell $(BF_SDL)/bin/sdl-config --libs) -lSDL_mixer
+BF_SDL_LIB = 'SDL portaudio portaudiocpp' #BF_SDL #$(shell $(BF_SDL)/bin/sdl-config --libs) -lSDL_mixer
 
 WITH_BF_FMOD = 'false'
 BF_FMOD = LIBDIR + '/fmod'
@@ -113,7 +113,7 @@
 BF_ICONV_LIBPATH = '${BF_ICONV}/lib'
 
 # enable ffmpeg  support
-WITH_BF_FFMPEG = 'false'  # -DWITH_FFMPEG
+WITH_BF_FFMPEG = 'true'  # -DWITH_FFMPEG
 BF_FFMPEG = '/usr'
 BF_FFMPEG_INC = '${BF_FFMPEG}/include'
 BF_FFMPEG_LIBPATH='${BF_FFMPEG}/lib'
@@ -128,8 +128,8 @@
 BF_OPENGL_LIB_STATIC = '${BF_OPENGL}/libGL.a ${BF_OPENGL}/libGLU.a ${BF_OPENGL}/libXxf86vm.a ${BF_OPENGL}/libX11.a ${BF_OPENGL}/libXi.a ${BF_OPENGL}/libXext.a ${BF_OPENGL}/libXxf86vm.a'
 
 ##
-CC = 'gcc'
-CXX = 'g++'
+CC = 'gcc-4.1'
+CXX = 'g++-4.1'
 ##ifeq ($CPU),alpha)
 ##   CFLAGS += -pipe -fPIC -funsigned-char -fno-strict-aliasing -mieee
 

Modified: branches/soc-2007-hcube/intern/SConscript
===================================================================
--- branches/soc-2007-hcube/intern/SConscript	2007-06-15 06:37:21 UTC (rev 10935)
+++ branches/soc-2007-hcube/intern/SConscript	2007-06-15 12:08:29 UTC (rev 10936)
@@ -1,7 +1,7 @@
 #!/usr/bin/python
 Import ('env')
 
-SConscript(['SoundSystem/SConscript',
+SConscript(['tinySND/SConscript',
             'string/SConscript',
             'ghost/SConscript',
             'guardedalloc/SConscript',

Added: branches/soc-2007-hcube/intern/tinySND/SConscript
===================================================================
--- branches/soc-2007-hcube/intern/tinySND/SConscript	                        (rev 0)
+++ branches/soc-2007-hcube/intern/tinySND/SConscript	2007-06-15 12:08:29 UTC (rev 10936)
@@ -0,0 +1,16 @@
+#!/usr/bin/python
+
+Import ('env')
+
+sources = env.Glob('portaudio/*.cpp') + env.Glob('sdl/*.cpp') + env.Glob('samplerate/*.cpp') + env.Glob('sndfile/*.cpp') + env.Glob('blender/*.cpp') + env.Glob('intern/*.cpp')
+
+incs = '. samplerate blender sdl portaudio sndfile' + ' ' + env['BF_SDL_INC']
+defs = ''
+#if env['WITH_BF_OPENAL']:
+#    sources += env.Glob('openal/*.cpp') + env.Glob('sdl/*.cpp')
+#    incs += ' ' + env['BF_OPENAL_INC']
+#    incs += ' ' + env['BF_SDL_INC']
+#else:
+#    defs = 'NO_SOUND'
+
+env.BlenderLib ('bf_soundsystem', sources, Split(incs), Split(defs), libtype=['core','player'], priority = [20,140] )

Added: branches/soc-2007-hcube/intern/tinySND/SND_DataProvider.h
===================================================================
--- branches/soc-2007-hcube/intern/tinySND/SND_DataProvider.h	                        (rev 0)
+++ branches/soc-2007-hcube/intern/tinySND/SND_DataProvider.h	2007-06-15 12:08:29 UTC (rev 10936)
@@ -0,0 +1,40 @@
+#ifndef __SND_DATAPROVIDER_H__
+#define __SND_DATAPROVIDER_H__
+
+// doesnt contains any cache buffer
+
+//file source
+class SND_DataProvider
+{
+public:
+    
+    virtual ~SND_DataProvider() {}
+    
+    // true if file loading is succed, false if there was an error
+    virtual bool isFormatSupported();
+    
+    int getNumFrames() const { return mNumFrames; }
+    float getDuration() const { return mDuration; } // in sec
+    
+    float getSampleRate() const { return mSampleRate; }
+    int getBitRate() const { return mBitRate; }
+
+    int getNumChannels() const { return mNumChannels; }
+    
+    int isSeekable() const { return mIsSeekable; }
+    
+    virtual void seek( int frameNum ) = 0;
+    
+    virtual int fillBuffer( float *buffer, int channelIndex, int framesNum ) = 0;    
+    
+protected:
+    int     mNumFrames;
+    float   mDuration;
+    int     mBitRate;
+    float   mSampleRate;
+    int     mNumChannels;
+    int     mCurrentFrame;
+    bool    mIsSeekable;
+};
+
+#endif //__SND_DATAPROVIDER_H__

Added: branches/soc-2007-hcube/intern/tinySND/SND_Defines.h
===================================================================
--- branches/soc-2007-hcube/intern/tinySND/SND_Defines.h	                        (rev 0)
+++ branches/soc-2007-hcube/intern/tinySND/SND_Defines.h	2007-06-15 12:08:29 UTC (rev 10936)
@@ -0,0 +1,96 @@
+/*
+ * SoundDefines.h
+ *
+ * this is where all kinds of defines are stored
+ *
+ * $Id: SoundDefines.h 229 2002-12-27 13:11:01Z mein $
+ *
+ * ***** BEGIN GPL/BL DUAL LICENSE BLOCK *****
+ *
+ * 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. The Blender
+ * Foundation also sells licenses for use in proprietary software under
+ * the Blender License.  See http://www.blender.org/BL/ for information
+ * about this.
+ *
+ * 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.
+ *
+ * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
+ * All rights reserved.
+ *
+ * The Original Code is: all of this file.
+ *
+ * Contributor(s): none yet.
+ *
+ * ***** END GPL/BL DUAL LICENSE BLOCK *****
+ */
+
+#ifndef __SOUNDDEFINES_H
+#define __SOUNDDEFINES_H
+
+#define SND_WAVE_BUFFER_SIZE					(256*1024)
+#define SND_MIX_BUFFER_SIZE					(16*1024)
+
+/* playstate flags */
+enum
+{
+	SND_UNKNOWN = -1,
+	SND_INITIAL,
+	SND_MUST_PLAY,
+	SND_PLAYING,
+	SND_MUST_STOP,
+	SND_STOPPED,
+	SND_MUST_PAUSE,
+	SND_PAUSED,
+	SND_MUST_RESUME,
+	SND_MUST_STOP_WHEN_FINISHED,
+	SND_MUST_BE_DELETED
+};
+
+/* loopmodes */
+enum
+{
+	SND_LOOP_OFF = 0,
+	SND_LOOP_NORMAL,
+	SND_LOOP_BIDIRECTIONAL
+};
+
+
+/* cd playstate flags */
+enum
+{
+	SND_CD_ALL = 0,
+	SND_CD_TRACK,
+	SND_CD_TRACKLOOP
+};
+
+enum
+{
+    SND_ENDIAN_LITTLE       = 0x1000,
+    SND_ENDIAN_BIG          = 0x2000
+};
+
+enum
+{
+    SND_FORMAT_PCM_S8       = 0x0001,       /* Signed 8 bit data */
+    SND_FORMAT_PCM_16       = 0x0002,       /* Signed 16 bit data */
+    SND_FORMAT_PCM_24       = 0x0003,       /* Signed 24 bit data */
+    SND_FORMAT_PCM_32       = 0x0004,       /* Signed 32 bit data */
+
+    SND_FORMAT_PCM_U8       = 0x0005,       /* Unsigned 8 bit data (WAV and RAW only) */
+
+    SND_FORMAT_FLOAT        = 0x0006,       /* 32 bit float data */
+    SND_FORMAT_DOUBLE       = 0x0007        /* 64 bit float data */
+};
+
+#endif //__SOUNDDEFINES_H
+

Added: branches/soc-2007-hcube/intern/tinySND/SND_Device.h
===================================================================
--- branches/soc-2007-hcube/intern/tinySND/SND_Device.h	                        (rev 0)
+++ branches/soc-2007-hcube/intern/tinySND/SND_Device.h	2007-06-15 12:08:29 UTC (rev 10936)
@@ -0,0 +1,24 @@
+#ifndef __SND_DEVICE_H__
+#define __SND_DEVICE_H__
+
+class SND_SoundInterface;
+
+class SND_Device
+{
+public:
+    virtual ~SND_Device(){}
+    // initalize sound device
+    virtual bool initialize() = 0;
+
+    // close sound device
+    virtual bool finalize() = 0;
+
+    virtual int getNumChannels() = 0;
+    virtual char* getChannelName( int hwChannelIdx ) = 0;
+    // only same sample rate is acceptable that device has
+    virtual void assignSoundToChannel( int hwChannelIdx, SND_SoundInterface *sound ) = 0;
+
+};
+
+#endif //__SND_DEVICE_H__
+

Added: branches/soc-2007-hcube/intern/tinySND/SND_FXSample.h
===================================================================
--- branches/soc-2007-hcube/intern/tinySND/SND_FXSample.h	                        (rev 0)
+++ branches/soc-2007-hcube/intern/tinySND/SND_FXSample.h	2007-06-15 12:08:29 UTC (rev 10936)
@@ -0,0 +1,71 @@
+#ifndef __SND_FXSAMPLE_H__
+#define __SND_FXSAMPLE_H__
+
+#include "SND_DataProvider.h"
+#include "SND_SoundInterface.h"
+
+/*  Represents a sound, one channel of dataProvider
+    Can be looped
+    dont do any format conversion
+    provides pcm data at same format that it comes from dataProvider
+*/
+class SND_FXSample: public SND_SoundInterface
+{
+public:
+    enum PlayState
+    {
+	STARTED  = 0,
+	PAUSED   = 1,
+	STOPPED  = 2
+    };
+    
+    SND_FXSample( SND_DataProvider *dataProvider, int channelIdx );
+
+    PlayState getPlayState();
+    void play();
+    void stop();
+    void pause();
+    
+    void setLoopMode( int loopMode );
+    void setLoopStart( int frameNum );
+    void setLoopEnd( int frameNum );
+    
+    void  setGain( float gain );
+    float getGain();
+    
+    bool isMuted();
+    void setMute( bool isMuted );
+
+    int getNumFrames();
+    float getDuration(); // in sec
+    
+    float getSampleRate();
+    int getBitRate();
+        
+    // we can request sound data. do not request big part, only few kilobytes are recommended
+    float* getPCMDataPtr( int framesNum ); // incremets frame counter according play state
+
+    int getCurrentFrameNum() const;
+    void seek( int frameNum );
+
+    bool isDataAvailable();
+
+private:
+    float              *mSourceBuffer; // it has it s own medium sized sample buffer max: ~300Kb
+    int                 mSourceBufferSize;
+    int                 mSourceBufferPos;
+    
+    float              *mMixBuffer; // it has it s own small sized mix buffer: dynamically can be incremented in 64Kb parts
+    int                 mMixBufferSize;
+    
+    SND_DataProvider   *mDataProvider;
+    
+    bool                mIsMuted;
+    int                 mFrameCounter;
+    PlayState           mPlayState;
+    float               mGain;
+    int                 mChannelNum;
+    
+};
+
+#endif //__SND_FXSAMPLE_H__

Added: branches/soc-2007-hcube/intern/tinySND/SND_SoundInterface.h
===================================================================
--- branches/soc-2007-hcube/intern/tinySND/SND_SoundInterface.h	                        (rev 0)
+++ branches/soc-2007-hcube/intern/tinySND/SND_SoundInterface.h	2007-06-15 12:08:29 UTC (rev 10936)

@@ Diff output truncated at 10240 characters. @@




More information about the Bf-blender-cvs mailing list