Skip to content

Commit

Permalink
optimize-ui-audio
Browse files Browse the repository at this point in the history
  • Loading branch information
wizmo2 committed Oct 15, 2023
1 parent 6b55588 commit cbace78
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 26 deletions.
21 changes: 5 additions & 16 deletions components/platform_console/cmd_config.c
Original file line number Diff line number Diff line change
Expand Up @@ -1019,7 +1019,7 @@ int add_int_param_str(char **buf, struct arg_int *param) {

static int do_squeezelite_cmd(int argc, char **argv)
{
esp_err_t err=ESP_OK;
esp_err_t err=ESP_OK;
int nerrors = arg_parse(argc, argv,(void **)&squeezelite_args);
char *buf = NULL;
size_t buf_size = 0;
Expand Down Expand Up @@ -1067,7 +1067,7 @@ static int do_squeezelite_cmd(int argc, char **argv)
}
FREE_AND_NULL(config_buffer);

// TODO: This should be stored as -G y or -G x in squeezelite value,
// TODO: This should be stored as -G y or -G x in squeezelite value,
// but requires a better way to access the active command from nvs parameters
err = config_set_value(NVS_TYPE_STR, "jack_mutes_amp", squeezelite_args.amp_off->count?"x":(squeezelite_args.jack_behavior->count?"y":"n"));
if(err!=ESP_OK){
Expand Down Expand Up @@ -1132,12 +1132,6 @@ cJSON * squeezelite_cb(){
get_str_parm_json(squeezelite_args.codecs, values);
get_lit_parm_json(squeezelite_args.header_format, values);
get_str_parm_json(squeezelite_args.log_level, values);

// get_str_parm_json(squeezelite_args.log_level_all, values);
// get_str_parm_json(squeezelite_args.log_level_decode, values);
// get_str_parm_json(squeezelite_args.log_level_output, values);
// get_str_parm_json(squeezelite_args.log_level_slimproto, values);
// get_str_parm_json(squeezelite_args.log_level_stream, values);
get_str_parm_json(squeezelite_args.mac_addr, values);
get_str_parm_json(squeezelite_args.output_device, values);
get_str_parm_json(squeezelite_args.model_name, values);
Expand All @@ -1156,7 +1150,7 @@ cJSON * squeezelite_cb(){
else {
arg_print_errors(f, squeezelite_args.end, desc_squeezelite);
}
fflush (f);
fflush(f);
if(strlen(buf)>0){
log_send_messaging(nerrors?MESSAGING_ERROR:MESSAGING_INFO,"%s", buf);
}
Expand Down Expand Up @@ -1502,19 +1496,14 @@ void register_spdif_config(void){
void register_squeezelite_config(void){
squeezelite_args._command_set = arg_str0(NULL,"_command_set","command","Command key (readonly)");
squeezelite_args.server = arg_str0("s","server","<server>[:<port>]","Connect to specified server, otherwise uses autodiscovery to find server");
squeezelite_args.buffers = arg_str0("b","buffers","<stream>:<output>","Internal Stream and Output buffer sizes in Kbytes");
squeezelite_args.buffers = arg_str0("b","buffers","<stream>:<output>","Internal Stream and Output buffer sizes in Kbytes, format: 500:2000");
squeezelite_args.codecs = arg_strn("c","codecs","+" CODECS "+",0,20,"Restrict codecs to those specified, otherwise load all available codecs; known codecs: " CODECS );
squeezelite_args.timeout = arg_int0("C","timeout","<n>","Close output device when idle after timeout seconds, default is to keep it open while player is 'on");
squeezelite_args.log_level = arg_str0("d","loglevel","log=level","Set logging level, logs: all|slimproto|stream|decode|output|ir, level: info|debug|sdebug"); // " -d <log>=<level>\tSet logging level, logs: all|slimproto|stream|decode|output|ir, level: info|debug|sdebug\n"
// squeezelite_args.log_level_all = arg_str0(NULL,"all",get_log_level_options("all"),"Overall Logging Level");
// squeezelite_args.log_level_slimproto = arg_str0(NULL,"loglevel_slimproto",get_log_level_options("slimproto"),"Slimproto Logging Level");
// squeezelite_args.log_level_stream= arg_str0(NULL,"loglevel_stream",get_log_level_options("stream"),"Stream Logging Level");
// squeezelite_args.log_level_decode= arg_str0(NULL,"loglevel_decode",get_log_level_options("decode"),"Decode Logging Level");
// squeezelite_args.log_level_output= arg_str0(NULL,"loglevel_output",get_log_level_options("output"),"Output Logging Level");
#if IR
squeezelite_args.log_level_ir= arg_str0(NULL,"loglevel_ir",get_log_level_options("ir"),"IR Logging Level");
#endif
squeezelite_args.output_device = arg_str0("o","output_device","<string>","Output device (BT, I2S or SPDIF)");
squeezelite_args.output_device = arg_str0("o","output_device","I2S|SPDIF|BT","Output device");
squeezelite_args.mac_addr = arg_str0("m","mac_addr","<string>","Mac address, format: ab:cd:ef:12:34:56.");
squeezelite_args.model_name = arg_str0("M", "modelname", "<string>","Set the squeezelite player model name sent to the server (default: " MODEL_NAME_STRING ")");
squeezelite_args.name = arg_str0("n","name","<string>","Player name, if different from the current host name. Name can alternatively be assigned from the system/device name configuration.");
Expand Down
17 changes: 10 additions & 7 deletions components/wifi-manager/webapp/src/index.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -44,18 +44,21 @@

</div>
<div class="info navbar-right" style="display: inline-flex;">
<span class="recovery_element material-icons " style="color:orange; display: none"
<span class="recovery_element material-icons" style="color:orange; display: none"
aria-label="πŸ›‘">system_update_alt</span>
<span id="battery" class="material-icons" style="fill:white; display: none"
aria-label="πŸ”‹">battery_full</span>
<span id="o_jack" class="material-icons" style="fill:white; display: none" aria-label="🎧">headphones</span>
<span id="s_airplay" class="material-icons" style="fill:white; display: none" aria-label="🍎">airplay</span>
<em id="s_cspot" class="fab fa-spotify" style="fill:white; display: inline"></em>
<span id="o_jack" class="material-icons" style="fill:white; display: none"
aria-label="🎧">headphones</span>
<span id="s_airplay" class="material-icons" style="fill:white; display: none"
aria-label="🍘">airplay</span>
<span data-bs-toggle="tooltip" id="o_type" data-bs-placement="top" title="">
<span id="o_bt" class="material-icons" style="fill:white; display: none" aria-label="">bluetooth</span>
<span id="o_bt" class="material-icons" style="fill:white; display: none"
aria-label="πŸ”΅">bluetooth</span>
<span id="o_spdif" class="material-icons" style="fill:white; display: none"
aria-label="">graphic_eq</span>
<span id="o_i2s" class="material-icons" style="fill:white; display: none" aria-label="πŸ”ˆ">speaker</span>
aria-label="πŸ“»">spdif</span>
<span id="o_i2s" class="material-icons" style="fill:white; display: none"
aria-label="πŸ”ˆ">speaker</span>
</span>
<span id="ethernet" class="material-icons if_eth" style="fill:white; display: none"
aria-label="ETH">cable</span>
Expand Down
4 changes: 1 addition & 3 deletions components/wifi-manager/webapp/src/js/custom.js
Original file line number Diff line number Diff line change
Expand Up @@ -1910,9 +1910,7 @@ function getConfig() {
.sort()
.forEach(function (key) {
let val = data[key].value;
if (key === 'autoexec') {

} else if (key === 'host_name') {
if (key === 'host_name') {
val = val.replaceAll('"', '');
$('input#dhcp-name1').val(val);
$('input#dhcp-name2').val(val);
Expand Down

0 comments on commit cbace78

Please sign in to comment.