don't crash when exitting dvd image selection without selection
[enigma2.git] / lib / dvb / sec.h
index dba5565100fff7c68c871bf4c0ae2aca592df7b0..42e53ebe1b066cb7cda2941bc093a598d3fcf76a 100644 (file)
@@ -19,15 +19,21 @@ public:
                MEASURE_IDLE_INPUTPOWER, MEASURE_RUNNING_INPUTPOWER,
                IF_MEASURE_IDLE_WAS_NOT_OK_GOTO, IF_INPUTPOWER_DELTA_GOTO,
                UPDATE_CURRENT_ROTORPARAMS, INVALIDATE_CURRENT_ROTORPARMS,
+               UPDATE_CURRENT_SWITCHPARMS, INVALIDATE_CURRENT_SWITCHPARMS,
                IF_ROTORPOS_VALID_GOTO,
                IF_TUNER_LOCKED_GOTO,
                IF_TONE_GOTO, IF_NOT_TONE_GOTO,
-               START_TUNE_TIMEOUT
+               START_TUNE_TIMEOUT,
+               SET_ROTOR_MOVING,
+               SET_ROTOR_STOPPED
        };
        int cmd;
        struct rotor
        {
-               int deltaA;   // difference in mA between running and stopped rotor
+               union {
+                       int deltaA;   // difference in mA between running and stopped rotor
+                       int lastSignal;
+               };
                int okcount;  // counter
                int steps;    // goto steps
                int direction;
@@ -243,6 +249,7 @@ class eDVBRegisteredFrontend;
 
 class eDVBSatelliteEquipmentControl: public iDVBSatelliteEquipmentControl
 {
+       DECLARE_REF(eDVBSatelliteEquipmentControl);
 public:
        enum {
                DELAY_AFTER_CONT_TONE=0,  // delay after continuous tone change
@@ -256,6 +263,7 @@ public:
                DELAY_AFTER_ENABLE_VOLTAGE_BEFORE_MOTOR_CMD, // delay after enable voltage before transmit motor command
                DELAY_AFTER_MOTOR_STOP_CMD, // delay after transmit motor stop
                DELAY_AFTER_VOLTAGE_CHANGE_BEFORE_MOTOR_CMD, // delay after voltage change before transmit motor command
+               DELAY_BEFORE_SEQUENCE_REPEAT, // delay before the complete sequence is repeated (when enabled)
                MOTOR_COMMAND_RETRIES, // max transmit tries of rotor command when the rotor dont start turning (with power measurement)
                MOTOR_RUNNING_TIMEOUT, // max motor running time before timeout
                DELAY_AFTER_VOLTAGE_CHANGE_BEFORE_SWITCH_CMDS, // delay after change voltage before transmit toneburst/diseqc
@@ -264,12 +272,13 @@ public:
 private:
 #ifndef SWIG
        static eDVBSatelliteEquipmentControl *instance;
-       eDVBSatelliteLNBParameters m_lnbs[128]; // i think its enough
+       eDVBSatelliteLNBParameters m_lnbs[144]; // i think its enough
        int m_lnbidx; // current index for set parameters
        std::map<int, eDVBSatelliteSwitchParameters>::iterator m_curSat;
-       eSmartPtrList<eDVBRegisteredFrontend> &m_avail_frontends;
+       eSmartPtrList<eDVBRegisteredFrontend> &m_avail_frontends, &m_avail_simulate_frontends;
        bool m_rotorMoving;
        int m_not_linked_slot_mask;
+       bool m_canMeasureInputPower;
 #endif
 #ifdef SWIG
        eDVBSatelliteEquipmentControl();
@@ -278,10 +287,9 @@ private:
        static int m_params[MAX_PARAMS];
 public:
 #ifndef SWIG
-       eDVBSatelliteEquipmentControl(eSmartPtrList<eDVBRegisteredFrontend> &avail_frontends);
-       DECLARE_REF(eDVBSatelliteEquipmentControl);
-       RESULT prepare(iDVBFrontend &frontend, FRONTENDPARAMETERS &parm, const eDVBFrontendParametersSatellite &sat, int frontend_id);
-       int canTune(const eDVBFrontendParametersSatellite &feparm, iDVBFrontend *, int frontend_id);
+       eDVBSatelliteEquipmentControl(eSmartPtrList<eDVBRegisteredFrontend> &avail_frontends, eSmartPtrList<eDVBRegisteredFrontend> &avail_simulate_frontends);
+       RESULT prepare(iDVBFrontend &frontend, FRONTENDPARAMETERS &parm, const eDVBFrontendParametersSatellite &sat, int frontend_id, unsigned int tunetimeout);
+       int canTune(const eDVBFrontendParametersSatellite &feparm, iDVBFrontend *, int frontend_id, int *highest_score_lnb=0);
        bool currentLNBValid() { return m_lnbidx > -1 && m_lnbidx < (int)(sizeof(m_lnbs) / sizeof(eDVBSatelliteLNBParameters)); }
 #endif
        static eDVBSatelliteEquipmentControl *getInstance() { return instance; }
@@ -321,9 +329,9 @@ public:
        RESULT setTunerDepends(int from, int to);
        void setSlotNotLinked(int tuner_no);
 
-       PyObject *get_exclusive_satellites(int tu1, int tu2);
        void setRotorMoving(bool); // called from the frontend's
        bool isRotorMoving();
+       bool canMeasureInputPower() { return m_canMeasureInputPower; }
 };
 
 #endif