Ticket #1037: legacysw.patch
File legacysw.patch, 4.7 KB (added by , 18 years ago) |
---|
-
libs/libmythtv/videosource.cpp
1242 1242 addSelection("DiSEqC v1.2 Positioner","6"); 1243 1243 addSelection("DiSEqC v1.3 Positioner (Goto X)","7"); 1244 1244 addSelection("DiSEqC v1.1 or 2.1 (10-way method2)","8"); 1245 addSelection("SW21 Switch","9"); 1246 addSelection("SW64 Switch","10"); 1245 1247 setHelpText(QObject::tr("Select the input type for DVB-S cards. " 1246 1248 "Leave as Single LNB/Input for DVB-C or DVB-T. " 1247 1249 "The inputs are mapped from Input Connections option " … … 2404 2406 QString stxt = "DiSEqC Switch Input %1"; 2405 2407 QString mtxt = "DiSEqC v1.2 Motor Position %1"; 2406 2408 QString itxt = "DiSEqC v1.3 Input %1"; 2409 QString l21txt = "SW21 Input %1"; 2410 QString l64txt = "SW64 Input %1"; 2407 2411 2408 2412 uint i; 2409 2413 switch (dvb_diseqc_type) … … 2433 2437 list.append(DVBDiSEqCInputList( 2434 2438 stxt.arg(i+1,2), QString::number(i), "")); 2435 2439 break; 2440 case 9: 2441 for (i = 0; i < 2; ++i) 2442 list.append(DVBDiSEqCInputList( 2443 l21txt.arg(i+1,2), QString::number(i), "")); 2444 break; 2445 case 10: 2446 for (i = 0; i < 3; ++i) 2447 list.append(DVBDiSEqCInputList( 2448 l64txt.arg(i+1,2), QString::number(i), "")); 2449 break; 2436 2450 default: 2437 2451 list.append(DVBDiSEqCInputList( 2438 2452 QString("DVBInput"), QString(""), QString(""))); -
libs/libmythtv/dvbdiseqc.h
37 37 38 38 bool ToneVoltageLnb(DVBTuning& tuning, bool reset, bool& havetuned); 39 39 bool ToneSwitch(DVBTuning& tuning, bool reset, bool& havetuned); 40 bool LegacyDishSwitch(DVBTuning& tuning, bool reset, bool& havetuned); 40 41 bool Diseqc1xSwitch(DVBTuning& tuning, bool reset, bool& havetuned, 41 42 uint ports); 42 43 bool PositionerGoto(DVBTuning& tuning, bool reset, bool& havetuned); -
libs/libmythtv/dvbdiseqc.cpp
94 94 if (!Diseqc1xSwitch(tuning, reset, havetuned, 10)) 95 95 return false; 96 96 break; 97 case 9: // SW21 98 case 10: // SW64 99 if (!LegacyDishSwitch(tuning, reset, havetuned)) 100 return false; 101 break; 97 102 98 103 default: 99 104 VERBOSE(VB_IMPORTANT, LOC_ERR + "Unsupported DiSEqC type(" … … 103 108 return true; 104 109 } 105 110 111 bool DVBDiSEqC::LegacyDishSwitch(DVBTuning& tuning, bool reset, 112 bool& havetuned) 113 { 114 if (reset) 115 { 116 //Do legacy switches need to be reset? 117 } 118 GENERAL(QString("Legacy Dish Switch - Port %1").arg(tuning.diseqc_port)); 119 if ((prev_tuning.diseqc_port != tuning.diseqc_port || 120 prev_tuning.tone != tuning.tone || 121 prev_tuning.voltage != tuning.voltage) || reset) 122 { 123 124 uint8_t cmd = 0x00; 125 126 switch(tuning.diseqc_type) { 127 //is there a pattern here? 128 case 9: //SW21 129 if(! tuning.diseqc_port) 130 cmd=0x34; 131 else 132 cmd=0x65; 133 break; 134 case 10: //SW64 135 if(tuning.diseqc_port == 0) 136 if(tuning.voltage == SEC_VOLTAGE_13) 137 cmd=0x39; 138 else 139 cmd=0x1A; 140 else if(tuning.diseqc_port == 1) 141 if(tuning.voltage == SEC_VOLTAGE_13) 142 cmd=0x4B; 143 else 144 cmd=0x5C; 145 else 146 if(tuning.voltage == SEC_VOLTAGE_13) 147 cmd=0x0D; 148 else 149 cmd=0x2E; 150 break; 151 } 152 if(tuning.voltage == SEC_VOLTAGE_18) 153 cmd|=0x80; 154 155 #ifdef FE_DISHNETWORK_SEND_LEGACY_CMD 156 if (ioctl(fd_frontend, FE_DISHNETWORK_SEND_LEGACY_CMD, cmd) <0) 157 { 158 ERRNO("Setup: Sending init command failed."); 159 return false; 160 } 161 #else 162 VERBOSE(VB_IMPORTANT, "Kernel does not support Legacy Dish Switch!"); 163 #endif 164 usleep(DISEQC_SHORT_WAIT); 165 166 prev_tuning.diseqc_port = tuning.diseqc_port; 167 prev_tuning.tone = tuning.tone; 168 prev_tuning.voltage = tuning.voltage; 169 havetuned = true; 170 } 171 return true; 172 } 173 106 174 /***************************************************************************** 107 175 Backward Compatible Methods 108 176 ****************************************************************************/