📄 test_audiomixer.cc
字号:
#include "playerclient.h"#include "test.h"#include <unistd.h>#include <math.h>//#include <linux/soundcard.h>inttest_audiomixer(PlayerClient* client, int index){ unsigned char access; AudioMixerProxy am(client,index,'c'); printf("device [audiodsp] index [%d]\n", index); TEST("subscribing (all)"); if((am.ChangeAccess(PLAYER_ALL_MODE,&access) < 0) || (access != PLAYER_ALL_MODE)) { FAIL(); printf("DRIVER: %s\n", am.driver_name); return -1; } PASS(); printf("DRIVER: %s\n", am.driver_name); TEST("get configuration"); if(am.GetConfigure()) { FAIL(); return(-1); } else { am.Print(); PASS(); } TEST("Set master volume(50,75)"); if(am.SetMaster(50,75)) { FAIL(); return(-1); } else { PASS(); } TEST("Set PCM volume(75,50)"); if(am.SetPCM(75,50)) { FAIL(); return(-1); } else { PASS(); } TEST("Set Line volume(100,75)"); if(am.SetPCM(100,75)) { FAIL(); return(-1); } else { PASS(); } TEST("Set Mic volume(100,100)"); if(am.SetPCM(100,100)) { FAIL(); return(-1); } else { PASS(); } TEST("Set IGain(85)"); if(am.SetIGain(85)) { FAIL(); return(-1); } else { PASS(); } TEST("Set OGain(95)"); if(am.SetIGain(95)) { FAIL(); return(-1); } else { PASS(); } TEST("sanity check"); if(am.GetConfigure()) { FAIL(); return(-1); } else { am.Print(); PASS(); } TEST("unsubscribing"); if((am.ChangeAccess(PLAYER_CLOSE_MODE,&access) < 0) || (access != PLAYER_CLOSE_MODE)) { FAIL(); return -1; } PASS(); return(0);}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -