aboutsummaryrefslogtreecommitdiffstats
path: root/alc/backends/jack.cpp
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2019-09-15 09:50:28 -0700
committerChris Robinson <[email protected]>2019-09-15 09:50:28 -0700
commitc5a3c52822d0ab8e36c2d3d31936eae1da64049f (patch)
tree0608df414c53e281459c29de73a6ca272f9fc33a /alc/backends/jack.cpp
parente4cc77ea237c8a2ca67cb0a1cb28e6d652746590 (diff)
Return and pass more appropriate types for backends
Diffstat (limited to 'alc/backends/jack.cpp')
-rw-r--r--alc/backends/jack.cpp22
1 files changed, 11 insertions, 11 deletions
diff --git a/alc/backends/jack.cpp b/alc/backends/jack.cpp
index e1ae91f0..660ea933 100644
--- a/alc/backends/jack.cpp
+++ b/alc/backends/jack.cpp
@@ -162,8 +162,8 @@ struct JackPlayback final : public BackendBase {
int mixerProc();
ALCenum open(const ALCchar *name) override;
- ALCboolean reset() override;
- ALCboolean start() override;
+ bool reset() override;
+ bool start() override;
void stop() override;
ClockLatency getClockLatency() override;
@@ -359,7 +359,7 @@ ALCenum JackPlayback::open(const ALCchar *name)
return ALC_NO_ERROR;
}
-ALCboolean JackPlayback::reset()
+bool JackPlayback::reset()
{
std::for_each(std::begin(mPort), std::end(mPort),
[this](jack_port_t *port) -> void
@@ -395,7 +395,7 @@ ALCboolean JackPlayback::reset()
if(bad_port != ports_end)
{
ERR("Not enough JACK ports available for %s output\n", DevFmtChannelsString(mDevice->FmtChans));
- if(bad_port == std::begin(mPort)) return ALC_FALSE;
+ if(bad_port == std::begin(mPort)) return false;
if(bad_port == std::begin(mPort)+1)
mDevice->FmtChans = DevFmtMono;
@@ -416,20 +416,20 @@ ALCboolean JackPlayback::reset()
if(!mRing)
{
ERR("Failed to allocate ringbuffer\n");
- return ALC_FALSE;
+ return false;
}
SetDefaultChannelOrder(mDevice);
- return ALC_TRUE;
+ return true;
}
-ALCboolean JackPlayback::start()
+bool JackPlayback::start()
{
if(jack_activate(mClient))
{
ERR("Failed to activate client\n");
- return ALC_FALSE;
+ return false;
}
const char **ports{jack_get_ports(mClient, nullptr, nullptr,
@@ -438,7 +438,7 @@ ALCboolean JackPlayback::start()
{
ERR("No physical playback ports found\n");
jack_deactivate(mClient);
- return ALC_FALSE;
+ return false;
}
std::mismatch(std::begin(mPort), std::end(mPort), ports,
[this](const jack_port_t *port, const char *pname) -> bool
@@ -460,7 +460,7 @@ ALCboolean JackPlayback::start()
try {
mKillNow.store(false, std::memory_order_release);
mThread = std::thread{std::mem_fn(&JackPlayback::mixerProc), this};
- return ALC_TRUE;
+ return true;
}
catch(std::exception& e) {
ERR("Could not create playback thread: %s\n", e.what());
@@ -468,7 +468,7 @@ ALCboolean JackPlayback::start()
catch(...) {
}
jack_deactivate(mClient);
- return ALC_FALSE;
+ return false;
}
void JackPlayback::stop()