Skip to content

Commit

Permalink
Subtitles: Make AVSubs zoom factor persistent.
Browse files Browse the repository at this point in the history
Most DVD/BD subtitles are consistently sized, so it makes sense to
save the zoom factor back to the database for next time.  Since there
is no relationship between text font sizes and AVSub sizes, separate
zoom settings are maintained for text subtitles (OSDCC708TextZoom) and
AV subtitles (OSDAVSubZoom).
  • Loading branch information
stichnot committed May 22, 2012
1 parent 53f7a1d commit 62ba11a
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions mythtv/libs/libmythtv/subtitlescreen.cpp
Expand Up @@ -575,6 +575,7 @@ void SubtitleScreen::EnableSubtitles(int type, bool forced_only)
ClearAllSubtitles();
SetVisible(m_subtitleType != kDisplayNone);
SetArea(MythRect());
m_textFontZoom = gCoreContext->GetNumSetting("OSDCC708TextZoom", 100);
switch (m_subtitleType)
{
case kDisplayTextSubtitle:
Expand All @@ -589,9 +590,10 @@ void SubtitleScreen::EnableSubtitles(int type, bool forced_only)
break;
case kDisplayAVSubtitle:
m_family = kSubFamilyAV;
m_textFontZoom = m_textFontZoomPrev = 100;
m_textFontZoom = gCoreContext->GetNumSetting("OSDAVSubZoom", 100);
break;
}
m_textFontZoomPrev = m_textFontZoom;
}

void SubtitleScreen::DisableForcedSubtitles(void)
Expand All @@ -617,8 +619,6 @@ bool SubtitleScreen::Create(void)
LOG(VB_GENERAL, LOG_WARNING, LOC + "Failed to get CEA-608 reader.");
if (!m_708reader)
LOG(VB_GENERAL, LOG_WARNING, LOC + "Failed to get CEA-708 reader.");
m_textFontZoom = gCoreContext->GetNumSetting("OSDCC708TextZoom", 100);
m_textFontZoomPrev = m_textFontZoom;

return true;
}
Expand Down Expand Up @@ -1395,10 +1395,10 @@ MythFontProperties* SubtitleScreen::GetFont(CC708CharacterAttribute attr,
void SubtitleScreen::SetZoom(int percent)
{
m_textFontZoom = percent;
if (m_family != kSubFamilyAV)
{
if (m_family == kSubFamilyAV)
gCoreContext->SaveSetting("OSDAVSubZoom", percent);
else
gCoreContext->SaveSetting("OSDCC708TextZoom", percent);
}
}

int SubtitleScreen::GetZoom(void)
Expand Down

0 comments on commit 62ba11a

Please sign in to comment.