[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [12600] branches/soc-2007-hcube/intern/ tinySND: Fixed leaving sndfileWriter when libsndfile is disabled.

Csaba Hruska csaba.hruska at gmail.com
Thu Nov 15 19:25:17 CET 2007


Revision: 12600
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=12600
Author:   hcube
Date:     2007-11-15 19:25:17 +0100 (Thu, 15 Nov 2007)

Log Message:
-----------
Fixed leaving sndfileWriter when libsndfile is disabled. now the indent is made by tabs.

Modified Paths:
--------------
    branches/soc-2007-hcube/intern/tinySND/SND_DataConsumer.h
    branches/soc-2007-hcube/intern/tinySND/SND_DataMultiplexer.h
    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_FXMixer.h
    branches/soc-2007-hcube/intern/tinySND/SND_FXSample.h
    branches/soc-2007-hcube/intern/tinySND/SND_NullDevice.h
    branches/soc-2007-hcube/intern/tinySND/SND_SoundInterface.h
    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/ffmpeg/ffmpegReader.cpp
    branches/soc-2007-hcube/intern/tinySND/ffmpeg/ffmpegReader.h
    branches/soc-2007-hcube/intern/tinySND/intern/SND_AiffReader.cpp
    branches/soc-2007-hcube/intern/tinySND/intern/SND_DataMultiplexer.cpp
    branches/soc-2007-hcube/intern/tinySND/intern/SND_FXMixer.cpp
    branches/soc-2007-hcube/intern/tinySND/intern/SND_FXSample.cpp
    branches/soc-2007-hcube/intern/tinySND/intern/SND_NullDevice.cpp
    branches/soc-2007-hcube/intern/tinySND/intern/SND_WavReader.cpp
    branches/soc-2007-hcube/intern/tinySND/jack/jackDevice.cpp
    branches/soc-2007-hcube/intern/tinySND/jack/jackDevice.h
    branches/soc-2007-hcube/intern/tinySND/mad/madReader.cpp
    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/SND_FXSRC.cpp
    branches/soc-2007-hcube/intern/tinySND/samplerate/SND_FXSRC.h
    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/sndfileReader.cpp
    branches/soc-2007-hcube/intern/tinySND/sndfile/sndfileReader.h
    branches/soc-2007-hcube/intern/tinySND/sndfile/sndfileWriter.cpp
    branches/soc-2007-hcube/intern/tinySND/sndfile/sndfileWriter.h
    branches/soc-2007-hcube/intern/tinySND/vorbis/vorbisReader.cpp

Modified: branches/soc-2007-hcube/intern/tinySND/SND_DataConsumer.h
===================================================================
--- branches/soc-2007-hcube/intern/tinySND/SND_DataConsumer.h	2007-11-15 13:38:35 UTC (rev 12599)
+++ branches/soc-2007-hcube/intern/tinySND/SND_DataConsumer.h	2007-11-15 18:25:17 UTC (rev 12600)
@@ -27,7 +27,7 @@
 
 	int				getBitRate();
 	
-    // only same sample rate is acceptable that device has
+	// only same sample rate is acceptable that device has
 	void			setInput( SND_DataMultiplexer *input );
 
 	// calling callback before producing pcm data to the device

Modified: branches/soc-2007-hcube/intern/tinySND/SND_DataMultiplexer.h
===================================================================
--- branches/soc-2007-hcube/intern/tinySND/SND_DataMultiplexer.h	2007-11-15 13:38:35 UTC (rev 12599)
+++ branches/soc-2007-hcube/intern/tinySND/SND_DataMultiplexer.h	2007-11-15 18:25:17 UTC (rev 12600)
@@ -14,11 +14,11 @@
 			SND_DataMultiplexer();
 			~SND_DataMultiplexer();
     
-    void	assignSoundToChannel( SND_SoundInterface *sound, int channelIdx );
+	void	assignSoundToChannel( SND_SoundInterface *sound, int channelIdx );
 	SND_SoundInterface *getChannel( int channelIdx );
 
-    int		getNumChannels();
-    void	setNumChannels( int channelsNum );
+	int		getNumChannels();
+	void	setNumChannels( int channelsNum );
 
 	int		getSampleFormat();
 	void	setSampleFormat( int sampleFormat );

Modified: branches/soc-2007-hcube/intern/tinySND/SND_DataProvider.h
===================================================================
--- branches/soc-2007-hcube/intern/tinySND/SND_DataProvider.h	2007-11-15 13:38:35 UTC (rev 12599)
+++ branches/soc-2007-hcube/intern/tinySND/SND_DataProvider.h	2007-11-15 18:25:17 UTC (rev 12600)
@@ -28,13 +28,13 @@
 	virtual void	fillBuffer( float *buffer, int framesNum ) = 0;    
     
 protected:
-	int     mNumFrames;
-	float   mDuration;
-	int     mBitRate;
-	float   mSampleRate;
-	int     mNumChannels;
-	int     mCurrentFrame;
-	bool    mIsSeekable;
+	int		mNumFrames;
+	float	mDuration;
+	int		mBitRate;
+	float	mSampleRate;
+	int		mNumChannels;
+	int		mCurrentFrame;
+	bool	mIsSeekable;
 };
 
 #endif //__SND_DATAPROVIDER_H__

Modified: branches/soc-2007-hcube/intern/tinySND/SND_Defines.h
===================================================================
--- branches/soc-2007-hcube/intern/tinySND/SND_Defines.h	2007-11-15 13:38:35 UTC (rev 12599)
+++ branches/soc-2007-hcube/intern/tinySND/SND_Defines.h	2007-11-15 18:25:17 UTC (rev 12600)
@@ -39,7 +39,7 @@
 
 // these are frame counts
 // the final values
-#define SND_WAVE_BUFFER_FRAMES				(64*1024)
+#define SND_WAVE_BUFFER_FRAMES				(24*1024)
 #define SND_WAVE_BUFFER_STEP_FRAMES			(8*1024)
 
 // smaller values are good for testing
@@ -50,21 +50,21 @@
 
 enum
 {
-    SND_ENDIAN_LITTLE       = 0x1000,
-    SND_ENDIAN_BIG          = 0x2000
+	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_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_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 */
+	SND_FORMAT_FLOAT	= 0x0006,       /* 32 bit float data */
+	SND_FORMAT_DOUBLE	= 0x0007        /* 64 bit float data */
 };
 
 #endif //__SOUNDDEFINES_H

Modified: branches/soc-2007-hcube/intern/tinySND/SND_Device.h
===================================================================
--- branches/soc-2007-hcube/intern/tinySND/SND_Device.h	2007-11-15 13:38:35 UTC (rev 12599)
+++ branches/soc-2007-hcube/intern/tinySND/SND_Device.h	2007-11-15 18:25:17 UTC (rev 12600)
@@ -6,19 +6,19 @@
 class SND_Device: public SND_DataConsumer
 {
 public:
-    virtual			~SND_Device() {}
+	virtual			~SND_Device() {}
 
 	void			consumeData( int framesNum ) {}
 	
 	// enables/disables audio device temporarly
-    virtual bool	isEnabled() = 0;
-    virtual void	enable() = 0;
-    virtual void	disable() = 0;
+	virtual bool	isEnabled() = 0;
+	virtual void	enable() = 0;
+	virtual void	disable() = 0;
 
 	virtual int		getAudioBufferSize() = 0;
 	virtual	void	setAudioBufferSize( int bufferSize ) = 0;
 
-    virtual char*	getChannelName( int hwChannelIdx ) = 0;
+	virtual char*	getChannelName( int hwChannelIdx ) = 0;
 };
 
 #endif //__SND_DEVICE_H__

Modified: branches/soc-2007-hcube/intern/tinySND/SND_FXMixer.h
===================================================================
--- branches/soc-2007-hcube/intern/tinySND/SND_FXMixer.h	2007-11-15 13:38:35 UTC (rev 12599)
+++ branches/soc-2007-hcube/intern/tinySND/SND_FXMixer.h	2007-11-15 18:25:17 UTC (rev 12600)
@@ -11,21 +11,21 @@
 			~SND_FXMixer();
 	
 	// only same sample rated sounds are acceptable
-    void	addSound(SND_SoundInterface* sound);
-    void	removeSound(SND_SoundInterface* sound);
+	void	addSound(SND_SoundInterface* sound);
+	void	removeSound(SND_SoundInterface* sound);
 
 	SND_SoundInterface* getSound( int idx );
-    int		getNumSounds();
+	int		getNumSounds();
 
-    void	setGain( float gain );
-    float	getGain();
+	void	setGain( float gain );
+	float	getGain();
     
-    bool	isMuted();
-    void	setMute( bool isMuted );
+	bool	isMuted();
+	void	setMute( bool isMuted );
 
-    float	getSampleRate();
-    bool	isDataAvailable();
-    float*	getPCMDataPtr( int framesNum );
+	float	getSampleRate();
+	bool	isDataAvailable();
+	float*	getPCMDataPtr( int framesNum );
 	
 private:
 	std::vector<SND_SoundInterface*>	mSounds;

Modified: branches/soc-2007-hcube/intern/tinySND/SND_FXSample.h
===================================================================
--- branches/soc-2007-hcube/intern/tinySND/SND_FXSample.h	2007-11-15 13:38:35 UTC (rev 12599)
+++ branches/soc-2007-hcube/intern/tinySND/SND_FXSample.h	2007-11-15 18:25:17 UTC (rev 12600)
@@ -14,84 +14,84 @@
 class SND_FXSample: public SND_SoundInterface
 {
 public:
-    enum PlayState
-    {
-		STARTED  = 0,
-		PAUSED   = 1,
-		STOPPED  = 2
-    };
+	enum PlayState
+	{
+		STARTED	= 0,
+		PAUSED	= 1,
+		STOPPED	= 2
+	};
     
-    enum PlayDirection
-    {
+	enum PlayDirection
+	{
 		FORWARD		= 0,
 		BACKWARD	= 1
-    };
+	};
     
-    enum LoopMode
-    {
+	enum LoopMode
+	{
 		OFF				= 0,
 		NORMAL			= 1,
 		BIDIRECTIONAL	= 2
-    };
+	};
     
 				SND_FXSample( SND_DataCache *dataCache, int channelIdx );
 
-	// Creates its own DataCache instance. Its only for simplier usage.
+				// Creates its own DataCache instance. Its only for simplier usage.
 				SND_FXSample( SND_DataProvider *dataProvider, int channelIdx );
 	
 				~SND_FXSample();
 
-    PlayState	getPlayState();
-    void		play();
-    void		stop();
-    void		pause();
+	PlayState	getPlayState();
+	void		play();
+	void		stop();
+	void		pause();
 	
 	PlayDirection	getPlayDirection();
 	void			setPlayDirection( PlayDirection playDirection );
     
-    LoopMode	getLoopMode();
-    void		setLoopMode( LoopMode loopMode );
-    int			getLoopStartFrame();
-    void		setLoopStartFrame( int frameNum );
-    int			getLoopEndFrame();
-    void		setLoopEndFrame( int frameNum );
+	LoopMode	getLoopMode();
+	void		setLoopMode( LoopMode loopMode );
+	int			getLoopStartFrame();
+	void		setLoopStartFrame( int frameNum );
+	int			getLoopEndFrame();
+	void		setLoopEndFrame( int frameNum );
     
-    void		setGain( float gain );
-    float		getGain();
+	void		setGain( float gain );
+	float		getGain();
 	
-    bool		isMuted();
-    void		setMute( bool isMuted );
+	bool		isMuted();
+	void		setMute( bool isMuted );
 
-    int			getNumFrames();
-    float		getDuration(); // in sec
+	int			getNumFrames();
+	float		getDuration(); // in sec
     
-    float		getSampleRate();
-    int			getBitRate();
+	float		getSampleRate();
+	int			getBitRate();
 
-    int			getCurrentFrameNumber();
-    void		seek( int frameNum );
+	int			getCurrentFrameNumber();
+	void		seek( int frameNum );
         
-    bool		isDataAvailable();
+	bool		isDataAvailable();
     // we can request sound data. do not request big part, only few kilobytes are recommended
-    float*		getPCMDataPtr( int framesNum ); // incremets frame counter according to play state
+	float*		getPCMDataPtr( int framesNum ); // incremets frame counter according to play state
 
 private:
 
-    float              *mBuffer;		// it has it s own small sized mix buffer: dynamically can be incremented in 64Kb parts
-    int                 mBufferSize;	// number of frames
+	float			*mBuffer;		// it has it s own small sized mix buffer: dynamically can be incremented in 64Kb parts
+	int				mBufferSize;	// number of frames
     
-    SND_DataCache		*mDataCache;
-	bool				mDeleteDataCache;
+	SND_DataCache	*mDataCache;
+	bool			mDeleteDataCache;
     
-	float				mGain;
-	bool                mIsMuted;
-    int                 mFrameCounter;
-    PlayState           mPlayState;
-    int                 mChannelNum;
-	PlayDirection		mPlayDirection;
-	LoopMode			mLoopMode;
-	int					mLoopStartFrame;
-	int					mLoopEndFrame;
+	float			mGain;
+	bool			mIsMuted;
+	int				mFrameCounter;
+	PlayState		mPlayState;
+	int				mChannelNum;
+	PlayDirection	mPlayDirection;
+	LoopMode		mLoopMode;
+	int				mLoopStartFrame;
+	int				mLoopEndFrame;
     
 };
 

Modified: branches/soc-2007-hcube/intern/tinySND/SND_NullDevice.h
===================================================================
--- branches/soc-2007-hcube/intern/tinySND/SND_NullDevice.h	2007-11-15 13:38:35 UTC (rev 12599)
+++ branches/soc-2007-hcube/intern/tinySND/SND_NullDevice.h	2007-11-15 18:25:17 UTC (rev 12600)
@@ -19,17 +19,17 @@
 	void	setNumChannels( int channelsNum );
 
 	// enables/disables audio device temporarly
-    bool	isEnabled();
-    void	enable();
-    void	disable();
+	bool	isEnabled();
+	void	enable();
+	void	disable();
 
 	int		getAudioBufferSize();
 	void	setAudioBufferSize( int bufferSize );
 
-    char*	getChannelName( int hwChannelIdx );
+	char*	getChannelName( int hwChannelIdx );
     
 private:

@@ Diff output truncated at 10240 characters. @@




More information about the Bf-blender-cvs mailing list