📄 audio.lst
字号:
}
#endif
AudioOn(); //SetMSPVol();
#else
271 1 switch(GetInputSelection())
272 1 {
273 2 #ifdef SUPPORT_TV
274 2 case TV:
275 2 P2_1 = 0; // A0 of 4052B
276 2 P2_2 = 0; // A1 of 4052B
277 2 break;
278 2 #endif
279 2 #ifdef SUPPORT_PC
280 2 case PC:
281 2 P2_1 = 0; // A0 of 4052B
282 2 P2_2 = 1; // A1 of 4052B
283 2 break;
284 2 #endif
285 2 default:
286 2 P2_1 = 1; // A0 of 4052B
287 2 P2_2 = 0; // A1 of 4052B
288 2 break;
289 2 }
290 1 #endif
291 1 }
292
293 #ifdef SUPPORT_PC
294 /*
295 void PCAudio(void)
296 {
297 BYTE mspdata[5], loop=0;
298 WORD ret;
299
300 AudioOff();
301
302 mspdata[0] = 0x10;
C51 COMPILER V7.50 AUDIO 04/01/2008 15:02:00 PAGE 6
303 mspdata[1] = 0x00;
304 mspdata[2] = 0x30; // MODUS register: Automatic-on
305 mspdata[3] = 0x20;
306 mspdata[4] = 0x03;
307 WriteI2Cn_(MSPI2CAddress, mspdata, 5);
308
309 mspdata[0] = 0x12;
310 mspdata[1] = 0x00;
311 mspdata[2] = 0x13; // SCART switch
312 mspdata[3] = 0x02; // SCART2->DSP
313 mspdata[4] = 0x00;
314 WriteI2Cn_(MSPI2CAddress, mspdata, 5);
315
316 mspdata[0] = 0x12;
317 mspdata[1] = 0x00;
318 mspdata[2] = 0x08; // source select
319 mspdata[3] = 0x02; // SCART input
320 mspdata[4] = 0x20; // stereo(transparent)
321 WriteI2Cn_(MSPI2CAddress, mspdata, 5);
322
323 mspdata[0] = 0x12;
324 mspdata[1] = 0x00;
325 mspdata[2] = 0x0d; // SCART input prescale
326 mspdata[3] = 0x50;
327 mspdata[4] = 0x00;
328 WriteI2Cn_(MSPI2CAddress, mspdata, 5);
329
330 ret = AudioAutoStdDetection();
331
332 #ifdef DEBUG_AUDIO
333 if( !ret ) {
334 Puts("\r\n--Fail to Audio AutoDetect");
335 }
336 #endif
337 AudioOn(); //SetMSPVol();
338 }
339 */
340 #endif
341
342 BYTE GetAudioVol(void)
343 {
344 1 return AudioVol;
345 1 }
346
347 BYTE ChangeVol(char amount)
348 {
349 1 BYTE chg=0;
350 1
351 1 CheckAndClearMuteOn();
352 1
353 1 if( amount>0 ) {
354 2 if( ((AudioVol+amount) <= UserRange.Max) )
355 2 chg=1;
356 2 }
357 1 else {
358 2 if( AudioVol>UserRange.Min )
359 2 chg=1;
360 2 }
361 1
362 1 if( chg ) {
363 2 AudioVol += amount;
364 2 SetAudioVolEE( AudioVol );
C51 COMPILER V7.50 AUDIO 04/01/2008 15:02:00 PAGE 7
365 2 SetMSPVol();
366 2 }
367 1
368 1 return AudioVol;
369 1 }
370
371 #ifdef SUPPORT_MSP_AUDIO
BYTE GetAudioBalance(void)
{
return AudioBalance;
}
BYTE ChangeBalance(char amount)
{
BYTE chg=0;
if( amount>0 ) {
if( ((AudioBalance+amount) <= UserRange.Max) ) {
chg=1;
}
}
else {
if( AudioBalance>UserRange.Min ) {
chg=1;
}
}
if( chg ) {
AudioBalance += amount;
SetAudioBalanceEE( AudioBalance );
SetMSPBalance();
}
return AudioBalance;
}
BYTE GetAudioBass(void)
{
return AudioBass;
}
BYTE ChangeBass(char amount)
{
BYTE chg=0;
if( amount>0 ) {
if( ((AudioBass+amount) <= UserRange.Max) ) {
chg = 1;
}
}
else {
if( AudioBass>UserRange.Min ) {
chg = 1;
}
}
if( chg ) {
AudioBass += amount;
SetAudioBassEE( AudioBass );
SetMSPBass();
}
C51 COMPILER V7.50 AUDIO 04/01/2008 15:02:00 PAGE 8
return AudioBass;
}
BYTE GetAudioTreble(void)
{
return AudioTreble;
}
BYTE ChangeTreble(char amount)
{
BYTE chg=0;
if( amount>0 ) {
if( ((AudioTreble+amount) <= UserRange.Max) ) {
chg = 1;
}
}
else {
if( AudioTreble>UserRange.Min ) {
chg = 1;
}
}
if( chg ) {
AudioTreble += amount;
SetAudioTrebleEE( AudioTreble );
SetMSPTreble();
}
return AudioTreble;
}
/*
BYTE GetAudioEffect(void)
{
return AudioEffect;
}
BYTE ChangeAudioEffect(char amount)
{
BYTE valdata[5];
amount = 0; //ignore
AudioEffect = 0xff - AudioEffect;
valdata[0] = 0x12;
valdata[1] = 0;
valdata[2] = 5;
valdata[3] = AudioEffect;
valdata[4] = 0;
WriteI2Cn_(MSPI2CAddress, valdata, 5);
SetAudioEffectEE( AudioEffect );
return AudioEffect;
}
*/
#endif
485
486 void ToggleAudioMute(void)
487 {
488 1 if( AudioMuteOn ) {
C51 COMPILER V7.50 AUDIO 04/01/2008 15:02:00 PAGE 9
489 2 AudioOn(); //SetMSPVol();
490 2 AudioMuteOn = 0;
491 2 }
492 1 else {
493 2 AudioOff();
494 2 AudioMuteOn = 1;
495 2 }
496 1 }
497
498 void CheckAndClearMuteOn(void)
499 {
500 1 if( AudioMuteOn ) {
501 2 AudioOn(); //SetMSPVol();
502 2 AudioMuteOn = 0;
503 2 ClearMuteInfo();
504 2 }
505 1 }
506
507 /*void SetAudioMute(BYTE on )
508 {
509 AudioMuteOn = on;
510 }
511 */
512 BYTE IsAudioMuteOn(void)
513 {
514 1 return (BYTE)AudioMuteOn;
515 1 }
516
517 void ResetAudioValue()
518 {
519 1 SetAudioVolEE( 50 );
520 1 #ifdef SUPPORT_MSP_AUDIO
SetAudioBalanceEE( 50 );
SetAudioBassEE( 50 );
SetAudioTrebleEE( 50 );
// SetAudioEffectEE( 0 );
#endif
526 1 }
MODULE INFORMATION: STATIC OVERLAYABLE
CODE SIZE = 219 ----
CONSTANT SIZE = 6 ----
XDATA SIZE = ---- ----
PDATA SIZE = ---- 4
DATA SIZE = 1 ----
IDATA SIZE = ---- ----
BIT SIZE = 2 ----
END OF MODULE INFORMATION.
C51 COMPILATION COMPLETE. 0 WARNING(S), 0 ERROR(S)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -