[Bf-committers] Sound stuff

Nery Chucuy idesisnery at gmail.com
Sun Jul 5 01:09:53 CEST 2009


Hi,
Works like charm now.

Things I also had to change on Windows and VC++ 2008 : (in a sort of svn
diff style :P )

File: main.cpp
============

Line 42
 - #include <iostream>
+ #include <windows.h>

Line 120
-  sleep(1);
+ Sleep(1);

File: SND_SinusReader.cpp
=====================

+ #define _USE_MATH_DEFINES


Regards,

Nery Chucuy (idesisNery)

2009/7/4 neXyon <nexyon at gmail.com>

> Hi all,
>
> idesisNery (IRC nick) is as kind as to test my library under windows with
> VC++, the problem is that this doesn't support memalign, so I had to rewrite
> that in SND_Buffer.cpp, which is attached.
>
> @idesisNery: Please write a mail if everything works now! Thanks a lot for
> testing!
>
> Good night!
>
>
>  I've done a small, quick update to the file: I added a SConstruct file.
>>
>> I'm quite sure the application won't built under Windows or MacOS without
>> adjustment in SConstruct or CMakeLists.txt, but I'd really appreciate it if
>> someone could test it on these plattforms.
>>
>> http://download.blender.org/ftp/incoming/SoundSpace_scons.tar.gz
>>
>> Regards,
>> Jörg
>> _______________________________________________
>> Bf-committers mailing list
>> Bf-committers at blender.org
>> http://lists.blender.org/mailman/listinfo/bf-committers
>>
>>
>
>
> /*
>  * $Id$
>  *
>  * ***** BEGIN LGPL LICENSE BLOCK *****
>  *
>  * Copyright 2009 Jörg Hermann Müller
>  *
>  * This file is part of SoundSpace.
>  *
>  * SoundSpace is free software: you can redistribute it and/or modify
>  * it under the terms of the GNU Lesser General Public License as published
> by
>  * the Free Software Foundation, either version 3 of the License, or
>  * (at your option) any later version.
>  *
>  * SoundSpace 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 Lesser General Public License for more details.
>  *
>  * You should have received a copy of the GNU Lesser General Public License
>  * along with SoundSpace.  If not, see <http://www.gnu.org/licenses/>.
>  *
>  * ***** END LGPL LICENSE BLOCK *****
>  */
>
> #include "SND_Buffer.h"
> #include "SND_Space.h"
>
> #include <cstring>
> #include <malloc.h>
>
> #define SND_ALIGN(a) (a + 16 - ((long)a & 15))
>
> SND_Buffer::SND_Buffer(int size)
> {
>        m_size = size;
>        m_buffer = (unsigned char*) malloc(size+15);
> }
>
> SND_Buffer::~SND_Buffer()
> {
>        free(m_buffer);
> }
>
> unsigned char* SND_Buffer::getBuffer()
> {
>        return SND_ALIGN(m_buffer);
> }
>
> int SND_Buffer::getSize()
> {
>        return m_size;
> }
>
> void SND_Buffer::resize(int size, bool keep)
> {
>        unsigned char* buffer = (unsigned char*) malloc(size+15);
>
>        // copy old data over if wanted
>        if(keep)
>                memcpy(SND_ALIGN(buffer), SND_ALIGN(m_buffer), SND_MIN(size,
> m_size));
>
>        free(m_buffer);
>
>        m_buffer = buffer;
>        m_size = size;
> }
>
> _______________________________________________
> Bf-committers mailing list
> Bf-committers at blender.org
> http://lists.blender.org/mailman/listinfo/bf-committers
>
>


More information about the Bf-committers mailing list