Show stream.cpp syntax highlighted
/***************************************************************************
stream.cpp - WAV stream
-------------------
begin : Wed Mar 17 2004
copyright : (C) 2004 by Reality Rift Studios
email : mattias@realityrift.com
***************************************************************************
The contents of this file are subject to the Mozilla Public License Version
1.1 (the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.mozilla.org/MPL/
Software distributed under the License is distributed on an "AS IS" basis,
WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
for the specific language governing rights and limitations under the
License.
The Original Code is the NeoEngine, NeoACWAV, stream.cpp
The Initial Developer of the Original Code is Mattias Jansson.
Portions created by Mattias Jansson are Copyright (C) 2004
Reality Rift Studios. All Rights Reserved.
***************************************************************************/
#include "stream.h"
namespace NeoACWAV
{
Stream::Stream( NeoEngine::File *pkFile ) :
SoundStream( pkFile )
{
m_pkFile->SetBinary( true );
m_pkFile->Seekg( 0, std::ios::beg );
m_pkFile->Read( &m_RiffChunk, sizeof( m_RiffChunk ) );
m_pkFile->Read( &m_FormatChunk, sizeof( m_FormatChunk ) );
m_pkFile->Read( &m_DataChunk, sizeof( m_DataChunk ) );
m_uiSize = m_DataChunk.chunkSize;
m_uiNumChannels = m_FormatChunk.wChannels;
m_uiSamplesPerSecond = m_FormatChunk.dwSamplesPerSec;
m_uiBitsPerSample = m_FormatChunk.wBitsPerSample;
}
Stream::~Stream()
{
}
void Stream::Reset()
{
SoundStream::Reset();
m_pkFile->Seekg( sizeof( RiffChunk ) + sizeof( FormatChunk ) + sizeof( DataChunk ), std::ios::beg );
}
unsigned int Stream::Decode( unsigned char *pucBuffer, unsigned int uiBytes )
{
m_pkFile->Read( pucBuffer, uiBytes );
m_uiCurPos += uiBytes;
return uiBytes;
}
};
See more files for this project here
NeoenEngine NG (Next Generation) is the evolution of neoengine one,it\'s a different development from NeoEngine2, it\'s a direct inherits from NeoEngine one.\n
Project homepage:
http://sourceforge.net/projects/neoengineng
Programming language(s): C,C++
License: other
Makefile.am
SConscript
codec.cpp
codec.h
link.h
neoacwav-static.dev
neoacwav.cbp
neoacwav.dev
neoacwav.dsp
neoacwav.layout
neoacwav.vcproj
stream.cpp
stream.h