#include "webradio.h"
Include dependency graph for userif.h:
This graph shows which files directly or indirectly include this file:
Go to the source code of this file.
Display Status | |
#define | DIST_NONE 0 |
Initial status, displays program banner. | |
#define | DIST_WAIT 1 |
Waiting? | |
#define | DIST_CONNECTING 2 |
Waiting for connection. | |
#define | DIST_CONNECTED 3 |
Successfully connected to a radio station. | |
#define | DIST_BUFFER 4 |
Buffering MP3 data. | |
#define | DIST_TITLE 5 |
Used? | |
#define | DIST_STATION 6 |
Used? | |
#define | DIST_VOLUME 7 |
Display volume. | |
#define | DIST_DEAD 8 |
Currently selected station is dead. | |
#define | DIST_FORCE 9 |
Force display update. | |
Functions | |
int | UserIfInit (char *name) |
Start background thread for display updates. | |
void | UserIfShowStatus (u_char status) |
Display a specified status. | |
void | UserIfShowMessage (u_char row, u_char secs, CONST char *fmt,...) |
Display a specified text. | |
void | UserIfEntry (u_char rs) |
|
Initial status, displays program banner.
|
|
Waiting?
|
|
Waiting for connection.
|
|
Successfully connected to a radio station.
|
|
Buffering MP3 data.
|
|
Used?
|
|
Used?
|
|
Display volume.
|
|
Currently selected station is dead.
|
|
Force display update.
|
|
Start background thread for display updates.
Definition at line 368 of file userif.c. 00370 { 00371 /* Initialize button interface. */ 00372 ButtonInit(); 00373 00374 if ((display.dpi_stream = fopen(name, "w")) == 0) { 00375 return -1; 00376 } 00377 display.dpi_scrolling = LCD_ROWS; 00378 00379 if (NutThreadCreate("displ", UserIfThread, 0, UI_THREAD_STACK) == 0) { 00380 fclose(display.dpi_stream); 00381 display.dpi_stream = NULL; 00382 return -1; 00383 } 00384 radio.rc_cstatus = DIST_NONE; 00385 UserIfShowStatus(DIST_FORCE); 00386 00387 return 0;
|
|
Display a specified status.
Definition at line 326 of file userif.c. 00328 { 00329 if (radio.rc_cstatus != status) { 00330 if (status == DIST_FORCE) 00331 status = radio.rc_cstatus; 00332 else 00333 radio.rc_cstatus = status; 00334 00335 if (status == DIST_NONE) { 00336 strcpy(display.dpi_line[0].dln_status, "Internet Radio"); 00337 strcpy(display.dpi_line[1].dln_status, "Version "); 00338 strcat(display.dpi_line[1].dln_status, VERSION); 00339 } else if (status == DIST_DEAD) { 00340 UserIfShowStationConf(&station[radio.rc_cstation]); 00341 UserIfShowMessage(1, 2, "not available"); 00342 } else if (status == DIST_CONNECTING) { 00343 UserIfShowStationConf(&station[radio.rc_cstation]); 00344 strcpy(display.dpi_line[1].dln_status, "Connecting..."); 00345 } else if (status == DIST_CONNECTED) { 00346 UserIfShowStationInfo(radio.rc_sip); 00347 if (radio.rc_rip) { 00348 SHOUTCASTINFO *sci = (SHOUTCASTINFO *) radio.rc_rip->ri_bcast; 00349 if (sci) { 00350 if (sci->sci_metatitle && sci->sci_metatitle[0]) { 00351 strncpy(display.dpi_line[1].dln_status, sci->sci_metatitle, LCD_VCOLS); 00352 } 00353 else if (radio.rc_sip && radio.rc_sip->si_genre && radio.rc_sip->si_genre[0]) { 00354 strncpy(display.dpi_line[1].dln_status, radio.rc_sip->si_genre, LCD_VCOLS); 00355 } 00356 } 00357 } 00358 } 00359 }
|
|
Display a specified text.
Definition at line 308 of file userif.c. 00310 { 00311 va_list ap; 00312 00313 va_start(ap, fmt); 00314 if (secs) { 00315 vsprintf(display.dpi_line[row].dln_msg, fmt, ap); 00316 display.dpi_line[row].dln_msgticks = secs * (1000 / UI_REFRESH_RATE); 00317 } else 00318 vsprintf(display.dpi_line[row].dln_status, fmt, ap); 00319 va_end(ap);
|
|
|