File indexing completed on 2024-05-12 04:52:10

0001 /*
0002  * dvbconfig.h
0003  *
0004  * Copyright (C) 2007-2011 Christoph Pfister <christophpfister@gmail.com>
0005  *
0006  * This program is free software; you can redistribute it and/or modify
0007  * it under the terms of the GNU General Public License as published by
0008  * the Free Software Foundation; either version 2 of the License, or
0009  * (at your option) any later version.
0010  *
0011  * This program is distributed in the hope that it will be useful,
0012  * but WITHOUT ANY WARRANTY; without even the implied warranty of
0013  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
0014  * GNU General Public License for more details.
0015  *
0016  * You should have received a copy of the GNU General Public License along
0017  * with this program; if not, write to the Free Software Foundation, Inc.,
0018  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
0019  */
0020 
0021 #ifndef DVBCONFIG_H
0022 #define DVBCONFIG_H
0023 
0024 #include <QSharedData>
0025 #include <QString>
0026 
0027 #include "dvbbackenddevice.h"
0028 
0029 class DvbConfigBase : public QSharedData
0030 {
0031 public:
0032     enum TransmissionType
0033     {
0034         DvbC = 0,
0035         DvbS = 1,
0036         DvbT = 2,
0037         Atsc = 3,
0038         IsdbT = 4,
0039         TransmissionTypeMax = IsdbT
0040     };
0041 
0042     explicit DvbConfigBase(TransmissionType transmissionType_) : transmissionType(transmissionType_) { }
0043     ~DvbConfigBase() { }
0044 
0045     TransmissionType getTransmissionType() const
0046     {
0047         return transmissionType;
0048     }
0049 
0050     QString name;
0051     QString scanSource;
0052     int timeout; // tuning timeout (ms)
0053     int numberOfTuners;
0054 
0055     // only used for Satellite
0056 
0057     enum Configuration
0058     {
0059         DiseqcSwitch = 0,
0060         UsalsRotor = 1,
0061         PositionsRotor = 2,
0062         NoDiseqc = 3,
0063         ConfigurationMax = NoDiseqc
0064     };
0065 
0066     Configuration configuration;
0067 
0068     struct lnbSat currentLnb;
0069     int lnbNumber;         // corresponds to diseqc switch position (0 = first sat etc)
0070                    // or to rotor position (0 = first position etc)
0071     int bpf;        // Bandpass Frequency for SCR/Unicable
0072 
0073     int latitude, longitude; // degrees - needed for Usals rotor
0074     int higherVoltage;  // Use a higher voltage to compensate cable loss
0075                 // Qt::PartiallyChecked: don't use the ioctl
0076                 // Qt::Unchecked: normal voltage (13V/18V)
0077                 // Qt::Checked: higher voltages (typically: 14V/19V)
0078 
0079 private:
0080     TransmissionType transmissionType;
0081 };
0082 
0083 class DvbConfig : public QSharedDataPointer<DvbConfigBase>
0084 {
0085 public:
0086     explicit DvbConfig(DvbConfigBase *config = NULL) :
0087         QSharedDataPointer<DvbConfigBase>(config) { }
0088     ~DvbConfig() { }
0089 };
0090 
0091 Q_DECLARE_TYPEINFO(DvbConfig, Q_MOVABLE_TYPE);
0092 
0093 #endif /* DVBCONFIG_H */