Skip to content

Commit

Permalink
TV: Create an Advanced menu option in the OSD Video menu.
Browse files Browse the repository at this point in the history
Create the new menu item, move the video scan selection into the new
menu (most users will never need to touch this) and create a new
additional sub-menu to override the current deinterlacer.

The deinterlacer selection is disabled for the time being until
MythPlayer is re-factored a little to better deal with customising the
deinterlacer. Currently, selecting a new deinterlacer will not change,
for example, whether the player runs at double rate or not.
  • Loading branch information
Mark Kendall committed Apr 7, 2011
1 parent 7270f8a commit f20739a
Show file tree
Hide file tree
Showing 2 changed files with 66 additions and 5 deletions.
68 changes: 63 additions & 5 deletions mythtv/libs/libmythtv/tv_play.cpp
Expand Up @@ -9394,6 +9394,8 @@ void TV::OSDDialogEvent(int result, QString text, QString action)
; // exit dialog
else if (HandleTrackAction(actx, action))
;
else if (action.startsWith("DEINTERLACER"))
HandleDeinterlacer(actx, action);
else if (action == "TOGGLEMANUALZOOM")
SetManualZoom(actx, true, tr("Zoom Mode ON"));
else if (action == "TOGGLESTRETCH")
Expand Down Expand Up @@ -9813,9 +9815,8 @@ void TV::FillOSDMenuVideo(const PlayerContext *ctx, OSD *osd,
selected == "ADJUSTPICTURE");
}
}
osd->DialogAddButton(tr("Video Scan"),
"DIALOG_MENU_VIDEOSCAN_0", true,
selected == "VIDEOSCAN");
osd->DialogAddButton(tr("Advanced"), "DIALOG_MENU_ADVANCEDVIDEO_0",
true, selected == "ADVANCEDVIDEO");
}
else if (category == "VIDEOASPECT")
{
Expand Down Expand Up @@ -9872,11 +9873,56 @@ void TV::FillOSDMenuVideo(const PlayerContext *ctx, OSD *osd,
}
}
}
else if (category == "VIDEOSCAN")
else if (category == "ADVANCEDVIDEO")
{
osd->DialogAddButton(tr("Video Scan"),
"DIALOG_MENU_VIDEOSCAN_0", true,
selected == "VIDEOSCAN");
/*
if (kScan_Progressive != scan_type)
{
osd->DialogAddButton(tr("Deinterlacer"),
"DIALOG_MENU_DEINTERLACER_0", true,
selected == "DEINTERLACER");
}
*/
backaction = "VIDEO";
currenttext = tr("Video Scan");
currenttext = tr("Advanced");
}
else if (category == "DEINTERLACER")
{
backaction = "ADVANCEDVIDEO";
currenttext = tr("Deinterlacer");

QStringList deinterlacers;
QString currentdeinterlacer;
bool doublerate = false;
ctx->LockDeletePlayer(__FILE__, __LINE__);
if (ctx->player && ctx->player->getVideoOutput())
{
ctx->player->getVideoOutput()->GetDeinterlacers(deinterlacers);
currentdeinterlacer = ctx->player->getVideoOutput()->GetDeinterlacer();
doublerate = ctx->player->CanSupportDoubleRate();
}
ctx->UnlockDeletePlayer(__FILE__, __LINE__);

foreach (QString deint, deinterlacers)
{
if ((deint.contains("doublerate") ||
deint.contains("doubleprocess") ||
deint.contains("bobdeint")) && !doublerate)
{
continue;
}
QString trans = VideoDisplayProfile::GetDeinterlacerName(deint);
osd->DialogAddButton(trans, "DEINTERLACER_" + deint, false,
deint == currentdeinterlacer);
}
}
else if (category == "VIDEOSCAN")
{
backaction = "ADVANCEDVIDEO";
currenttext = tr("Video Scan");

QString cur_mode = "";
if (!scan_type_locked)
Expand Down Expand Up @@ -10713,6 +10759,18 @@ void TV::FillOSDMenuJumpRec(PlayerContext* ctx, const QString category,
ReturnOSDLock(ctx, osd);
}

void TV::HandleDeinterlacer(PlayerContext *ctx, const QString &action)
{
if (!action.startsWith("DEINTERLACER"))
return;

QString deint = action.mid(13);
ctx->LockDeletePlayer(__FILE__, __LINE__);
if (ctx->player && ctx->player->getVideoOutput())
ctx->player->getVideoOutput()->SetupDeinterlace(true, deint);
ctx->UnlockDeletePlayer(__FILE__, __LINE__);
}

void TV::ToggleAutoExpire(PlayerContext *ctx)
{
QString desc = QString::null;
Expand Down
3 changes: 3 additions & 0 deletions mythtv/libs/libmythtv/tv_play.h
Expand Up @@ -612,6 +612,9 @@ class MTV_PUBLIC TV : public QObject

void ITVRestart(PlayerContext*, bool isLive);

// Deinterlacer handling
void HandleDeinterlacer(PlayerContext* ctx, const QString &action);

// DVD methods
void DVDJumpBack(PlayerContext*);
void DVDJumpForward(PlayerContext*);
Expand Down

0 comments on commit f20739a

Please sign in to comment.