aboutsummaryrefslogtreecommitdiffstats
path: root/Alc/backends/qsa.cpp
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2018-12-19 05:57:36 -0800
committerChris Robinson <[email protected]>2018-12-19 05:57:36 -0800
commit0214a1102497003df07f354adc1e77d2b3185953 (patch)
tree5b39e70dc19752eb620767991a0bddf68ee22faf /Alc/backends/qsa.cpp
parentb49e8985a47f384dfde0ddd04d97426e3c37f480 (diff)
Use inline methods for the device format sizes
Diffstat (limited to 'Alc/backends/qsa.cpp')
-rw-r--r--Alc/backends/qsa.cpp21
1 files changed, 8 insertions, 13 deletions
diff --git a/Alc/backends/qsa.cpp b/Alc/backends/qsa.cpp
index 3d09a744..f8b26878 100644
--- a/Alc/backends/qsa.cpp
+++ b/Alc/backends/qsa.cpp
@@ -210,9 +210,7 @@ FORCE_ALIGN static int qsa_proc_playback(void *ptr)
param.sched_priority=param.sched_curpriority+1;
SchedSet(0, 0, SCHED_NOCHANGE, &param);
- const ALint frame_size = FrameSizeFromDevFmt(
- device->FmtChans, device->FmtType, device->mAmbiOrder
- );
+ const ALint frame_size = device->frameSizeFromFmt();
PlaybackWrapper_lock(self);
while(!data->mKillNow.load(std::memory_order_acquire))
@@ -385,14 +383,13 @@ static ALCboolean qsa_reset_playback(PlaybackWrapper *self)
data->cparams.start_mode=SND_PCM_START_FULL;
data->cparams.stop_mode=SND_PCM_STOP_STOP;
- data->cparams.buf.block.frag_size=device->UpdateSize *
- FrameSizeFromDevFmt(device->FmtChans, device->FmtType, device->mAmbiOrder);
+ data->cparams.buf.block.frag_size=device->UpdateSize * device->frameSizeFromFmt();
data->cparams.buf.block.frags_max=device->NumUpdates;
data->cparams.buf.block.frags_min=device->NumUpdates;
data->cparams.format.interleave=1;
data->cparams.format.rate=device->Frequency;
- data->cparams.format.voices=ChannelsFromDevFmt(device->FmtChans, device->mAmbiOrder);
+ data->cparams.format.voices=device->channelsFromFmt();
data->cparams.format.format=format;
if ((snd_pcm_plugin_params(data->pcmHandle, &data->cparams))<0)
@@ -575,8 +572,7 @@ static ALCboolean qsa_reset_playback(PlaybackWrapper *self)
SetDefaultChannelOrder(device);
- device->UpdateSize=data->csetup.buf.block.frag_size/
- FrameSizeFromDevFmt(device->FmtChans, device->FmtType, device->mAmbiOrder);
+ device->UpdateSize=data->csetup.buf.block.frag_size / device->frameSizeFromFmt();
device->NumUpdates=data->csetup.buf.block.frags;
data->size=data->csetup.buf.block.frag_size;
@@ -757,14 +753,13 @@ static ALCenum qsa_open_capture(CaptureWrapper *self, const ALCchar *deviceName)
data->cparams.start_mode=SND_PCM_START_GO;
data->cparams.stop_mode=SND_PCM_STOP_STOP;
- data->cparams.buf.block.frag_size=device->UpdateSize*
- FrameSizeFromDevFmt(device->FmtChans, device->FmtType, device->mAmbiOrder);
+ data->cparams.buf.block.frag_size=device->UpdateSize * device->frameSizeFromFmt();
data->cparams.buf.block.frags_max=device->NumUpdates;
data->cparams.buf.block.frags_min=device->NumUpdates;
data->cparams.format.interleave=1;
data->cparams.format.rate=device->Frequency;
- data->cparams.format.voices=ChannelsFromDevFmt(device->FmtChans, device->mAmbiOrder);
+ data->cparams.format.voices=device->channelsFromFmt();
data->cparams.format.format=format;
if(snd_pcm_plugin_params(data->pcmHandle, &data->cparams) < 0)
@@ -822,7 +817,7 @@ static ALCuint qsa_available_samples(CaptureWrapper *self)
ALCdevice *device = STATIC_CAST(ALCbackend,self)->mDevice;
qsa_data *data = self->ExtraData.get();
snd_pcm_channel_status_t status;
- ALint frame_size = FrameSizeFromDevFmt(device->FmtChans, device->FmtType, device->mAmbiOrder);
+ ALint frame_size = device->frameSizeFromFmt();
ALint free_size;
int rstatus;
@@ -859,7 +854,7 @@ static ALCenum qsa_capture_samples(CaptureWrapper *self, ALCvoid *buffer, ALCuin
int selectret;
struct timeval timeout;
int bytes_read;
- ALint frame_size=FrameSizeFromDevFmt(device->FmtChans, device->FmtType, device->mAmbiOrder);
+ ALint frame_size=device->frameSizeFromFmt();
ALint len=samples*frame_size;
int rstatus;