Commit Graph

8 Commits

Author SHA1 Message Date
Lioncash
6beb823f15 audio_core: Make g_sink_details internally linked
We can hide the direct array from external view and instead provide
functions to retrieve the necessary info. This has the benefit of
completely hiding the makeup of the SinkDetails structure from the rest
of the code.

Given that this makes the array hidden, we can also make the array
constexpr by altering the members slightly. This gets rid of several
static constructor calls related to std::vector and std::function.

Now we don't have heap allocations here that need to occur before the
program can even enter main(). It also has the benefit of saving a
little bit of heap space, but this doesn't matter too much, since the
savings in that regard are pretty tiny.
2018-12-13 16:44:32 -05:00
Lioncash
bad035e9a3 audio_core/sink_details: Change std::string parameter into std::string_view
The given string is only ever used for lookup and comparison, so we can
just utilize a non-owning view to string data here
2018-09-11 21:36:12 -04:00
Lioncash
2bc4ab3958 sink_details: Deduplicate long std::function repetition
We can just use type aliases to avoid needing to write the same long
type twice
2018-08-01 23:56:02 -04:00
Lioncash
89ebef6571 sink_details: std::move std::function instances
Given std::function is allowed to potentially allocate, these should be
std::move'd to prevent potential reallocation (should that ever happen).
2018-08-01 23:50:48 -04:00
bunnei
9ef227e09d audio_core: Add interfaces for Sink and SinkStream. 2018-07-30 21:45:24 -04:00
James Rowe
ebf9a784a9 Massive removal of unused modules 2018-01-12 19:11:03 -07:00
Kloen Lansfiel
f852369986 SDL: Select audio device (#2403)
* Initial Commit

Added Device logic to Sinks
Started on UI for selecting devices

Removed redundant import

* Audio Core: Complete Device Switching

Complete the device switching implementation by allowing the output
device to be loaded, changed and saved through the configurations menu.

Worked with the Sink abstraction and tuned the "Device Selection"
configuration so that the Device List is automatically populated when
the Sink is changed.
This hopefully addresses the concerns and recommendations mentioned in
the comments of the PR.

* Clean original implementation.

* Refactor GetSinkDetails
2017-01-25 22:33:26 -05:00
MerryMage
8b94422e3e AudioCore: List of sink types 2016-04-30 07:39:48 +01:00