Ticket #7232: channelscan.patch

File channelscan.patch, 4.7 KB (added by mythtv@…, 10 years ago)
  • libs/libmythtv/dtvconfparserhelpers.h

     
    5454
    5555    operator int()                const { return value;          }
    5656    int operator=(int _value)           { return value = _value; }
    57     bool operator==(const int& v) const { return value == v;     }
    58     bool operator!=(const int& v) const { return value != v;     }
    5957
    6058  protected:
    6159    static bool ParseParam(const QString &symbol, int &value,
     
    7371    static const DTVParamHelperStruct parseTable[];
    7472
    7573  public:
    76     typedef enum
     74    enum
    7775    {
    7876        //                           Modulations which may be supported
    7977        kTunerTypeDVBS1   = 0x00, // QPSK
     
    104102        // reality some hardware does support multiple formats and this should
    105103        // be a mask. Also the transmission schemes used in Asia and South
    106104        // America are not represented here.
    107     } my_enum;
     105    };
    108106
    109     bool operator==(const my_enum& v) const { return value == (int) v; }
    110     bool operator!=(const my_enum& v) const { return value != (int) v; }
    111 
    112107    DTVTunerType(int _default = kTunerTypeUnknown)
    113         : DTVParamHelper(_default) { initStr(); }
     108        : DTVParamHelper(_default) { }
    114109
    115110    bool Parse(const QString &_value)
    116111        { return ParseParam(_value, value, parseTable); }
     
    137132
    138133    QString toString() const { return toString(value); }
    139134
    140     static void initStr(void);
    141135    static QString toString(int _value);
    142136};
    143137
  • libs/libmythtv/channelscan/channelscan_sm.cpp

     
    495495
    496496DTVTunerType ChannelScanSM::GuessDTVTunerType(DTVTunerType type) const
    497497{
    498     if (scanDTVTunerType != (int)DTVTunerType::kTunerTypeUnknown)
     498    if (scanDTVTunerType != DTVTunerType(DTVTunerType::kTunerTypeUnknown))
    499499        type = scanDTVTunerType;
    500500
    501501    const DTVChannel *chan = GetDTVChannel();
  • libs/libmythtv/dtvconfparserhelpers.cpp

     
    11
    2 #include <QMutex>
    3 #include <QMap>
    4 
    52#include "mythverbose.h"
    63#include "dtvconfparserhelpers.h"
    74
     
    3835    return strings[index];
    3936}
    4037
    41 static QMutex dtv_tt_canonical_str_lock;
    42 static QMap<int,QString> dtv_tt_canonical_str;
    43 void DTVTunerType::initStr(void)
    44 {
    45     QMutexLocker locker(&dtv_tt_canonical_str_lock);
    46     dtv_tt_canonical_str[kTunerTypeATSC]    = "ATSC";
    47     dtv_tt_canonical_str[kTunerTypeDVBT]    = "OFDM";
    48     dtv_tt_canonical_str[kTunerTypeDVBC]    = "QAM";
    49     dtv_tt_canonical_str[kTunerTypeDVBS1]   = "QPSK";
    50     dtv_tt_canonical_str[kTunerTypeDVBS2]   = "DVB_S2";
    51     dtv_tt_canonical_str[kTunerTypeUnknown] = "UNKNOWN";
    52 }
    53 
    5438QString DTVTunerType::toString(int _value)
    5539{
    56     QMutexLocker locker(&dtv_tt_canonical_str_lock);
    57     QMap<int,QString>::const_iterator it = dtv_tt_canonical_str.find(_value);
    58     if (it != dtv_tt_canonical_str.end())
    59         return *it;
    60     return dtv_tt_canonical_str[kTunerTypeUnknown];
     40    switch (_value){
     41    case kTunerTypeATSC:  return "ATSC";
     42    case kTunerTypeDVBT:  return "OFDM";
     43    case kTunerTypeDVBC:  return "QAM";
     44    case kTunerTypeDVBS1: return "QPSK";
     45    case kTunerTypeDVBS2: return "DVB_S2";
     46    default:              return "UNKNOWN";   
     47    }
    6148}
    6249
    6350const DTVParamHelperStruct DTVTunerType::parseTable[] =
  • libs/libmythtv/scanwizard.cpp

     
    148148
    149149    // Just verify what we get from the UI...
    150150    DTVMultiplex tuning;
    151     if ((parse_type != DTVTunerType::kTunerTypeUnknown) &&
     151    if ((parse_type != DTVTunerType(DTVTunerType::kTunerTypeUnknown)) &&
    152152        !tuning.ParseTuningParams(
    153153            parse_type,
    154154            start_chan["frequency"],      start_chan["inversion"],
  • libs/libmythtv/dtvchannel.cpp

     
    158158vector<DTVTunerType> DTVChannel::GetTunerTypes(void) const
    159159{
    160160    vector<DTVTunerType> tts;
    161     if (tunerType != DTVTunerType::kTunerTypeUnknown)
     161    if (tunerType != DTVTunerType(DTVTunerType::kTunerTypeUnknown))
    162162        tts.push_back(tunerType);
    163163    return tts;
    164164}