Ticket #6547: mythvideodefaultplayer-fixes.patch
File mythvideodefaultplayer-fixes.patch, 9.8 KB (added by , 15 years ago) |
---|
-
mythplugins/mythvideo/mythvideo/videodlg.h
25 25 const QString &lwinName, const QString &lname, 26 26 VideoList *video_list); 27 27 28 virtual void playVideo(Metadata *someItem );28 virtual void playVideo(Metadata *someItem, bool defaultplayer=false); 29 29 30 30 GenericTree *getVideoTreeRoot(void); 31 31 … … 45 45 void exitWin(); 46 46 virtual void slotParentalLevelChanged(); 47 47 virtual void slotWatchVideo(); 48 virtual void slotWatchVideoDefault(); 48 49 49 50 protected: 50 51 virtual ~VideoDialog(); // use deleteLater() instead for thread safety -
mythplugins/mythvideo/mythvideo/metadata.cpp
797 797 return ret; 798 798 } 799 799 800 QString Metadata::getPlayer(const Metadata *item )800 QString Metadata::getPlayer(const Metadata *item, bool defaultplayer) 801 801 { 802 802 QString empty; 803 return getPlayer(item, empty );803 return getPlayer(item, empty, defaultplayer); 804 804 } 805 805 806 QString Metadata::getPlayer(const Metadata *item, QString &internal_mrl )806 QString Metadata::getPlayer(const Metadata *item, QString &internal_mrl, bool defaultplayer) 807 807 { 808 808 if (!item) return ""; 809 809 810 if (defaultplayer) 811 return gContext->GetSetting("VideoDefaultPlayer"); 812 810 813 internal_mrl = item->Filename(); 811 814 812 815 if (item->PlayCommand().length()) return item->PlayCommand(); … … 833 836 return gContext->GetSetting("VideoDefaultPlayer"); 834 837 } 835 838 836 QString Metadata::getPlayCommand(const Metadata *item )839 QString Metadata::getPlayCommand(const Metadata *item, bool defaultplayer) 837 840 { 838 841 if (!item) return ""; 839 842 840 843 QString filename = item->Filename(); 841 QString handler = getPlayer(item );844 QString handler = getPlayer(item, defaultplayer); 842 845 843 846 QString arg = QString("\"%1\"").arg(QString(item->Filename()) 844 847 .replace(QRegExp("\""), "\\\"") -
mythplugins/mythvideo/mythvideo/videotree.cpp
458 458 { 459 459 focusButton = popup->addButton(tr("Watch This Video"), this, 460 460 SLOT(slotWatchVideo())); 461 popup->addButton(tr("Watch This Video (default player)"), this, SLOT(slotWatchVideoDefault())); 461 462 popup->addButton(tr("View Full Plot"), this, SLOT(slotViewPlot())); 462 463 popup->addButton(tr("View Cast"), this, SLOT(slotViewCast())); 463 464 } … … 565 566 VERBOSE(VB_IMPORTANT, QString("no Item to watch")); 566 567 } 567 568 568 void VideoTree:: playVideo(Metadata *someItem)569 void VideoTree::slotWatchVideoDefault() 569 570 { 571 cancelPopup(); 572 573 if (curitem) 574 playVideo(curitem,true); 575 else 576 VERBOSE(VB_IMPORTANT, QString("no Item to watch")); 577 } 578 579 void VideoTree::playVideo(Metadata *someItem, bool defaultplayer) 580 { 570 581 if (!someItem) 571 582 return; 572 583 573 PlayVideo(someItem->Filename(), m_video_list->getListCache() );584 PlayVideo(someItem->Filename(), m_video_list->getListCache(), defaultplayer); 574 585 575 586 m_imp->video_tree_list->deactivate(); 576 587 gContext->GetMainWindow()->raise(); -
mythplugins/mythvideo/mythvideo/videoutils.cpp
16 16 const QString VIDEO_COVERFILE_DEFAULT_OLD = QObject::tr("None"); 17 17 } 18 18 19 void PlayVideo(const QString &filename, const MetadataListManager &video_list )19 void PlayVideo(const QString &filename, const MetadataListManager &video_list, bool defaultplayer) 20 20 { 21 21 MetadataListManager::MetadataPtr item = video_list.byFilename(filename); 22 22 … … 29 29 playing_time.start(); 30 30 31 31 QString internal_mrl; 32 QString handler = Metadata::getPlayer(item.get(), internal_mrl); 32 QString handler; 33 34 handler = Metadata::getPlayer(item.get(), internal_mrl, defaultplayer); 35 33 36 // See if this is being handled by a plugin.. 34 if ( !gContext->GetMainWindow()->37 if (defaultplayer || !gContext->GetMainWindow()-> 35 38 HandleMedia(handler, internal_mrl, item->Plot(), item->Title(), 36 39 item->Director(), item->Length(), 37 40 QString::number(item->Year()))) 38 41 { 39 42 // No internal handler for this, play external 40 QString command = Metadata::getPlayCommand(item.get() );43 QString command = Metadata::getPlayCommand(item.get(), defaultplayer); 41 44 if (command.length()) 42 45 { 43 46 gContext->sendPlaybackStart(); -
mythplugins/mythvideo/mythvideo/videodlg.cpp
198 198 VERBOSE(VB_IMPORTANT, QString("no Item to watch")); 199 199 } 200 200 201 void VideoDialog:: playVideo(Metadata *someItem)201 void VideoDialog::slotWatchVideoDefault() 202 202 { 203 cancelPopup(); 204 205 if (curitem) 206 playVideo(curitem, true); 207 else 208 VERBOSE(VB_IMPORTANT, QString("no Item to watch")); 209 } 210 211 void VideoDialog::playVideo(Metadata *someItem, bool defaultplayer) 212 { 203 213 // Show a please wait message 204 214 LayerSet *container = theme->GetSet("playwait"); 205 215 if (container) … … 209 219 update(fullRect); 210 220 allowPaint = false; 211 221 212 PlayVideo(someItem->Filename(), m_video_list->getListCache() );222 PlayVideo(someItem->Filename(), m_video_list->getListCache(), defaultplayer); 213 223 214 224 gContext->GetMainWindow()->raise(); 215 225 gContext->GetMainWindow()->setActiveWindow(); -
mythplugins/mythvideo/mythvideo/videobrowser.cpp
130 130 { 131 131 focusButton = popup->addButton(tr("Watch This Video"), this, 132 132 SLOT(slotWatchVideo())); 133 popup->addButton(tr("Watch This Video (default player)"), this, SLOT(slotWatchVideoDefault())); 133 134 popup->addButton(tr("View Full Plot"), this, SLOT(slotViewPlot())); 134 135 popup->addButton(tr("View Cast"), this, SLOT(slotViewCast())); 135 136 } -
mythplugins/mythvideo/mythvideo/metadata.h
46 46 static SortKey GenerateDefaultSortKey(const Metadata &m, bool ignore_case); 47 47 static QString FilenameToTitle(const QString &file_name); 48 48 static QString trimTitle(const QString &title, bool ignore_case); 49 static QString getPlayer(const Metadata *item );50 static QString getPlayer(const Metadata *item, QString &internal_mrl );51 static QString getPlayCommand(const Metadata *item );49 static QString getPlayer(const Metadata *item, bool defaultplayer = false); 50 static QString getPlayer(const Metadata *item, QString &internal_mrl, bool defaultplayer = false); 51 static QString getPlayCommand(const Metadata *item, bool defaultplayer=false); 52 52 static bool getPlayer(const QString &extension, QString &player, 53 53 bool &use_default); 54 54 -
mythplugins/mythvideo/mythvideo/videogallery.cpp
499 499 { 500 500 focusButton = popup->addButton(tr("Watch This Video"), this, 501 501 SLOT(slotWatchVideo())); 502 popup->addButton(tr("Watch This Video (default player)"), this, SLOT(slotWatchVideoDefault())); 502 503 popup->addButton(tr("View Full Plot"), this, SLOT(slotViewPlot())); 503 504 popup->addButton(tr("View Cast"), this, SLOT(slotViewCast())); 504 505 popup->addButton(tr("View Details"), this, -
mythplugins/mythvideo/mythvideo/videotree.h
22 22 23 23 void buildVideoList(); 24 24 25 void playVideo(Metadata *someItem );25 void playVideo(Metadata *someItem, bool defaultplayer=false); 26 26 int videoExitType() { return m_exit_type; } 27 27 28 28 public slots: … … 33 33 void slotViewCast(); 34 34 void slotDoFilter(); 35 35 void slotWatchVideo(); 36 void slotWatchVideoDefault(); 36 37 37 38 void handleTreeListSelection(int node_int); 38 39 void handleTreeListEntry(int node_int); -
mythplugins/mythvideo/mythvideo/videoutils.h
4 4 class Metadata; 5 5 class MetadataListManager; 6 6 7 void PlayVideo(const QString &filename, const MetadataListManager &video_list );7 void PlayVideo(const QString &filename, const MetadataListManager &video_list, bool defaultplayer = false); 8 8 9 9 template <typename T> 10 10 void checkedSetText(T *item, const QString &text)