UNPKG

1.42 kBSource Map (JSON)View Raw
1{"version":3,"sources":["../../../src/main-process/commands/sound.js"],"names":["logger","set","output","info","sound","type","currentSoundOutput","update","config"],"mappings":";;;;;;;AAAA;;;;AACA;;AACA;;;;AAEA,MAAMA,SAAS,0BAAW,oBAAX,CAAf;;AAEA,MAAMC,MAAOC,MAAD,IAAmC;AAC7CF,SAAOG,IAAP,CAAY,qBAAZ,EAAmC,EAAED,MAAF,EAAnC;AACA,2BAAc,YAAd,EAA4B,CAAC,eAAOE,KAAP,CAAaC,IAAd,EAAoB,GAAG,eAAOD,KAAP,CAAaF,MAAb,CAAvB,CAA5B;AACD,CAHD;;AAKA,IAAII,kBAAJ;;AAEO,MAAMC,0BAAUC,MAAD,IAAoB;AACxC,MAAI,CAACA,OAAOJ,KAAR,IAAiB,CAAC,eAAOA,KAAzB,IAAkC,CAAC,eAAOA,KAAP,CAAaI,OAAOJ,KAApB,CAAvC,EAAmE;AACjEE,yBAAqB,IAArB;AACA;AACD;;AAED,MAAIA,uBAAuBE,OAAOJ,KAAlC,EAAyC;AACzCE,uBAAqBE,OAAOJ,KAA5B;;AAEAH,MAAIK,kBAAJ;AACD,CAVM","file":"sound.js","sourcesContent":["import Logger from 'nightingale';\nimport { device } from '../params';\nimport { runSyncAsUser } from '../utils/exec';\n\nconst logger = new Logger('app:commands:sound');\n\nconst set = (output: 'hdmi' | 'jack'): void => {\n logger.info('change sound output', { output });\n runSyncAsUser('./sound.sh', [device.sound.type, ...device.sound[output]]);\n};\n\nlet currentSoundOutput;\n\nexport const update = (config: Object) => {\n if (!config.sound || !device.sound || !device.sound[config.sound]) {\n currentSoundOutput = null;\n return;\n }\n\n if (currentSoundOutput === config.sound) return;\n currentSoundOutput = config.sound;\n\n set(currentSoundOutput);\n};\n"]}
\No newline at end of file