BITRATE_FULL_150
This commit is contained in:
@@ -11,6 +11,10 @@ void audio_info(const char *info) {
|
||||
#ifdef USE_NEXTION
|
||||
nextion.audioinfo(info);
|
||||
#endif
|
||||
if (strstr(info, "format is aac") != NULL) config.setBitrateFormat(BF_AAC);
|
||||
if (strstr(info, "format is flac") != NULL) config.setBitrateFormat(BF_FLAC);
|
||||
if (strstr(info, "format is mp3") != NULL) config.setBitrateFormat(BF_MP3);
|
||||
if (strstr(info, "format is wav") != NULL) config.setBitrateFormat(BF_WAV);
|
||||
if (strstr(info, "skip metadata") != NULL) config.setTitle(config.station.name);
|
||||
if (strstr(info, "Account already in use") != NULL || strstr(info, "HTTP/1.0 401") != NULL) {
|
||||
player.setError(info);
|
||||
|
||||
@@ -36,6 +36,7 @@
|
||||
|
||||
#define MAX_PLAY_MODE 1
|
||||
enum playMode_e : uint8_t { PM_WEB=0, PM_SDCARD=1 };
|
||||
enum BitrateFormat { BF_UNCNOWN, BF_MP3, BF_AAC, BF_FLAC, BF_OGG, BF_WAV };
|
||||
|
||||
void u8fix(char *src);
|
||||
|
||||
@@ -152,6 +153,7 @@ class Config {
|
||||
uint8_t irchck;
|
||||
ircodes_t ircodes;
|
||||
#endif
|
||||
BitrateFormat configFmt = BF_UNCNOWN;
|
||||
neworkItem ssids[5];
|
||||
byte ssidsCount;
|
||||
uint16_t sleepfor;
|
||||
@@ -185,6 +187,7 @@ class Config {
|
||||
bool saveWifi();
|
||||
bool saveWifiFromNextion(const char* post);
|
||||
void setSmartStart(byte ss);
|
||||
void setBitrateFormat(BitrateFormat fmt) { configFmt = fmt; }
|
||||
void initPlaylist();
|
||||
void indexPlaylist();
|
||||
uint8_t fillPlMenu(int from, uint8_t count, bool fromNextion=false);
|
||||
|
||||
@@ -24,7 +24,10 @@ Page *pages[] = { new Page(), new Page(), new Page() };
|
||||
#ifndef DSP_TASK_DELAY
|
||||
#define DSP_TASK_DELAY 2
|
||||
#endif
|
||||
|
||||
#if !((DSP_MODEL==DSP_ST7735 && DTYPE==INITR_BLACKTAB) || DSP_MODEL==DSP_ST7789)
|
||||
#undef BITRATE_FULL
|
||||
#define BITRATE_FULL false
|
||||
#endif
|
||||
TaskHandle_t DspTask;
|
||||
QueueHandle_t displayQueue;
|
||||
|
||||
@@ -137,7 +140,7 @@ void Display::_buildPager(){
|
||||
pages[PG_PLAYER]->addWidget(&_title1);
|
||||
if(_title2) pages[PG_PLAYER]->addWidget(_title2);
|
||||
if(_weather) pages[PG_PLAYER]->addWidget(_weather);
|
||||
#ifdef BITRATE_FULL
|
||||
#if BITRATE_FULL
|
||||
_fullbitrate = new BitrateWidget(fullbitrateConf, config.theme.bitrate, config.theme.background);
|
||||
pages[PG_PLAYER]->addWidget( _fullbitrate);
|
||||
#else
|
||||
@@ -380,7 +383,7 @@ void Display::loop() {
|
||||
if(_bitrate) { _bitrate->setText(config.station.bitrate==0?"":buf); }
|
||||
if(_fullbitrate) {
|
||||
_fullbitrate->setBitrate(config.station.bitrate);
|
||||
_fullbitrate->setFormat(BF_MP3);
|
||||
_fullbitrate->setFormat(config.configFmt);
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#ifndef options_h
|
||||
#define options_h
|
||||
|
||||
#define YOVERSION "0.9.143"
|
||||
#define YOVERSION "0.9.150"
|
||||
|
||||
/*******************************************************
|
||||
DO NOT EDIT THIS FILE.
|
||||
@@ -305,6 +305,9 @@ The connection tables are located here https://github.com/e2002/yoradio#connecti
|
||||
#ifndef MAX_AUDIO_SOCKET_TIMEOUT
|
||||
#define MAX_AUDIO_SOCKET_TIMEOUT false // max audio socket timeout?
|
||||
#endif
|
||||
#ifndef BITRATE_FULL
|
||||
#define BITRATE_FULL false
|
||||
#endif
|
||||
/*
|
||||
*** ST7735 display submodel ***
|
||||
INITR_BLACKTAB // 1.8' https://aliexpress.ru/item/1005002822797745.html
|
||||
|
||||
@@ -94,6 +94,7 @@ void Player::_stop(bool alreadyStopped){
|
||||
setOutputPins(false);
|
||||
if(!hasError()) config.setTitle((display.mode()==LOST || display.mode()==UPDATING)?"":const_PlStopped);
|
||||
config.station.bitrate = 0;
|
||||
config.setBitrateFormat(BF_UNCNOWN);
|
||||
#ifdef USE_NEXTION
|
||||
nextion.bitrate(config.station.bitrate);
|
||||
#endif
|
||||
@@ -172,8 +173,10 @@ void Player::_play(uint16_t stationId) {
|
||||
setOutputPins(false);
|
||||
config.setTitle(config.store.play_mode==PM_WEB?const_PlConnect:"");
|
||||
config.station.bitrate=0;
|
||||
config.setBitrateFormat(BF_UNCNOWN);
|
||||
config.loadStation(stationId);
|
||||
_loadVol(config.store.volume);
|
||||
display.putRequest(DBITRATE);
|
||||
display.putRequest(NEWSTATION);
|
||||
netserver.requestOnChange(STATION, 0);
|
||||
netserver.loop();
|
||||
|
||||
Reference in New Issue
Block a user