~mythbuntu/mythbuntu/mythbuntu

« back to all changes in this revision

Viewing changes to weekly_build/work/debian-mythtv/patches/23_video_device_symlinks.dpatch

  • Committer: Mario Limonciello
  • Date: 2007-07-30 00:05:59 UTC
  • Revision ID: supermario@portablemario-20070730000559-6jm2h0ns9m9zi1te
remerge with mythtv/mythplugins gutsy

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#! /bin/sh /usr/share/dpatch/dpatch-run
 
2
## video_device_symlinks.dpatch by Mario Limonciello <superm1@ubuntu.com>
 
3
##
 
4
## All lines beginning with `## DP:' are a description of the patch.
 
5
## DP: No description.
 
6
 
 
7
@DPATCH@
 
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
 
11
@@ -50,7 +50,7 @@
 
12
 QString VSSetting::whereClause(MSqlBindings& bindings)
 
13
 {
 
14
     QString sourceidTag(":WHERESOURCEID");
 
15
-    
 
16
+
 
17
     QString query("sourceid = " + sourceidTag);
 
18
 
 
19
     bindings.insert(sourceidTag, parent.getSourceID());
 
20
@@ -63,7 +63,7 @@
 
21
     QString sourceidTag(":SETSOURCEID");
 
22
     QString colTag(":SET" + getColumn().upper());
 
23
 
 
24
-    QString query("sourceid = " + sourceidTag + ", " + 
 
25
+    QString query("sourceid = " + sourceidTag + ", " +
 
26
             getColumn() + " = " + colTag);
 
27
 
 
28
     bindings.insert(sourceidTag, parent.getSourceID());
 
29
@@ -75,7 +75,7 @@
 
30
 QString CCSetting::whereClause(MSqlBindings& bindings)
 
31
 {
 
32
     QString cardidTag(":WHERECARDID");
 
33
-    
 
34
+
 
35
     QString query("cardid = " + cardidTag);
 
36
 
 
37
     bindings.insert(cardidTag, parent.getCardID());
 
38
@@ -107,7 +107,7 @@
 
39
     };
 
40
 };
 
41
 
 
42
-FreqTableSelector::FreqTableSelector(const VideoSource& parent) 
 
43
+FreqTableSelector::FreqTableSelector(const VideoSource& parent)
 
44
   : VSSetting(parent, "freqtable")
 
45
 {
 
46
     setLabel(QObject::tr("Channel frequency table"));
 
47
@@ -154,7 +154,7 @@
 
48
 
 
49
 void DataDirectLineupSelector::fillSelections(const QString &uid,
 
50
                                               const QString &pwd,
 
51
-                                              int _source) 
 
52
+                                              int _source)
 
53
 {
 
54
     (void) uid;
 
55
     (void) pwd;
 
56
@@ -168,7 +168,7 @@
 
57
     DataDirectProcessor ddp(_source, uid, pwd);
 
58
     QString waitMsg = tr("Fetching lineups from %1...")
 
59
         .arg(ddp.GetListingsProviderName());
 
60
-        
 
61
+
 
62
     VERBOSE(VB_GENERAL, waitMsg);
 
63
     MythProgressDialog pdlg(waitMsg, 2);
 
64
 
 
65
@@ -196,13 +196,13 @@
 
66
 #endif // USING_BACKEND
 
67
 }
 
68
 
 
69
-void DataDirect_config::load() 
 
70
+void DataDirect_config::load()
 
71
 {
 
72
     VerticalConfigurationGroup::load();
 
73
-    if ((userid->getValue() != lastloadeduserid) || 
 
74
-        (password->getValue() != lastloadedpassword)) 
 
75
+    if ((userid->getValue() != lastloadeduserid) ||
 
76
+        (password->getValue() != lastloadedpassword))
 
77
     {
 
78
-        lineupselector->fillSelections(userid->getValue(), 
 
79
+        lineupselector->fillSelections(userid->getValue(),
 
80
                                        password->getValue(),
 
81
                                        source);
 
82
         lastloadeduserid = userid->getValue();
 
83
@@ -213,7 +213,7 @@
 
84
 DataDirect_config::DataDirect_config(const VideoSource& _parent, int _source) :
 
85
     ConfigurationGroup(false, false, false, false),
 
86
     VerticalConfigurationGroup(false, false, false, false),
 
87
-    parent(_parent) 
 
88
+    parent(_parent)
 
89
 {
 
90
     source = _source;
 
91
 
 
92
@@ -238,11 +238,11 @@
 
93
         userid->getValue(), password->getValue(), source);
 
94
 }
 
95
 
 
96
-XMLTV_generic_config::XMLTV_generic_config(const VideoSource& _parent, 
 
97
+XMLTV_generic_config::XMLTV_generic_config(const VideoSource& _parent,
 
98
                                            QString _grabber) :
 
99
     ConfigurationGroup(false, false, false, false),
 
100
     VerticalConfigurationGroup(false, false, false, false),
 
101
-    parent(_parent), grabber(_grabber) 
 
102
+    parent(_parent), grabber(_grabber)
 
103
 {
 
104
     TransLabelSetting *label = new TransLabelSetting();
 
105
     label->setLabel(grabber);
 
106
@@ -295,7 +295,7 @@
 
107
         "instead of just 'mythfilldatabase'.\nYour grabber does not provide "
 
108
         "channel numbers, so you have to set them manually.");
 
109
 
 
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" ||
 
115
@@ -310,7 +310,7 @@
 
116
             gContext->GetMainWindow(), QObject::tr("Warning."), err_msg);
 
117
     }
 
118
 
 
119
-    pdlg.setProgress( 2 );    
 
120
+    pdlg.setProgress( 2 );
 
121
     pdlg.Close();
 
122
 }
 
123
 
 
124
@@ -370,10 +370,10 @@
 
125
 
 
126
     // only save settings for the selected grabber
 
127
     setSaveAll(false);
 
128
 
129
+
 
130
     addTarget("datadirect", new DataDirect_config(parent));
 
131
     grabber->addSelection("North America (DataDirect)", "datadirect");
 
132
-    
 
133
+
 
134
     addTarget("eitonly", new EITOnly_config(parent));
 
135
     grabber->addSelection("Transmitted guide only (EIT)", "eitonly");
 
136
 
 
137
@@ -444,7 +444,7 @@
 
138
     grabber->addSelection("No grabber", "/bin/true");
 
139
 }
 
140
 
 
141
-VideoSource::VideoSource() 
 
142
+VideoSource::VideoSource()
 
143
 {
 
144
     // must be first
 
145
     addChild(id = new ID());
 
146
@@ -457,8 +457,8 @@
 
147
     addChild(group);
 
148
 }
 
149
 
 
150
-bool VideoSourceEditor::cardTypesInclude(const int &sourceID, 
 
151
-                                         const QString &thecardtype) 
 
152
+bool VideoSourceEditor::cardTypesInclude(const int &sourceID,
 
153
+                                         const QString &thecardtype)
 
154
 {
 
155
     MSqlQuery query(MSqlQuery::InitCon());
 
156
     query.prepare("SELECT count(cardtype)"
 
157
@@ -481,7 +481,7 @@
 
158
     return false;
 
159
 }
 
160
 
 
161
-void VideoSource::fillSelections(SelectSetting* setting) 
 
162
+void VideoSource::fillSelections(SelectSetting* setting)
 
163
 {
 
164
     MSqlQuery result(MSqlQuery::InitCon());
 
165
     result.prepare("SELECT name, sourceid FROM videosource;");
 
166
@@ -496,7 +496,7 @@
 
167
     }
 
168
 }
 
169
 
 
170
-void VideoSource::loadByID(int sourceid) 
 
171
+void VideoSource::loadByID(int sourceid)
 
172
 {
 
173
     id->setValue(sourceid);
 
174
     load();
 
175
@@ -513,7 +513,13 @@
 
176
       : PathSetting(true), CCSetting(parent, "videodevice")
 
177
     {
 
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);
 
184
 
 
185
+/*
 
186
         // /dev/v4l/video*
 
187
         QDir dev("/dev/v4l", "video*", QDir::Name, QDir::System);
 
188
         fillSelectionsFromDir(dev, minor_min, minor_max,
 
189
@@ -524,6 +530,8 @@
 
190
         fillSelectionsFromDir(dev, minor_min, minor_max,
 
191
                               card, driver, false);
 
192
 
 
193
+*/
 
194
+
 
195
         // /dev/dtv/video*
 
196
         dev.setPath("/dev/dtv");
 
197
         fillSelectionsFromDir(dev, minor_min, minor_max,
 
198
@@ -534,7 +542,7 @@
 
199
         dev.setNameFilter("dtv*");
 
200
         fillSelectionsFromDir(dev, minor_min, minor_max,
 
201
                               card, driver, false);
 
202
-    };
 
203
+     };
 
204
 
 
205
     uint fillSelectionsFromDir(const QDir& dir,
 
206
                                uint minor_min, uint minor_max,
 
207
@@ -545,7 +553,7 @@
 
208
         const QFileInfoList *il = dir.entryInfoList();
 
209
         if (!il)
 
210
             return cnt;
 
211
-        
 
212
+
 
213
         QFileInfoListIterator it( *il );
 
214
         QFileInfo *fi;
 
215
 
 
216
@@ -831,7 +839,7 @@
 
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 @@
 
226
 
 
227
     setTrigger(cardtype);
 
228
     setSaveAll(false);
 
229
-    
 
230
-    
 
231
+
 
232
+
 
233
 #ifdef USING_V4L
 
234
     addTarget("V4L",       new V4LConfigurationGroup(parent));
 
235
     addTarget("HDTV",      new pcHDTVConfigurationGroup(parent));
 
236
@@ -1280,13 +1288,13 @@
 
237
 #endif // USING_FREEBOX
 
238
 }
 
239
 
 
240
-void CaptureCardGroup::triggerChanged(const QString& value) 
 
241
+void CaptureCardGroup::triggerChanged(const QString& value)
 
242
 {
 
243
     QString own = (value == "MJPEG" || value == "GO7007") ? "V4L" : value;
 
244
     TriggeredConfigurationGroup::triggerChanged(own);
 
245
 }
 
246
 
 
247
-CaptureCard::CaptureCard(bool use_card_group) 
 
248
+CaptureCard::CaptureCard(bool use_card_group)
 
249
 {
 
250
     // must be first
 
251
     addChild(id = new ID());
 
252
@@ -1301,12 +1309,12 @@
 
253
     parentid->setValue(QString::number(id));
 
254
 }
 
255
 
 
256
-void CaptureCard::fillSelections(SelectSetting* setting) 
 
257
+void CaptureCard::fillSelections(SelectSetting* setting)
 
258
 {
 
259
     CaptureCard::fillSelections(setting, false);
 
260
 }
 
261
 
 
262
-void CaptureCard::fillSelections(SelectSetting* setting, bool no_children) 
 
263
+void CaptureCard::fillSelections(SelectSetting* setting, bool no_children)
 
264
 {
 
265
     MSqlQuery query(MSqlQuery::InitCon());
 
266
     QString qstr =
 
267
@@ -1338,14 +1346,14 @@
 
268
     }
 
269
 }
 
270
 
 
271
-void CaptureCard::loadByID(int cardid) 
 
272
+void CaptureCard::loadByID(int cardid)
 
273
 {
 
274
     id->setValue(cardid);
 
275
     load();
 
276
 }
 
277
 
 
278
 CardType::CardType(const CaptureCard& parent)
 
279
-        : CCSetting(parent, "cardtype") 
 
280
+        : CCSetting(parent, "cardtype")
 
281
 {
 
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."));
 
290
     };
 
291
 };
 
292
 
 
293
@@ -1562,7 +1570,7 @@
 
294
         return;
 
295
     }
 
296
 
 
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 @@
 
303
     if (isDTVcard)
 
304
     {
 
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()));
 
315
-   
 
316
-        ConfigurationGroup *chgroup = 
 
317
+
 
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);
 
324
 
 
325
     if (SourceUtil::GetChannelCount(srcid))
 
326
-        startchan->SetSourceID(QString::number(srcid));        
 
327
+        startchan->SetSourceID(QString::number(srcid));
 
328
     if (num_channels_before)
 
329
     {
 
330
         startchan->load();
 
331
@@ -1730,7 +1738,7 @@
 
332
     VERBOSE(VB_IMPORTANT, "You must compile the backend "
 
333
             "to be able to scan for channels");
 
334
 #endif
 
335
-    
 
336
+
 
337
 }
 
338
 
 
339
 void CardInput::sourceFetch(void)
 
340
@@ -1758,7 +1766,7 @@
 
341
     }
 
342
 
 
343
     if (SourceUtil::GetChannelCount(srcid))
 
344
-        startchan->SetSourceID(QString::number(srcid));        
 
345
+        startchan->SetSourceID(QString::number(srcid));
 
346
     if (num_channels_before)
 
347
     {
 
348
         startchan->load();
 
349
@@ -1774,10 +1782,10 @@
 
350
 #endif // USING_DVB
 
351
 }
 
352
 
 
353
-QString CISetting::whereClause(MSqlBindings& bindings) 
 
354
+QString CISetting::whereClause(MSqlBindings& bindings)
 
355
 {
 
356
     QString cardinputidTag(":WHERECARDINPUTID");
 
357
-    
 
358
+
 
359
     QString query("cardinputid = " + cardinputidTag);
 
360
 
 
361
     bindings.insert(cardinputidTag, parent.getInputID());
 
362
@@ -1785,12 +1793,12 @@
 
363
     return query;
 
364
 }
 
365
 
 
366
-QString CISetting::setClause(MSqlBindings& bindings) 
 
367
+QString CISetting::setClause(MSqlBindings& bindings)
 
368
 {
 
369
     QString cardinputidTag(":SETCARDINPUTID");
 
370
     QString colTag(":SET" + getColumn().upper());
 
371
 
 
372
-    QString query("cardinputid = " + cardinputidTag + ", " + 
 
373
+    QString query("cardinputid = " + cardinputidTag + ", " +
 
374
             getColumn() + " = " + colTag);
 
375
 
 
376
     bindings.insert(cardinputidTag, parent.getInputID());
 
377
@@ -1799,7 +1807,7 @@
 
378
     return query;
 
379
 }
 
380
 
 
381
-void CardInput::loadByID(int inputid) 
 
382
+void CardInput::loadByID(int inputid)
 
383
 {
 
384
     id->setValue(inputid);
 
385
 #ifdef USING_DVB
 
386
@@ -1808,7 +1816,7 @@
 
387
     load();
 
388
 }
 
389
 
 
390
-void CardInput::loadByInput(int _cardid, QString _inputname) 
 
391
+void CardInput::loadByInput(int _cardid, QString _inputname)
 
392
 {
 
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);
 
398
 
 
399
-    if (query.exec() && query.isActive() && query.size() > 0) 
 
400
+    if (query.exec() && query.isActive() && query.size() > 0)
 
401
     {
 
402
         query.next();
 
403
         loadByID(query.value(0).toInt());
 
404
-    } 
 
405
-    else 
 
406
+    }
 
407
+    else
 
408
     {
 
409
         load(); // new
 
410
         cardid->setValue(QString::number(_cardid));
 
411
@@ -1829,7 +1837,7 @@
 
412
     }
 
413
 }
 
414
 
 
415
-void CardInput::save() 
 
416
+void CardInput::save()
 
417
 {
 
418
 
 
419
     if (sourceid->getValue() == "0")
 
420
@@ -1849,17 +1857,17 @@
 
421
     }
 
422
 }
 
423
 
 
424
-int CISetting::getInputID(void) const 
 
425
+int CISetting::getInputID(void) const
 
426
 {
 
427
     return parent.getInputID();
 
428
 }
 
429
 
 
430
-int CCSetting::getCardID(void) const 
 
431
+int CCSetting::getCardID(void) const
 
432
 {
 
433
     return parent.getCardID();
 
434
 }
 
435
 
 
436
-int CaptureCardEditor::exec() 
 
437
+int CaptureCardEditor::exec()
 
438
 {
 
439
     while (ConfigurationDialog::exec() == QDialog::Accepted)
 
440
         edit();
 
441
@@ -1867,7 +1875,7 @@
 
442
     return QDialog::Rejected;
 
443
 }
 
444
 
 
445
-void CaptureCardEditor::load() 
 
446
+void CaptureCardEditor::load()
 
447
 {
 
448
     clearSelections();
 
449
     addSelection(QObject::tr("(New capture card)"), "0");
 
450
@@ -1878,7 +1886,7 @@
 
451
 }
 
452
 
 
453
 MythDialog* CaptureCardEditor::dialogWidget(MythMainWindow* parent,
 
454
-                                            const char* widgetName) 
 
455
+                                            const char* widgetName)
 
456
 {
 
457
     dialog = ConfigurationDialog::dialogWidget(parent, widgetName);
 
458
     connect(dialog, SIGNAL(menuButtonPressed()), this, SLOT(menu()));
 
459
@@ -1889,12 +1897,12 @@
 
460
 
 
461
 void CaptureCardEditor::menu(void)
 
462
 {
 
463
-    if (getValue().toInt() == 0) 
 
464
+    if (getValue().toInt() == 0)
 
465
     {
 
466
         CaptureCard cc;
 
467
         cc.exec();
 
468
-    } 
 
469
-    else 
 
470
+    }
 
471
+    else
 
472
     {
 
473
         int val = MythPopupBox::show2ButtonPopup(
 
474
             gContext->GetMainWindow(),
 
475
@@ -1992,7 +2000,7 @@
 
476
 }
 
477
 
 
478
 MythDialog* VideoSourceEditor::dialogWidget(MythMainWindow* parent,
 
479
-                                            const char* widgetName) 
 
480
+                                            const char* widgetName)
 
481
 {
 
482
     dialog = ConfigurationDialog::dialogWidget(parent, widgetName);
 
483
     connect(dialog, SIGNAL(menuButtonPressed()), this, SLOT(menu()));
 
484
@@ -2017,12 +2025,12 @@
 
485
 
 
486
 void VideoSourceEditor::menu()
 
487
 {
 
488
-    if (getValue().toInt() == 0) 
 
489
+    if (getValue().toInt() == 0)
 
490
     {
 
491
         VideoSource vs;
 
492
         vs.exec();
 
493
-    } 
 
494
-    else 
 
495
+    }
 
496
+    else
 
497
     {
 
498
         int val = MythPopupBox::show2ButtonPopup(
 
499
             gContext->GetMainWindow(),
 
500
@@ -2039,7 +2047,7 @@
 
501
     }
 
502
 }
 
503
 
 
504
-void VideoSourceEditor::edit() 
 
505
+void VideoSourceEditor::edit()
 
506
 {
 
507
     const int sourceid = getValue().toInt();
 
508
     if (-1 == sourceid)
 
509
@@ -2074,7 +2082,7 @@
 
510
     }
 
511
 }
 
512
 
 
513
-void VideoSourceEditor::del() 
 
514
+void VideoSourceEditor::del()
 
515
 {
 
516
     int val = MythPopupBox::show2ButtonPopup(
 
517
         gContext->GetMainWindow(), "",
 
518
@@ -2122,7 +2130,7 @@
 
519
     }
 
520
 }
 
521
 
 
522
-int CardInputEditor::exec() 
 
523
+int CardInputEditor::exec()
 
524
 {
 
525
     while (ConfigurationDialog::exec() == QDialog::Accepted)
 
526
         cardinputs[getValue().toInt()]->exec();
 
527
@@ -2130,7 +2138,7 @@
 
528
     return QDialog::Rejected;
 
529
 }
 
530
 
 
531
-void CardInputEditor::load() 
 
532
+void CardInputEditor::load()
 
533
 {
 
534
     cardinputs.clear();
 
535
     clearSelections();
 
536
@@ -2348,7 +2356,7 @@
 
537
 
 
538
     addChild(cardnum);
 
539
 
 
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."));
 
547
 
 
548
     TransButtonSetting *buttonRecOpt = new TransButtonSetting();
 
549
-    buttonRecOpt->setLabel(tr("Recording Options"));    
 
550
+    buttonRecOpt->setLabel(tr("Recording Options"));
 
551
 
 
552
-    HorizontalConfigurationGroup *advcfg = 
 
553
+    HorizontalConfigurationGroup *advcfg =
 
554
         new HorizontalConfigurationGroup(false, false, true, true);
 
555
     advcfg->addChild(buttonDiSEqC);
 
556
     advcfg->addChild(buttonAnalog);