mirror of
https://github.com/tuxbox-fork-migrations/recycled-ni-libstb-hal.git
synced 2025-08-26 15:02:43 +02:00
cleanup
Origin commit data
------------------
Branch: master
Commit: 900dd63a2e
Author: TangoCash <eric@loxat.de>
Date: 2017-11-15 (Wed, 15 Nov 2017)
------------------
No further description and justification available within origin commit message!
------------------
This commit was generated by Migit
This commit is contained in:
@@ -27,26 +27,17 @@ cAudio::cAudio(void *, void *, void *)
|
||||
clipfd = -1;
|
||||
mixer_fd = -1;
|
||||
|
||||
/*
|
||||
mixerAnalog = mixerHDMI = mixerSPDIF = NULL;
|
||||
volumeAnalog = volumeHDMI = volumeSPDIF = 0;
|
||||
mixersMuted = false
|
||||
*/
|
||||
|
||||
openDevice();
|
||||
Muted = false;
|
||||
}
|
||||
|
||||
cAudio::~cAudio(void)
|
||||
{
|
||||
//closeMixers();
|
||||
closeDevice();
|
||||
}
|
||||
|
||||
void cAudio::openDevice(void)
|
||||
{
|
||||
//openMixers();
|
||||
|
||||
if (fd < 0)
|
||||
{
|
||||
if ((fd = open(AUDIO_DEVICE, O_RDWR)) < 0)
|
||||
@@ -60,8 +51,6 @@ void cAudio::openDevice(void)
|
||||
|
||||
void cAudio::closeDevice(void)
|
||||
{
|
||||
//closeMixers();
|
||||
|
||||
if (fd > -1) {
|
||||
close(fd);
|
||||
fd = -1;
|
||||
@@ -424,57 +413,3 @@ void cAudio::setBypassMode(bool disable)
|
||||
if (ioctl(fd, AUDIO_SET_BYPASS_MODE, mode) < 0)
|
||||
lt_info("%s AUDIO_SET_BYPASS_MODE %d: %m\n", __func__, mode);
|
||||
}
|
||||
|
||||
#if 0
|
||||
void cAudio::openMixers(void)
|
||||
{
|
||||
if (!mixerAnalog)
|
||||
mixerAnalog = new mixerVolume("Analog", "1");
|
||||
if (!mixerHDMI)
|
||||
mixerHDMI = new mixerVolume("HDMI", "1");
|
||||
if (!mixerSPDIF)
|
||||
mixerSPDIF = new mixerVolume("SPDIF", "1");
|
||||
}
|
||||
|
||||
void cAudio::closeMixers(void)
|
||||
{
|
||||
delete mixerAnalog;
|
||||
delete mixerHDMI;
|
||||
delete mixerSPDIF;
|
||||
mixerAnalog = mixerHDMI = mixerSPDIF = NULL;
|
||||
}
|
||||
|
||||
void cAudio::setMixerVolume(const char *name, long value, bool remember)
|
||||
{
|
||||
if (!strcmp(name, "Analog")) {
|
||||
mixerAnalog->setVolume(value);
|
||||
if (remember)
|
||||
volumeAnalog = value;
|
||||
}
|
||||
if (!strcmp(name, "HDMI")) {
|
||||
mixerHDMI->setVolume(value);
|
||||
if (remember)
|
||||
volumeHDMI = value;
|
||||
}
|
||||
if (!strcmp(name, "SPDIF")) {
|
||||
mixerSPDIF->setVolume(value);
|
||||
if (remember)
|
||||
volumeSPDIF = value;
|
||||
}
|
||||
}
|
||||
|
||||
void cAudio::muteMixers(bool m)
|
||||
{
|
||||
if (m && !mixersMuted) {
|
||||
mixersMuted = true;
|
||||
setMixerVolume("Analog", 0, false);
|
||||
setMixerVolume("HDMI", 0, false);
|
||||
setMixerVolume("SPDIF", 0, false);
|
||||
} else if (!m && mixersMuted) {
|
||||
mixersMuted = false;
|
||||
setMixerVolume("Analog", volumeAnalog, false);
|
||||
setMixerVolume("HDMI", volumeHDMI, false);
|
||||
setMixerVolume("SPDIF", volumeSPDIF, false);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
Reference in New Issue
Block a user