Ticket #3152: filterwizard4.patch
| File filterwizard4.patch, 37.1 KB (added by , 17 years ago) |
|---|
-
mythtv/libs/libmythtv/libmythtv.pro
225 225 HEADERS += profilegroup.h 226 226 SOURCES += profilegroup.cpp 227 227 228 # Filter wizard stuff 229 HEADERS += filterchaineditor.h 230 SOURCES += filterchaineditor.cpp 231 228 232 # XBox LED control 229 233 HEADERS += xbox.h 230 234 SOURCES += xbox.cpp -
mythtv/libs/libmythtv/filterchaineditor.cpp
1 #include "filterchaineditor.h" 2 #include "filtermanager.h" 3 #include "libmyth/mythcontext.h" 4 #include <mythtv/libmythui/mythuihelper.h> 5 #include <qlayout.h> 6 7 FilterChainEditor::FilterChainEditor(QString chain) : 8 m_listbox(new ListBoxSetting(this)), m_dialog(NULL), m_redraw(true) 9 { 10 addChild(m_listbox); 11 m_listbox->setLabel(QObject::tr("Filter Chain")); 12 13 // Parse the filter string into individual filters 14 m_filterList = QStringList::split(",", chain); 15 } 16 17 QString FilterChainEditor::exec() 18 { 19 int ret = QDialog::Accepted; 20 m_redraw = true; 21 22 while ((QDialog::Accepted == ret) || m_redraw) 23 { 24 m_redraw = false; 25 26 load(); 27 28 m_dialog = new ConfigurationDialogWidget(gContext->GetMainWindow(), 29 "FilterChainEditor"); 30 connect(m_dialog, SIGNAL(menuButtonPressed()), 31 this, SLOT( open())); 32 connect(m_dialog, SIGNAL(deleteButtonPressed()), 33 this, SLOT( deleteFilter())); 34 35 int width = 0, height = 0; 36 float wmult = 0.0f, hmult = 0.0f; 37 38 GetMythUI()->GetScreenSettings(width, wmult, height, hmult); 39 40 QVBoxLayout *layout = new QVBoxLayout(m_dialog, (int)(20 * hmult)); 41 layout->addWidget(m_listbox->configWidget(NULL, m_dialog)); 42 43 m_dialog->Show(); 44 ret = m_dialog->exec(); 45 46 m_dialog->deleteLater(); 47 m_dialog = NULL; 48 49 if (ret == QDialog::Accepted) 50 { 51 editFilter(m_listbox->getValue().toInt()); 52 } 53 } 54 return getFilterString(); 55 } 56 57 void FilterChainEditor::load(void) 58 { 59 m_listbox->clearSelections(); 60 61 // Fill the listbox with filters in the filter chain 62 int index = 1; 63 for (QStringList::Iterator i = m_filterList.begin(); i != m_filterList.end(); ++i) 64 { 65 m_listbox->addSelection(*i, QString::number(index)); 66 index++; 67 } 68 m_listbox->addSelection(QObject::tr("(Add new filter)"), "0"); 69 70 if (m_lastSelected < index && m_lastSelected >= 0) 71 { 72 m_listbox->setValue(m_lastSelected); 73 } 74 m_lastSelected = 0; 75 } 76 77 void FilterChainEditor::open() 78 { 79 int id = m_listbox->getValue().toInt(); 80 if (id != 0) 81 { 82 // Prompt user for action 83 QStringList buttons; 84 buttons << QObject::tr("Move Up"); 85 buttons << QObject::tr("Move Down"); 86 buttons << QObject::tr("Remove"); 87 buttons << QObject::tr("Cancel"); 88 int value = MythPopupBox::ShowButtonPopup(gContext->GetMainWindow(), 89 "", QObject::tr("Filter Options"), 90 buttons, kDialogCodeButton3); 91 if (value == 0) 92 { 93 raiseFilter(); // Move the filter up in the chain 94 } 95 else if (value == 1) 96 { 97 lowerFilter(); // Move the filter down in the chain 98 } 99 else if (value == 2) 100 { 101 deleteFilter(); // Remove the filter from the chain 102 } 103 } 104 } 105 106 void FilterChainEditor::deleteFilter() 107 { 108 int id = m_listbox->getValue().toInt(); 109 if (id == 0) 110 { 111 return; 112 } 113 114 // Prompt user for confirmation 115 int value = MythPopupBox::Show2ButtonPopup(gContext->GetMainWindow(),"", 116 QObject::tr("Delete filter?"), 117 QObject::tr("Yes, delete filter"), 118 QObject::tr("No, Don't delete filter"), kDialogCodeButton2); 119 if (value == 0) 120 { 121 m_filterList.removeAt(id - 1); 122 m_redraw = true; 123 if (m_dialog) 124 { 125 m_dialog->done(QDialog::Rejected); 126 } 127 } 128 } 129 130 void FilterChainEditor::editFilter(int id) 131 { 132 if (id != 0) 133 { 134 m_lastSelected = id - 1; 135 QString filterName = m_filterList.at(id - 1).section('=', 0, 0); 136 const FilterInfo* info = m_manager.GetFilterInfo(filterName); 137 if (info) 138 { 139 QStringList parameters = QStringList::split(",", info->params); 140 if (parameters.size() > 0) 141 { 142 // Edit the filters parameters 143 FilterWizard filterwizard(filterName); 144 filterwizard.loadByString(m_filterList.at(id - 1).section('=', 1)); 145 if (filterwizard.exec(false) == QDialog::Accepted) 146 { 147 filterwizard.Save(); 148 m_filterList.replace(id - 1, filterwizard.getString()); 149 } 150 } 151 } 152 } 153 else 154 { 155 // Allow user to choose which type of filter to add 156 FilterSelector selector; 157 selector.exec(); 158 if (selector.getString() != "") 159 { 160 m_filterList.append(selector.getString()); 161 } 162 } 163 } 164 165 void FilterChainEditor::raiseFilter() 166 { 167 int id = m_listbox->getValue().toInt() - 1; 168 if (id <= 0) 169 { 170 return; 171 } 172 173 m_lastSelected = id - 1; 174 m_filterList.swap(id - 1, id); 175 m_redraw = true; 176 177 if (m_dialog) 178 { 179 m_dialog->done(QDialog::Rejected); 180 } 181 } 182 183 void FilterChainEditor::lowerFilter() 184 { 185 int id = m_listbox->getValue().toInt() - 1; 186 if (id >= (int)m_filterList.size() - 1) 187 { 188 return; 189 } 190 191 m_lastSelected = id + 1; 192 m_filterList.swap(id, id + 1); 193 m_redraw = true; 194 195 if (m_dialog) 196 { 197 m_dialog->done(QDialog::Rejected); 198 } 199 } 200 201 QString FilterChainEditor::getFilterString() 202 { 203 // Concatenate all the filters together with commas 204 QStringListIterator iter(m_filterList); 205 QString filterstring = ""; 206 bool hasFirst = false; 207 while (iter.hasNext()) 208 { 209 if (hasFirst) 210 { 211 filterstring.append(","); 212 } 213 hasFirst = true; 214 filterstring.append(iter.next()); 215 } 216 217 return filterstring; 218 } 219 220 FilterSelector::FilterSelector() : m_listbox(new FilterListBox(this)), 221 m_help(new TransLabelSetting()), m_dialog(NULL), m_redraw(true) 222 { 223 addChild(m_listbox); 224 addChild(m_help); 225 m_listbox->setLabel(QObject::tr("Filters")); 226 } 227 228 int FilterSelector::exec() 229 { 230 int ret = QDialog::Accepted; 231 m_redraw = true; 232 233 while ((QDialog::Accepted == ret) || m_redraw) 234 { 235 m_redraw = false; 236 237 load(); 238 239 m_dialog = new ConfigurationDialogWidget(gContext->GetMainWindow(), 240 "FilterSelector"); 241 242 int width = 0, height = 0; 243 float wmult = 0.0f, hmult = 0.0f; 244 GetMythUI()->GetScreenSettings(width, wmult, height, hmult); 245 246 QVBoxLayout *layout = new QVBoxLayout(m_dialog, (int)(20 * hmult)); 247 layout->addWidget(m_listbox->configWidget(NULL, m_dialog)); 248 layout->addWidget(m_help->configWidget(NULL, m_dialog)); 249 250 connect(m_listbox, SIGNAL(highlighted(int)), 251 this, SLOT( setHelpText(int))); 252 m_dialog->Show(); 253 ret = m_dialog->exec(); 254 m_dialog->deleteLater(); 255 m_dialog = NULL; 256 257 if (ret == QDialog::Accepted) 258 { 259 if (open(m_listbox->getSelectionLabel()) == QDialog::Accepted) 260 { 261 return ret; 262 } 263 } 264 } 265 266 return QDialog::Rejected; 267 } 268 269 void FilterSelector::load(void) 270 { 271 m_listbox->clearSelections(); 272 273 // Get the list of the available filters on the system 274 filter_map_t info = m_manager.GetAllFilterInfo(); 275 filter_map_t::iterator iter; 276 277 for (iter = info.begin(); iter != info.end(); ++iter) 278 { 279 m_listbox->addSelection(iter->second->name); 280 } 281 282 m_listbox->setValue(0); 283 setHelpText(0); 284 } 285 286 void FilterSelector::setHelpText(int id) 287 { 288 const FilterInfo* info = m_manager.GetFilterInfo(m_listbox->getSelectionLabel()); 289 m_help->setValue(info->descript); 290 } 291 292 int FilterSelector::open(QString filterName) 293 { 294 const FilterInfo* info = m_manager.GetFilterInfo(filterName); 295 296 QString params(info->params); 297 if (!params.isNull() && !params.isEmpty()) 298 { 299 QStringList parameters = QStringList::split(",", params); 300 FilterWizard filterwizard(filterName); 301 if (filterwizard.exec(false) == QDialog::Accepted) 302 { 303 filterwizard.Save(); 304 m_filterstring = filterwizard.getString(); 305 return QDialog::Accepted; 306 } 307 return QDialog::Rejected; 308 } 309 m_filterstring = filterName; 310 return QDialog::Accepted; 311 } 312 313 QWidget* FilterListBox::configWidget(ConfigurationGroup *cg, QWidget* parent, 314 const char* widgetName) 315 { 316 QWidget* box = ListBoxSetting::configWidget(cg,parent,widgetName); 317 318 connect(widget, SIGNAL(highlighted(int)), 319 this, SIGNAL(highlighted(int))); 320 321 return box; 322 } 323 324 FilterWizard::FilterWizard(QString name) 325 { 326 m_name = name; 327 m_hasDisable = false; 328 m_config = new VerticalConfigurationGroup(false); 329 m_config->setLabel("Filters->" + m_name); 330 331 FilterManager manager; 332 const FilterInfo* info = manager.GetFilterInfo(m_name); 333 QStringList parameters = QStringList::split(",", info->params); 334 335 // Create a widget for each parameter 336 QStringListIterator iter(parameters); 337 while(iter.hasNext()) 338 { 339 QStringList description = QStringList::split(":", iter.next()); 340 if (description.size() == 3 && description[0] == "disable") 341 { 342 // The disable parameter is special and overrides all the other 343 // parameters. If the filter is disabled then none of the 344 // other parameters will be stored. 345 m_disableBox = new DisableFilterParam(description); 346 m_config->addChild(m_disableBox); 347 m_hasDisable = true; 348 } 349 else 350 { 351 QString* store = new QString(""); 352 if (description.count() == 6 && description[0] == "int") 353 { 354 IntegerFilterParam* param = new IntegerFilterParam(description, store); 355 m_config->addChild(param); 356 m_values.append(store); 357 } 358 else if (description.size() == 6 && description[0] == "float") 359 { 360 FloatFilterParam* param = new FloatFilterParam(description, store); 361 m_config->addChild(param); 362 m_values.append(store); 363 } 364 else if (description.size() == 5 && description[0] == "flag") 365 { 366 BooleanFilterParam* param = new BooleanFilterParam(description, store); 367 m_config->addChild(param); 368 m_values.append(store); 369 } 370 else 371 { 372 delete store; 373 } 374 } 375 } 376 addChild(m_config); 377 } 378 379 FilterWizard::~FilterWizard() 380 { 381 QListIterator<QString*> values(m_values); 382 while (values.hasNext()) 383 { 384 delete values.next(); 385 } 386 } 387 388 void FilterWizard::loadByString(QString params) 389 { 390 // Split the existing filter string into individual parameter values 391 QStringList parameters = QStringList::split(":", params); 392 393 // If the filter is disabled don't look for the rest of the parameters in 394 // the string. 395 if (m_hasDisable && parameters.count() == 1 && parameters[0] == m_disableBox->getFlag()) 396 { 397 m_disableBox->setValue(true); 398 } 399 else 400 { 401 for (int i = 0; i < parameters.count() && i < m_values.count(); i++) 402 { 403 m_values.value(i)->truncate(0); 404 m_values.value(i)->append(parameters[i]); 405 } 406 } 407 m_config->Load(); 408 } 409 410 QString FilterWizard::getString() 411 { 412 // Construct a filter parameter string from the widget values 413 QString filterstring = m_name; 414 QString parameters = ""; 415 416 // If the filter is disabled don't output any other parameters 417 if (m_hasDisable && m_disableBox->boolValue() == true) 418 { 419 parameters = m_disableBox->getFlag(); 420 } 421 else 422 { 423 bool hasFirst = false; 424 QListIterator<QString*> values(m_values); 425 while (values.hasNext()) 426 { 427 QString* value = values.next(); 428 if (!value->isNull() && !value->isEmpty()) 429 { 430 if (hasFirst) 431 { 432 parameters.append(":"); 433 } 434 hasFirst = true; 435 parameters.append(*value); 436 } 437 } 438 } 439 if (parameters.stripWhiteSpace() != "") 440 { 441 filterstring.append("=" + parameters); 442 } 443 444 return filterstring; 445 } 446 447 FilterWizard::IntegerFilterParam::IntegerFilterParam(QStringList info, QString* store) : 448 SliderSetting::SliderSetting(this,0,255,1), stringVal(store) 449 { 450 if (info.count() == 6) 451 { 452 min = info[3].toInt(); 453 max = info[4].toInt(); 454 455 setName(info[1]); 456 setLabel(info[1]); 457 setHelpText(info[2]); 458 459 setValue(info[5].toInt()); 460 stringVal->append(info[5]); 461 } 462 } 463 464 void FilterWizard::IntegerFilterParam::Save() 465 { 466 stringVal->truncate(0); 467 stringVal->append(getValue()); 468 } 469 470 FilterWizard::FloatFilterParam::FloatFilterParam(QStringList info, QString* store) : 471 SliderSetting::SliderSetting(this,0,100,1), stringVal(store) 472 { 473 if (info.count() == 6) 474 { 475 min = info[3].toFloat() >= 0 ? int(info[3].toFloat() * 100.0 + .1) : 476 int(info[3].toFloat() * 100.0 - .1); 477 max = info[4].toFloat() >= 0 ? int(info[4].toFloat() * 100.0 + .1) : 478 int(info[4].toFloat() * 100.0 - .1 ); 479 480 setName(info[1]); 481 setLabel(info[1]); 482 setHelpText(info[2]); 483 484 int defVal = info[5].toFloat() >= 0 ? int(info[5].toFloat() * 100.0 + .1) : 485 int(info[5].toFloat() * 100.0 - .1); 486 setValue(defVal); 487 stringVal->append(info[5]); 488 } 489 } 490 491 void FilterWizard::FloatFilterParam::Load() 492 { 493 setValue(stringVal->toFloat() >= 0 ? int(stringVal->toFloat() * 100.0 + .1) : 494 int(stringVal->toFloat() * 100.0 - .1)); 495 } 496 497 void FilterWizard::FloatFilterParam::Save() 498 { 499 stringVal->truncate(0); 500 stringVal->append(QString::number((float)(getValue().toInt()) / 100.0,'f',2)); 501 } 502 503 FilterWizard::BooleanFilterParam::BooleanFilterParam(QStringList info, QString* store) : 504 CheckBoxSetting::CheckBoxSetting(this), stringVal(store) 505 { 506 if (info.count() == 5) 507 { 508 setName(info[1]); 509 setLabel(info[1]); 510 setHelpText(info[2]); 511 512 flag = info[3]; 513 if (info[4] == "on") 514 { 515 setValue(true); 516 stringVal->append(flag); 517 } 518 else 519 { 520 setValue(false); 521 } 522 setEnabled(true); 523 } 524 } 525 526 void FilterWizard::BooleanFilterParam::Save() 527 { 528 stringVal->truncate(0); 529 stringVal->append(boolValue() ? flag : ""); 530 } 531 532 FilterWizard::DisableFilterParam::DisableFilterParam(QStringList info) : 533 CheckBoxSetting::CheckBoxSetting(this) 534 { 535 if (info.count() == 3) 536 { 537 setName(info[0]); 538 setLabel(info[0]); 539 setHelpText(QObject::tr("Disable the filter.")); 540 541 flag = info[1]; 542 if (info[2] == "yes") 543 { 544 setValue(true); 545 } 546 else 547 { 548 setValue(false); 549 } 550 setEnabled(true); 551 } 552 } -
mythtv/libs/libmythtv/filter.h
26 26 char *descript; 27 27 FmtConv *formats; 28 28 char *libname; 29 char *params; 29 30 } FilterInfo; 30 31 31 32 typedef struct VideoFilter_ -
mythtv/libs/libmythtv/filtermanager.cpp
105 105 free(tmp->name); 106 106 free(tmp->descript); 107 107 free(tmp->libname); 108 free(tmp->params); 108 109 delete [] (tmp->formats); 109 110 delete tmp; 110 111 } … … 161 162 newFilter->symbol = strdup(filtInfo->symbol); 162 163 newFilter->name = strdup(filtInfo->name); 163 164 newFilter->descript = strdup(filtInfo->descript); 165 newFilter->params = strdup(filtInfo->params); 164 166 165 167 int i = 0; 166 168 for (; filtInfo->formats[i].in != FMT_NONE; i++); -
mythtv/libs/libmythtv/recordingprofile.h
116 116 void ResizeTranscode(bool resize); 117 117 void SetLosslessTranscode(bool lossless); 118 118 void FiltersChanged(const QString &val); 119 void EditFilters(); 119 120 120 121 private: 121 122 ID *id; -
mythtv/libs/libmythtv/channelsettings.cpp
1 1 #include "channelsettings.h" 2 2 #include "cardutil.h" 3 3 #include "channelutil.h" 4 #include "filterchaineditor.h" 4 5 5 6 QString ChannelDBStorage::GetWhereClause(MSqlBindings &bindings) const 6 7 { … … 196 197 } 197 198 }; 198 199 199 class VideoFilter s : public LineEditSetting, public ChannelDBStorage200 class VideoFilterButton : public ButtonSetting, public ChannelDBStorage 200 201 { 201 202 public: 202 VideoFilter s(const ChannelID &id) :203 LineEditSetting(this), ChannelDBStorage(this, id, "videofilters")203 VideoFilterButton(const ChannelID &id) : 204 ButtonSetting(this), ChannelDBStorage(this, id, "videofilters") 204 205 { 205 206 setLabel(QObject::tr("Video filters")); 206 207 setHelpText(QObject::tr("Filters to be used when recording " … … 211 212 }; 212 213 213 214 214 class OutputFilter s : public LineEditSetting, public ChannelDBStorage215 class OutputFilterButton : public ButtonSetting, public ChannelDBStorage 215 216 { 216 217 public: 217 OutputFilter s(const ChannelID &id) :218 LineEditSetting(this), ChannelDBStorage(this, id, "outputfilters")218 OutputFilterButton(const ChannelID &id) : 219 ButtonSetting(this), ChannelDBStorage(this, id, "outputfilters") 219 220 { 220 221 setLabel(QObject::tr("Playback filters")); 221 222 setHelpText(QObject::tr("Filters to be used when recordings " … … 468 469 setLabel(QObject::tr("Channel Options - Filters")); 469 470 setUseLabel(false); 470 471 471 addChild(new VideoFilters(id)); 472 addChild(new OutputFilters(id)); 472 videoButton = new VideoFilterButton(id); 473 outputButton = new OutputFilterButton(id); 474 475 addChild(videoButton); 476 addChild(outputButton); 477 478 connect(videoButton, SIGNAL( pressed()), 479 this, SLOT(videoPressed())); 480 connect(outputButton, SIGNAL( pressed()), 481 this, SLOT(outputPressed())); 473 482 } 474 483 484 void ChannelOptionsFilters::videoPressed() 485 { 486 FilterChainEditor editor(videoButton->getValue()); 487 videoButton->setValue(editor.exec()); 488 } 489 490 void ChannelOptionsFilters::outputPressed() 491 { 492 FilterChainEditor editor(outputButton->getValue()); 493 outputButton->setValue(editor.exec()); 494 } 495 475 496 ChannelOptionsV4L::ChannelOptionsV4L(const ChannelID& id) : 476 497 VerticalConfigurationGroup(false, true, false, false) 477 498 { -
mythtv/libs/libmythtv/filterchaineditor.h
1 #ifndef FILTERCHAINEDITOR_H 2 #define FILTERCHAINEDITOR_H 3 4 #include "libmyth/settings.h" 5 #include "libmyth/mythwidgets.h" 6 #include "filtermanager.h" 7 8 class FilterWizard : public ConfigurationWizard 9 { 10 protected: 11 class IntegerFilterParam : public SliderSetting, public TransientStorage 12 { 13 public: 14 IntegerFilterParam(QStringList info, QString* store); 15 void Load() {settingValue = *stringVal;} 16 void Save(); 17 protected: 18 QString* stringVal; // The stored value 19 }; 20 21 class FloatFilterParam : public SliderSetting, public TransientStorage 22 { 23 public: 24 FloatFilterParam(QStringList info, QString* store); 25 void Load(); 26 void Save(); 27 protected: 28 QString* stringVal; // The stored value 29 }; 30 31 class BooleanFilterParam : public CheckBoxSetting, public TransientStorage 32 { 33 public: 34 BooleanFilterParam(QStringList info, QString* store); 35 void Load() {setValue(stringVal->compare(flag) == 0);} 36 void Save(); 37 protected: 38 QString flag; // The enabled flag 39 QString* stringVal; // The stored value 40 }; 41 42 class DisableFilterParam : public CheckBoxSetting, public TransientStorage 43 { 44 public: 45 DisableFilterParam(QStringList info); 46 QString getFlag(){return flag;} 47 protected: 48 QString flag; // The enabled flag 49 }; 50 51 VerticalConfigurationGroup *m_config; 52 DisableFilterParam *m_disableBox; 53 bool m_hasDisable; // If this filter can be disabled 54 QList<QString*> m_values; // List of the stored values 55 QString m_name; // Filter name 56 57 public: 58 FilterWizard(QString name); 59 ~FilterWizard(); 60 void loadByString(QString params); 61 QString getString(); 62 }; 63 64 class FilterListBox : public ListBoxSetting 65 { 66 Q_OBJECT 67 public: 68 FilterListBox(Storage *_storage) : ListBoxSetting(_storage){} 69 virtual QWidget* configWidget(ConfigurationGroup *cg, QWidget* parent, 70 const char* widgetName = 0); 71 signals: 72 void highlighted(int); 73 }; 74 75 class MPUBLIC FilterSelector : public QObject, public ConfigurationDialog 76 { 77 Q_OBJECT 78 public: 79 FilterSelector(); 80 QString getString(){return m_filterstring;} 81 virtual int exec(); 82 virtual void load(); 83 virtual void save(){}; 84 85 protected slots: 86 int open(QString filterName); 87 void setHelpText(int id); 88 89 protected: 90 FilterManager m_manager; // Gets info on available filters 91 QString m_filterstring; // [[<filter>=<options>,]...] 92 FilterListBox *m_listbox; 93 TransLabelSetting *m_help; 94 MythDialog *m_dialog; 95 bool m_redraw; 96 }; 97 98 class MPUBLIC FilterChainEditor : public QObject, public ConfigurationDialog 99 { 100 Q_OBJECT 101 public: 102 FilterChainEditor(QString chain); 103 virtual QString exec(); 104 virtual void load(); 105 virtual void save(){}; 106 107 protected slots: 108 void open(); 109 void deleteFilter(); // Remove filter from the chain 110 111 protected: 112 void raiseFilter(); // Move filter forward in the chain 113 void lowerFilter(); // Move filter backward in the chain 114 void editFilter(int id); // Modify filter paramters 115 QString getFilterString(); // Return a comma delineated filter list 116 FilterManager m_manager; // Gets info on available filters 117 QStringList m_filterList; // list of [[<filter>=<options>,]...] 118 ListBoxSetting *m_listbox; 119 MythDialog *m_dialog; 120 int m_lastSelected; 121 bool m_redraw; 122 }; 123 124 #endif -
mythtv/libs/libmythtv/filtermanager.h
45 45 VideoFrameType &outpixfmt, int &width, 46 46 int &height, int &bufsize); 47 47 48 const FilterInfo *GetFilterInfo(const QString &name) const; 49 50 filter_map_t GetAllFilterInfo() 51 { 52 return filter_map_t(filters); 53 } 54 48 55 private: 49 56 bool LoadFilterLib(const QString &path); 50 const FilterInfo *GetFilterInfo(const QString &name) const; 51 57 52 58 library_map_t dlhandles; 53 59 filter_map_t filters; 54 60 }; -
mythtv/libs/libmythtv/recordingprofile.cpp
4 4 #include <QLayout> 5 5 6 6 #include "recordingprofile.h" 7 #include "filterchaineditor.h" 7 8 #include "cardutil.h" 8 9 #include "libmyth/mythcontext.h" 9 10 #include "libmythdb/mythdb.h" … … 994 995 }; 995 996 }; 996 997 997 class TranscodeFilters : public LineEditSetting, public CodecParamStorage998 class TranscodeFilters : public ButtonSetting, public CodecParamStorage 998 999 { 999 1000 public: 1000 1001 TranscodeFilters(const RecordingProfile &parent) : 1001 LineEditSetting(this),1002 ButtonSetting(this), 1002 1003 CodecParamStorage(this, parent, "transcodefilters") 1003 1004 { 1004 1005 setLabel(QObject::tr("Custom Filters")); 1005 1006 setHelpText(QObject::tr("Filters used when transcoding with this " 1006 1007 "profile. This value must be blank to perform " 1007 "lossless transcoding. Format: " 1008 "[[<filter>=<options>,]...]" 1008 "lossless transcoding." 1009 1009 )); 1010 1010 }; 1011 1011 }; … … 1273 1273 this, SLOT( SetLosslessTranscode(bool))); 1274 1274 connect(tr_filters, SIGNAL(valueChanged(const QString&)), 1275 1275 this, SLOT(FiltersChanged(const QString&))); 1276 connect(tr_filters, SIGNAL(pressed ()), 1277 this, SLOT(EditFilters())); 1276 1278 } 1277 1279 } 1278 1280 else if (type.toUpper() == "DVB") … … 1284 1286 Load(); 1285 1287 } 1286 1288 1289 void RecordingProfile::EditFilters() 1290 { 1291 FilterChainEditor editor(tr_filters->getValue()); 1292 tr_filters->setValue(editor.exec()); 1293 } 1294 1287 1295 void RecordingProfile::FiltersChanged(const QString &val) 1288 1296 { 1289 1297 if (!tr_filters || !tr_lossless) -
mythtv/libs/libmythtv/channelsettings.h
105 105 106 106 class OnAirGuide; 107 107 class XmltvID; 108 class VideoFilterButton; 109 class OutputFilterButton; 108 110 109 111 class ChannelOptionsCommon: public VerticalConfigurationGroup 110 112 { … … 124 126 }; 125 127 126 128 class ChannelOptionsFilters: public VerticalConfigurationGroup { 129 Q_OBJECT 127 130 public: 128 131 ChannelOptionsFilters(const ChannelID& id); 132 public slots: 133 void outputPressed(); 134 void videoPressed(); 135 protected: 136 VideoFilterButton *videoButton; 137 OutputFilterButton *outputButton; 129 138 }; 130 139 131 140 class ChannelOptionsV4L: public VerticalConfigurationGroup { -
mythtv/filters/linearblend/filter_linearblend.c
380 380 name: "linearblend", 381 381 descript: "fast blending deinterlace filter", 382 382 formats: FmtList, 383 libname: NULL 383 libname: NULL, 384 params: "" 384 385 }, 385 386 FILT_NULL 386 387 }; -
mythtv/filters/quickdnr/filter_quickdnr.c
586 586 name: "quickdnr", 587 587 descript: "removes noise with a fast single/double thresholded average filter", 588 588 formats: FmtList, 589 libname: NULL 589 libname: NULL, 590 params: "int:threshold:Less to more filtering.:0:255:0" 590 591 }, 591 592 FILT_NULL 592 593 }; -
mythtv/filters/postprocess/filter_postprocess.c
133 133 name: "postprocess", 134 134 descript: "FFMPEG's postprocessing filters", 135 135 formats: FmtList, 136 libname: NULL 136 libname: NULL, 137 params: "" 137 138 }, 138 139 FILT_NULL 139 140 }; -
mythtv/filters/onefield/filter_onefield.c
101 101 { 102 102 symbol: "new_filter", 103 103 name: "onefield", 104 descript: "one-field-only deinterlace filter ; parameter \"bottom\" for bottom field, otherwise top",104 descript: "one-field-only deinterlace filter", 105 105 formats: FmtList, 106 106 libname: NULL, 107 params: "flag:keep bottom field:Keep the bottom field instead of the top one.:bottom:off" 107 108 }, 108 109 FILT_NULL 109 110 }; -
mythtv/filters/bobdeint/filter_bobdeint.c
150 150 descript: "bob deinterlace filter; splits fields to top and bottom of buffer", 151 151 formats: FmtList, 152 152 libname: NULL, 153 params: "" 153 154 }, 154 155 FILT_NULL 155 156 }; -
mythtv/filters/adjust/filter_adjust.c
313 313 name: "adjust", 314 314 descript: "adjust range and gamma of video", 315 315 formats: FmtList, 316 libname: NULL 316 libname: NULL, 317 params: "disable:-1:no," 318 "int:minimum luma:Minimum luma input value.:0:255:16," 319 "int:maximum luma:Maximum luma input value.:0:255:253," 320 "float:luma gamma:Luma gamma correction.:0:1:1," 321 "int:minimum chroma:Minimum chroma input value.:0:255:2," 322 "int:maximum chroma:Maximum chroma input value.:0:255:253," 323 "float:chroma gamma:Chroma gamma correction.:0:1:1" 317 324 }, 318 325 FILT_NULL 319 326 }; -
mythtv/filters/yadif/filter_yadif.c
592 592 name: "yadifdeint", 593 593 descript: "combines data from several fields to deinterlace with less motion blur", 594 594 formats: FmtList, 595 libname: NULL 595 libname: NULL, 596 params: "" 596 597 }, 597 598 { 598 599 symbol: "YadifDeintFilter", 599 600 name: "yadifdoubleprocessdeint", 600 601 descript: "combines data from several fields to deinterlace with less motion blur", 601 602 formats: FmtList, 602 libname: NULL 603 libname: NULL, 604 params: "" 603 605 },FILT_NULL 604 606 }; 605 607 -
mythtv/filters/force/filter_force.c
101 101 name: "forceyv12", 102 102 descript: "forces use of YV12 video format", 103 103 formats: Fmt_List_YV12, 104 libname: NULL 104 libname: NULL, 105 params: "" 105 106 }, 106 107 { 107 108 symbol: "new_force_yuv422p", 108 109 name: "forceyuv422p", 109 110 descript: "forces use of YUV422P video format", 110 111 formats: Fmt_List_YUV422P, 111 libname: NULL 112 libname: NULL, 113 params: "" 112 114 }, 113 115 { 114 116 symbol: "new_force_rgb24", 115 117 name: "forcergb24", 116 118 descript: "forces use of RGB24 video format", 117 119 formats: Fmt_List_RGB24, 118 libname: NULL 120 libname: NULL, 121 params: "" 119 122 }, 120 123 { 121 124 symbol: "new_force_argb32", 122 125 name: "forceargb32", 123 126 descript: "forces use of ARGB32 video format", 124 127 formats: Fmt_List_ARGB32, 125 libname: NULL 128 libname: NULL, 129 params: "" 126 130 }, 127 131 FILT_NULL 128 132 }; -
mythtv/filters/crop/filter_crop.c
301 301 name: "crop", 302 302 descript: "crops picture by macroblock intervals", 303 303 formats: FmtList, 304 libname: NULL 304 libname: NULL, 305 params: "int:top:Amount to crop on top as number of 16 pixel blocks.:0:255:1," 306 "int:left:Amount to crop on left as number of 16 pixel blocks.:0:255:1," 307 "int:bottom:Amount to crop on bottom as number of 16 pixel blocks.:0:255:1," 308 "int:right:Amount to crop on right as number of 16 pixel blocks.:0:255:1" 305 309 }, 306 310 FILT_NULL 307 311 }; -
mythtv/filters/kerneldeint/filter_kerneldeint.c
370 370 name: "kerneldeint", 371 371 descript: "combines data from several fields to deinterlace with less motion blur", 372 372 formats: FmtList, 373 libname: NULL 373 libname: NULL, 374 params: "int:threshold:Adjacent lines differing by more than the threshold value are filtered.:0:255:10," 375 "flag:skip chroma:If enabled only luminance will be filtered.:1:off" 374 376 }, 375 377 FILT_NULL 376 378 }; -
mythtv/filters/ivtc/filter_ivtc.c
252 252 name: "ivtc", 253 253 descript: "inverse telecine filter", 254 254 formats: FmtList, 255 libname: NULL 255 libname: NULL, 256 params: "" 256 257 }, 257 258 FILT_NULL 258 259 }; -
mythtv/filters/invert/filter_invert.c
79 79 name: "invert", 80 80 descript: "inverts the colors of the input video", 81 81 formats: FmtList, 82 libname: NULL 82 libname: NULL, 83 params: "" 83 84 }, 84 85 FILT_NULL 85 86 }; -
mythtv/filters/greedyhdeint/filter_greedyhdeint.c
333 333 name: "greedyhdeint", 334 334 descript: "combines data from several fields to deinterlace with less motion blur", 335 335 formats: FmtList, 336 libname: NULL 336 libname: NULL, 337 params: "" 337 338 }, 338 339 { 339 340 symbol: "GreedyHDeintFilter", 340 341 name: "greedyhdoubleprocessdeint", 341 342 descript: "combines data from several fields to deinterlace with less motion blur", 342 343 formats: FmtList, 343 libname: NULL 344 libname: NULL, 345 params: "" 344 346 },FILT_NULL 345 347 }; 346 348 -
mythtv/filters/denoise3d/filter_denoise3d.c
474 474 name: "denoise3d", 475 475 descript: "removes noise with a spatial and temporal low-pass filter", 476 476 formats: FmtList, 477 libname: NULL 477 libname: NULL, 478 params: "float:luma spatial filter strength:Luma spatial filter strength.:0:1:0," 479 "float:chroma spatial filter strength:Chroma spatial filter strength.:0:1:0," 480 "float:luma temporal filter strength:Luma temporal filter strength.:0:1:0" 478 481 }, 479 482 FILT_NULL 480 483 };
