Ver código fonte

Switch headphone source between input and DAC

dds
Jurgen Beliën 4 anos atrás
pai
commit
9187a9aa0b
1 arquivos alterados com 13 adições e 0 exclusões
  1. +13
    -0
      control_sgtl5000.h

+ 13
- 0
control_sgtl5000.h Ver arquivo

@@ -29,6 +29,10 @@

#include "AudioControl.h"

// SGTL5000-specific defines for headphones
#define AUDIO_HEADPHONE_DAC 0
#define AUDIO_HEADPHONE_LINEIN 1

class AudioControlSGTL5000 : public AudioControl
{
public:
@@ -54,6 +58,15 @@ public:
return false;
}
}
bool headphoneSelect(int n) {
if (n == AUDIO_HEADPHONE_DAC) {
return write(0x0024, ana_ctrl | (1<<6)); // route DAC to headphones out
} else if (n == AUDIO_HEADPHONE_LINEIN) {
return write(0x0024, ana_ctrl & ~(1<<6)); // route linein to headphones out
} else {
return false;
}
}
bool volume(float left, float right);
bool micGain(unsigned int dB);
bool lineInLevel(uint8_t n) { return lineInLevel(n, n); }

Carregando…
Cancelar
Salvar