whitespace and style cleanup, no functional changes
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28358 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -239,28 +239,34 @@ BFileGameSound::FillBuffer(void *inBuffer,
|
|||||||
// Fill the requested buffer, stopping if the paused flag is set
|
// Fill the requested buffer, stopping if the paused flag is set
|
||||||
switch(Format().format) {
|
switch(Format().format) {
|
||||||
case gs_audio_format::B_GS_U8:
|
case gs_audio_format::B_GS_U8:
|
||||||
rampDone = ::FillBuffer(fPausing, (uint8*)inBuffer, (uint8*)&fBuffer[fPlayPosition], &bytes);
|
rampDone = ::FillBuffer(fPausing, (uint8*)inBuffer,
|
||||||
|
(uint8*)&fBuffer[fPlayPosition], &bytes);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case gs_audio_format::B_GS_S16:
|
case gs_audio_format::B_GS_S16:
|
||||||
rampDone = ::FillBuffer(fPausing, (int16*)inBuffer, (int16*)&fBuffer[fPlayPosition], &bytes);
|
rampDone = ::FillBuffer(fPausing, (int16*)inBuffer,
|
||||||
|
(int16*)&fBuffer[fPlayPosition], &bytes);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case gs_audio_format::B_GS_S32:
|
case gs_audio_format::B_GS_S32:
|
||||||
rampDone = ::FillBuffer(fPausing, (int32*)inBuffer, (int32*)&fBuffer[fPlayPosition], &bytes);
|
rampDone = ::FillBuffer(fPausing, (int32*)inBuffer,
|
||||||
|
(int32*)&fBuffer[fPlayPosition], &bytes);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case gs_audio_format::B_GS_F:
|
case gs_audio_format::B_GS_F:
|
||||||
rampDone = ::FillBuffer(fPausing, (float*)inBuffer, (float*)&fBuffer[fPlayPosition], &bytes);
|
rampDone = ::FillBuffer(fPausing, (float*)inBuffer,
|
||||||
|
(float*)&fBuffer[fPlayPosition], &bytes);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
// We finished ramping
|
// We finished ramping
|
||||||
if (rampDone) {
|
if (rampDone) {
|
||||||
if (bytes < inByteCount && !fPausing) {
|
if (bytes < inByteCount && !fPausing) {
|
||||||
// Since we are resuming play back, we need to copy any remaining samples
|
// Since we are resuming play back,
|
||||||
|
// we need to copy any remaining samples
|
||||||
char * buffer = (char*)inBuffer;
|
char * buffer = (char*)inBuffer;
|
||||||
memcpy(&buffer[bytes], &fBuffer[fPlayPosition + bytes], inByteCount - bytes);
|
memcpy(&buffer[bytes], &fBuffer[fPlayPosition + bytes],
|
||||||
|
inByteCount - bytes);
|
||||||
}
|
}
|
||||||
|
|
||||||
delete fPausing;
|
delete fPausing;
|
||||||
@@ -308,9 +314,11 @@ BFileGameSound::SetPaused(bool isPaused,
|
|||||||
if (rampTime > 100000) {
|
if (rampTime > 100000) {
|
||||||
// Setup for ramping
|
// Setup for ramping
|
||||||
if (isPaused)
|
if (isPaused)
|
||||||
fPausing = InitRamp(&fPauseGain, 0.0, Format().frame_rate, rampTime);
|
fPausing = InitRamp(&fPauseGain, 0.0,
|
||||||
|
Format().frame_rate, rampTime);
|
||||||
else
|
else
|
||||||
fPausing = InitRamp(&fPauseGain, 1.0, Format().frame_rate, rampTime);
|
fPausing = InitRamp(&fPauseGain, 1.0,
|
||||||
|
Format().frame_rate, rampTime);
|
||||||
}
|
}
|
||||||
|
|
||||||
fPaused = isPaused;
|
fPaused = isPaused;
|
||||||
|
|||||||
Reference in New Issue
Block a user