53 changes: 27 additions & 26 deletions mythtv/libs/libmythui/lirc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,8 @@ static QByteArray get_ip(const QString &h)
int err = getaddrinfo(hba.constData(), NULL, &hints, &result);
if (err)
{
VERBOSE(VB_IMPORTANT, QString("get_ip: %1").arg(gai_strerror(err)));
LOG(VB_GENERAL, LOG_DEBUG,
QString("get_ip: %1").arg(gai_strerror(err)));
return QString("").toLatin1();
}

Expand Down Expand Up @@ -178,8 +179,7 @@ bool LIRC::Init(void)
QByteArray dev = lircdDevice.toLocal8Bit();
if (dev.size() > 107)
{
VERBOSE(vtype, LOC_ERR + QString("lircdDevice '%1'")
.arg(lircdDevice) +
LOG(vtype, LOG_ERR, QString("lircdDevice '%1'").arg(lircdDevice) +
" is too long for the 'unix' socket API");

return false;
Expand All @@ -188,8 +188,7 @@ bool LIRC::Init(void)
lircd_socket = socket(AF_UNIX, SOCK_STREAM, 0);
if (lircd_socket < 0)
{
VERBOSE(vtype, LOC_ERR +
QString("Failed to open Unix socket '%1'")
LOG(vtype, LOG_ERR, QString("Failed to open Unix socket '%1'")
.arg(lircdDevice) + ENO);

return false;
Expand All @@ -205,8 +204,7 @@ bool LIRC::Init(void)

if (ret < 0)
{
VERBOSE(vtype, LOC_ERR +
QString("Failed to connect to Unix socket '%1'")
LOG(vtype, LOG_ERR, QString("Failed to connect to Unix socket '%1'")
.arg(lircdDevice) + ENO);

close(lircd_socket);
Expand All @@ -218,8 +216,7 @@ bool LIRC::Init(void)
lircd_socket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);
if (lircd_socket < 0)
{
VERBOSE(vtype, LOC_ERR +
QString("Failed to open TCP socket '%1'")
LOG(vtype, LOG_ERR, QString("Failed to open TCP socket '%1'")
.arg(lircdDevice) + ENO);

return false;
Expand All @@ -241,8 +238,8 @@ bool LIRC::Init(void)

if (!inet_aton(device.constData(), &addr.sin_addr))
{
VERBOSE(vtype, LOC_ERR +
QString("Failed to parse IP address '%1'").arg(dev));
LOG(vtype, LOG_ERR, QString("Failed to parse IP address '%1'")
.arg(dev));

close(lircd_socket);
return false;
Expand All @@ -252,8 +249,7 @@ bool LIRC::Init(void)
sizeof(addr));
if (ret < 0)
{
VERBOSE(vtype, LOC_ERR +
QString("Failed to connect TCP socket '%1'")
LOG(vtype, LOG_ERR, QString("Failed to connect TCP socket '%1'")
.arg(lircdDevice) + ENO);

close(lircd_socket);
Expand All @@ -269,7 +265,7 @@ bool LIRC::Init(void)
ret = fcntl(lircd_socket, F_SETFD, flags | O_NONBLOCK);
if (ret < 0)
{
VERBOSE(VB_IMPORTANT, LOC_WARN +
LOG(VB_GENERAL, LOG_WARNING,
QString("Failed set flags for socket '%1'")
.arg(lircdDevice) + ENO);
}
Expand Down Expand Up @@ -297,7 +293,7 @@ bool LIRC::Init(void)
QByteArray cfg = configFile.toLocal8Bit();
if (lirc_readconfig(d->lircState, cfg.constData(), &d->lircConfig, NULL))
{
VERBOSE(vtype, LOC_ERR +
LOG(vtype, LOG_ERR,
QString("Failed to read config file '%1'").arg(configFile));

lirc_deinit(d->lircState);
Expand All @@ -306,7 +302,7 @@ bool LIRC::Init(void)
}
}

VERBOSE(VB_GENERAL, LOC +
LOG(VB_GENERAL, LOG_INFO,
QString("Successfully initialized '%1' using '%2' config")
.arg(lircdDevice).arg(configFile));

Expand All @@ -319,7 +315,7 @@ void LIRC::start(void)

if (!d->lircState)
{
VERBOSE(VB_IMPORTANT, LOC_ERR + "start() called without lircd socket");
LOG(VB_GENERAL, LOG_ERR, "start() called without lircd socket");
return;
}

Expand Down Expand Up @@ -401,7 +397,9 @@ void LIRC::Process(const QByteArray &data)
void LIRC::run(void)
{
threadRegister("LIRC");
//VERBOSE(VB_GENERAL, LOC + "run -- start");
#if 0
LOG(VB_GENERAL, LOG_DEBUG, "run -- start");
#endif
/* Process all events read */
while (IsDoRunSet())
{
Expand All @@ -414,12 +412,12 @@ void LIRC::run(void)
eofCount = 0;
if (++retryCount > 1000)
{
VERBOSE(VB_IMPORTANT, LOC_ERR +
LOG(VB_GENERAL, LOG_ERR,
"Failed to reconnect, exiting LIRC thread.");
doRun = false;
continue;
}
VERBOSE(VB_FILE, LOC_WARN + "EOF -- reconnecting");
LOG(VB_FILE, LOG_WARNING, "EOF -- reconnecting");

lirc_deinit(d->lircState);
d->lircState = NULL;
Expand All @@ -441,11 +439,12 @@ void LIRC::run(void)
timeout.tv_sec = 1; // 1 second
timeout.tv_usec = 100 * 1000; // 100 ms

int ret = select(d->lircState->lirc_lircd + 1, &readfds, NULL, NULL, &timeout);
int ret = select(d->lircState->lirc_lircd + 1, &readfds, NULL, NULL,
&timeout);

if (ret < 0 && errno != EINTR)
{
VERBOSE(VB_IMPORTANT, LOC_ERR + "select() failed" + ENO);
LOG(VB_GENERAL, LOG_ERR, "select() failed" + ENO);
continue;
}

Expand All @@ -458,7 +457,9 @@ void LIRC::run(void)
for (uint i = 0; i < (uint) codes.size(); i++)
Process(codes[i]);
}
//VERBOSE(VB_GENERAL, LOC + "run -- end");
#if 0
LOG(VB_GENERAL, LOG_DEBUG, "run -- end");
#endif
threadDeregister();
}

Expand All @@ -483,13 +484,13 @@ QList<QByteArray> LIRC::GetCodes(void)
else if (107 == errno)
{
if (!eofCount)
VERBOSE(VB_GENERAL, LOC + "GetCodes -- EOF?");
LOG(VB_GENERAL, LOG_NOTICE, "GetCodes -- EOF?");
eofCount++;
return ret;
}
else
{
VERBOSE(VB_IMPORTANT, LOC_ERR + "Could not read socket" + ENO);
LOG(VB_GENERAL, LOG_ERR, "Could not read socket" + ENO);
return ret;
}

Expand All @@ -499,7 +500,7 @@ QList<QByteArray> LIRC::GetCodes(void)
if (0 == len)
{
if (!eofCount)
VERBOSE(VB_GENERAL, LOC + "GetCodes -- eof?");
LOG(VB_GENERAL, LOG_NOTICE, "GetCodes -- eof?");
eofCount++;
return ret;
}
Expand Down
22 changes: 12 additions & 10 deletions mythtv/libs/libmythui/mythdialogbox.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ bool MythDialogBox::Create(void)

if (err)
{
VERBOSE(VB_IMPORTANT, QString("Cannot load screen '%1'")
LOG(VB_GENERAL, LOG_ERR, QString("Cannot load screen '%1'")
.arg(windowName));
return false;
}
Expand Down Expand Up @@ -280,7 +280,7 @@ bool MythConfirmationDialog::Create(void)

if (err)
{
VERBOSE(VB_IMPORTANT, "Cannot load screen 'MythConfirmationDialog'");
LOG(VB_GENERAL, LOG_ERR, "Cannot load screen 'MythConfirmationDialog'");
return false;
}

Expand Down Expand Up @@ -382,14 +382,14 @@ MythConfirmationDialog *ShowOkPopup(const QString &message, QObject *parent,
stk = win->GetStack("popup stack");
else
{
VERBOSE(VB_IMPORTANT, LOC + "no main window?");
LOG(VB_GENERAL, LOG_ERR, "no main window?");
return NULL;
}

if (!stk)
{
VERBOSE(VB_IMPORTANT, LOC + "no popup stack?\n"
"Is there a MythThemeBase?");
LOG(VB_GENERAL, LOG_ERR, "no popup stack? "
"Is there a MythThemeBase?");
return NULL;
}
}
Expand All @@ -399,13 +399,14 @@ MythConfirmationDialog *ShowOkPopup(const QString &message, QObject *parent,
{
stk->AddScreen(pop);
if (parent && slot)
QObject::connect(pop, SIGNAL(haveResult(bool)), parent, slot, Qt::QueuedConnection);
QObject::connect(pop, SIGNAL(haveResult(bool)), parent, slot,
Qt::QueuedConnection);
}
else
{
delete pop;
pop = NULL;
VERBOSE(VB_IMPORTANT, LOC + "Couldn't Create() Dialog");
LOG(VB_GENERAL, LOG_ERR, "Couldn't Create() Dialog");
}

return pop;
Expand Down Expand Up @@ -447,7 +448,7 @@ bool MythTextInputDialog::Create(void)

if (err)
{
VERBOSE(VB_IMPORTANT, "Cannot load screen 'MythTextInputDialog'");
LOG(VB_GENERAL, LOG_ERR, "Cannot load screen 'MythTextInputDialog'");
return false;
}

Expand Down Expand Up @@ -544,7 +545,7 @@ bool MythUISearchDialog::Create(void)

if (err)
{
VERBOSE(VB_IMPORTANT, "Cannot load screen 'MythSearchDialog'");
LOG(VB_GENERAL, LOG_ERR, "Cannot load screen 'MythSearchDialog'");
return false;
}

Expand All @@ -553,7 +554,8 @@ bool MythUISearchDialog::Create(void)

connect(okButton, SIGNAL(Clicked()), SLOT(slotSendResult()));

connect(m_itemList, SIGNAL(itemClicked(MythUIButtonListItem*)), SLOT(slotSendResult()));
connect(m_itemList, SIGNAL(itemClicked(MythUIButtonListItem*)),
SLOT(slotSendResult()));

m_textEdit->SetText(m_defaultValue);
connect(m_textEdit, SIGNAL(valueChanged()), SLOT(slotUpdateList()));
Expand Down
26 changes: 12 additions & 14 deletions mythtv/libs/libmythui/mythfontmanager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ void MythFontManager::LoadFonts(const QString &directory,
(*maxDirs)--;
if (*maxDirs < 1)
{
VERBOSE(VB_IMPORTANT, LOC_WARN + "Reached the maximum directory depth "
LOG(VB_GENERAL, LOG_WARNING, "Reached the maximum directory depth "
"for a font directory structure. Terminating font scan.");
return;
}
Expand Down Expand Up @@ -94,23 +94,21 @@ void MythFontManager::ReleaseFonts(const QString &registeredFor)
MythFontReference *fontRef = it.value();
if (registeredFor == fontRef->GetRegisteredFor())
{
VERBOSE(VB_FILE|VB_EXTRA, LOC +
QString("Removing application font '%1'")
LOG(VB_FILE, LOG_DEBUG, QString("Removing application font '%1'")
.arg(fontRef->GetFontPath()));

it = m_fontPathToReference.erase(it);
if (!IsFontFileLoaded(fontRef->GetFontPath()))
{
if (QFontDatabase::removeApplicationFont(fontRef->GetFontID()))
{
VERBOSE(VB_FILE|VB_EXTRA, LOC +
QString("Successfully removed "
"application font '%1'")
LOG(VB_FILE, LOG_DEBUG, QString("Successfully removed "
"application font '%1'")
.arg(fontRef->GetFontPath()));
}
else
{
VERBOSE(VB_IMPORTANT, LOC_WARN +
LOG(VB_GENERAL, LOG_ERR,
QString("Unable to remove application font '%1'")
.arg(fontRef->GetFontPath()));
}
Expand Down Expand Up @@ -139,7 +137,7 @@ void MythFontManager::LoadFontsFromDirectory(const QString &directory,
if (directory.isEmpty() || directory == "/" || registeredFor.isEmpty())
return;

VERBOSE(VB_FILE|VB_EXTRA, LOC +
LOG(VB_FILE, LOG_DEBUG,
QString("Scanning directory '%1' for font files.").arg(directory));

QDir dir(directory);
Expand Down Expand Up @@ -167,40 +165,40 @@ void MythFontManager::LoadFontFile(const QString &fontPath,
QMutexLocker locker(&m_lock);
if (IsFontFileLoaded(fontPath))
{
VERBOSE(VB_GUI|VB_FILE, LOC + QString("Font file '%1' already loaded")
LOG(VB_GUI | VB_FILE, LOG_INFO, QString("Font file '%1' already loaded")
.arg(fontPath));

if (!RegisterFont(fontPath, registeredFor))
{
VERBOSE(VB_GUI|VB_FILE, LOC +
LOG(VB_GUI | VB_FILE, LOG_INFO,
QString("Unable to load font(s) in file '%1'")
.arg(fontPath));
}
}
else
{
VERBOSE(VB_GUI|VB_FILE, LOC +
LOG(VB_GUI | VB_FILE, LOG_INFO,
QString("Loading font file: '%1'").arg(fontPath));

int result = QFontDatabase::addApplicationFont(fontPath);
if (result > -1)
{
VERBOSE(VB_GUI|VB_FILE|VB_EXTRA, LOC +
LOG(VB_GUI | VB_FILE, LOG_DEBUG,
QString("In file '%1', found font(s) '%2'")
.arg(fontPath)
.arg(QFontDatabase::applicationFontFamilies(result)
.join(", ")));

if (!RegisterFont(fontPath, registeredFor, result))
{
VERBOSE(VB_IMPORTANT, LOC_WARN +
LOG(VB_GENERAL, LOG_WARNING,
QString("Unable to register font(s) in file '%1'")
.arg(fontPath));
}
}
else
{
VERBOSE(VB_IMPORTANT, LOC_WARN +
LOG(VB_GENERAL, LOG_WARNING,
QString("Unable to load font(s) in file '%1'")
.arg(fontPath));
}
Expand Down
38 changes: 17 additions & 21 deletions mythtv/libs/libmythui/mythfontproperties.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -176,14 +176,15 @@ MythFontProperties *MythFontProperties::ParseFromXml(
newFont->Freeze();

if (element.tagName() == "font")
VERBOSE(VB_GENERAL, LOC_WARN + "Use of 'font' is deprecated in favour "
"of 'fontdef'");
LOG(VB_GENERAL, LOG_WARNING,
QString("File %1: Use of 'font' is deprecated in favour of "
"'fontdef'") .arg(filename));

QString name = element.attribute("name", "");
if (name.isEmpty())
{
VERBOSE_XML(VB_IMPORTANT,
filename, element, LOC_ERR + "Font requires a name");
VERBOSE_XML(VB_GENERAL, LOG_ERR,
filename, element, "Font requires a name");
delete newFont;
return NULL;
}
Expand All @@ -202,8 +203,7 @@ MythFontProperties *MythFontProperties::ParseFromXml(

if (!tmp)
{
VERBOSE_XML(
VB_IMPORTANT, filename, element, LOC_ERR +
VERBOSE_XML(VB_GENERAL, LOG_ERR, filename, element,
QString("Specified base font '%1' does not exist.").arg(base));

delete newFont;
Expand All @@ -222,8 +222,8 @@ MythFontProperties *MythFontProperties::ParseFromXml(
{
if (!fromBase)
{
VERBOSE_XML(VB_IMPORTANT, filename, element,
LOC_ERR + "Font needs a face");
VERBOSE_XML(VB_GENERAL, LOG_ERR, filename, element,
"Font needs a face");
delete newFont;
return NULL;
}
Expand All @@ -238,9 +238,7 @@ MythFontProperties *MythFontProperties::ParseFromXml(
MythFontProperties *tmp = GetGlobalFontMap()->GetFont(name);
if (showWarnings)
{
VERBOSE_XML(
VB_GENERAL, filename, element,
LOC_WARN +
VERBOSE_XML(VB_GENERAL, LOG_WARNING, filename, element,
QString("Attempting to define '%1'\n\t\t\t"
"with face '%2', but it already "
"exists with face '%3'")
Expand Down Expand Up @@ -400,8 +398,7 @@ MythFontProperties *MythFontProperties::ParseFromXml(
}
else
{
VERBOSE_XML(VB_IMPORTANT, filename, info,
LOC_ERR +
VERBOSE_XML(VB_GENERAL, LOG_ERR, filename, info,
QString("Unknown tag in font '%1'").arg(name));
delete newFont;
return NULL;
Expand All @@ -411,8 +408,8 @@ MythFontProperties *MythFontProperties::ParseFromXml(

if (size <= 0 && pixelsize <= 0 && !fromBase)
{
VERBOSE_XML(VB_IMPORTANT, filename, element,
LOC_ERR + "Font size must be greater than 0.");
VERBOSE_XML(VB_GENERAL, LOG_ERR, filename, element,
"Font size must be greater than 0.");
delete newFont;
return NULL;
}
Expand All @@ -430,15 +427,14 @@ MythFontProperties *MythFontProperties::ParseFromXml(
QFontInfo fi(newFont->m_face);
if (newFont->m_face.family() != fi.family())
{
VERBOSE_XML(
VB_IMPORTANT, filename, element,
LOC_ERR + QString("Failed to load '%1', got '%2' instead")
VERBOSE_XML(VB_GENERAL, LOG_ERR, filename, element,
QString("Failed to load '%1', got '%2' instead")
.arg(newFont->m_face.family()).arg(fi.family()));
}
else
{
VERBOSE_XML(VB_GENERAL|VB_EXTRA, filename, element,
LOC + QString("loaded '%1'").arg(fi.family()));
VERBOSE_XML(VB_GENERAL, LOG_DEBUG, filename, element,
QString("loaded '%1'").arg(fi.family()));
}

if (addToGlobal)
Expand Down Expand Up @@ -469,7 +465,7 @@ bool FontMap::AddFont(const QString &text, MythFontProperties *font)

if (m_FontMap.contains(text))
{
VERBOSE(VB_IMPORTANT, QString("Already have a font: %1").arg(text));
LOG(VB_GENERAL, LOG_ERR, QString("Already have a font: %1").arg(text));
return false;
}

Expand Down
10 changes: 5 additions & 5 deletions mythtv/libs/libmythui/mythgenerictree.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -390,7 +390,7 @@ void MythGenericTree::becomeSelectedChild()
if (m_parent)
m_parent->setSelectedChild(this);
else
VERBOSE(VB_IMPORTANT, "Top level can't become selected child");
LOG(VB_GENERAL, LOG_ERR, "Top level can't become selected child");
}

MythGenericTree* MythGenericTree::prevSibling(int number_up)
Expand Down Expand Up @@ -463,8 +463,8 @@ int MythGenericTree::getAttribute(uint which_one) const
{
if (m_attributes->size() < (int)(which_one + 1))
{
VERBOSE(VB_IMPORTANT, "Asked a MythGenericTree node for a non-existent"
"attribute");
LOG(VB_GENERAL, LOG_ERR,
"Asked a MythGenericTree node for a non-existent attribute");
return 0;
}

Expand Down Expand Up @@ -528,7 +528,7 @@ MythGenericTree* MythGenericTree::nextPrevFromFlatList(bool forward_or_backward,
int i = m_flatenedSubnodes->indexOf(active);
if (i < 0)
{
VERBOSE(VB_IMPORTANT, "Can't find active item on flatened list");
LOG(VB_GENERAL, LOG_ERR, "Can't find active item on flatened list");
return NULL;
}

Expand Down Expand Up @@ -674,7 +674,7 @@ void MythGenericTree::reOrderAsSorted()

if (m_subnodes->count() != m_ordered_subnodes->count())
{
VERBOSE(VB_IMPORTANT, "Can't reOrderAsSorted(), because the number "
LOG(VB_GENERAL, LOG_ERR, "Can't reOrderAsSorted(), because the number "
"of subnodes is different than the number of ordered subnodes");
return;
}
Expand Down
10 changes: 7 additions & 3 deletions mythtv/libs/libmythui/mythimage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ MythUIHelper *MythImage::m_ui = NULL;
MythImage::MythImage(MythPainter *parent)
{
if (!parent)
VERBOSE(VB_IMPORTANT, "ERROR: Image created without parent!");
LOG(VB_GENERAL, LOG_ERR, "Image created without parent!");

m_Parent = parent;
m_RefCount = 0;
Expand Down Expand Up @@ -288,8 +288,12 @@ bool MythImage::Load(const QString &filename, bool scale)

if (ret)
im->loadFromData(data);
// else
// VERBOSE(VB_GENERAL, QString("MythImage::Load failed to load remote image %1").arg(filename));
#if 0
else
LOG(VB_GENERAL, LOG_ERR,
QString("MythImage::Load failed to load remote image %1")
.arg(filename));
#endif

}
else if ((filename.startsWith("http://")) ||
Expand Down
105 changes: 56 additions & 49 deletions mythtv/libs/libmythui/mythmainwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -819,16 +819,16 @@ bool MythMainWindow::SaveScreenShot(const QImage &image, QString filename)
else
extension = "PNG";

VERBOSE(VB_GENERAL,QString("Saving screenshot to %1 (%2x%3)")
LOG(VB_GENERAL, LOG_INFO, QString("Saving screenshot to %1 (%2x%3)")
.arg(filename).arg(image.width()).arg(image.height()));

if (image.save(filename, extension.toAscii(), 100))
{
VERBOSE(VB_GENERAL, "MythMainWindow::screenShot succeeded");
LOG(VB_GENERAL, LOG_INFO, "MythMainWindow::screenShot succeeded");
return true;
}

VERBOSE(VB_GENERAL, "MythMainWindow::screenShot Failed!");
LOG(VB_GENERAL, LOG_INFO, "MythMainWindow::screenShot Failed!");
return false;
}

Expand Down Expand Up @@ -895,7 +895,7 @@ void MythMainWindow::Init(void)

if (!GetMythDB()->GetNumSetting("RunFrontendInWindow", 0))
{
VERBOSE(VB_GENERAL, "Using Frameless Window");
LOG(VB_GENERAL, LOG_INFO, "Using Frameless Window");
flags |= Qt::FramelessWindowHint;
}

Expand All @@ -908,7 +908,7 @@ void MythMainWindow::Init(void)

if (d->does_fill_screen && !GetMythUI()->IsGeometryOverridden())
{
VERBOSE(VB_GENERAL, "Using Full Screen Window");
LOG(VB_GENERAL, LOG_INFO, "Using Full Screen Window");
setWindowState(Qt::WindowFullScreen);
}

Expand Down Expand Up @@ -951,7 +951,7 @@ void MythMainWindow::Init(void)
#ifdef USING_MINGW
if (painter == "auto" || painter == "d3d9")
{
VERBOSE(VB_GENERAL, "Using the D3D9 painter");
LOG(VB_GENERAL, LOG_INFO, "Using the D3D9 painter");
d->painter = new MythD3D9Painter();
d->paintwin = new MythPainterWindowD3D9(this, d);
}
Expand All @@ -960,7 +960,7 @@ void MythMainWindow::Init(void)
if ((painter == "auto" && (!d->painter && !d->paintwin)) ||
painter == "opengl")
{
VERBOSE(VB_GENERAL, "Trying the OpenGL painter");
LOG(VB_GENERAL, LOG_INFO, "Trying the OpenGL painter");
d->painter = new MythOpenGLPainter();
QGLFormat fmt;
fmt.setDepth(false);
Expand All @@ -973,14 +973,15 @@ void MythMainWindow::Init(void)
bool teardown = false;
if (!qgl->isValid())
{
VERBOSE(VB_IMPORTANT, "Failed to create OpenGL painter. "
"Check your OpenGL installation.");
LOG(VB_GENERAL, LOG_ERR, "Failed to create OpenGL painter. "
"Check your OpenGL installation.");
teardown = true;
}
else if (painter == "auto" && !qgl->format().directRendering())
{
VERBOSE(VB_IMPORTANT, "OpenGL is using software rendering. "
"Falling back to Qt painter.");
LOG(VB_GENERAL, LOG_WARNING,
"OpenGL is using software rendering. "
"Falling back to Qt painter.");
teardown = true;
}
if (teardown)
Expand All @@ -999,15 +1000,15 @@ void MythMainWindow::Init(void)

if (!d->painter && !d->paintwin)
{
VERBOSE(VB_GENERAL, "Using the Qt painter");
LOG(VB_GENERAL, LOG_INFO, "Using the Qt painter");
d->painter = new MythQtPainter();
d->paintwin = new MythPainterWindowQt(this, d);
}

if (!d->paintwin)
{
VERBOSE(VB_IMPORTANT, "MythMainWindow failed to create a "
"painter window.");
LOG(VB_GENERAL, LOG_ERR, "MythMainWindow failed to create a "
"painter window.");
return;
}

Expand Down Expand Up @@ -1225,7 +1226,7 @@ void MythMainWindow::attach(QWidget *child)
// if windows are created on different threads,
// or if setFocus() is called from a thread other than the main UI thread,
// setFocus() hangs the thread that called it
VERBOSE(VB_IMPORTANT,
LOG(VB_GENERAL, LOG_ERR,
QString("MythMainWindow::attach old: %1, new: %2, thread: %3")
.arg(currentWidget() ? currentWidget()->objectName() : "none")
.arg(child->objectName())
Expand All @@ -1248,7 +1249,7 @@ void MythMainWindow::detach(QWidget *child)

if (it == d->widgetList.end())
{
VERBOSE(VB_IMPORTANT, "Could not find widget to detach");
LOG(VB_GENERAL, LOG_ERR, "Could not find widget to detach");
return;
}

Expand Down Expand Up @@ -1550,15 +1551,16 @@ void MythMainWindow::BindKey(const QString &context, const QString &action,
QStringList dummyaction("");
if (d->keyContexts.value(context)->GetMapping(keynum, dummyaction))
{
VERBOSE(VB_GENERAL, QString("Key %1 is bound to multiple actions "
"in context %2.")
LOG(VB_GENERAL, LOG_WARNING,
QString("Key %1 is bound to multiple actions in context %2.")
.arg(key).arg(context));
}

d->keyContexts.value(context)->AddMapping(keynum, action);
//VERBOSE(VB_GENERAL, QString("Binding: %1 to action: %2 (%3)")
// .arg(key).arg(action)
// .arg(context));
#if 0
LOG(VB_GENERAL, LOG_DEBUG, QString("Binding: %1 to action: %2 (%3)")
.arg(key).arg(action).arg(context));
#endif

if (action == "ESCAPE" && context == "Global" && i == 0)
d->escapekey = keynum;
Expand Down Expand Up @@ -1589,7 +1591,8 @@ void MythMainWindow::RegisterKey(const QString &context, const QString &action,
// Update keybinding description if changed
if (db_description != description)
{
VERBOSE(VB_IMPORTANT, "Updating keybinding description...");
LOG(VB_GENERAL, LOG_NOTICE,
"Updating keybinding description...");
query.prepare(
"UPDATE keybindings "
"SET description = :DESCRIPTION "
Expand Down Expand Up @@ -1659,7 +1662,8 @@ void MythMainWindow::ClearJump(const QString &destination)
/* make sure that the jump point exists (using [] would add it)*/
if (d->destinationMap.find(destination) == d->destinationMap.end())
{
VERBOSE(VB_GENERAL, "Cannot clear ficticious jump point"+destination);
LOG(VB_GENERAL, LOG_ERR,
"Cannot clear ficticious jump point" + destination);
return;
}

Expand All @@ -1679,7 +1683,8 @@ void MythMainWindow::BindJump(const QString &destination, const QString &key)
/* make sure the jump point exists */
if (d->destinationMap.find(destination) == d->destinationMap.end())
{
VERBOSE(VB_GENERAL,"Cannot bind to ficticious jump point"+destination);
LOG(VB_GENERAL, LOG_ERR,
"Cannot bind to ficticious jump point" + destination);
return;
}

Expand All @@ -1692,21 +1697,24 @@ void MythMainWindow::BindJump(const QString &destination, const QString &key)

if (d->jumpMap.count(keynum) == 0)
{
//VERBOSE(VB_GENERAL, QString("Binding: %1 to JumpPoint: %2")
// .arg(keybind).arg(destination));
#if 0
LOG(VB_GENERAL, LOG_DEBUG, QString("Binding: %1 to JumpPoint: %2")
.arg(keybind).arg(destination));
#endif

d->jumpMap[keynum] = &d->destinationMap[destination];
}
else
{
VERBOSE(VB_GENERAL, QString("Key %1 is already bound to a jump "
"point.").arg(key));
LOG(VB_GENERAL, LOG_WARNING,
QString("Key %1 is already bound to a jump point.").arg(key));
}
}
//else
// VERBOSE(VB_GENERAL, QString("JumpPoint: %2 exists, no keybinding")
// .arg(destination));

#if 0
else
LOG(VB_GENERAL, LOG_DEBUG,
QString("JumpPoint: %2 exists, no keybinding") .arg(destination));
#endif
}

void MythMainWindow::RegisterJump(const QString &destination,
Expand Down Expand Up @@ -1778,15 +1786,16 @@ void MythMainWindow::RegisterMediaPlugin(const QString &name,
{
if (d->mediaPluginMap.count(name) == 0)
{
VERBOSE(VB_GENERAL, QString("Registering %1 as a media playback "
"plugin.").arg(name));
LOG(VB_GENERAL, LOG_NOTICE,
QString("Registering %1 as a media playback plugin.").arg(name));
MPData mpd = {desc, fn};
d->mediaPluginMap[name] = mpd;
}
else
{
VERBOSE(VB_GENERAL, QString("%1 is already registered as a media "
"playback plugin.").arg(name));
LOG(VB_GENERAL, LOG_NOTICE,
QString("%1 is already registered as a media playback plugin.")
.arg(name));
}
}

Expand Down Expand Up @@ -2038,8 +2047,7 @@ void MythMainWindow::customEvent(QEvent *ce)
if (screen)
screen->gestureEvent(ge);
}
VERBOSE(VB_GUI, QString("Gesture: %1")
.arg(QString(*ge).toLocal8Bit().constData()));
LOG(VB_GUI, LOG_DEBUG, QString("Gesture: %1") .arg(QString(*ge)));
}
else if (ce->type() == MythEvent::kExitToMainMenuEventType &&
d->exitingtomain)
Expand Down Expand Up @@ -2067,7 +2075,7 @@ void MythMainWindow::customEvent(QEvent *ce)

if (LircKeycodeEvent::kLIRCInvalidKeyCombo == lke->modifiers())
{
VERBOSE(VB_IMPORTANT, QString("MythMainWindow, Warning: ") +
LOG(VB_GENERAL, LOG_WARNING,
QString("Attempt to convert LIRC key sequence '%1' "
"to a Qt key sequence failed.")
.arg(lke->lirctext()));
Expand Down Expand Up @@ -2123,11 +2131,10 @@ void MythMainWindow::customEvent(QEvent *ce)
}
else
{
VERBOSE(VB_IMPORTANT,
QString("JoystickMenuClient warning: attempt to convert "
"'%1' to a key sequence failed. Fix your key "
"mappings.")
.arg(jke->getJoystickMenuText().toLocal8Bit().constData()));
LOG(VB_GENERAL, LOG_WARNING,
QString("attempt to convert '%1' to a key sequence failed. "
"Fix your key mappings.")
.arg(jke->getJoystickMenuText()));
}
}
#endif
Expand Down Expand Up @@ -2166,7 +2173,7 @@ void MythMainWindow::customEvent(QEvent *ce)
MythMediaDevice *device = me->getDevice();
if (device)
{
VERBOSE(VB_GENERAL, QString("Media Event: %1 - %2")
LOG(VB_GENERAL, LOG_DEBUG, QString("Media Event: %1 - %2")
.arg(device->getDevicePath()).arg(device->getStatus()));
}
}
Expand All @@ -2192,7 +2199,7 @@ void MythMainWindow::customEvent(QEvent *ce)
}
default:
{
VERBOSE(VB_IMPORTANT,
LOG(VB_GENERAL, LOG_ERR,
QString("Unknown ScreenSaverEvent type: %1")
.arg(sse->getSSEventType()));
}
Expand Down Expand Up @@ -2232,7 +2239,7 @@ void MythMainWindow::customEvent(QEvent *ce)
if (me->ExtraDataCount() == 1)
HandleMedia("Internal", me->ExtraData(0));
else
VERBOSE(VB_IMPORTANT, "Failed to handle media");
LOG(VB_GENERAL, LOG_ERR, "Failed to handle media");
}
else if (message.startsWith(ACTION_SCREENSHOT))
{
Expand Down Expand Up @@ -2412,9 +2419,9 @@ void MythMainWindow::StartLIRC(void)
void MythMainWindow::LockInputDevices( bool locked )
{
if( locked )
VERBOSE(VB_IMPORTANT, "Locking input devices");
LOG(VB_GENERAL, LOG_INFO, "Locking input devices");
else
VERBOSE(VB_IMPORTANT, "Unlocking input devices");
LOG(VB_GENERAL, LOG_INFO, "Unlocking input devices");

#ifdef USE_LIRC
d->ignore_lirc_keys = locked;
Expand Down
12 changes: 7 additions & 5 deletions mythtv/libs/libmythui/mythpainter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,9 @@ MythPainter::~MythPainter(void)
if (m_allocatedImages.isEmpty())
return;

VERBOSE(VB_GENERAL, QString("MythPainter: %1 images not yet de-allocated.")
.arg(m_allocatedImages.size()));
LOG(VB_GENERAL, LOG_WARNING,
QString("MythPainter: %1 images not yet de-allocated.")
.arg(m_allocatedImages.size()));
while (!m_allocatedImages.isEmpty())
m_allocatedImages.takeLast()->SetParent(NULL);
}
Expand All @@ -49,7 +50,7 @@ void MythPainter::DrawImage(int x, int y, MythImage *im, int alpha)
{
if (!im)
{
VERBOSE(VB_IMPORTANT,
LOG(VB_GENERAL, LOG_ERR,
"Null image pointer passed to MythPainter::DrawImage()");
return;
}
Expand Down Expand Up @@ -411,6 +412,7 @@ void MythPainter::SetMaximumCacheSizes(int hardware, int software)
{
m_MaxHardwareCacheSize = 1024 * 1024 * hardware;
m_MaxSoftwareCacheSize = 1024 * 1024 * software;
VERBOSE(VB_GUI, QString("MythPainter cache sizes: Hardware %1Mb, Software %2Mb")
.arg(hardware).arg(software));
LOG(VB_GUI, LOG_INFO,
QString("MythPainter cache sizes: Hardware %1Mb, Software %2Mb")
.arg(hardware).arg(software));
}
8 changes: 4 additions & 4 deletions mythtv/libs/libmythui/mythpainter_d3d9.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ void MythD3D9Painter::Begin(QPaintDevice *parent)
{
if (!InitD3D9(parent))
{
VERBOSE(VB_IMPORTANT, "Failed to create D3D9 render.");
LOG(VB_GENERAL, LOG_ERR, "Failed to create D3D9 render.");
return;
}
}
Expand All @@ -90,7 +90,7 @@ void MythD3D9Painter::Begin(QPaintDevice *parent)
}
else if (!m_target->SetAsRenderTarget())
{
VERBOSE(VB_IMPORTANT, "Failed to enable offscreen buffer.");
LOG(VB_GENERAL, LOG_ERR, "Failed to enable offscreen buffer.");
return;
}

Expand Down Expand Up @@ -118,7 +118,7 @@ void MythD3D9Painter::End(void)

void MythD3D9Painter::ClearCache(void)
{
VERBOSE(VB_GENERAL, LOC + "Clearing D3D9 painter cache.");
LOG(VB_GENERAL, LOG_INFO, "Clearing D3D9 painter cache.");

QMutexLocker locker(&m_bitmapDeleteLock);
QMapIterator<MythImage *, D3D9Image*> it(m_ImageBitmapMap);
Expand Down Expand Up @@ -238,7 +238,7 @@ D3D9Image* MythD3D9Painter::GetImageFromCache(MythImage *im)
}
else
{
VERBOSE(VB_IMPORTANT, LOC + "Failed to create D3D9 UI bitmap.");
LOG(VB_GENERAL, LOG_ERR, "Failed to create D3D9 UI bitmap.");
if (newimage)
delete newimage;
}
Expand Down
17 changes: 10 additions & 7 deletions mythtv/libs/libmythui/mythpainter_ogl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,10 @@ MythOpenGLPainter::MythOpenGLPainter(MythRenderOpenGL *render,
target(0), swapControl(true)
{
if (realRender)
VERBOSE(VB_GENERAL, "OpenGL painter using existing OpenGL context.");
LOG(VB_GENERAL, LOG_INFO,
"OpenGL painter using existing OpenGL context.");
if (realParent)
VERBOSE(VB_GENERAL, "OpenGL painter using existing QGLWidget.");
LOG(VB_GENERAL, LOG_INFO, "OpenGL painter using existing QGLWidget.");
}

MythOpenGLPainter::~MythOpenGLPainter()
Expand Down Expand Up @@ -58,7 +59,7 @@ void MythOpenGLPainter::DeleteTextures(void)

void MythOpenGLPainter::ClearCache(void)
{
VERBOSE(VB_GENERAL, "Clearing OpenGL painter cache.");
LOG(VB_GENERAL, LOG_INFO, "Clearing OpenGL painter cache.");

QMutexLocker locker(&m_textureDeleteLock);
QMapIterator<MythImage *, unsigned int> it(m_ImageIntMap);
Expand All @@ -80,7 +81,8 @@ void MythOpenGLPainter::Begin(QPaintDevice *parent)

if (!realParent)
{
VERBOSE(VB_IMPORTANT, "FATAL ERROR: Failed to cast parent to QGLWidget");
LOG(VB_GENERAL, LOG_ERR,
"FATAL ERROR: Failed to cast parent to QGLWidget");
return;
}

Expand All @@ -89,7 +91,8 @@ void MythOpenGLPainter::Begin(QPaintDevice *parent)
realRender = (MythRenderOpenGL*)(realParent->context());
if (!realRender)
{
VERBOSE(VB_IMPORTANT, "FATAL ERROR: Failed to get MythRenderOpenGL");
LOG(VB_GENERAL, LOG_ERR,
"FATAL ERROR: Failed to get MythRenderOpenGL");
return;
}
}
Expand All @@ -111,7 +114,7 @@ void MythOpenGLPainter::End(void)
{
if (!realRender)
{
VERBOSE(VB_IMPORTANT, "FATAL ERROR: No render device in 'End'");
LOG(VB_GENERAL, LOG_ERR, "FATAL ERROR: No render device in 'End'");
return;
}
else
Expand Down Expand Up @@ -154,7 +157,7 @@ int MythOpenGLPainter::GetTextureFromCache(MythImage *im)

if (!tx_id)
{
VERBOSE(VB_IMPORTANT, "Failed to create OpenGL texture.");
LOG(VB_GENERAL, LOG_ERR, "Failed to create OpenGL texture.");
return tx_id;
}

Expand Down
7 changes: 4 additions & 3 deletions mythtv/libs/libmythui/mythpainter_qimage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ void MythQImagePainter::Begin(QPaintDevice *parent)
{
if (!parent)
{
VERBOSE(VB_IMPORTANT, "FATAL ERROR: No parent widget defined for "
"QT Painter, bailing");
LOG(VB_GENERAL, LOG_ERR,
"FATAL ERROR: No parent widget defined for QT Painter, bailing");
return;
}

Expand Down Expand Up @@ -144,7 +144,8 @@ void MythQImagePainter::DrawImage(const QRect &r, MythImage *im,
{
if (!painter)
{
VERBOSE(VB_IMPORTANT, "FATAL ERROR: DrawImage called with no painter");
LOG(VB_GENERAL, LOG_ERR,
"FATAL ERROR: DrawImage called with no painter");
return;
}

Expand Down
7 changes: 4 additions & 3 deletions mythtv/libs/libmythui/mythpainter_qt.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,8 @@ void MythQtPainter::Begin(QPaintDevice *parent)
{
if (!parent)
{
VERBOSE(VB_IMPORTANT, "FATAL ERROR: No parent widget defined for "
"QT Painter, bailing");
LOG(VB_GENERAL, LOG_ERR,
"FATAL ERROR: No parent widget defined for QT Painter, bailing");
return;
}

Expand Down Expand Up @@ -119,7 +119,8 @@ void MythQtPainter::DrawImage(const QRect &r, MythImage *im,
{
if (!painter)
{
VERBOSE(VB_IMPORTANT, "FATAL ERROR: DrawImage called with no painter");
LOG(VB_GENERAL, LOG_ERR,
"FATAL ERROR: DrawImage called with no painter");
return;
}

Expand Down
6 changes: 3 additions & 3 deletions mythtv/libs/libmythui/mythpainter_vdpau.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ void MythVDPAUPainter::Begin(QPaintDevice *parent)
{
if (!InitVDPAU(parent))
{
VERBOSE(VB_IMPORTANT, "Failed to create VDPAU render.");
LOG(VB_GENERAL, LOG_ERR, "Failed to create VDPAU render.");
return;
}
}
Expand All @@ -108,7 +108,7 @@ void MythVDPAUPainter::End(void)

void MythVDPAUPainter::ClearCache(void)
{
VERBOSE(VB_GENERAL, LOC + "Clearing VDPAU painter cache.");
LOG(VB_GENERAL, LOG_INFO, "Clearing VDPAU painter cache.");

QMutexLocker locker(&m_bitmapDeleteLock);
QMapIterator<MythImage *, uint32_t> it(m_ImageBitmapMap);
Expand Down Expand Up @@ -190,7 +190,7 @@ uint MythVDPAUPainter::GetTextureFromCache(MythImage *im)
}
else
{
VERBOSE(VB_IMPORTANT, LOC + "Failed to create VDPAU UI bitmap.");
LOG(VB_GENERAL, LOG_ERR, "Failed to create VDPAU UI bitmap.");
}

return newbitmap;
Expand Down
15 changes: 7 additions & 8 deletions mythtv/libs/libmythui/mythprogressdialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -96,14 +96,14 @@ MythUIBusyDialog *ShowBusyPopup(const QString &message)
stk = win->GetStack("popup stack");
else
{
VERBOSE(VB_IMPORTANT, LOC + "no main window?");
LOG(VB_GENERAL, LOG_ERR, "no main window?");
return NULL;
}

if (!stk)
{
VERBOSE(VB_IMPORTANT, LOC + "no popup stack?\n"
"Is there a MythThemeBase?");
LOG(VB_GENERAL, LOG_ERR, "no popup stack?\n"
"Is there a MythThemeBase?");
return NULL;
}
}
Expand Down Expand Up @@ -172,7 +172,7 @@ void MythUIProgressDialog::customEvent(QEvent *event)

if (!pue)
{
VERBOSE(VB_IMPORTANT, "MythUIProgressDialog::customEvent() "
LOG(VB_GENERAL, LOG_ERR,
"Error, event claims to be a progress update but fails "
"to cast");
return;
Expand Down Expand Up @@ -217,10 +217,9 @@ void MythUIProgressDialog::UpdateProgress()

if (m_count > m_total)
{
VERBOSE(VB_IMPORTANT, QString("Progress count (%1) is higher "
"than total (%2)")
.arg(m_count)
.arg(m_total));
LOG(VB_GENERAL, LOG_ERR, QString("Progress count (%1) is higher "
"than total (%2)")
.arg(m_count) .arg(m_total));
return;
}

Expand Down
120 changes: 59 additions & 61 deletions mythtv/libs/libmythui/mythrender_d3d9.cpp

Large diffs are not rendered by default.

84 changes: 39 additions & 45 deletions mythtv/libs/libmythui/mythrender_opengl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ static inline int __glCheck__(const QString &loc, const char* fileName, int n)
int error = glGetError();
if (error)
{
VERBOSE(VB_IMPORTANT, QString("%1: %2 @ %3, %4")
LOG(VB_GENERAL, LOG_ERR, QString("%1: %2 @ %3, %4")
.arg(loc).arg(error).arg(fileName).arg(n));
}
return error;
Expand Down Expand Up @@ -79,7 +79,7 @@ void MythRenderOpenGL::Init(void)
Init2DState();
InitFeatures();

VERBOSE(VB_GENERAL, LOC + "Initialised MythRenderOpenGL");
LOG(VB_GENERAL, LOG_INFO, "Initialised MythRenderOpenGL");
}

void MythRenderOpenGL::makeCurrent()
Expand All @@ -96,7 +96,7 @@ void MythRenderOpenGL::doneCurrent()
if (m_lock_level == 0)
QGLContext::doneCurrent();
if (m_lock_level < 0)
VERBOSE(VB_IMPORTANT, LOC_ERR + "Mis-matched calls to makeCurrent()");
LOG(VB_GENERAL, LOG_ERR, "Mis-matched calls to makeCurrent()");
m_lock->unlock();
}

Expand Down Expand Up @@ -182,13 +182,13 @@ void MythRenderOpenGL::SetFence(void)
{
m_glGenFencesAPPLE(1, &m_fence);
if (m_fence)
VERBOSE(VB_PLAYBACK, LOC + "Using GL_APPLE_fence");
LOG(VB_PLAYBACK, LOG_INFO, "Using GL_APPLE_fence");
}
else if (m_exts_used & kGLNVFence)
{
m_glGenFencesNV(1, &m_fence);
if (m_fence)
VERBOSE(VB_PLAYBACK, LOC + "Using GL_NV_fence");
LOG(VB_PLAYBACK, LOG_INFO, "Using GL_NV_fence");
}
doneCurrent();
}
Expand Down Expand Up @@ -261,7 +261,7 @@ int MythRenderOpenGL::GetTextureType(bool &rect)
check = false;
rects = !getenv("OPENGL_NORECT");
if (!rects)
VERBOSE(VB_GENERAL, LOC + "Disabling NPOT textures.");
LOG(VB_GENERAL, LOG_INFO, "Disabling NPOT textures.");
}

int ret = GL_TEXTURE_2D;
Expand Down Expand Up @@ -512,43 +512,39 @@ bool MythRenderOpenGL::CreateFrameBuffer(uint &fb, uint tex)
switch (status)
{
case GL_FRAMEBUFFER_COMPLETE:
VERBOSE(VB_PLAYBACK, LOC +
LOG(VB_PLAYBACK, LOG_INFO,
QString("Created frame buffer object (%1x%2).")
.arg(size.width()).arg(size.height()));
success = true;
break;
case GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT:
VERBOSE(VB_PLAYBACK, LOC + "Frame buffer incomplete_ATTACHMENT");
LOG(VB_PLAYBACK, LOG_INFO, "Frame buffer incomplete_ATTACHMENT");
break;
case GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT:
VERBOSE(VB_PLAYBACK, LOC +
LOG(VB_PLAYBACK, LOG_INFO,
"Frame buffer incomplete_MISSING_ATTACHMENT");
break;
case GL_FRAMEBUFFER_INCOMPLETE_DUPLICATE_ATTACHMENT:
VERBOSE(VB_PLAYBACK, LOC +
LOG(VB_PLAYBACK, LOG_INFO,
"Frame buffer incomplete_DUPLICATE_ATTACHMENT");
break;
case GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS:
VERBOSE(VB_PLAYBACK, LOC +
"Frame buffer incomplete_DIMENSIONS");
LOG(VB_PLAYBACK, LOG_INFO, "Frame buffer incomplete_DIMENSIONS");
break;
case GL_FRAMEBUFFER_INCOMPLETE_FORMATS:
VERBOSE(VB_PLAYBACK, LOC +
"Frame buffer incomplete_FORMATS");
LOG(VB_PLAYBACK, LOG_INFO, "Frame buffer incomplete_FORMATS");
break;
case GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER:
VERBOSE(VB_PLAYBACK, LOC +
"Frame buffer incomplete_DRAW_BUFFER");
LOG(VB_PLAYBACK, LOG_INFO, "Frame buffer incomplete_DRAW_BUFFER");
break;
case GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER:
VERBOSE(VB_PLAYBACK, LOC +
"Frame buffer incomplete_READ_BUFFER");
LOG(VB_PLAYBACK, LOG_INFO, "Frame buffer incomplete_READ_BUFFER");
break;
case GL_FRAMEBUFFER_UNSUPPORTED:
VERBOSE(VB_PLAYBACK, LOC + "Frame buffer unsupported.");
LOG(VB_PLAYBACK, LOG_INFO, "Frame buffer unsupported.");
break;
default:
VERBOSE(VB_PLAYBACK, LOC +
LOG(VB_PLAYBACK, LOG_INFO,
QString("Unknown frame buffer error %1.").arg(status));
}

Expand Down Expand Up @@ -727,7 +723,7 @@ void* MythRenderOpenGL::GetProcAddress(const QString &proc) const
break;
}
if (result == NULL)
VERBOSE(VB_EXTRA, LOC + QString("Extension not found: %1").arg(proc));
LOG(VB_GENERAL, LOG_INFO, QString("Extension not found: %1").arg(proc));

return result;
}
Expand Down Expand Up @@ -756,21 +752,21 @@ bool MythRenderOpenGL::InitFeatures(void)
ycbcrtextures = !getenv("OPENGL_NOYCBCR");
mipmapping = !getenv("OPENGL_NOMIPMAP");
if (!multitexture)
VERBOSE(VB_GENERAL, LOC + "Disabling multi-texturing.");
LOG(VB_GENERAL, LOG_INFO, "Disabling multi-texturing.");
if (!vertexarrays)
VERBOSE(VB_GENERAL, LOC + "Disabling Vertex Arrays.");
LOG(VB_GENERAL, LOG_INFO, "Disabling Vertex Arrays.");
if (!framebuffers)
VERBOSE(VB_GENERAL, LOC + "Disabling Framebuffer Objects.");
LOG(VB_GENERAL, LOG_INFO, "Disabling Framebuffer Objects.");
if (!pixelbuffers)
VERBOSE(VB_GENERAL, LOC + "Disabling Pixel Buffer Objects.");
LOG(VB_GENERAL, LOG_INFO, "Disabling Pixel Buffer Objects.");
if (!vertexbuffers)
VERBOSE(VB_GENERAL, LOC + "Disabling Vertex Buffer Objects.");
LOG(VB_GENERAL, LOG_INFO, "Disabling Vertex Buffer Objects.");
if (!fences)
VERBOSE(VB_GENERAL, LOC + "Disabling fences.");
LOG(VB_GENERAL, LOG_INFO, "Disabling fences.");
if (!ycbcrtextures)
VERBOSE(VB_GENERAL, LOC + "Disabling YCbCr textures.");
LOG(VB_GENERAL, LOG_INFO, "Disabling YCbCr textures.");
if (!mipmapping)
VERBOSE(VB_GENERAL, LOC + "Disabling mipmapping.");
LOG(VB_GENERAL, LOG_INFO, "Disabling mipmapping.");
}

GLint maxtexsz = 0;
Expand All @@ -792,14 +788,13 @@ bool MythRenderOpenGL::InitFeatures(void)
m_exts_supported += kGLMultiTex;
if (m_max_units < 3)
{
VERBOSE(VB_IMPORTANT, LOC_ERR +
QString("Insufficient texture units for "
"advanced OpenGL features."));
LOG(VB_GENERAL, LOG_ERR, QString("Insufficient texture units for "
"advanced OpenGL features."));
}
}
else
{
VERBOSE(VB_IMPORTANT, LOC_ERR +
LOG(VB_GENERAL, LOG_ERR,
QString("Multi-texturing not supported. "
"Certain OpenGL features will not work"));
}
Expand All @@ -810,7 +805,7 @@ bool MythRenderOpenGL::InitFeatures(void)
}
else
{
VERBOSE(VB_IMPORTANT, LOC_ERR +
LOG(VB_GENERAL, LOG_ERR,
QString("GL_EXT_vertex_array extension not supported. "
"This may not work"));
}
Expand Down Expand Up @@ -859,26 +854,25 @@ bool MythRenderOpenGL::InitFeatures(void)
if (!debugged)
{
debugged = true;
VERBOSE(VB_GENERAL, LOC + QString("OpenGL vendor : %1")
LOG(VB_GENERAL, LOG_INFO, QString("OpenGL vendor : %1")
.arg((const char*) glGetString(GL_VENDOR)));
VERBOSE(VB_GENERAL, LOC + QString("OpenGL renderer: %1")
LOG(VB_GENERAL, LOG_INFO, QString("OpenGL renderer: %1")
.arg((const char*) glGetString(GL_RENDERER)));
VERBOSE(VB_GENERAL, LOC + QString("OpenGL version : %1")
LOG(VB_GENERAL, LOG_INFO, QString("OpenGL version : %1")
.arg((const char*) glGetString(GL_VERSION)));
VERBOSE(VB_GENERAL, LOC + QString("Max texture size: %1 x %2")
LOG(VB_GENERAL, LOG_INFO, QString("Max texture size: %1 x %2")
.arg(m_max_tex_size).arg(m_max_tex_size));
VERBOSE(VB_GENERAL, LOC + QString("Max texture units: %1")
LOG(VB_GENERAL, LOG_INFO, QString("Max texture units: %1")
.arg(m_max_units));
VERBOSE(VB_GENERAL, LOC + QString("Direct rendering: %1")
LOG(VB_GENERAL, LOG_INFO, QString("Direct rendering: %1")
.arg((this->format().directRendering()) ? "Yes" : "No"));
}

m_exts_used = m_exts_supported;

if (m_exts_used & kGLExtPBufObj)
{
VERBOSE(VB_GENERAL, LOC +
QString("PixelBufferObject support available"));
LOG(VB_GENERAL, LOG_INFO, "PixelBufferObject support available");
}

return true;
Expand Down Expand Up @@ -966,7 +960,7 @@ uint MythRenderOpenGL::CreateVBO(void)

void MythRenderOpenGL::DeleteOpenGLResources(void)
{
VERBOSE(VB_GENERAL, LOC + "Deleting OpenGL Resources");
LOG(VB_GENERAL, LOG_INFO, "Deleting OpenGL Resources");
DeleteTextures();
DeleteFrameBuffers();
Flush(true);
Expand All @@ -987,13 +981,13 @@ void MythRenderOpenGL::DeleteOpenGLResources(void)

if (m_cachedVertices.size())
{
VERBOSE(VB_IMPORTANT, LOC_ERR + QString(" %1 unexpired vertices")
LOG(VB_GENERAL, LOG_ERR, QString(" %1 unexpired vertices")
.arg(m_cachedVertices.size()));
}

if (m_cachedVBOS.size())
{
VERBOSE(VB_IMPORTANT, LOC_ERR + QString(" %1 unexpired VBOs")
LOG(VB_GENERAL, LOG_ERR, QString(" %1 unexpired VBOs")
.arg(m_cachedVertices.size()));
}
}
Expand Down
17 changes: 8 additions & 9 deletions mythtv/libs/libmythui/mythrender_opengl1.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ bool MythRenderOpenGL1::InitFeatures(void)
check = false;
fragmentprog = !getenv("OPENGL_NOFRAGPROG");
if (!fragmentprog)
VERBOSE(VB_GENERAL, LOC + "Disabling fragment programs.");
LOG(VB_GENERAL, LOG_INFO, "Disabling fragment programs.");
}

if (m_extensions.contains("GL_ARB_fragment_program") &&
Expand All @@ -75,7 +75,7 @@ bool MythRenderOpenGL1::InitFeatures(void)
fragmentprog)
{
m_exts_supported += kGLExtFragProg;
VERBOSE(VB_GENERAL, LOC + QString("Fragment program support available"));
LOG(VB_GENERAL, LOG_INFO, "Fragment program support available");
}

return MythRenderOpenGL::InitFeatures();
Expand Down Expand Up @@ -134,7 +134,7 @@ uint MythRenderOpenGL1::CreateShaderObject(const QString &vert, const QString &f
glGetIntegerv(GL_PROGRAM_ERROR_POSITION_ARB, &error);
if (error != -1)
{
VERBOSE(VB_PLAYBACK, LOC_ERR +
LOG(VB_PLAYBACK, LOG_ERR,
QString("Fragment Program compile error: position %1:'%2'")
.arg(error).arg(frag.mid(error)));

Expand All @@ -144,15 +144,15 @@ uint MythRenderOpenGL1::CreateShaderObject(const QString &vert, const QString &f
GL_PROGRAM_UNDER_NATIVE_LIMITS_ARB, &error);
if (error != 1)
{
VERBOSE(VB_PLAYBACK, LOC_ERR +
LOG(VB_PLAYBACK, LOG_ERR,
"Fragment program exceeds hardware capabilities.");

success = false;
}

if (success)
{
VERBOSE(VB_PLAYBACK|VB_EXTRA, "\n" + frag + "\n");
LOG(VB_PLAYBACK, LOG_DEBUG, "\n" + frag + "\n");
m_programs.push_back(glfp);
}
else
Expand Down Expand Up @@ -263,17 +263,16 @@ uint MythRenderOpenGL1::CreateHelperTexture(void)
glBindTexture(m_textures[tmp_tex].m_type, tmp_tex);
glTexImage1D(GL_TEXTURE_1D, 0, GL_RGBA16, width, 0, GL_RGBA, GL_FLOAT, buf);

VERBOSE(VB_PLAYBACK, LOC +
QString("Created bicubic helper texture (%1 samples)")
.arg(width));
LOG(VB_PLAYBACK, LOG_INFO,
QString("Created bicubic helper texture (%1 samples)") .arg(width));
delete [] buf;
doneCurrent();
return tmp_tex;
}

void MythRenderOpenGL1::DeleteOpenGLResources(void)
{
VERBOSE(VB_GENERAL, LOC + "Deleting OpenGL Resources");
LOG(VB_GENERAL, LOG_INFO, "Deleting OpenGL Resources");
DeleteShaders();
MythRenderOpenGL::DeleteOpenGLResources();
}
Expand Down
18 changes: 9 additions & 9 deletions mythtv/libs/libmythui/mythrender_opengl2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ bool MythRenderOpenGL2::InitFeatures(void)
check = false;
glslshaders = !getenv("OPENGL_NOGLSL");
if (!glslshaders)
VERBOSE(VB_GENERAL, LOC + "Disabling GLSL.");
LOG(VB_GENERAL, LOG_INFO, "Disabling GLSL.");
}

// These should all be present for a valid OpenGL2.0/ES installation
Expand All @@ -233,7 +233,7 @@ bool MythRenderOpenGL2::InitFeatures(void)
m_glBindAttribLocation &&
m_glVertexAttrib4f && glslshaders)
{
VERBOSE(VB_GENERAL, LOC + QString("GLSL supported"));
LOG(VB_GENERAL, LOG_INFO, "GLSL supported");
m_exts_supported += kGLSL;
}

Expand Down Expand Up @@ -753,9 +753,9 @@ uint MythRenderOpenGL2::CreateShader(int type, const QString &source)
{
char *log = (char*)malloc(sizeof(char) * length);
m_glGetShaderInfoLog(result, length, NULL, log);
VERBOSE(VB_IMPORTANT, LOC_ERR + "Failed to compile shader.");
VERBOSE(VB_IMPORTANT, log);
VERBOSE(VB_IMPORTANT, source);
LOG(VB_GENERAL, LOG_ERR, "Failed to compile shader.");
LOG(VB_GENERAL, LOG_ERR, log);
LOG(VB_GENERAL, LOG_ERR, source);
free(log);
}
m_glDeleteShader(result);
Expand Down Expand Up @@ -788,7 +788,7 @@ bool MythRenderOpenGL2::CheckObjectStatus(uint obj)
if (ok > 0)
return true;

VERBOSE(VB_IMPORTANT, LOC_ERR + QString("Failed to link shader object."));
LOG(VB_GENERAL, LOG_ERR, "Failed to link shader object.");
int infologLength = 0;
int charsWritten = 0;
char *infoLog;
Expand All @@ -797,7 +797,7 @@ bool MythRenderOpenGL2::CheckObjectStatus(uint obj)
{
infoLog = (char *)malloc(infologLength);
m_glGetProgramInfoLog(obj, infologLength, &charsWritten, infoLog);
VERBOSE(VB_IMPORTANT, QString("\n\n%1").arg(infoLog));
LOG(VB_GENERAL, LOG_ERR, QString("\n\n%1").arg(infoLog));
free(infoLog);
}
return false;
Expand All @@ -821,12 +821,12 @@ void MythRenderOpenGL2::OptimiseShaderSource(QString &source)
source.replace("GLSL_TEXTURE", texture);
source.replace("GLSL_DEFINES", version + extensions + m_qualifiers);

VERBOSE(VB_EXTRA, "\n" + source);
LOG(VB_GENERAL, LOG_DEBUG, "\n" + source);
}

void MythRenderOpenGL2::DeleteOpenGLResources(void)
{
VERBOSE(VB_GENERAL, LOC + "Deleting OpenGL Resources");
LOG(VB_GENERAL, LOG_INFO, "Deleting OpenGL Resources");
DeleteDefaultShaders();
DeleteShaders();
MythRenderOpenGL::DeleteOpenGLResources();
Expand Down
20 changes: 11 additions & 9 deletions mythtv/libs/libmythui/mythrender_opengl2es.h
Original file line number Diff line number Diff line change
Expand Up @@ -83,15 +83,15 @@ class MUI_PUBLIC MythRenderOpenGL2ES : public MythRenderOpenGL2
if (!debugged)
{
debugged = true;
VERBOSE(VB_GENERAL, LOC + QString("Vendor : %1")
LOG(VB_GENERAL, LOG_INFO, QString("Vendor : %1")
.arg((const char*) glGetString(GL_VENDOR)));
VERBOSE(VB_GENERAL, LOC + QString("Renderer: %1")
LOG(VB_GENERAL, LOG_INFO, QString("Renderer: %1")
.arg((const char*) glGetString(GL_RENDERER)));
VERBOSE(VB_GENERAL, LOC + QString("Version : %1")
LOG(VB_GENERAL, LOG_INFO, QString("Version : %1")
.arg((const char*) glGetString(GL_VERSION)));
VERBOSE(VB_GENERAL, LOC + QString("Max texture size: %1 x %2")
LOG(VB_GENERAL, LOG_INFO, QString("Max texture size: %1 x %2")
.arg(m_max_tex_size).arg(m_max_tex_size));
VERBOSE(VB_GENERAL, LOC + QString("Direct rendering: %1")
LOG(VB_GENERAL, LOG_INFO, QString("Direct rendering: %1")
.arg((this->format().directRendering()) ? "Yes" : "No"));
}

Expand All @@ -106,12 +106,12 @@ class MUI_PUBLIC MythRenderOpenGL2ES : public MythRenderOpenGL2
m_glBindBuffer && m_glDeleteBuffers && m_glBufferData &&
m_glActiveTexture))
{
VERBOSE(VB_IMPORTANT,
LOG(VB_GENERAL, LOG_ERR,
"OpenGL2ES Error: Failed to find basic functionality.");
return false;
}

VERBOSE(VB_GENERAL, "OpenGL2ES: Found default functionality.");
LOG(VB_GENERAL, LOG_INFO, "OpenGL2ES: Found default functionality.");
m_exts_supported += kGLSL | kGLExtVBO | kGLVertexArray |
kGLMultiTex;
m_default_texture_type = GL_TEXTURE_2D;
Expand All @@ -122,7 +122,8 @@ class MUI_PUBLIC MythRenderOpenGL2ES : public MythRenderOpenGL2
m_glDeleteFramebuffers)
{
m_exts_supported += kGLExtFBufObj;
VERBOSE(VB_GENERAL, "OpenGL2ES: Framebuffer Objects available.");
LOG(VB_GENERAL, LOG_INFO,
"OpenGL2ES: Framebuffer Objects available.");
}

// GL_OES_mapbuffer
Expand All @@ -131,7 +132,8 @@ class MUI_PUBLIC MythRenderOpenGL2ES : public MythRenderOpenGL2
m_glMapBuffer && m_glUnmapBuffer)
{
m_exts_supported += kGLExtPBufObj;
VERBOSE(VB_GENERAL, "OpenGL2ES: Pixel Buffer Objects available.");
LOG(VB_GENERAL, LOG_INFO,
"OpenGL2ES: Pixel Buffer Objects available.");
}

m_exts_used = m_exts_supported;
Expand Down
96 changes: 45 additions & 51 deletions mythtv/libs/libmythui/mythrender_vdpau.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
ok &= (vdp_st == VDP_STATUS_OK); \
if (!ok) \
{ \
VERBOSE(VB_GENERAL, LOC_ERR + QString("Error at %1:%2 (#%3, %4)") \
LOG(VB_GENERAL, LOG_ERR, QString("Error at %1:%2 (#%3, %4)") \
.arg(__FILE__).arg( __LINE__).arg(vdp_st) \
.arg(vdp_get_error_string(vdp_st))); \
}
Expand All @@ -53,7 +53,7 @@
{ \
ok = arg1; \
if (!ok) \
VERBOSE(VB_IMPORTANT, LOC_ERR + arg2); \
LOG(VB_GENERAL, LOG_ERR, arg2); \
}

#define CHECK_VIDEO_SURFACES(arg1) \
Expand Down Expand Up @@ -244,7 +244,7 @@ class VDPAUVideoMixer : public VDPAUResource
static void vdpau_preemption_callback(VdpDevice device, void *myth_render)
{
(void)device;
VERBOSE(VB_IMPORTANT, LOC_WARN + "Display pre-empted.");
LOG(VB_GENERAL, LOG_WARNING, "Display pre-empted.");
MythRenderVDPAU *render = (MythRenderVDPAU*)myth_render;
if (render)
render->SetPreempted();
Expand Down Expand Up @@ -278,7 +278,7 @@ bool MythRenderVDPAU::IsMPEG4Available(void)
if (gVDPAUSupportChecked)
return gVDPAUMPEG4Accel;

VERBOSE(VB_PLAYBACK, LOC + QString("Checking VDPAU capabilities."));
LOG(VB_PLAYBACK, LOG_INFO, "Checking VDPAU capabilities.");
MythRenderVDPAU *dummy = new MythRenderVDPAU();
if (dummy)
{
Expand All @@ -299,7 +299,7 @@ bool MythRenderVDPAU::H264DecoderSizeSupported(uint width, uint height)
if (!check)
return true;

VERBOSE(VB_PLAYBACK, LOC +
LOG(VB_PLAYBACK, LOG_INFO,
QString("Checking support for H.264 video with width %1").arg(width));
bool supported = true;
MythRenderVDPAU *dummy = new MythRenderVDPAU();
Expand All @@ -312,7 +312,7 @@ bool MythRenderVDPAU::H264DecoderSizeSupported(uint width, uint height)
else
dummy->DestroyDecoder(test);
}
VERBOSE(VB_IMPORTANT, (supported ? LOC : LOC_WARN) +
LOG(VB_GENERAL, (supported ? LOG_INFO : LOG_WARNING),
QString("Hardware decoding of this H.264 video is %1supported "
"on this video card.").arg(supported ? "" : "NOT "));
if (dummy)
Expand All @@ -332,7 +332,7 @@ bool MythRenderVDPAU::CreateDummy(void)
CREATE_CHECK(CheckHardwareSupport(), "")

if (!ok)
VERBOSE(VB_IMPORTANT, LOC + QString("Failed to create dummy device."));
LOG(VB_GENERAL, LOG_ERR, "Failed to create dummy device.");

return ok;
}
Expand Down Expand Up @@ -365,12 +365,12 @@ bool MythRenderVDPAU::Create(const QSize &size, WId window, uint colorkey)

if (ok)
{
VERBOSE(VB_GENERAL, LOC + QString("Created VDPAU render device %1x%2")
LOG(VB_GENERAL, LOG_INFO, QString("Created VDPAU render device %1x%2")
.arg(size.width()).arg(size.height()));
return ok;
}

VERBOSE(VB_IMPORTANT, "Failed to create VDPAU render device.");
LOG(VB_GENERAL, LOG_ERR, "Failed to create VDPAU render device.");
return ok;
}

Expand Down Expand Up @@ -400,7 +400,7 @@ bool MythRenderVDPAU::SetColorKey(uint colorkey)
&(color.m_vdp_color));
CHECK_ST

VERBOSE(VB_PLAYBACK, LOC + QString("Set colorkey to 0x%1")
LOG(VB_PLAYBACK, LOG_INFO, QString("Set colorkey to 0x%1")
.arg(m_colorKey, 0, 16));
return ok;
}
Expand Down Expand Up @@ -549,7 +549,7 @@ void MythRenderVDPAU::CheckOutputSurfaces(void)
break;
}

VERBOSE(VB_GENERAL, LOC +
LOG(VB_GENERAL, LOG_INFO,
QString("Added %1 output surfaces (total %2, max %3)")
.arg(created).arg(m_surfaces.size()).arg(need));
}
Expand All @@ -571,8 +571,7 @@ uint MythRenderVDPAU::CreateOutputSurface(const QSize &size, VdpRGBAFormat fmt,

if (!ok || !tmp)
{
VERBOSE(VB_IMPORTANT, LOC_ERR +
QString("Failed to create output surface."));
LOG(VB_GENERAL, LOG_ERR, "Failed to create output surface.");
return 0;
}

Expand Down Expand Up @@ -615,8 +614,7 @@ uint MythRenderVDPAU::CreateVideoSurface(const QSize &size, VdpChromaType type,

if (!ok || !tmp)
{
VERBOSE(VB_PLAYBACK, LOC_ERR +
QString("Failed to create video surface."));
LOG(VB_PLAYBACK, LOG_ERR, "Failed to create video surface.");
return 0;
}

Expand Down Expand Up @@ -660,8 +658,7 @@ uint MythRenderVDPAU::CreateBitmapSurface(const QSize &size, VdpRGBAFormat fmt,

if (!ok || !tmp)
{
VERBOSE(VB_GENERAL, LOC_ERR +
QString("Failed to create bitmap surface."));
LOG(VB_GENERAL, LOG_ERR, "Failed to create bitmap surface.");
return 0;
}

Expand Down Expand Up @@ -705,8 +702,7 @@ uint MythRenderVDPAU::CreateDecoder(const QSize &size,

if (!ok || !tmp)
{
VERBOSE(VB_PLAYBACK, LOC_ERR +
QString("Failed to create decoder."));
LOG(VB_PLAYBACK, LOG_ERR, "Failed to create decoder.");
return 0;
}

Expand Down Expand Up @@ -798,11 +794,10 @@ uint MythRenderVDPAU::CreateVideoMixer(const QSize &size, uint layers,
{
feat[count] = gVDPAUBestScaling;
count++;
VERBOSE(VB_PLAYBACK, LOC +
QString("Enabling high quality scaling."));
LOG(VB_PLAYBACK, LOG_INFO, "Enabling high quality scaling.");
}
else
VERBOSE(VB_PLAYBACK, LOC + "High quality scaling not available");
LOG(VB_PLAYBACK, LOG_INFO, "High quality scaling not available");
}

vdp_st = vdp_video_mixer_create(m_device, count, count ? feat : NULL,
Expand All @@ -811,8 +806,7 @@ uint MythRenderVDPAU::CreateVideoMixer(const QSize &size, uint layers,

if (!ok || !tmp)
{
VERBOSE(VB_PLAYBACK, LOC_ERR +
QString("Failed to create video mixer."));
LOG(VB_PLAYBACK, LOG_ERR, QString("Failed to create video mixer."));
return 0;
}

Expand All @@ -821,8 +815,8 @@ uint MythRenderVDPAU::CreateVideoMixer(const QSize &size, uint layers,
CHECK_ST

if (!ok)
VERBOSE(VB_PLAYBACK, LOC_ERR +
QString("WARNING: Failed to enable video mixer features."));
LOG(VB_PLAYBACK, LOG_WARNING,
"WARNING: Failed to enable video mixer features.");

if (existing)
{
Expand Down Expand Up @@ -1444,7 +1438,7 @@ bool MythRenderVDPAU::CreateDevice(void)

if (!ok)
{
VERBOSE(VB_IMPORTANT, LOC_ERR + "Failed to create VDPAU device.");
LOG(VB_GENERAL, LOG_ERR, "Failed to create VDPAU device.");
return false;
}

Expand Down Expand Up @@ -1566,7 +1560,7 @@ bool MythRenderVDPAU::CreatePresentationSurfaces(void)
if (m_surfaces.size() >= MIN_OUTPUT_SURFACES)
{
m_flipReady = m_flipQueue;
VERBOSE(VB_GENERAL, LOC + QString("Created %1 output surfaces.")
LOG(VB_GENERAL, LOG_INFO, QString("Created %1 output surfaces.")
.arg(m_surfaces.size()));
}
return ok;
Expand Down Expand Up @@ -1601,13 +1595,13 @@ bool MythRenderVDPAU::CheckHardwareSupport(void)
{
uint version;
vdp_get_api_version(&version);
VERBOSE(VB_GENERAL, LOC + QString("Version %1").arg(version));
LOG(VB_GENERAL, LOG_INFO, QString("Version %1").arg(version));
}
if (vdp_get_information_string)
{
const char * info;
vdp_get_information_string(&info);
VERBOSE(VB_GENERAL, LOC + QString("Information %2").arg(info));
LOG(VB_GENERAL, LOG_INFO, QString("Information %2").arg(info));
}

for (int i = 0; i < NUM_SCALING_LEVELS; i++)
Expand All @@ -1616,12 +1610,13 @@ bool MythRenderVDPAU::CheckHardwareSupport(void)

if (gVDPAUBestScaling)
{
VERBOSE(VB_PLAYBACK, LOC + QString("HQ scaling level %1 of %2 available.")
LOG(VB_PLAYBACK, LOG_INFO,
QString("HQ scaling level %1 of %2 available.")
.arg(gVDPAUBestScaling - VDP_VIDEO_MIXER_FEATURE_HIGH_QUALITY_SCALING_L1 + 1)
.arg(NUM_SCALING_LEVELS));
}
else
VERBOSE(VB_PLAYBACK, LOC + QString("HQ Scaling not supported."));
LOG(VB_PLAYBACK, LOG_INFO, "HQ Scaling not supported.");

VdpBool supported = false;

Expand All @@ -1636,7 +1631,7 @@ bool MythRenderVDPAU::CheckHardwareSupport(void)

gVDPAUMPEG4Accel = (bool)supported;

VERBOSE(VB_PLAYBACK, LOC +
LOG(VB_PLAYBACK, LOG_INFO,
QString("MPEG4 hardware acceleration %1supported.")
.arg(gVDPAUMPEG4Accel ? "" : "not "));
}
Expand Down Expand Up @@ -1762,7 +1757,7 @@ void MythRenderVDPAU::DestroyOutputSurfaces(void)
return;

if (m_outputSurfaces.size())
VERBOSE(VB_IMPORTANT, LOC_WARN + QString("Orphaned output surfaces."));
LOG(VB_GENERAL, LOG_WARNING, "Orphaned output surfaces.");

INIT_ST
QHash<uint, VDPAUOutputSurface>::iterator it;
Expand All @@ -1780,7 +1775,7 @@ void MythRenderVDPAU::DestroyVideoSurfaces(void)
return;

if (m_videoSurfaces.size())
VERBOSE(VB_IMPORTANT, LOC_WARN + QString("Orphaned video surfaces."));
LOG(VB_GENERAL, LOG_WARNING, "Orphaned video surfaces.");

INIT_ST
QHash<uint, VDPAUVideoSurface>::iterator it;;
Expand All @@ -1796,7 +1791,7 @@ void MythRenderVDPAU::DestroyVideoSurfaces(void)
void MythRenderVDPAU::DestroyLayers(void)
{
if (m_layers.size())
VERBOSE(VB_IMPORTANT, LOC_WARN + QString("Orphaned layers."));
LOG(VB_GENERAL, LOG_WARNING, "Orphaned layers.");
m_layers.clear();
}

Expand All @@ -1806,7 +1801,7 @@ void MythRenderVDPAU::DestroyBitmapSurfaces(void)
return;

if (m_bitmapSurfaces.size())
VERBOSE(VB_IMPORTANT, LOC_WARN + QString("Orphaned bitmap surfaces."));
LOG(VB_GENERAL, LOG_WARNING, "Orphaned bitmap surfaces.");

INIT_ST
QHash<uint, VDPAUBitmapSurface>::iterator it;
Expand All @@ -1824,7 +1819,7 @@ void MythRenderVDPAU::DestroyDecoders(void)
return;

if (m_decoders.size())
VERBOSE(VB_IMPORTANT, LOC_WARN + QString("Orphaned decoders."));
LOG(VB_GENERAL, LOG_WARNING, "Orphaned decoders.");

INIT_ST
QHash<uint, VDPAUDecoder>::iterator it;
Expand All @@ -1842,7 +1837,7 @@ void MythRenderVDPAU::DestroyVideoMixers(void)
return;

if (m_videoMixers.size())
VERBOSE(VB_IMPORTANT, LOC_WARN + QString("Orphaned video mixers."));
LOG(VB_GENERAL, LOG_WARNING, "Orphaned video mixers.");

INIT_ST
QHash<uint, VDPAUVideoMixer>::iterator it;
Expand Down Expand Up @@ -1874,7 +1869,7 @@ void MythRenderVDPAU::Preempted(void)
if (!m_preempted || m_recreating)
return;

VERBOSE(VB_IMPORTANT, LOC + "Attempting to re-create VDPAU resources.");
LOG(VB_GENERAL, LOG_NOTICE, "Attempting to re-create VDPAU resources.");
m_recreating = true;
m_flipReady = false;
ResetProcs();
Expand Down Expand Up @@ -1908,7 +1903,7 @@ void MythRenderVDPAU::Preempted(void)
layers.value().m_layer.source_surface = old_surfaces[old];
}
if (ok)
VERBOSE(VB_IMPORTANT, LOC + "Re-created output surfaces.");
LOG(VB_GENERAL, LOG_INFO, "Re-created output surfaces.");
}

if (ok && m_bitmapSurfaces.size())
Expand All @@ -1922,7 +1917,7 @@ void MythRenderVDPAU::Preempted(void)
ok = false;
}
if (ok)
VERBOSE(VB_IMPORTANT, LOC + "Re-created bitmap surfaces.");
LOG(VB_GENERAL, LOG_INFO, "Re-created bitmap surfaces.");

}

Expand All @@ -1937,7 +1932,7 @@ void MythRenderVDPAU::Preempted(void)
ok = false;
}
if (ok)
VERBOSE(VB_IMPORTANT, LOC + "Re-created decoders.");
LOG(VB_GENERAL, LOG_INFO, "Re-created decoders.");
}

if (ok && m_videoMixers.size())
Expand All @@ -1953,7 +1948,7 @@ void MythRenderVDPAU::Preempted(void)
ok = false;
}
if (ok)
VERBOSE(VB_IMPORTANT, LOC + "Re-created video mixers.");
LOG(VB_GENERAL, LOG_INFO, "Re-created video mixers.");
}

// reset of hardware surfaces needs to be done in the correct thread
Expand All @@ -1966,7 +1961,7 @@ void MythRenderVDPAU::Preempted(void)

if (!ok)
{
VERBOSE(VB_IMPORTANT, LOC + "Failed to re-create VDPAU resources.");
LOG(VB_GENERAL, LOG_INFO, "Failed to re-create VDPAU resources.");
m_errored = true;
return;
}
Expand Down Expand Up @@ -2005,7 +2000,7 @@ void MythRenderVDPAU::ResetVideoSurfaces(void)
if (!surfaces_owned)
return;

VERBOSE(VB_IMPORTANT, LOC +
LOG(VB_GENERAL, LOG_INFO,
QString("Attempting to reset %1 video surfaces owned by this thread %2")
.arg(surfaces_owned).arg((long long)this_thread));

Expand Down Expand Up @@ -2054,19 +2049,18 @@ void MythRenderVDPAU::ResetVideoSurfaces(void)
}

if (ok)
VERBOSE(VB_IMPORTANT, LOC + QString("Re-created %1 video surfaces.")
LOG(VB_GENERAL, LOG_INFO, QString("Re-created %1 video surfaces.")
.arg(surfaces_owned));
else
VERBOSE(VB_IMPORTANT, LOC_ERR +
QString("Error re-creating video surfaces."));
LOG(VB_GENERAL, LOG_ERR, "Error re-creating video surfaces.");

int remaining = 0;
for (it = m_videoSurfaces.begin(); it != m_videoSurfaces.end(); ++it)
if (it.value().m_needs_reset)
remaining++;

VERBOSE(VB_IMPORTANT,
LOC + QString("%1 of %2 video surfaces still need to be reset")
LOG(VB_GENERAL, LOG_INFO,
QString("%1 of %2 video surfaces still need to be reset")
.arg(remaining).arg(m_videoSurfaces.size()));

m_reset_video_surfaces = remaining;
Expand Down
4 changes: 2 additions & 2 deletions mythtv/libs/libmythui/mythscreentype.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -538,7 +538,7 @@ void MythScreenType::CopyFrom(MythUIType *base)
MythScreenType *st = dynamic_cast<MythScreenType *>(base);
if (!st)
{
VERBOSE(VB_IMPORTANT, "ERROR, bad parsing");
LOG(VB_GENERAL, LOG_ERR, "ERROR, bad parsing");
return;
}

Expand All @@ -558,7 +558,7 @@ void MythScreenType::CopyFrom(MythUIType *base)
*/
void MythScreenType::CreateCopy(MythUIType *)
{
VERBOSE(VB_IMPORTANT, "CreateCopy called on screentype - bad.");
LOG(VB_GENERAL, LOG_ERR, "CreateCopy called on screentype - bad.");
}

MythPainter* MythScreenType::GetPainter(void)
Expand Down
47 changes: 25 additions & 22 deletions mythtv/libs/libmythui/myththemedmenu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ bool MythThemedMenuState::Create(void)

if (!m_buttonList)
{
VERBOSE(VB_IMPORTANT, "Missing 'menu' buttonlist.");
LOG(VB_GENERAL, LOG_ERR, "Missing 'menu' buttonlist.");
return false;
}

Expand All @@ -67,7 +67,7 @@ void MythThemedMenuState::CopyFrom(MythUIType *base)
MythThemedMenuState *st = dynamic_cast<MythThemedMenuState *>(base);
if (!st)
{
VERBOSE(VB_IMPORTANT, "ERROR, bad parsing");
LOG(VB_GENERAL, LOG_INFO, "ERROR, bad parsing");
return;
}

Expand Down Expand Up @@ -555,21 +555,22 @@ void MythThemedMenu::parseThemeButton(QDomElement &element)
}
else
{
VERBOSE(VB_GENERAL, QString("MythThemedMenu: Unknown tag %1 "
"in button").arg(info.tagName()));
LOG(VB_GENERAL, LOG_ERR,
QString("MythThemedMenu: Unknown tag %1 in button")
.arg(info.tagName()));
}
}
}

if (text.isEmpty())
{
VERBOSE(VB_IMPORTANT, "MythThemedMenu: Missing 'text' in button");
LOG(VB_GENERAL, LOG_ERR, "MythThemedMenu: Missing 'text' in button");
return;
}

if (action.empty())
{
VERBOSE(VB_IMPORTANT, "MythThemedMenu: Missing 'action' in button");
LOG(VB_GENERAL, LOG_ERR, "MythThemedMenu: Missing 'action' in button");
return;
}

Expand Down Expand Up @@ -599,7 +600,7 @@ bool MythThemedMenu::parseMenu(const QString &menuname)

if (!f.exists() || !f.open(QIODevice::ReadOnly))
{
VERBOSE(VB_IMPORTANT, QString("MythThemedMenu: Couldn't read "
LOG(VB_GENERAL, LOG_ERR, QString("MythThemedMenu: Couldn't read "
"menu file %1").arg(menuname));

if (menuname != "mainmenu.xml")
Expand All @@ -614,7 +615,7 @@ bool MythThemedMenu::parseMenu(const QString &menuname)

if (!doc.setContent(&f, false, &errorMsg, &errorLine, &errorColumn))
{
VERBOSE(VB_IMPORTANT,
LOG(VB_GENERAL, LOG_ERR,
QString("Error parsing: %1\nat line: %2 column: %3 msg: %4").
arg(filename).arg(errorLine).arg(errorColumn).arg(errorMsg));
f.close();
Expand All @@ -627,7 +628,7 @@ bool MythThemedMenu::parseMenu(const QString &menuname)

f.close();

VERBOSE(VB_GUI, QString("Loading menu theme from %1").arg(filename));
LOG(VB_GUI, LOG_INFO, QString("Loading menu theme from %1").arg(filename));

QDomElement docElem = doc.documentElement();

Expand All @@ -645,8 +646,9 @@ bool MythThemedMenu::parseMenu(const QString &menuname)
}
else
{
VERBOSE(VB_IMPORTANT, QString("MythThemedMenu: Unknown "
"element %1").arg(e.tagName()));
LOG(VB_GENERAL, LOG_ERR,
QString("MythThemedMenu: Unknown element %1")
.arg(e.tagName()));
return false;
}
}
Expand All @@ -655,8 +657,8 @@ bool MythThemedMenu::parseMenu(const QString &menuname)

if (m_buttonList->GetCount() == 0)
{
VERBOSE(VB_IMPORTANT, QString("MythThemedMenu: No buttons "
"for menu %1").arg(menuname));
LOG(VB_GENERAL, LOG_ERR,
QString("MythThemedMenu: No buttons for menu %1").arg(menuname));
return false;
}

Expand Down Expand Up @@ -733,42 +735,42 @@ QString MythThemedMenu::findMenuFile(const QString &menuname)
if (file.exists())
return testdir;
else
VERBOSE(VB_FILE+VB_EXTRA, "No menu file " + testdir);
LOG(VB_FILE, LOG_DEBUG, "No menu file " + testdir);

testdir = GetMythUI()->GetMenuThemeDir() + '/' + menuname;
file.setFileName(testdir);
if (file.exists())
return testdir;
else
VERBOSE(VB_FILE+VB_EXTRA, "No menu file " + testdir);
LOG(VB_FILE, LOG_DEBUG, "No menu file " + testdir);

testdir = GetMythUI()->GetThemeDir() + '/' + menuname;
file.setFileName(testdir);
if (file.exists())
return testdir;
else
VERBOSE(VB_FILE+VB_EXTRA, "No menu file " + testdir);
LOG(VB_FILE, LOG_DEBUG, "No menu file " + testdir);

testdir = GetShareDir() + menuname;
file.setFileName(testdir);
if (file.exists())
return testdir;
else
VERBOSE(VB_FILE+VB_EXTRA, "No menu file " + testdir);
LOG(VB_FILE, LOG_DEBUG, "No menu file " + testdir);

testdir = "../mythfrontend/" + menuname;
file.setFileName(testdir);
if (file.exists())
return testdir;
else
VERBOSE(VB_FILE+VB_EXTRA, "No menu file " + testdir);
LOG(VB_FILE, LOG_DEBUG, "No menu file " + testdir);

testdir = GetShareDir() + "themes/defaultmenu/" + menuname;
file.setFileName(testdir);
if (file.exists())
return testdir;
else
VERBOSE(VB_FILE+VB_EXTRA, "No menu file " + testdir);
LOG(VB_FILE, LOG_DEBUG, "No menu file " + testdir);

return QString();
}
Expand Down Expand Up @@ -864,7 +866,7 @@ bool MythThemedMenu::handleAction(const QString &action, const QString &password
if (m_state->m_callback)
m_state->m_callback(m_state->m_callbackdata, m_selection);
else
VERBOSE(VB_IMPORTANT, "Unknown menu action: " + action);
LOG(VB_GENERAL, LOG_ERR, "Unknown menu action: " + action);
}

return true;
Expand Down Expand Up @@ -912,7 +914,7 @@ bool MythThemedMenu::checkPinCode(const QString &password_setting)

if (last_time_stamp.length() < 1)
{
VERBOSE(VB_IMPORTANT,
LOG(VB_GENERAL, LOG_ERR,
"MythThemedMenu: Could not read password/pin time stamp.\n"
"This is only an issue if it happens repeatedly.");
}
Expand All @@ -929,7 +931,8 @@ bool MythThemedMenu::checkPinCode(const QString &password_setting)
}
}

VERBOSE(VB_GENERAL, QString("Using Password: %1").arg(password_setting));
LOG(VB_GENERAL, LOG_INFO, QString("Using Password: %1")
.arg(password_setting));

QString text = tr("Enter password:");
MythScreenStack *popupStack = GetMythMainWindow()->GetStack("popup stack");
Expand Down
19 changes: 10 additions & 9 deletions mythtv/libs/libmythui/mythudplistener.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,14 @@ MythUDPListener::MythUDPListener()
m_socket = new QUdpSocket(this);
connect(m_socket, SIGNAL(readyRead()),
this, SLOT(ReadPending()));
if (m_socket->bind(QHostAddress(gCoreContext->MythHostAddressAny()),udp_port))
if (m_socket->bind(QHostAddress(gCoreContext->MythHostAddressAny()),
udp_port))
{
VERBOSE(VB_GENERAL, LOC + QString("bound to port %1").arg(udp_port));
LOG(VB_GENERAL, LOG_INFO, QString("bound to port %1").arg(udp_port));
}
else
{
VERBOSE(VB_GENERAL, LOC +
LOG(VB_GENERAL, LOG_INFO,
QString("failed to bind to port %1").arg(udp_port));
}
}
Expand All @@ -39,7 +40,7 @@ void MythUDPListener::TeardownAll(void)
if (!m_socket)
return;

VERBOSE(VB_GENERAL, LOC + "Disconnecting");
LOG(VB_GENERAL, LOG_INFO, "Disconnecting");

m_socket->disconnect();
m_socket->close();
Expand Down Expand Up @@ -71,7 +72,7 @@ void MythUDPListener::Process(const QByteArray &buf)
QDomDocument doc;
if (!doc.setContent(buf, false, &errorMsg, &errorLine, &errorColumn))
{
VERBOSE(VB_IMPORTANT, ERR +
LOG(VB_GENERAL, LOG_ERR,
QString("Parsing xml:\n\t\t\t at line: %1 column: %2\n\t\t\t%3")
.arg(errorLine).arg(errorColumn).arg(errorMsg));

Expand All @@ -83,15 +84,15 @@ void MythUDPListener::Process(const QByteArray &buf)
{
if (docElem.tagName() != "mythmessage")
{
VERBOSE(VB_IMPORTANT, ERR +
LOG(VB_GENERAL, LOG_ERR,
"Unknown UDP packet (not <mythmessage> XML)");
return;
}

QString version = docElem.attribute("version", "");
if (version.isEmpty())
{
VERBOSE(VB_IMPORTANT, ERR +
LOG(VB_GENERAL, LOG_ERR,
"<mythmessage> missing 'version' attribute");
return;
}
Expand All @@ -106,14 +107,14 @@ void MythUDPListener::Process(const QByteArray &buf)
if (e.tagName() == "text")
{
QString msg = e.text();
VERBOSE(VB_GENERAL, LOC + msg);
LOG(VB_GENERAL, LOG_INFO, msg);
MythMainWindow *window = GetMythMainWindow();
MythEvent* me = new MythEvent(MythEvent::MythUserMessage, msg);
qApp->postEvent(window, me);
}
else
{
VERBOSE(VB_IMPORTANT, ERR + QString("Unknown element: %1")
LOG(VB_GENERAL, LOG_ERR, QString("Unknown element: %1")
.arg(e.tagName()));
return;
}
Expand Down
5 changes: 2 additions & 3 deletions mythtv/libs/libmythui/mythuibutton.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ void MythUIButton::SetInitialStates()
m_BackgroundState = dynamic_cast<MythUIStateType*>(GetChild("buttonstate"));

if (!m_BackgroundState)
VERBOSE(VB_IMPORTANT, QString("Button %1 is missing required "
LOG(VB_GENERAL, LOG_ERR, QString("Button %1 is missing required "
"elements").arg(objectName()));

SetState("active");
Expand Down Expand Up @@ -285,8 +285,7 @@ void MythUIButton::CopyFrom(MythUIType *base)
MythUIButton *button = dynamic_cast<MythUIButton *>(base);
if (!button)
{
VERBOSE(VB_IMPORTANT,
"MythUIButton::CopyFrom: Dynamic cast of base failed");
LOG(VB_GENERAL, LOG_ERR, "Dynamic cast of base failed");
return;
}

Expand Down
55 changes: 27 additions & 28 deletions mythtv/libs/libmythui/mythuibuttonlist.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,7 @@ bool MythUIButtonList::DistributeRow(int & first_button, int & last_button,

if (buttonstate == NULL)
{
VERBOSE(VB_IMPORTANT, QString("Failed to query buttonlist state: %1")
LOG(VB_GENERAL, LOG_ERR, QString("Failed to query buttonlist state: %1")
.arg(last_button));
return false;
}
Expand Down Expand Up @@ -345,7 +345,7 @@ bool MythUIButtonList::DistributeRow(int & first_button, int & last_button,
((vsplit ? split_height : total_height) +
m_itemVertSpacing + row_height > max_height))
{
VERBOSE(VB_GUI|VB_EXTRA,
LOG(VB_GUI, LOG_DEBUG,
QString("%1 Height exceeded %2 + (%3) + %4 = %5 which is > %6")
.arg(vsplit ? "Centering" : "Total")
.arg(split_height).arg(m_itemVertSpacing).arg(row_height)
Expand All @@ -356,7 +356,7 @@ bool MythUIButtonList::DistributeRow(int & first_button, int & last_button,
return false;
}

VERBOSE(VB_GUI|VB_EXTRA, QString("Added button item %1 width %2 height %3")
LOG(VB_GUI, LOG_DEBUG, QString("Added button item %1 width %2 height %3")
.arg(grow_right ? last_item : first_item)
.arg(width).arg(row_height));

Expand Down Expand Up @@ -419,7 +419,7 @@ bool MythUIButtonList::DistributeRow(int & first_button, int & last_button,
m_itemHorizSpacing + width > max_width)
{
int total = hsplit ? right_width : left_width + right_width;
VERBOSE(VB_GUI|VB_EXTRA,
LOG(VB_GUI, LOG_DEBUG,
QString("button on right would exceed width: "
"%1+(%2)+%3 == %4 which is > %5")
.arg(total).arg(m_itemHorizSpacing).arg(width)
Expand All @@ -437,7 +437,7 @@ bool MythUIButtonList::DistributeRow(int & first_button, int & last_button,
height = minButtonHeight(buttonstate->GetArea());
if (row_height < height)
row_height = height;
VERBOSE(VB_GUI|VB_EXTRA,
LOG(VB_GUI, LOG_DEBUG,
QString("Added button item %1 "
"r.width %2 height %3 total width %4+%5")
.arg(last_item).arg(width).arg(height)
Expand Down Expand Up @@ -485,7 +485,7 @@ bool MythUIButtonList::DistributeRow(int & first_button, int & last_button,
m_itemHorizSpacing + width > max_width)
{
int total = hsplit ? left_width : left_width + right_width;
VERBOSE(VB_GUI|VB_EXTRA,
LOG(VB_GUI, LOG_DEBUG,
QString("button on left would exceed width: "
"%1+(%2)+%3 == %4 which is > %5")
.arg(total).arg(m_itemHorizSpacing).arg(width)
Expand All @@ -504,7 +504,7 @@ bool MythUIButtonList::DistributeRow(int & first_button, int & last_button,
height = minButtonHeight(buttonstate->GetArea());
if (row_height < height)
row_height = height;
VERBOSE(VB_GUI|VB_EXTRA,
LOG(VB_GUI, LOG_DEBUG,
QString("Added button item %1 "
"l.width %2 height %3 total width %4+%5")
.arg(first_item).arg(width).arg(height)
Expand All @@ -525,9 +525,8 @@ bool MythUIButtonList::DistributeRow(int & first_button, int & last_button,
((vsplit ? split_height : total_height) +
m_itemVertSpacing + row_height > max_height))
{
VERBOSE(VB_GUI|VB_EXTRA,
QString("%1 Height exceeded %2 + (%3) + %4 = %5 "
"which is > %6")
LOG(VB_GUI, LOG_DEBUG,
QString("%1 Height exceeded %2 + (%3) + %4 = %5 which is > %6")
.arg(vsplit ? "Centering" : "Total")
.arg(split_height).arg(m_itemVertSpacing).arg(row_height)
.arg(split_height + m_itemVertSpacing + row_height)
Expand Down Expand Up @@ -733,7 +732,7 @@ bool MythUIButtonList::DistributeButtons(void)
col_widths = 0;
first_button = last_button = start_button = 0;

VERBOSE(VB_GUI|VB_EXTRA, QString("DistributeButtons: "
LOG(VB_GUI, LOG_DEBUG, QString("DistributeButtons: "
"selected item %1 total items %2")
.arg(start_item).arg(m_itemCount));

Expand Down Expand Up @@ -848,7 +847,7 @@ bool MythUIButtonList::DistributeButtons(void)

m_rows = row_heights.size();

VERBOSE(VB_GUI|VB_EXTRA,
LOG(VB_GUI, LOG_DEBUG,
QString("%1 rows, %2 columns fit inside parent area %3x%4")
.arg(m_rows).arg(m_columns).arg(m_contentsRect.width())
.arg(m_contentsRect.height()));
Expand Down Expand Up @@ -973,7 +972,7 @@ bool MythUIButtonList::DistributeButtons(void)
.arg(top_spacing).arg(bottom_spacing)
.arg(m_itemVertSpacing).arg(y);

VERBOSE(VB_GUI|VB_EXTRA, status_msg);
LOG(VB_GUI, LOG_DEBUG, status_msg);

/*
* Calculate width of buttons on each side of selected button
Expand Down Expand Up @@ -1089,7 +1088,7 @@ bool MythUIButtonList::DistributeButtons(void)
status_msg += QString(" spacing left %1 right %2 fixed %3 offset %4")
.arg(left_spacing).arg(right_spacing)
.arg(m_itemHorizSpacing).arg(x_init);
VERBOSE(VB_GUI|VB_EXTRA, status_msg);
LOG(VB_GUI, LOG_DEBUG, status_msg);

top_spacing += m_itemVertSpacing;
bottom_spacing += m_itemVertSpacing;
Expand Down Expand Up @@ -1613,8 +1612,8 @@ int MythUIButtonList::PageUp(void)
(realButton->GetCurrentState());
if (buttonstate == NULL)
{
VERBOSE(VB_IMPORTANT,
QString("PageUp: Failed to query buttonlist state"));
LOG(VB_GENERAL, LOG_ERR,
"PageUp: Failed to query buttonlist state");
return pos;
}
if (total + m_itemHorizSpacing +
Expand Down Expand Up @@ -1659,8 +1658,8 @@ int MythUIButtonList::PageUp(void)
(realButton->GetCurrentState());
if (buttonstate == NULL)
{
VERBOSE(VB_IMPORTANT,
QString("PageUp: Failed to query buttonlist state"));
LOG(VB_GENERAL, LOG_ERR,
"PageUp: Failed to query buttonlist state");
return pos;
}
if (total + m_itemHorizSpacing +
Expand Down Expand Up @@ -1708,8 +1707,8 @@ int MythUIButtonList::PageDown(void)
(realButton->GetCurrentState());
if (buttonstate == NULL)
{
VERBOSE(VB_IMPORTANT,
QString("PageDown: Failed to query buttonlist state"));
LOG(VB_GENERAL, LOG_ERR,
"PageDown: Failed to query buttonlist state");
return pos;
}
if (total + m_itemHorizSpacing +
Expand Down Expand Up @@ -1754,8 +1753,8 @@ int MythUIButtonList::PageDown(void)
(realButton->GetCurrentState());
if (buttonstate == NULL)
{
VERBOSE(VB_IMPORTANT,
QString("PageDown: Failed to query buttonlist state"));
LOG(VB_GENERAL, LOG_ERR,
"PageDown: Failed to query buttonlist state");
return pos;
}
if (total + m_itemHorizSpacing +
Expand Down Expand Up @@ -2034,8 +2033,8 @@ void MythUIButtonList::Init()

if (!m_buttontemplate)
{
VERBOSE(VB_IMPORTANT, QString("Statetype buttonitem is required in "
"mythuibuttonlist: %1")
LOG(VB_GENERAL, LOG_ERR, QString("Statetype buttonitem is required in "
"mythuibuttonlist: %1")
.arg(objectName()));
return;
}
Expand Down Expand Up @@ -2657,7 +2656,7 @@ MythUIButtonListItem::MythUIButtonListItem(MythUIButtonList* lbtype,
bool showArrow, int listPosition)
{
if (!lbtype)
VERBOSE(VB_IMPORTANT, "Cannot add a button to a non-existent list!");
LOG(VB_GENERAL, LOG_ERR, "Cannot add a button to a non-existent list!");

m_parent = lbtype;
m_text = text;
Expand All @@ -2680,7 +2679,7 @@ MythUIButtonListItem::MythUIButtonListItem(MythUIButtonList* lbtype,
QVariant data, int listPosition)
{
if (!lbtype)
VERBOSE(VB_IMPORTANT, "Cannot add a button to a non-existent list!");
LOG(VB_GENERAL, LOG_ERR, "Cannot add a button to a non-existent list!");

m_parent = lbtype;
m_text = text;
Expand Down Expand Up @@ -3036,7 +3035,7 @@ void MythUIButtonListItem::SetToRealButton(MythUIStateType *button, bool selecte

if (!buttonstate)
{
VERBOSE(VB_IMPORTANT, QString("Failed to query buttonlist state: %1")
LOG(VB_GENERAL, LOG_ERR, QString("Failed to query buttonlist state: %1")
.arg(state));
return;
}
Expand Down Expand Up @@ -3205,7 +3204,7 @@ bool SearchButtonListDialog::Create(void)

if (err)
{
VERBOSE(VB_IMPORTANT, "Cannot load screen 'MythSearchListDialog'");
LOG(VB_GENERAL, LOG_ERR, "Cannot load screen 'MythSearchListDialog'");
return false;
}

Expand Down
2 changes: 1 addition & 1 deletion mythtv/libs/libmythui/mythuibuttontree.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ void MythUIButtonTree::Init()

if (!m_listTemplate)
{
VERBOSE(VB_IMPORTANT, QString("MythUIButtonList listtemplate is "
LOG(VB_GENERAL, LOG_ERR, QString("MythUIButtonList listtemplate is "
"required in mythuibuttonlist: %1")
.arg(objectName()));
return;
Expand Down
8 changes: 4 additions & 4 deletions mythtv/libs/libmythui/mythuicheckbox.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,9 @@ void MythUICheckBox::SetInitialStates()
m_CheckState = dynamic_cast<MythUIStateType*>(GetChild("checkstate"));

if (!m_CheckState || !m_BackgroundState)
VERBOSE(VB_IMPORTANT, QString("Checkbox %1 is missing required "
"elements").arg(objectName()));
LOG(VB_GENERAL, LOG_ERR,
QString("Checkbox %1 is missing required elements")
.arg(objectName()));

if (m_CheckState)
m_CheckState->DisplayState(m_currentCheckState);
Expand Down Expand Up @@ -195,8 +196,7 @@ void MythUICheckBox::CopyFrom(MythUIType *base)
MythUICheckBox *button = dynamic_cast<MythUICheckBox *>(base);
if (!button)
{
VERBOSE(VB_IMPORTANT, "MythUICheckBox::CopyFrom: Dynamic cast of base "
"failed");
LOG(VB_GENERAL, LOG_ERR, "Dynamic cast of base failed");
return;
}

Expand Down
2 changes: 1 addition & 1 deletion mythtv/libs/libmythui/mythuiclock.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ void MythUIClock::CopyFrom(MythUIType *base)
MythUIClock *clock = dynamic_cast<MythUIClock *>(base);
if (!clock)
{
VERBOSE(VB_IMPORTANT, "ERROR, bad parsing");
LOG(VB_GENERAL, LOG_ERR, "ERROR, bad parsing");
return;
}

Expand Down
19 changes: 9 additions & 10 deletions mythtv/libs/libmythui/mythuifilebrowser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -219,8 +219,8 @@ bool MythUIFileBrowser::Create()

if (!m_fileList || !m_locationEdit || !m_okButton || !m_cancelButton)
{
VERBOSE(VB_IMPORTANT, "MythUIFileBrowser: Your theme is missing"
" some UI elements! Bailing out.");
LOG(VB_GENERAL, LOG_ERR, "MythUIFileBrowser: Your theme is missing"
" some UI elements! Bailing out.");
return false;
}

Expand Down Expand Up @@ -443,8 +443,8 @@ void MythUIFileBrowser::updateRemoteFileList()
.arg(m_subDirectory);
if (!GetRemoteFileList(m_baseDirectory, sgdir, sgdirlist))
{
VERBOSE(VB_IMPORTANT, "GetRemoteFileList failed to get "
"Storage Group dirs");
LOG(VB_GENERAL, LOG_ERR, "GetRemoteFileList failed to get "
"Storage Group dirs");
return;
}

Expand All @@ -458,8 +458,9 @@ void MythUIFileBrowser::updateRemoteFileList()

if (!GetRemoteFileList(dirURL, m_storageGroupDir, slist))
{
VERBOSE(VB_IMPORTANT, QString("GetRemoteFileList failed for "
"'%1' in '%2' SG dir").arg(dirURL).arg(m_storageGroupDir));
LOG(VB_GENERAL, LOG_ERR,
QString("GetRemoteFileList failed for '%1' in '%2' SG dir")
.arg(dirURL).arg(m_storageGroupDir));
return;
}

Expand Down Expand Up @@ -517,9 +518,7 @@ void MythUIFileBrowser::updateRemoteFileList()
QStringList tokens = (*it).split("::");
if (tokens.size() < 2)
{
VERBOSE(VB_IMPORTANT,
QString("MythUIFileBrowser::updateRemoteFileList(): ") +
QString("failed to parse '%1'.").arg(*it));
LOG(VB_GENERAL, LOG_ERR, QString("failed to parse '%1'.").arg(*it));
++it;
continue;
}
Expand Down Expand Up @@ -599,7 +598,7 @@ void MythUIFileBrowser::updateLocalFileList()

if (!d.exists())
{
VERBOSE(VB_IMPORTANT,
LOG(VB_GENERAL, LOG_ERR,
"MythUIFileBrowser: current directory does not exist!");
m_locationEdit->SetText("/");
m_subDirectory = "/";
Expand Down
8 changes: 4 additions & 4 deletions mythtv/libs/libmythui/mythuiguidegrid.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ bool MythUIGuideGrid::ParseElement(
*m_font = fontcopy;
}
else
VERBOSE(VB_IMPORTANT, LOC_ERR + "Unknown font: " + fontname);
LOG(VB_GENERAL, LOG_ERR, "Unknown font: " + fontname);
}
else if (element.tagName() == "recordstatus")
{
Expand Down Expand Up @@ -246,7 +246,7 @@ void MythUIGuideGrid::CopyFrom(MythUIType *base)
MythUIGuideGrid *gg = dynamic_cast<MythUIGuideGrid *>(base);
if (!gg)
{
VERBOSE(VB_IMPORTANT, LOC_ERR + "bad parsing");
LOG(VB_GENERAL, LOG_ERR, "bad parsing");
return;
}

Expand Down Expand Up @@ -575,7 +575,7 @@ bool MythUIGuideGrid::parseDefaultCategoryColors(QMap<QString, QString> &catColo
}
if (f.handle() == -1)
{
VERBOSE(VB_IMPORTANT, LOC_ERR + QString("Unable to open '%1'")
LOG(VB_GENERAL, LOG_ERR, QString("Unable to open '%1'")
.arg(f.fileName()));
return false;
}
Expand All @@ -587,7 +587,7 @@ bool MythUIGuideGrid::parseDefaultCategoryColors(QMap<QString, QString> &catColo

if (!doc.setContent(&f, false, &errorMsg, &errorLine, &errorColumn))
{
VERBOSE(VB_IMPORTANT, LOC_ERR +
LOG(VB_GENERAL, LOG_ERR,
QString("Parsing colors: %1 at line: %2 column: %3")
.arg(f.fileName()).arg(errorLine).arg(errorColumn) +
QString("\n\t\t\t%1").arg(errorMsg));
Expand Down
Loading