Ticket #5863: min_comm_skip.diff

File min_comm_skip.diff, 5.9 KB (added by Wolfgang <mythtv@…>, 16 years ago)
  • i18n/mythfrontend_de.ts

     
    83928392        <translation>Bestimmt die Methode mit der MyhTV den Beginn und das Ende eines Werbeblocks sucht.</translation>
    83938393    </message>
    83948394    <message>
     8395        <source>Minimum commercial skip (in seconds)</source>
     8396        <translation>Minimale Werbeblock SprunglÀnge (in Sek.)</translation>
     8397    </message>
     8398    <message>
    83958399        <source>Maximum commercial skip (in seconds)</source>
    83968400        <translation>Maximale Werbeblock SprunglÀnge (in Sek.)</translation>
    83978401    </message>
     
    90169020        <translation>Das Audio-AusgabegerÀt um AC3- und DTS-Ton durchzuleiten. Bei &quot;Standard&quot; wird das &quot;Audio-AusgabegerÀt&quot; verwendet. Diese Einstellung kann momentan nur bei Tonausgabe ÃŒber ALSA genutzt werden.</translation>
    90179021    </message>
    90189022    <message>
     9023        <source>Commercial skipping will only skip commercials longer than this limit. This will also affect automatic commercial skipping.</source>
     9024        <translation>WerbeblocksprÃŒnge werden nur ausgefÃŒhrt fÃŒr Werbeblöcke die lÀnger als das Limit sind. Dies betrifft auch automatische WerbeblocksprÃŒnge.</translation>
     9025    </message>
     9026    <message>
    90199027        <source>MythTV will discourage long manual commercial skips.  Skips which are longer than this will require the user to hit the SKIP key twice.  Automatic commercial skipping is not affected by this limit.</source>
    90209028        <translation>MythTV wird von langen manuellen WerbeblocksprÃŒngen Abstand nehmen. WerbesprÃŒnge, die lÀnger als dieser Wert sind, mÃŒssen mit einem weiteren Tastendruck (SKIP-Taste) wiederholt werden. Automatische WerbesprÃŒnge sind hiervon nicht betroffen.</translation>
    90219029    </message>
  • libs/libmythtv/NuppelVideoPlayer.cpp

     
    61706170                    .arg(framesPlayed).arg(commBreakIter.key()));
    61716171
    61726172            ++commBreakIter;
     6173                   
     6174            int minskip = gContext->GetNumSetting("MinimumCommercialSkip", 180);
     6175            int skipped_seconds = (int)((commBreakIter.key() -
     6176                    framesPlayed) / video_frame_rate);
    61736177
    61746178            MergeShortCommercials();
    61756179           
    6176             if (commBreakIter == commBreakMap.end())
     6180            if (abs(skipped_seconds) <= minskip)
    61776181            {
     6182                VERBOSE(VB_COMMFLAG, LOC + "AutoCommercialSkip(), "
     6183                        "skipped_seconds smaller than minskip, will not skip.");
     6184
     6185                if (osd)
     6186                {
     6187                    QString comm_msg;
     6188                    QString skipTime;
     6189                    skipTime.sprintf("%d:%02d", skipped_seconds / 60,
     6190                                     abs(skipped_seconds) % 60);
     6191                    comm_msg = QString(QObject::tr("Too Far %1"))
     6192                                       .arg(skipTime);
     6193                    struct StatusPosInfo posInfo;
     6194                    calcSliderPos(posInfo);
     6195                    osd->ShowStatus(posInfo, false, comm_msg, 2);
     6196                }
     6197            }
     6198            else if (commBreakIter == commBreakMap.end())
     6199            {
    61786200                VERBOSE(VB_COMMFLAG, LOC + "AutoCommercialSkip(), at "
    61796201                        "end of commercial break list, will not skip.");
    61806202            }
     
    61986220                if (osd)
    61996221                {
    62006222                    QString comm_msg;
    6201                     int skipped_seconds = (int)((commBreakIter.key() -
    6202                             framesPlayed) / video_frame_rate);
    62036223                    QString skipTime;
    62046224                    skipTime.sprintf("%d:%02d", skipped_seconds / 60,
    62056225                                     abs(skipped_seconds) % 60);
     
    63866406    {
    63876407        int skipped_seconds = (int)((commBreakIter.key() -
    63886408                framesPlayed) / video_frame_rate);
     6409        int minskip = gContext->GetNumSetting("MinimumCommercialSkip", 0);
    63896410        int maxskip = gContext->GetNumSetting("MaximumCommercialSkip", 3600);
    63906411        QString skipTime;
    63916412        skipTime.sprintf("%d:%02d", skipped_seconds / 60,
     
    63936414        struct StatusPosInfo posInfo;
    63946415        calcSliderPos(posInfo);
    63956416        if ((lastIgnoredManualSkip.secsTo(QDateTime::currentDateTime()) > 3) &&
    6396             (abs(skipped_seconds) >= maxskip))
     6417            ((abs(skipped_seconds) <= minskip) ||
     6418            (abs(skipped_seconds) >= maxskip)))
    63976419        {
    63986420            osd->ShowStatus(posInfo, false,
    63996421                            QObject::tr("Too Far %1").arg(skipTime), 2);
  • programs/mythfrontend/globalsettings.cpp

     
    574574    return gs;
    575575}
    576576
     577static GlobalSpinBox *MinimumCommercialSkip()
     578{
     579    GlobalSpinBox *bs = new GlobalSpinBox("MinimumCommercialSkip", 0, 3600, 10);
     580    bs->setLabel(QObject::tr("Minimum commercial skip (in seconds)"));
     581    bs->setHelpText(QObject::tr("Commercial skipping will only skip commercials "
     582                    "longer than this limit. This will also affect automatic "
     583                    "commercial skipping."));
     584    bs->setValue(0);
     585    return bs;
     586}
     587
    577588static GlobalSpinBox *MaximumCommercialSkip()
    578589{
    579590    GlobalSpinBox *bs = new GlobalSpinBox("MaximumCommercialSkip", 0, 3600, 10);
     
    47484759    comms->addChild(AutoCommercialSkip());
    47494760    comms->addChild(CommRewindAmount());
    47504761    comms->addChild(CommNotifyAmount());
     4762    comms->addChild(MinimumCommercialSkip());
    47514763    comms->addChild(MaximumCommercialSkip());
    47524764    comms->addChild(MergeShortCommBreaks());
    47534765    comms->addChild(CommSkipAllBlanks());