Ticket #2878: perchancommflag.2.patch
File perchancommflag.2.patch, 4.5 KB (added by , 17 years ago) |
---|
-
libs/libmythtv/dbcheck.cpp
10 10 #include "mythdbcon.h" 11 11 12 12 /// This is the DB schema version expected by the running MythTV instance. 13 const QString currentDatabaseVersion = "117 5";13 const QString currentDatabaseVersion = "1176"; 14 14 15 15 static bool UpdateDBVersionNumber(const QString &newnumber); 16 16 static bool performActualUpdate(const QString updates[], QString version, … … 258 258 those on the BBC and CBC networks. On commercial free channels we 259 259 do not need to run the commercial detector. 260 260 261 'commmethod' tells us which commercial flagger to use on the channel, the 262 default is to use the global setting 263 261 264 'visible' tells us whether we should show this channel in the channel 262 265 guide. 263 266 … … 2803 2806 return false; 2804 2807 } 2805 2808 2809 if (dbver == "1175") 2810 { 2811 const QString updates[] = { 2812 "ALTER TABLE channel ADD COLUMN commmethod INT NOT NULL default '-1';", 2813 "" 2814 }; 2815 if (!performActualUpdate(updates, "1176", dbver)) 2816 return false; 2817 } 2818 2806 2819 //"ALTER TABLE cardinput DROP COLUMN preference;" in 0.22 2807 2820 //"ALTER TABLE channel DROP COLUMN atscsrcid;" in 0.22 2808 2821 //"ALTER TABLE recordedmarkup DROP COLUMN offset;" in 0.22 … … 2912 2925 " hue int(11) default '32768'," 2913 2926 " tvformat varchar(10) NOT NULL default 'Default'," 2914 2927 " commfree tinyint(4) NOT NULL default '0'," 2928 " commmethod int(11) NOT NULL default '-1'," 2915 2929 " visible tinyint(1) NOT NULL default '1'," 2916 2930 " outputfilters varchar(255) NOT NULL default ''," 2917 2931 " useonairguide tinyint(1) default '0'," -
libs/libmythtv/channelsettings.cpp
237 237 } 238 238 }; 239 239 240 class CommMethod : public ComboBoxSetting, public ChannelDBStorage 241 { 242 public: 243 CommMethod(const ChannelID &id) : 244 ComboBoxSetting(this), ChannelDBStorage(this, id, "commmethod") 245 { 246 setLabel(QObject::tr("Commercial Flagging Method")); 247 setHelpText(QObject::tr("Changes the method of " 248 "commercial detection used for recordings on this channel")); 249 addSelection(QObject::tr("Use Global Setting"), "-1"); 250 251 /* These settings should probably be consolodated with 252 * programs/mythfrontend/globalsettings.cpp:391 253 * however I don't know the appropiate way to do this to fit 254 * into mythtv frameworks.. so I have left for the experts :) 255 */ 256 addSelection(QObject::tr("All Available Methods"), "255"); 257 addSelection(QObject::tr("Blank Frame Detection"), "1"); 258 addSelection(QObject::tr("Blank Frame + Scene Change Detection"), "3"); 259 addSelection(QObject::tr("Scene Change Detection"), "2"); 260 addSelection(QObject::tr("Logo Detection"), "4"); 261 addSelection(QObject::tr("Experimental"), "511"); 262 263 } 264 }; 265 240 266 class Visible : public CheckBoxSetting, public ChannelDBStorage 241 267 { 242 268 public: … … 377 403 bottomhoz->addChild(new TimeOffset(id)); 378 404 379 405 addChild(group1); 406 addChild(new CommMethod(id)); 380 407 addChild(new Icon(id)); 381 408 addChild(new VideoFilters(id)); 382 409 addChild(new OutputFilters(id)); -
programs/mythcommflag/main.cpp
454 454 int FlagCommercials(QString chanid, QString starttime) 455 455 { 456 456 int breaksFound = 0; 457 457 458 if (commDetectMethod == COMM_DETECT_UNINIT) 459 { 460 MSqlQuery method_query(MSqlQuery::InitCon()); 461 method_query.prepare("SELECT commmethod FROM channel " 462 "WHERE chanid = :CHANID;"); 463 method_query.bindValue(":CHANID", chanid); 464 465 if (method_query.exec() && method_query.isActive() 466 && method_query.size() > 0) 467 { 468 method_query.next(); 469 commDetectMethod = (enum SkipTypes) 470 method_query.value(0).toInt(); 471 VERBOSE(VB_COMMFLAG, 472 QString("Using method: %1 from chaneld %2") 473 .arg(commDetectMethod).arg(chanid)); 474 } 475 476 } 477 478 if (commDetectMethod == COMM_DETECT_UNINIT) 458 479 commDetectMethod = (enum SkipTypes)gContext->GetNumSetting( 459 480 "CommercialSkipMethod", COMM_DETECT_ALL); 460 481 QMap<long long, int> blanks;