This commit is contained in:
e2002
2024-12-21 11:58:32 +03:00
parent 9ad82acc80
commit 27e33a1bc8
16 changed files with 149 additions and 60 deletions

View File

@@ -294,9 +294,15 @@ void Nextion::drawVU(){
//if(mode!=PLAYER) return;
if(mode!=PLAYER && mode!=VOL) return;
static uint8_t measL, measR;
player.getVUlevel();
uint8_t L = map(player.vuLeft, 0, 255, 0, 100);
uint8_t R = map(player.vuRight, 0, 255, 0, 100);
//player.getVUlevel();
uint16_t vulevel = player.get_VUlevel((uint16_t)100);
uint8_t L = (vulevel >> 8) & 0xFF;
uint8_t R = vulevel & 0xFF;
//uint8_t L = map(player.vuLeft, 0, 255, 0, 100);
//uint8_t R = map(player.vuRight, 0, 255, 0, 100);
if(player.isRunning()){
measL=(L<=measL)?measL-5:L;
measR=(R<=measR)?measR-5:R;

View File

@@ -284,21 +284,25 @@ void VuWidget::init(WidgetConfig wconf, VUBandsConfig bands, uint16_t vumaxcolor
_canvas = new Canvas(_bands.width * 2 + _bands.space, _bands.height);
}
void VuWidget::_draw(){
if(!_active || _locked) return;
#if !defined(USE_NEXTION) && I2S_DOUT==255
static uint8_t cc = 0;
/* static uint8_t cc = 0;
cc++;
if(cc>0){
player.getVUlevel();
cc=0;
}
}*/
#endif
static uint16_t measL, measR;
uint16_t bandColor;
uint16_t dimension = _config.align?_bands.width:_bands.height;
uint8_t L = map(player.vuLeft, 255, 0, 0, dimension);
uint8_t R = map(player.vuRight, 255, 0, 0, dimension);
uint16_t vulevel = player.get_VUlevel(dimension);
uint8_t L = (vulevel >> 8) & 0xFF;
uint8_t R = vulevel & 0xFF;
bool played = player.isRunning();
if(played){
measL=(L>=measL)?measL + _bands.fadespeed:L;