1
#! /bin/sh /usr/share/dpatch/dpatch-run
2
## video_device_symlinks.dpatch by Mario Limonciello <superm1@ubuntu.com>
4
## All lines beginning with `## DP:' are a description of the patch.
8
diff -urNad mythtv-0.20.1+fixes13837~/libs/libmythtv/videosource.cpp mythtv-0.20.1+fixes13837/libs/libmythtv/videosource.cpp
9
--- mythtv-0.20.1+fixes13837~/libs/libmythtv/videosource.cpp 2007-07-18 01:20:07.000000000 -0500
10
+++ mythtv-0.20.1+fixes13837/libs/libmythtv/videosource.cpp 2007-07-20 00:12:29.000000000 -0500
12
QString VSSetting::whereClause(MSqlBindings& bindings)
14
QString sourceidTag(":WHERESOURCEID");
17
QString query("sourceid = " + sourceidTag);
19
bindings.insert(sourceidTag, parent.getSourceID());
21
QString sourceidTag(":SETSOURCEID");
22
QString colTag(":SET" + getColumn().upper());
24
- QString query("sourceid = " + sourceidTag + ", " +
25
+ QString query("sourceid = " + sourceidTag + ", " +
26
getColumn() + " = " + colTag);
28
bindings.insert(sourceidTag, parent.getSourceID());
30
QString CCSetting::whereClause(MSqlBindings& bindings)
32
QString cardidTag(":WHERECARDID");
35
QString query("cardid = " + cardidTag);
37
bindings.insert(cardidTag, parent.getCardID());
42
-FreqTableSelector::FreqTableSelector(const VideoSource& parent)
43
+FreqTableSelector::FreqTableSelector(const VideoSource& parent)
44
: VSSetting(parent, "freqtable")
46
setLabel(QObject::tr("Channel frequency table"));
49
void DataDirectLineupSelector::fillSelections(const QString &uid,
57
DataDirectProcessor ddp(_source, uid, pwd);
58
QString waitMsg = tr("Fetching lineups from %1...")
59
.arg(ddp.GetListingsProviderName());
62
VERBOSE(VB_GENERAL, waitMsg);
63
MythProgressDialog pdlg(waitMsg, 2);
66
#endif // USING_BACKEND
69
-void DataDirect_config::load()
70
+void DataDirect_config::load()
72
VerticalConfigurationGroup::load();
73
- if ((userid->getValue() != lastloadeduserid) ||
74
- (password->getValue() != lastloadedpassword))
75
+ if ((userid->getValue() != lastloadeduserid) ||
76
+ (password->getValue() != lastloadedpassword))
78
- lineupselector->fillSelections(userid->getValue(),
79
+ lineupselector->fillSelections(userid->getValue(),
82
lastloadeduserid = userid->getValue();
84
DataDirect_config::DataDirect_config(const VideoSource& _parent, int _source) :
85
ConfigurationGroup(false, false, false, false),
86
VerticalConfigurationGroup(false, false, false, false),
93
userid->getValue(), password->getValue(), source);
96
-XMLTV_generic_config::XMLTV_generic_config(const VideoSource& _parent,
97
+XMLTV_generic_config::XMLTV_generic_config(const VideoSource& _parent,
99
ConfigurationGroup(false, false, false, false),
100
VerticalConfigurationGroup(false, false, false, false),
101
- parent(_parent), grabber(_grabber)
102
+ parent(_parent), grabber(_grabber)
104
TransLabelSetting *label = new TransLabelSetting();
105
label->setLabel(grabber);
107
"instead of just 'mythfilldatabase'.\nYour grabber does not provide "
108
"channel numbers, so you have to set them manually.");
110
- if (grabber == "tv_grab_de_tvtoday" || grabber == "tv_grab_se_swedb" ||
111
+ if (grabber == "tv_grab_de_tvtoday" || grabber == "tv_grab_se_swedb" ||
112
grabber == "tv_grab_fi" || grabber == "tv_grab_es" ||
113
grabber == "tv_grab_es_laguiatv" ||
114
grabber == "tv_grab_nl" || grabber == "tv_grab_jp" ||
116
gContext->GetMainWindow(), QObject::tr("Warning."), err_msg);
119
- pdlg.setProgress( 2 );
120
+ pdlg.setProgress( 2 );
124
@@ -370,10 +370,10 @@
126
// only save settings for the selected grabber
130
addTarget("datadirect", new DataDirect_config(parent));
131
grabber->addSelection("North America (DataDirect)", "datadirect");
134
addTarget("eitonly", new EITOnly_config(parent));
135
grabber->addSelection("Transmitted guide only (EIT)", "eitonly");
138
grabber->addSelection("No grabber", "/bin/true");
141
-VideoSource::VideoSource()
142
+VideoSource::VideoSource()
145
addChild(id = new ID());
150
-bool VideoSourceEditor::cardTypesInclude(const int &sourceID,
151
- const QString &thecardtype)
152
+bool VideoSourceEditor::cardTypesInclude(const int &sourceID,
153
+ const QString &thecardtype)
155
MSqlQuery query(MSqlQuery::InitCon());
156
query.prepare("SELECT count(cardtype)"
161
-void VideoSource::fillSelections(SelectSetting* setting)
162
+void VideoSource::fillSelections(SelectSetting* setting)
164
MSqlQuery result(MSqlQuery::InitCon());
165
result.prepare("SELECT name, sourceid FROM videosource;");
170
-void VideoSource::loadByID(int sourceid)
171
+void VideoSource::loadByID(int sourceid)
173
id->setValue(sourceid);
176
: PathSetting(true), CCSetting(parent, "videodevice")
178
setLabel(QObject::tr("Video device"));
179
+ //Ubuntu specific udev patches allow for this
180
+ // /dev/v4l/by-path/video*
181
+ QDir dev("/dev/v4l/by-path", QString::null, QDir::Name, QDir::System);
182
+ fillSelectionsFromDir(dev, minor_min, minor_max,
183
+ card, driver, false);
187
QDir dev("/dev/v4l", "video*", QDir::Name, QDir::System);
188
fillSelectionsFromDir(dev, minor_min, minor_max,
190
fillSelectionsFromDir(dev, minor_min, minor_max,
191
card, driver, false);
196
dev.setPath("/dev/dtv");
197
fillSelectionsFromDir(dev, minor_min, minor_max,
199
dev.setNameFilter("dtv*");
200
fillSelectionsFromDir(dev, minor_min, minor_max,
201
card, driver, false);
205
uint fillSelectionsFromDir(const QDir& dir,
206
uint minor_min, uint minor_max,
208
const QFileInfoList *il = dir.entryInfoList();
213
QFileInfoListIterator it( *il );
217
addSelection(QObject::tr("Other"));
218
addSelection("DCT-6200");
219
addSelection("SA3250HD");
220
- addSelection("SA4200HD");
221
+ addSelection("SA4200HD");
222
QString help = QObject::tr(
223
"Choose the model that most closely resembles your set top box. "
224
"Depending on firmware revision SA4200HD may work better for a "
225
@@ -1245,8 +1253,8 @@
227
setTrigger(cardtype);
234
addTarget("V4L", new V4LConfigurationGroup(parent));
235
addTarget("HDTV", new pcHDTVConfigurationGroup(parent));
236
@@ -1280,13 +1288,13 @@
237
#endif // USING_FREEBOX
240
-void CaptureCardGroup::triggerChanged(const QString& value)
241
+void CaptureCardGroup::triggerChanged(const QString& value)
243
QString own = (value == "MJPEG" || value == "GO7007") ? "V4L" : value;
244
TriggeredConfigurationGroup::triggerChanged(own);
247
-CaptureCard::CaptureCard(bool use_card_group)
248
+CaptureCard::CaptureCard(bool use_card_group)
251
addChild(id = new ID());
252
@@ -1301,12 +1309,12 @@
253
parentid->setValue(QString::number(id));
256
-void CaptureCard::fillSelections(SelectSetting* setting)
257
+void CaptureCard::fillSelections(SelectSetting* setting)
259
CaptureCard::fillSelections(setting, false);
262
-void CaptureCard::fillSelections(SelectSetting* setting, bool no_children)
263
+void CaptureCard::fillSelections(SelectSetting* setting, bool no_children)
265
MSqlQuery query(MSqlQuery::InitCon());
267
@@ -1338,14 +1346,14 @@
271
-void CaptureCard::loadByID(int cardid)
272
+void CaptureCard::loadByID(int cardid)
274
id->setValue(cardid);
278
CardType::CardType(const CaptureCard& parent)
279
- : CCSetting(parent, "cardtype")
280
+ : CCSetting(parent, "cardtype")
282
setLabel(QObject::tr("Card type"));
283
setHelpText(QObject::tr("Change the cardtype to the appropriate type for "
284
@@ -1502,7 +1510,7 @@
285
setLabel(QObject::tr("Allow audio only channels"));
286
setHelpText(QObject::tr(
287
"If set, audio only channels will not be ignored "
288
- "by the MythTV channel scanner."));
289
+ "by the MythTV channel scanner."));
293
@@ -1562,7 +1570,7 @@
297
- // If there are channels sort them, then add them
298
+ // If there are channels sort them, then add them
299
// (selecting the old start channel if it is there).
300
QString order = gContext->GetSetting("ChannelOrdering", "channum");
301
ChannelUtil::SortChannels(channels, order);
302
@@ -1630,7 +1638,7 @@
305
// we place this in a group just so the margins match the DVB ones.
306
- ConfigurationGroup *chgroup =
307
+ ConfigurationGroup *chgroup =
308
new HorizontalConfigurationGroup(false, false, true, true);
309
chgroup->addChild(new FreeToAir(*this));
310
group->addChild(chgroup);
311
@@ -1645,8 +1653,8 @@
312
diseqc->setVisible(DTVDeviceNeedsConfiguration(_cardid));
313
group->addChild(diseqc);
314
connect(diseqc, SIGNAL(pressed()), SLOT(diseqcConfig()));
316
- ConfigurationGroup *chgroup =
318
+ ConfigurationGroup *chgroup =
319
new HorizontalConfigurationGroup(false, false, true, true);
320
chgroup->addChild(new RadioServices(*this));
321
chgroup->addChild(new DishNetEIT(*this));
322
@@ -1720,7 +1728,7 @@
323
scanwizard.exec(false,true);
325
if (SourceUtil::GetChannelCount(srcid))
326
- startchan->SetSourceID(QString::number(srcid));
327
+ startchan->SetSourceID(QString::number(srcid));
328
if (num_channels_before)
331
@@ -1730,7 +1738,7 @@
332
VERBOSE(VB_IMPORTANT, "You must compile the backend "
333
"to be able to scan for channels");
339
void CardInput::sourceFetch(void)
340
@@ -1758,7 +1766,7 @@
343
if (SourceUtil::GetChannelCount(srcid))
344
- startchan->SetSourceID(QString::number(srcid));
345
+ startchan->SetSourceID(QString::number(srcid));
346
if (num_channels_before)
349
@@ -1774,10 +1782,10 @@
353
-QString CISetting::whereClause(MSqlBindings& bindings)
354
+QString CISetting::whereClause(MSqlBindings& bindings)
356
QString cardinputidTag(":WHERECARDINPUTID");
359
QString query("cardinputid = " + cardinputidTag);
361
bindings.insert(cardinputidTag, parent.getInputID());
362
@@ -1785,12 +1793,12 @@
366
-QString CISetting::setClause(MSqlBindings& bindings)
367
+QString CISetting::setClause(MSqlBindings& bindings)
369
QString cardinputidTag(":SETCARDINPUTID");
370
QString colTag(":SET" + getColumn().upper());
372
- QString query("cardinputid = " + cardinputidTag + ", " +
373
+ QString query("cardinputid = " + cardinputidTag + ", " +
374
getColumn() + " = " + colTag);
376
bindings.insert(cardinputidTag, parent.getInputID());
377
@@ -1799,7 +1807,7 @@
381
-void CardInput::loadByID(int inputid)
382
+void CardInput::loadByID(int inputid)
384
id->setValue(inputid);
386
@@ -1808,7 +1816,7 @@
390
-void CardInput::loadByInput(int _cardid, QString _inputname)
391
+void CardInput::loadByInput(int _cardid, QString _inputname)
393
MSqlQuery query(MSqlQuery::InitCon());
394
query.prepare("SELECT cardinputid FROM cardinput "
395
@@ -1816,12 +1824,12 @@
396
query.bindValue(":CARDID", _cardid);
397
query.bindValue(":INPUTNAME", _inputname);
399
- if (query.exec() && query.isActive() && query.size() > 0)
400
+ if (query.exec() && query.isActive() && query.size() > 0)
403
loadByID(query.value(0).toInt());
410
cardid->setValue(QString::number(_cardid));
411
@@ -1829,7 +1837,7 @@
415
-void CardInput::save()
416
+void CardInput::save()
419
if (sourceid->getValue() == "0")
420
@@ -1849,17 +1857,17 @@
424
-int CISetting::getInputID(void) const
425
+int CISetting::getInputID(void) const
427
return parent.getInputID();
430
-int CCSetting::getCardID(void) const
431
+int CCSetting::getCardID(void) const
433
return parent.getCardID();
436
-int CaptureCardEditor::exec()
437
+int CaptureCardEditor::exec()
439
while (ConfigurationDialog::exec() == QDialog::Accepted)
441
@@ -1867,7 +1875,7 @@
442
return QDialog::Rejected;
445
-void CaptureCardEditor::load()
446
+void CaptureCardEditor::load()
449
addSelection(QObject::tr("(New capture card)"), "0");
450
@@ -1878,7 +1886,7 @@
453
MythDialog* CaptureCardEditor::dialogWidget(MythMainWindow* parent,
454
- const char* widgetName)
455
+ const char* widgetName)
457
dialog = ConfigurationDialog::dialogWidget(parent, widgetName);
458
connect(dialog, SIGNAL(menuButtonPressed()), this, SLOT(menu()));
459
@@ -1889,12 +1897,12 @@
461
void CaptureCardEditor::menu(void)
463
- if (getValue().toInt() == 0)
464
+ if (getValue().toInt() == 0)
473
int val = MythPopupBox::show2ButtonPopup(
474
gContext->GetMainWindow(),
475
@@ -1992,7 +2000,7 @@
478
MythDialog* VideoSourceEditor::dialogWidget(MythMainWindow* parent,
479
- const char* widgetName)
480
+ const char* widgetName)
482
dialog = ConfigurationDialog::dialogWidget(parent, widgetName);
483
connect(dialog, SIGNAL(menuButtonPressed()), this, SLOT(menu()));
484
@@ -2017,12 +2025,12 @@
486
void VideoSourceEditor::menu()
488
- if (getValue().toInt() == 0)
489
+ if (getValue().toInt() == 0)
498
int val = MythPopupBox::show2ButtonPopup(
499
gContext->GetMainWindow(),
500
@@ -2039,7 +2047,7 @@
504
-void VideoSourceEditor::edit()
505
+void VideoSourceEditor::edit()
507
const int sourceid = getValue().toInt();
509
@@ -2074,7 +2082,7 @@
513
-void VideoSourceEditor::del()
514
+void VideoSourceEditor::del()
516
int val = MythPopupBox::show2ButtonPopup(
517
gContext->GetMainWindow(), "",
518
@@ -2122,7 +2130,7 @@
522
-int CardInputEditor::exec()
523
+int CardInputEditor::exec()
525
while (ConfigurationDialog::exec() == QDialog::Accepted)
526
cardinputs[getValue().toInt()]->exec();
527
@@ -2130,7 +2138,7 @@
528
return QDialog::Rejected;
531
-void CardInputEditor::load()
532
+void CardInputEditor::load()
536
@@ -2348,7 +2356,7 @@
540
- HorizontalConfigurationGroup *hg0 =
541
+ HorizontalConfigurationGroup *hg0 =
542
new HorizontalConfigurationGroup(false, false, true, true);
543
hg0->addChild(cardname);
544
hg0->addChild(cardtype);
545
@@ -2376,9 +2384,9 @@
546
"detect this problem."));
548
TransButtonSetting *buttonRecOpt = new TransButtonSetting();
549
- buttonRecOpt->setLabel(tr("Recording Options"));
550
+ buttonRecOpt->setLabel(tr("Recording Options"));
552
- HorizontalConfigurationGroup *advcfg =
553
+ HorizontalConfigurationGroup *advcfg =
554
new HorizontalConfigurationGroup(false, false, true, true);
555
advcfg->addChild(buttonDiSEqC);
556
advcfg->addChild(buttonAnalog);