Skip to content

Commit

Permalink
tidy: Convert the HideOSDWindow macro into a class function.
Browse files Browse the repository at this point in the history
Had to add a semicolon after every reference to this function.
  • Loading branch information
linuxdude42 committed Jul 10, 2022
1 parent 16a3c0c commit 71e1ab2
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 13 deletions.
28 changes: 15 additions & 13 deletions mythtv/libs/libmythtv/tv_play.cpp
Expand Up @@ -81,12 +81,6 @@

#define LOC QString("TV::%1(): ").arg(__func__)

#define HideOSDWindow(WINDOW) { \
OSD *osd = GetOSDL(); \
if (osd) \
osd->HideWindow(WINDOW); \
ReturnOSDLock(); }

/**
* \brief If any cards are configured, return the number.
*/
Expand Down Expand Up @@ -5703,7 +5697,7 @@ QString TV::GetQueuedChanNum() const
void TV::ClearInputQueues(bool Hideosd)
{
if (Hideosd)
HideOSDWindow(OSD_WIN_INPUT)
HideOSDWindow(OSD_WIN_INPUT);

m_queuedInput = "";
m_queuedChanNum = "";
Expand Down Expand Up @@ -5869,7 +5863,7 @@ bool TV::CommitQueuedInput()
if (chanid)
BrowseChannel(channum);

HideOSDWindow(OSD_WIN_INPUT)
HideOSDWindow(OSD_WIN_INPUT);
}
else if (GetQueuedChanID() || !channum.isEmpty())
{
Expand Down Expand Up @@ -5924,7 +5918,7 @@ void TV::ChangeChannel(ChannelChangeDirection Direction)

if (ContextIsPaused(__FILE__, __LINE__))
{
HideOSDWindow(OSD_WIN_STATUS)
HideOSDWindow(OSD_WIN_STATUS);
MythMainWindow::DisableScreensaver();
}

Expand Down Expand Up @@ -6087,7 +6081,7 @@ void TV::ChangeChannel(uint Chanid, const QString &Channum)

if (ContextIsPaused(__FILE__, __LINE__))
{
HideOSDWindow(OSD_WIN_STATUS)
HideOSDWindow(OSD_WIN_STATUS);
MythMainWindow::DisableScreensaver();
}

Expand Down Expand Up @@ -6126,7 +6120,7 @@ void TV::ChangeChannel(const ChannelInfoList &Options)
if (chanid && !channum.isEmpty() && IsTunablePriv(chanid))
{
// hide the channel number, activated by certain signal monitors
HideOSDWindow(OSD_WIN_INPUT)
HideOSDWindow(OSD_WIN_INPUT);
m_queuedInput = channum;
m_queuedChanNum = channum;
m_queuedChanID = chanid;
Expand Down Expand Up @@ -6173,7 +6167,7 @@ void TV::PopPreviousChannel(bool ImmediateChange)
if (ImmediateChange)
{
// Turn off OSD Channel Num so the channel changes right away
HideOSDWindow(OSD_WIN_INPUT)
HideOSDWindow(OSD_WIN_INPUT);
}
}

Expand Down Expand Up @@ -6554,6 +6548,14 @@ bool TV::CalcPlayerSliderPosition(osdInfo &info, bool paddedFields) const
return result;
}

void TV::HideOSDWindow(const char *window)
{
OSD *osd = GetOSDL();
if (osd)
osd->HideWindow(window);
ReturnOSDLock();
}

void TV::UpdateLCD()
{
// Make sure the LCD information gets updated shortly
Expand Down Expand Up @@ -8184,7 +8186,7 @@ void TV::OSDDialogEvent(int Result, const QString& Text, QString Action)

// Turn off OSD Channel Num so the channel
// changes right away
HideOSDWindow(OSD_WIN_INPUT)
HideOSDWindow(OSD_WIN_INPUT);
}
}
}
Expand Down
1 change: 1 addition & 0 deletions mythtv/libs/libmythtv/tv_play.h
Expand Up @@ -421,6 +421,7 @@ class MTV_PUBLIC TV : public TVPlaybackState, public MythTVMenuItemDisplayer, pu
void UpdateOSDSignal(const QStringList &List);
void UpdateOSDTimeoutMessage();
bool CalcPlayerSliderPosition(osdInfo &info, bool paddedFields = false) const;
void HideOSDWindow(const char *window);

// Captions/subtitles
bool SubtitleZoomHandleAction(const QStringList& Actions);
Expand Down

0 comments on commit 71e1ab2

Please sign in to comment.