mirror of
https://github.com/badaix/snapcast.git
synced 2025-06-01 02:11:47 +02:00
merge with develop
This commit is contained in:
parent
fc075555ea
commit
113e71b67b
4 changed files with 54 additions and 28 deletions
|
@ -41,6 +41,30 @@ using namespace popl;
|
|||
|
||||
volatile sig_atomic_t g_terminated = false;
|
||||
|
||||
PcmDevice getPcmDevice(const std::string& soundcard)
|
||||
{
|
||||
#ifdef HAS_ALSA
|
||||
vector<PcmDevice> pcmDevices = AlsaPlayer::pcm_list();
|
||||
|
||||
try
|
||||
{
|
||||
int soundcardIdx = cpt::stoi(soundcard);
|
||||
for (auto dev: pcmDevices)
|
||||
if (dev.idx == soundcardIdx)
|
||||
return dev;
|
||||
}
|
||||
catch(...)
|
||||
{
|
||||
}
|
||||
|
||||
for (auto dev: pcmDevices)
|
||||
if (dev.name.find(soundcard) != string::npos)
|
||||
return dev;
|
||||
#endif
|
||||
PcmDevice pcmDevice;
|
||||
return pcmDevice;
|
||||
}
|
||||
|
||||
|
||||
int main (int argc, char **argv)
|
||||
{
|
||||
|
@ -174,6 +198,17 @@ int main (int argc, char **argv)
|
|||
}
|
||||
#endif
|
||||
|
||||
/* TODO: Merge
|
||||
PcmDevice pcmDevice = getPcmDevice(soundcard);
|
||||
#if defined(HAS_ALSA)
|
||||
if (pcmDevice.idx == -1)
|
||||
{
|
||||
cout << "soundcard \"" << soundcard << "\" not found\n";
|
||||
// exit(EXIT_FAILURE);
|
||||
}
|
||||
#endif
|
||||
*/
|
||||
|
||||
PcmDevice pcmDevice;
|
||||
pcmDevice.idx = 1;
|
||||
if (soundcardValue->is_set())
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue