mirror of
https://github.com/tuxbox-neutrino/neutrino.git
synced 2025-08-29 08:21:12 +02:00
gui/channellist.cpp: move info/menu/zap icons from head to button bar;
add play button icon for PiP; rework CChannelList::paintButtonBar; handle PiP key binding in addition to play button
This commit is contained in:
@@ -511,12 +511,13 @@ void CChannelList::calcSize()
|
|||||||
frameBuffer->getIconSize(NEUTRINO_ICON_BUTTON_MENU, &icol_w, &icol_h);
|
frameBuffer->getIconSize(NEUTRINO_ICON_BUTTON_MENU, &icol_w, &icol_h);
|
||||||
theight = std::max(theight, icol_h);
|
theight = std::max(theight, icol_h);
|
||||||
|
|
||||||
|
#if 0
|
||||||
if(new_zap_mode)
|
if(new_zap_mode)
|
||||||
{
|
{
|
||||||
frameBuffer->getIconSize(NEUTRINO_ICON_BUTTON_MUTE_ZAP_ACTIVE, &icol_w, &icol_h);
|
frameBuffer->getIconSize(NEUTRINO_ICON_BUTTON_MUTE_ZAP_ACTIVE, &icol_w, &icol_h);
|
||||||
theight = std::max(theight, icol_h);
|
theight = std::max(theight, icol_h);
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
// calculate max entrys in mainbox
|
// calculate max entrys in mainbox
|
||||||
listmaxshow = (height - theight - footerHeight) / fheight;
|
listmaxshow = (height - theight - footerHeight) / fheight;
|
||||||
|
|
||||||
@@ -776,19 +777,6 @@ int CChannelList::show()
|
|||||||
loop=false;
|
loop=false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#ifdef ENABLE_PIP
|
|
||||||
else if ( msg == CRCInput::RC_play) {
|
|
||||||
if(SameTP()) {
|
|
||||||
if (CZapit::getInstance()->GetPipChannelID() == chanlist[selected]->getChannelID()) {
|
|
||||||
g_Zapit->stopPip();
|
|
||||||
paint();
|
|
||||||
} else {
|
|
||||||
if(CNeutrinoApp::getInstance()->StartPip(chanlist[selected]->getChannelID()))
|
|
||||||
paint();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
else if (( msg == CRCInput::RC_spkr ) && new_zap_mode ) {
|
else if (( msg == CRCInput::RC_spkr ) && new_zap_mode ) {
|
||||||
if(CNeutrinoApp::getInstance()->getMode() != NeutrinoMessages::mode_ts) {
|
if(CNeutrinoApp::getInstance()->getMode() != NeutrinoMessages::mode_ts) {
|
||||||
switch (new_zap_mode) {
|
switch (new_zap_mode) {
|
||||||
@@ -802,8 +790,11 @@ int CChannelList::show()
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
#if 0
|
||||||
paintHead();
|
paintHead();
|
||||||
showChannelLogo();
|
showChannelLogo();
|
||||||
|
#endif
|
||||||
|
paintButtonBar(SameTP());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (CRCInput::isNumeric(msg) && (this->historyMode || g_settings.sms_channel)) {
|
else if (CRCInput::isNumeric(msg) && (this->historyMode || g_settings.sms_channel)) {
|
||||||
@@ -890,7 +881,19 @@ int CChannelList::show()
|
|||||||
paint();
|
paint();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#ifdef ENABLE_PIP
|
||||||
|
else if ((msg == CRCInput::RC_play) || (msg == (neutrino_msg_t) g_settings.key_pip_close)) {
|
||||||
|
if(SameTP()) {
|
||||||
|
if (CZapit::getInstance()->GetPipChannelID() == chanlist[selected]->getChannelID()) {
|
||||||
|
g_Zapit->stopPip();
|
||||||
|
paint();
|
||||||
|
} else {
|
||||||
|
if(CNeutrinoApp::getInstance()->StartPip(chanlist[selected]->getChannelID()))
|
||||||
|
paint();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif
|
||||||
else if ((msg == CRCInput::RC_info) || (msg == CRCInput::RC_help)) {
|
else if ((msg == CRCInput::RC_info) || (msg == CRCInput::RC_help)) {
|
||||||
hide();
|
hide();
|
||||||
CChannelEvent *p_event=NULL;
|
CChannelEvent *p_event=NULL;
|
||||||
@@ -1701,101 +1704,110 @@ void CChannelList::showChannelLogo()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#define NUM_LIST_BUTTONS 4
|
#define NUM_LIST_BUTTONS_SORT 9
|
||||||
struct button_label SChannelListButtons[NUM_LIST_BUTTONS] =
|
|
||||||
{
|
|
||||||
{ NEUTRINO_ICON_BUTTON_RED, LOCALE_INFOVIEWER_EVENTLIST},
|
|
||||||
{ NEUTRINO_ICON_BUTTON_YELLOW, LOCALE_BOUQUETLIST_HEAD},
|
|
||||||
{ NEUTRINO_ICON_BUTTON_BLUE, LOCALE_INFOVIEWER_NEXT},
|
|
||||||
{ NEUTRINO_ICON_BUTTON_RECORD_INACTIVE, NONEXISTANT_LOCALE}
|
|
||||||
};
|
|
||||||
#define NUM_LIST_BUTTONS_SORT 5
|
|
||||||
struct button_label SChannelListButtons_SMode[NUM_LIST_BUTTONS_SORT] =
|
struct button_label SChannelListButtons_SMode[NUM_LIST_BUTTONS_SORT] =
|
||||||
{
|
{
|
||||||
{ NEUTRINO_ICON_BUTTON_RED, LOCALE_INFOVIEWER_EVENTLIST},
|
{ NEUTRINO_ICON_BUTTON_RED, LOCALE_INFOVIEWER_EVENTLIST},
|
||||||
{ NEUTRINO_ICON_BUTTON_GREEN, LOCALE_CHANNELLIST_FOOT_SORT_ALPHA},
|
{ NEUTRINO_ICON_BUTTON_GREEN, LOCALE_CHANNELLIST_FOOT_SORT_ALPHA},
|
||||||
{ NEUTRINO_ICON_BUTTON_YELLOW, LOCALE_BOUQUETLIST_HEAD},
|
{ NEUTRINO_ICON_BUTTON_YELLOW, LOCALE_BOUQUETLIST_HEAD},
|
||||||
{ NEUTRINO_ICON_BUTTON_BLUE, LOCALE_INFOVIEWER_NEXT},
|
{ NEUTRINO_ICON_BUTTON_BLUE, LOCALE_INFOVIEWER_NEXT},
|
||||||
{ NEUTRINO_ICON_BUTTON_RECORD_INACTIVE, NONEXISTANT_LOCALE}
|
{ NEUTRINO_ICON_BUTTON_RECORD_INACTIVE, NONEXISTANT_LOCALE},
|
||||||
|
{ NEUTRINO_ICON_BUTTON_PLAY, LOCALE_EXTRA_KEY_PIP_CLOSE},
|
||||||
|
{ NEUTRINO_ICON_BUTTON_INFO, NONEXISTANT_LOCALE},
|
||||||
|
{ NEUTRINO_ICON_BUTTON_MENU_SMALL, NONEXISTANT_LOCALE},
|
||||||
|
{ NEUTRINO_ICON_BUTTON_MUTE_ZAP_ACTIVE, NONEXISTANT_LOCALE}
|
||||||
};
|
};
|
||||||
|
|
||||||
void CChannelList::paintButtonBar(bool is_current)
|
void CChannelList::paintButtonBar(bool is_current)
|
||||||
{
|
{
|
||||||
//printf("[neutrino channellist] %s...%d, selected %d\n", __FUNCTION__, __LINE__, selected);
|
//printf("[neutrino channellist] %s...%d, selected %d\n", __FUNCTION__, __LINE__, selected);
|
||||||
unsigned int smode = CNeutrinoApp::getInstance()->GetChannelMode();
|
unsigned int smode = CNeutrinoApp::getInstance()->GetChannelMode();
|
||||||
int num_buttons = smode != LIST_MODE_FAV ? NUM_LIST_BUTTONS_SORT : NUM_LIST_BUTTONS;
|
|
||||||
|
|
||||||
|
#if 0
|
||||||
|
int num_buttons = smode != LIST_MODE_FAV ? NUM_LIST_BUTTONS_SORT : NUM_LIST_BUTTONS;
|
||||||
struct button_label Button[num_buttons];
|
struct button_label Button[num_buttons];
|
||||||
const neutrino_locale_t button_ids[] = {LOCALE_INFOVIEWER_NOW,LOCALE_INFOVIEWER_NEXT,LOCALE_MAINMENU_RECORDING,LOCALE_MAINMENU_RECORDING_STOP,NONEXISTANT_LOCALE,
|
const neutrino_locale_t button_ids[] = {LOCALE_INFOVIEWER_NOW,LOCALE_INFOVIEWER_NEXT,LOCALE_MAINMENU_RECORDING,LOCALE_MAINMENU_RECORDING_STOP,LOCALE_EXTRA_KEY_PIP_CLOSE,
|
||||||
LOCALE_CHANNELLIST_FOOT_SORT_ALPHA,LOCALE_CHANNELLIST_FOOT_SORT_FREQ,LOCALE_CHANNELLIST_FOOT_SORT_SAT,LOCALE_CHANNELLIST_FOOT_SORT_CHNUM};
|
LOCALE_CHANNELLIST_FOOT_SORT_ALPHA,LOCALE_CHANNELLIST_FOOT_SORT_FREQ,LOCALE_CHANNELLIST_FOOT_SORT_SAT,LOCALE_CHANNELLIST_FOOT_SORT_CHNUM};
|
||||||
const std::vector<neutrino_locale_t> buttonID_rest (button_ids, button_ids + sizeof(button_ids) / sizeof(neutrino_locale_t) );
|
const std::vector<neutrino_locale_t> buttonID_rest (button_ids, button_ids + sizeof(button_ids) / sizeof(neutrino_locale_t) );
|
||||||
|
#endif
|
||||||
for (int i = 0;i<num_buttons;i++)
|
struct button_label Button[NUM_LIST_BUTTONS_SORT];
|
||||||
{
|
|
||||||
if(smode)
|
|
||||||
Button[i] = SChannelListButtons_SMode[i];
|
|
||||||
else
|
|
||||||
Button[i] = SChannelListButtons[i];
|
|
||||||
}
|
|
||||||
|
|
||||||
int Bindex = 2 + (smode ? 1:0);
|
|
||||||
|
|
||||||
//manage now/next button
|
|
||||||
if (g_settings.channellist_additional)
|
|
||||||
{
|
|
||||||
if (displayList)
|
|
||||||
Button[Bindex].locale = LOCALE_FONTSIZE_CHANNELLIST_DESCR;
|
|
||||||
else
|
|
||||||
Button[Bindex].locale = LOCALE_FONTMENU_EVENTLIST;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
if (displayNext)
|
|
||||||
Button[Bindex].locale = LOCALE_INFOVIEWER_NOW;
|
|
||||||
else
|
|
||||||
Button[Bindex].locale = LOCALE_INFOVIEWER_NEXT;
|
|
||||||
}
|
|
||||||
|
|
||||||
Bindex++;
|
|
||||||
//manage record button
|
|
||||||
bool do_record = CRecordManager::getInstance()->RecordingStatus(getActiveChannel_ChannelID());
|
bool do_record = CRecordManager::getInstance()->RecordingStatus(getActiveChannel_ChannelID());
|
||||||
|
|
||||||
if (g_settings.recording_type != RECORDING_OFF && !displayNext){
|
int bcnt = 0;
|
||||||
if (is_current && !do_record){
|
for (int i = 0; i < NUM_LIST_BUTTONS_SORT; i++) {
|
||||||
Button[Bindex].locale = LOCALE_MAINMENU_RECORDING;
|
Button[bcnt] = SChannelListButtons_SMode[i];
|
||||||
Button[Bindex].button = NEUTRINO_ICON_BUTTON_RECORD_ACTIVE;
|
if (i == 1) {
|
||||||
}else if (do_record){
|
/* check green / sort */
|
||||||
Button[Bindex].locale = LOCALE_MAINMENU_RECORDING_STOP;
|
if(smode) {
|
||||||
Button[Bindex].button = NEUTRINO_ICON_BUTTON_STOP;
|
switch (g_settings.channellist_sort_mode) {
|
||||||
}else{
|
case SORT_ALPHA:
|
||||||
Button[Bindex].locale = NONEXISTANT_LOCALE;
|
Button[bcnt].locale = LOCALE_CHANNELLIST_FOOT_SORT_ALPHA;
|
||||||
Button[Bindex].button = NEUTRINO_ICON_BUTTON_RECORD_INACTIVE;
|
break;
|
||||||
|
case SORT_TP:
|
||||||
|
Button[bcnt].locale = LOCALE_CHANNELLIST_FOOT_SORT_FREQ;
|
||||||
|
break;
|
||||||
|
case SORT_SAT:
|
||||||
|
Button[bcnt].locale = LOCALE_CHANNELLIST_FOOT_SORT_SAT;
|
||||||
|
break;
|
||||||
|
case SORT_CH_NUMBER:
|
||||||
|
Button[bcnt].locale = LOCALE_CHANNELLIST_FOOT_SORT_CHNUM;
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
} else
|
||||||
|
continue;
|
||||||
}
|
}
|
||||||
}
|
if (i == 3) {
|
||||||
if(smode)
|
//manage now/next button
|
||||||
{
|
if (g_settings.channellist_additional) {
|
||||||
switch (g_settings.channellist_sort_mode)
|
if (displayList)
|
||||||
{
|
Button[bcnt].locale = LOCALE_FONTSIZE_CHANNELLIST_DESCR;
|
||||||
case SORT_ALPHA:
|
else
|
||||||
Button[1].locale = LOCALE_CHANNELLIST_FOOT_SORT_ALPHA;
|
Button[bcnt].locale = LOCALE_FONTMENU_EVENTLIST;
|
||||||
break;
|
} else {
|
||||||
case SORT_TP:
|
if (displayNext)
|
||||||
Button[1].locale = LOCALE_CHANNELLIST_FOOT_SORT_FREQ;
|
Button[bcnt].locale = LOCALE_INFOVIEWER_NOW;
|
||||||
break;
|
else
|
||||||
case SORT_SAT:
|
Button[bcnt].locale = LOCALE_INFOVIEWER_NEXT;
|
||||||
Button[1].locale = LOCALE_CHANNELLIST_FOOT_SORT_SAT;
|
}
|
||||||
break;
|
}
|
||||||
case SORT_CH_NUMBER:
|
if (i == 4) {
|
||||||
Button[1].locale = LOCALE_CHANNELLIST_FOOT_SORT_CHNUM;
|
//manage record button
|
||||||
break;
|
if (g_settings.recording_type != RECORDING_OFF && !displayNext){
|
||||||
default:
|
if (do_record){
|
||||||
break;
|
Button[bcnt].locale = LOCALE_MAINMENU_RECORDING_STOP;
|
||||||
|
Button[bcnt].button = NEUTRINO_ICON_BUTTON_STOP;
|
||||||
|
} else if (is_current) {
|
||||||
|
Button[bcnt].locale = LOCALE_MAINMENU_RECORDING;
|
||||||
|
Button[bcnt].button = NEUTRINO_ICON_BUTTON_RECORD_ACTIVE;
|
||||||
|
} else {
|
||||||
|
Button[bcnt].locale = NONEXISTANT_LOCALE;
|
||||||
|
Button[bcnt].button = NEUTRINO_ICON_BUTTON_RECORD_INACTIVE;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (i == 5) {
|
||||||
|
//manage pip button
|
||||||
|
#ifdef ENABLE_PIP
|
||||||
|
if (!is_current)
|
||||||
|
#endif
|
||||||
|
continue;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
|
if (i == 8) {
|
||||||
|
/* check mute / zap mode */
|
||||||
|
if (new_zap_mode)
|
||||||
|
Button[bcnt].button = new_zap_mode == 2 /* active */ ?
|
||||||
|
NEUTRINO_ICON_BUTTON_MUTE_ZAP_ACTIVE : NEUTRINO_ICON_BUTTON_MUTE_ZAP_INACTIVE;
|
||||||
|
else
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
bcnt++;
|
||||||
|
}
|
||||||
//paint buttons
|
//paint buttons
|
||||||
int y_foot = y + (height - footerHeight);
|
int y_foot = y + (height - footerHeight);
|
||||||
::paintButtons(x, y_foot, width, num_buttons, Button, width, footerHeight);
|
::paintButtons(x, y_foot, full_width, bcnt, Button, full_width, footerHeight);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CChannelList::paintItem(int pos)
|
void CChannelList::paintItem(int pos)
|
||||||
@@ -2038,7 +2050,7 @@ void CChannelList::paintHead()
|
|||||||
strftime(timestr, 10, "%H:%M", tm);
|
strftime(timestr, 10, "%H:%M", tm);
|
||||||
timestr_len = g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE]->getRenderWidth(timestr, true); // UTF-8
|
timestr_len = g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE]->getRenderWidth(timestr, true); // UTF-8
|
||||||
}
|
}
|
||||||
|
#if 0
|
||||||
int iw1, iw2, iw3, ih = 0;
|
int iw1, iw2, iw3, ih = 0;
|
||||||
frameBuffer->getIconSize(NEUTRINO_ICON_BUTTON_INFO, &iw1, &ih);
|
frameBuffer->getIconSize(NEUTRINO_ICON_BUTTON_INFO, &iw1, &ih);
|
||||||
frameBuffer->getIconSize(NEUTRINO_ICON_BUTTON_MENU, &iw2, &ih);
|
frameBuffer->getIconSize(NEUTRINO_ICON_BUTTON_MENU, &iw2, &ih);
|
||||||
@@ -2065,6 +2077,13 @@ void CChannelList::paintHead()
|
|||||||
timestr_len += iw1 + iw2 + 12;
|
timestr_len += iw1 + iw2 + 12;
|
||||||
if (new_zap_mode)
|
if (new_zap_mode)
|
||||||
timestr_len += iw3 + 10;
|
timestr_len += iw3 + 10;
|
||||||
|
#endif
|
||||||
|
frameBuffer->paintBoxRel(x,y, full_width,theight+0, COL_MENUHEAD_PLUS_0, RADIUS_LARGE, CORNER_TOP);//round
|
||||||
|
if (gotTime) {
|
||||||
|
g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE]->RenderString(x + full_width - timestr_len - 10,
|
||||||
|
y+theight, timestr_len, timestr, COL_MENUHEAD, 0, true); // UTF-8
|
||||||
|
timestr_len += 4;
|
||||||
|
}
|
||||||
logo_off = timestr_len + 10;
|
logo_off = timestr_len + 10;
|
||||||
g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE]->RenderString(x+10,y+theight+0, full_width - timestr_len, name, COL_MENUHEAD, 0, true); // UTF-8
|
g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE]->RenderString(x+10,y+theight+0, full_width - timestr_len, name, COL_MENUHEAD, 0, true); // UTF-8
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user