Ticket #6547: mythvideodefaultplayer-trunk.patch
File mythvideodefaultplayer-trunk.patch, 5.1 KB (added by , 15 years ago) |
---|
-
mythplugins/mythvideo/mythvideo/videodlg.h
58 58 void SetCurrentNode(MythGenericTree *); 59 59 60 60 void playVideo(); 61 void playVideoDefault(); 61 62 void playVideoWithTrailers(); 62 63 void playTrailer(); 63 64 -
mythplugins/mythvideo/mythvideo/videodlg.cpp
840 840 } 841 841 842 842 void PlayVideo(const QString &filename, 843 const MetadataListManager &video_list )843 const MetadataListManager &video_list, bool defaultplayer = false) 844 844 { 845 845 const int WATCHED_WATERMARK = 10000; // Less than this and the chain of 846 846 // videos will not be followed when … … 856 856 { 857 857 playing_time.start(); 858 858 859 VideoPlayerCommand::PlayerFor(item.get() ).Play();859 VideoPlayerCommand::PlayerFor(item.get(), defaultplayer).Play(); 860 860 861 861 if (item->GetChildID() > 0) 862 862 item = video_list.byID(item->GetChildID()); … … 2186 2186 } 2187 2187 } 2188 2188 2189 m_menuPopup->AddButton(tr("Watch This Video (default player)"), SLOT(playVideoDefault())); 2189 2190 m_menuPopup->AddButton(tr("Video Info"), SLOT(InfoMenu()), true); 2190 2191 m_menuPopup->AddButton(tr("Manage Video"), SLOT(ManageMenu()), true); 2191 2192 } … … 2434 2435 PlayVideo(metadata->GetFilename(), m_d->m_videoList->getListCache()); 2435 2436 } 2436 2437 2438 void VideoDialog::playVideoDefault() 2439 { 2440 Metadata *metadata = GetMetadata(GetItemCurrent()); 2441 if (metadata) 2442 PlayVideo(metadata->GetFilename(), m_d->m_videoList->getListCache(), true); 2443 } 2444 2437 2445 namespace 2438 2446 { 2439 2447 struct SimpleCollect : public DirectoryHandler -
mythplugins/mythvideo/mythvideo/playercommand.h
4 4 class VideoPlayerCommand 5 5 { 6 6 public: 7 static VideoPlayerCommand PlayerFor(const class Metadata *item );7 static VideoPlayerCommand PlayerFor(const class Metadata *item, bool defaultplayer = false); 8 8 static VideoPlayerCommand PlayerFor(const QString &filename); 9 9 10 10 public: -
mythplugins/mythvideo/mythvideo/playercommand.cpp
184 184 ClearPlayerList(); 185 185 } 186 186 187 void PlayerFor(const Metadata *item )187 void PlayerFor(const Metadata *item, bool defaultplayer = false) 188 188 { 189 189 if (item) 190 190 { … … 197 197 else 198 198 filename = item->GetFilename(); 199 199 200 if ( play_command.length())200 if (!defaultplayer && play_command.length()) 201 201 { 202 202 AddPlayer(play_command, filename, item->GetPlot(), 203 203 item->GetTitle(), item->GetDirector(), … … 206 206 } 207 207 else 208 208 { 209 PlayerFor(filename, item);209 PlayerFor(filename, item, defaultplayer); 210 210 } 211 211 } 212 212 } 213 213 214 void PlayerFor(const QString &filename, const Metadata *extraData = 0)214 void PlayerFor(const QString &filename, const Metadata *extraData = 0, bool defaultplayer = false) 215 215 { 216 216 QString extension = filename.section(".", -1, -1); 217 217 QDir dir_test(QString("%1/VIDEO_TS").arg(filename)); … … 222 222 223 223 const FileAssociations::association_list fa_list = 224 224 FileAssociations::getFileAssociation().getList(); 225 for (FileAssociations::association_list::const_iterator p = 225 if (!defaultplayer) 226 for (FileAssociations::association_list::const_iterator p = 226 227 fa_list.begin(); p != fa_list.end(); ++p) 227 {228 if (p->extension.toLower() == extension.toLower() &&229 !p->use_default)230 228 { 231 play_command = p->playcommand; 232 break; 229 if (p->extension.toLower() == extension.toLower() && 230 !p->use_default) 231 { 232 play_command = p->playcommand; 233 break; 234 } 233 235 } 234 }235 236 236 237 if (play_command.trimmed().isEmpty()) 237 238 play_command = "Internal"; … … 297 298 298 299 //////////////////////////////////////////////////////////////////////// 299 300 300 VideoPlayerCommand VideoPlayerCommand::PlayerFor(const Metadata *item )301 VideoPlayerCommand VideoPlayerCommand::PlayerFor(const Metadata *item, bool defaultplayer) 301 302 { 302 303 VideoPlayerCommand ret; 303 ret.m_d->PlayerFor(item );304 ret.m_d->PlayerFor(item, defaultplayer); 304 305 return ret; 305 306 } 306 307