Skip to content
Browse files

TV: Create an Advanced menu option in the OSD Video menu.

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...
1 parent 7270f8a commit f20739acba30eb83f638b5db22dad80b70da0857 Mark Kendall committed Apr 7, 2011
Showing with 66 additions and 5 deletions.
  1. +63 −5 mythtv/libs/libmythtv/tv_play.cpp
  2. +3 −0 mythtv/libs/libmythtv/tv_play.h
View
68 mythtv/libs/libmythtv/tv_play.cpp
@@ -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")
@@ -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")
{
@@ -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)
@@ -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;
View
3 mythtv/libs/libmythtv/tv_play.h
@@ -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*);

0 comments on commit f20739a

Please sign in to comment.
Something went wrong with that request. Please try again.