Skip to content

Commit

Permalink
dm820: fix lcd
Browse files Browse the repository at this point in the history
  • Loading branch information
BPanther committed May 27, 2024
1 parent 3a33195 commit 19c6a33
Show file tree
Hide file tree
Showing 15 changed files with 97 additions and 3 deletions.
6 changes: 5 additions & 1 deletion src/driver/lcdd.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -390,11 +390,15 @@ static std::string splitString(const std::string &text, const int maxwidth, LcdF
/* display "big" and "small" text.
TODO: right now, "big" is hardcoded as utf-8, small is not (for EPG)
*/
void CLCD::showTextScreen(const std::string &big, const std::string &small, const int showmode, const bool perform_wakeup, const bool centered)
void CLCD::showTextScreen(const std::string &big, const std::string &small, /*const*/ int showmode, const bool perform_wakeup, const bool centered)
{
if (!has_lcd)
return;

#if BOXMODEL_DM820 // lcd to small
showmode = 0x01;
#endif

unsigned int lcd_width = display.xres;
unsigned int lcd_height = display.yres;

Expand Down
4 changes: 4 additions & 0 deletions src/gui/bookmarkmanager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -202,8 +202,12 @@ void CBookmarkManager::paintItem(int pos)
// LCD Display
if (i_selected)
{
#if BOXMODEL_DM820
CVFD::getInstance()->setMode(CVFD::MODE_MENU_UTF8, theBookmark.getName());
#else
CVFD::getInstance()->showMenuText(0, theBookmark.getName(), -1, true); // UTF-8
CVFD::getInstance()->showMenuText(1, theBookmark.getUrl(), -1, true); // UTF-8
#endif
}
}
frameBuffer->blit();
Expand Down
4 changes: 4 additions & 0 deletions src/gui/bouquetlist.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -621,7 +621,11 @@ void CBouquetList::paintItem(int pos)
if (i_selected)
{
if (npos < (int) Bouquets.size())
#if BOXMODEL_DM820
CVFD::getInstance()->setMode(CVFD::MODE_MENU_UTF8, lname);
#else
CVFD::getInstance()->showMenuText(0, lname, -1, true);
#endif
#ifdef ENABLE_LCD4LINUX
if (g_settings.lcd4l_support)
LCD4l->CreateFile("/tmp/lcd/menu", lname, g_settings.lcd4l_convert);
Expand Down
9 changes: 8 additions & 1 deletion src/gui/channellist.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2280,10 +2280,17 @@ void CChannelList::updateVfd()
char nameAndDescription[255];
snprintf(nameAndDescription, sizeof(nameAndDescription), "%s - %s",
chan->getName().c_str(), p_event->description.c_str());
#if BOXMODEL_DM820
CVFD::getInstance()->setMode(CVFD::MODE_MENU_UTF8, nameAndDescription);
#else
CVFD::getInstance()->showMenuText(0, nameAndDescription, -1, true); // UTF-8
#endif
} else
#if BOXMODEL_DM820
CVFD::getInstance()->setMode(CVFD::MODE_MENU_UTF8, chan->getName().c_str());
#else
CVFD::getInstance()->showMenuText(0, chan->getName().c_str(), -1, true); // UTF-8

#endif
#ifdef ENABLE_LCD4LINUX
if (g_settings.lcd4l_support)
LCD4l->CreateFile("/tmp/lcd/menu", chan->getName().c_str(), g_settings.lcd4l_convert);
Expand Down
4 changes: 4 additions & 0 deletions src/gui/filebrowser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1213,7 +1213,11 @@ void CFileBrowser::paintItem(unsigned int pos)
actual_file->Name = fname_temp;

if (currpos == selected)
#if BOXMODEL_DM820
CVFD::getInstance()->setMode(CVFD::MODE_MENU_UTF8, FILESYSTEM_ENCODING_TO_UTF8_STRING(actual_file->getFileName()).c_str());
#else
CVFD::getInstance()->showMenuText(0, FILESYSTEM_ENCODING_TO_UTF8_STRING(actual_file->getFileName()).c_str(), -1, true); // UTF-8
#endif

switch(actual_file->getType())
{
Expand Down
9 changes: 8 additions & 1 deletion src/gui/moviebrowser/mb.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1519,7 +1519,11 @@ void CMovieBrowser::refreshLCD(void)
if (m_vMovieInfo.empty() || m_movieSelectionHandler == NULL)
return;

#if BOXMODEL_DM820
CVFD::getInstance()->setMode(CVFD::MODE_MENU_UTF8, m_movieSelectionHandler->epgTitle.c_str());
#else
CVFD::getInstance()->showMenuText(0, m_movieSelectionHandler->epgTitle.c_str(), -1, true); // UTF-8
#endif
}

void CMovieBrowser::refreshFilterList(void)
Expand Down Expand Up @@ -3924,8 +3928,11 @@ int CMenuSelector::paint(bool selected)
g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->RenderString(stringstartposName, y + height, dx - (stringstartposName - x), optionName, color);

if (selected)
#if BOXMODEL_DM820
CVFD::getInstance()->setMode(CVFD::MODE_MENU_UTF8, optionName);
#else
CVFD::getInstance()->showMenuText(0, optionName, -1, true); // UTF-8

#endif
return y + height;
}

Expand Down
8 changes: 8 additions & 0 deletions src/gui/movieplayer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -492,7 +492,11 @@ void CMoviePlayerGui::updateLcd(bool display_playtime)
}

// CVFD::getInstance()->setMode(LCD_MODE);
#if BOXMODEL_DM820
CVFD::getInstance()->setMode(CVFD::MODE_MENU_UTF8, lcd.c_str());
#else
CVFD::getInstance()->showMenuText(0, lcd.c_str(), -1, true);
#endif
return;
}

Expand Down Expand Up @@ -560,9 +564,13 @@ void CMoviePlayerGui::updateLcd(bool display_playtime)
break;
}
lcd += name;
#if BOXMODEL_DM820
CVFD::getInstance()->setMode(CVFD::MODE_MENU_UTF8, lcd.c_str());
#else
CVFD::getInstance()->setMode(CVFD::MODE_MENU_UTF8);
CVFD::getInstance()->showMenuText(0, lcd.c_str(), -1, true);
#endif
#endif
}

void CMoviePlayerGui::fillPids()
Expand Down
8 changes: 8 additions & 0 deletions src/gui/pictureviewer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -792,7 +792,11 @@ void CPictureViewerGui::view(unsigned int index, bool unscaled)
m_unscaled = unscaled;
selected=index;

#if BOXMODEL_DM820
CVFD::getInstance()->setMode(CVFD::MODE_MENU_UTF8, playlist[index].Name.c_str());
#else
CVFD::getInstance()->showMenuText(0, playlist[index].Name.c_str());
#endif
char timestring[19];
strftime(timestring, 18, "%d-%m-%Y %H:%M", gmtime(&playlist[index].Date));
//CVFD::getInstance()->showMenuText(1, timestring); //FIXME
Expand Down Expand Up @@ -843,7 +847,11 @@ void CPictureViewerGui::endView()

void CPictureViewerGui::deletePicFile(unsigned int index, bool mode)
{
#if BOXMODEL_DM820
CVFD::getInstance()->setMode(CVFD::MODE_MENU_UTF8, playlist[index].Name.c_str());
#else
CVFD::getInstance()->showMenuText(0, playlist[index].Name.c_str());
#endif
if (ShowMsg(LOCALE_FILEBROWSER_DELETE, playlist[index].Filename, CMsgBox::mbrNo, CMsgBox::mbYes|CMsgBox::mbNo)==CMsgBox::mbrYes)
{
unlink(playlist[index].Filename.c_str());
Expand Down
8 changes: 8 additions & 0 deletions src/gui/scan.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -410,7 +410,11 @@ neutrino_msg_t CScanTs::handleMsg(neutrino_msg_t msg, neutrino_msg_data_t data)
paintLine(xpos2, ypos_transponder, w - (8*fw), buffer);
total = data;
snprintf(str, sizeof(buffer), "scan: %d/%d", done, total);
#if BOXMODEL_DM820
CVFD::getInstance()->setMode(CVFD::MODE_MENU_UTF8, str);
#else
CVFD::getInstance()->showMenuText(0, str, -1, true);
#endif
break;

case NeutrinoMessages::EVT_SCAN_REPORT_NUM_SCANNED_TRANSPONDERS:
Expand All @@ -419,7 +423,11 @@ neutrino_msg_t CScanTs::handleMsg(neutrino_msg_t msg, neutrino_msg_data_t data)
sprintf(buffer, "%d/%d", done, total);
paintLine(xpos2, ypos_transponder, w - (8*fw), buffer);
snprintf(str, sizeof(buffer), "scan %d/%d", done, total);
#if BOXMODEL_DM820
CVFD::getInstance()->setMode(CVFD::MODE_MENU_UTF8, str);
#else
CVFD::getInstance()->showMenuText(0, str, -1, true);
#endif
break;

case NeutrinoMessages::EVT_SCAN_REPORT_FREQUENCYP:
Expand Down
4 changes: 4 additions & 0 deletions src/gui/timerlist.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1392,7 +1392,11 @@ void CTimerList::paintItem(int pos)
default:
;
}
#if BOXMODEL_DM820
CVFD::getInstance()->setMode(CVFD::MODE_MENU_UTF8, line1.c_str());
#else
CVFD::getInstance()->showMenuText(0, line1.c_str(), -1, true);
#endif
}
}
}
Expand Down
8 changes: 8 additions & 0 deletions src/gui/upnpbrowser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -953,7 +953,11 @@ bool CUpnpBrowserGui::selectItem(std::string id)

void CUpnpBrowserGui::paintDeviceInfo()
{
#if BOXMODEL_DM820
CVFD::getInstance()->setMode(CVFD::MODE_MENU_UTF8, m_devices[m_selecteddevice].friendlyname.c_str());
#else
CVFD::getInstance()->showMenuText(0, m_devices[m_selecteddevice].friendlyname.c_str(), -1, true);
#endif

// Info
std::string tmp;
Expand Down Expand Up @@ -1123,7 +1127,11 @@ void CUpnpBrowserGui::paintItemInfo(UPnPEntry *entry)
int preferred=entry->preferred;

// LCD
#if BOXMODEL_DM820
CVFD::getInstance()->setMode(CVFD::MODE_MENU_UTF8, entry->title.c_str());
#else
CVFD::getInstance()->showMenuText(0, entry->title.c_str(), -1, true);
#endif

// first line
ts << "Resources: " << entry->resources.size() << " Selected: " << preferred+1 << " ";
Expand Down
4 changes: 4 additions & 0 deletions src/gui/widget/keyboard_input.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -515,7 +515,11 @@ int CKeyboardInput::exec(CMenuTarget *parent, const std::string &)
if (changed)
{
changed = false;
#if BOXMODEL_DM820
CVFD::getInstance()->setMode(CVFD::MODE_MENU_UTF8, inputString->c_str());
#else
CVFD::getInstance()->showMenuText(1, inputString->c_str(), selected + 1);
#endif
}
g_RCInput->getMsgAbsoluteTimeout(&msg, &data, &timeoutEnd, true);

Expand Down
8 changes: 8 additions & 0 deletions src/gui/widget/menue.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -223,15 +223,23 @@ void CMenuItem::paintItemCaption(const bool select_mode, const char *right_text,
ssize_t len = strlen(left_text) + strlen(right_text) + 2;
char str[len];
snprintf(str, len, "%s %s", left_text, right_text);
#if BOXMODEL_DM820
CVFD::getInstance()->setMode(CVFD::MODE_MENU_UTF8, str);
#else
CVFD::getInstance()->showMenuText(0, str, -1, true);
#endif
#ifdef ENABLE_LCD4LINUX
if (g_settings.lcd4l_support)
lcd4l_text = str;
#endif
}
else
{
#if BOXMODEL_DM820
CVFD::getInstance()->setMode(CVFD::MODE_MENU_UTF8, left_text);
#else
CVFD::getInstance()->showMenuText(0, left_text, -1, true);
#endif
#ifdef ENABLE_LCD4LINUX
if (g_settings.lcd4l_support)
lcd4l_text = left_text;
Expand Down
4 changes: 4 additions & 0 deletions src/gui/widget/stringinput.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -436,7 +436,11 @@ int CStringInput::exec(CMenuTarget *parent, const std::string &)
frameBuffer->blit();
if (*valueString != dispval)
{
#if BOXMODEL_DM820
CVFD::getInstance()->setMode(CVFD::MODE_MENU_UTF8, valueString->c_str());
#else
CVFD::getInstance()->showMenuText(1, valueString->c_str(), selected + 1);
#endif
dispval = *valueString;
}

Expand Down
12 changes: 12 additions & 0 deletions src/gui/widget/stringinput_ext.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,11 @@ int CExtendedInput::exec(CMenuTarget *parent, const std::string &)
{
if (*valueString != dispval)
{
#if BOXMODEL_DM820
CVFD::getInstance()->setMode(CVFD::MODE_MENU_UTF8, valueString->c_str());
#else
CVFD::getInstance()->showMenuText(1, valueString->c_str(), selectedChar + 1);
#endif
dispval = *valueString;
}

Expand Down Expand Up @@ -234,7 +238,11 @@ int CExtendedInput::exec(CMenuTarget *parent, const std::string &)
{
inputFields[oldSelectedChar]->paint(x + offset, y + hheight + offset, false);
inputFields[selectedChar]->paint(x + offset, y + hheight + offset, true);
#if BOXMODEL_DM820
CVFD::getInstance()->setMode(CVFD::MODE_MENU_UTF8, valueString->c_str());
#else
CVFD::getInstance()->showMenuText(1, valueString->c_str(), selectedChar + 1);
#endif
}
}
else if (msg == CRCInput::RC_right)
Expand Down Expand Up @@ -270,7 +278,11 @@ int CExtendedInput::exec(CMenuTarget *parent, const std::string &)
{
inputFields[oldSelectedChar]->paint(x + offset, y + hheight + offset, false);
inputFields[selectedChar]->paint(x + offset, y + hheight + offset, true);
#if BOXMODEL_DM820
CVFD::getInstance()->setMode(CVFD::MODE_MENU_UTF8, valueString->c_str());
#else
CVFD::getInstance()->showMenuText(1, valueString->c_str(), selectedChar + 1);
#endif
}
}
else if ((*CRCInput::getUnicodeValue(msg)) || (msg == CRCInput::RC_red) || (msg == CRCInput::RC_green) || (msg == CRCInput::RC_blue) || (msg == CRCInput::RC_yellow)
Expand Down

0 comments on commit 19c6a33

Please sign in to comment.