Ticket #5920: trailerplayback.5.diff
File trailerplayback.5.diff, 18.6 KB (added by , 15 years ago) |
---|
-
mythvideo/theme/default/video-ui.xml
735 735 </textarea> 736 736 737 737 <textarea name="browse_text" from="title_text"> 738 <position>50,3 40</position>738 <position>50,337</position> 739 739 <value>Include while Browsing:</value> 740 740 </textarea> 741 741 742 742 <textarea name="coverart_text_label" from="title_text"> 743 <position>50,3 90</position>743 <position>50,375</position> 744 744 <value>Cover Art:</value> 745 745 </textarea> 746 746 747 <textarea name="trailer_text_label" from="title_text"> 748 <position>50,405</position> 749 <value>Trailer:</value> 750 </textarea> 751 747 752 <textarea name="player_text" from="title_text"> 748 753 <position>50,445</position> 749 754 <value>Unique Player Command:</value> … … 772 777 </checkbox> 773 778 774 779 <button name="coverart_button"> 775 <area>310,3 85,32,32</area>780 <area>310,370,32,32</area> 776 781 <statetype name="buttonstate"> 777 782 <state name="active"> 778 783 <imagetype name="background"> … … 794 799 </button> 795 800 796 801 <textarea name="coverart_text" from="basetextarea"> 797 <area>350,3 90,250,40</area>802 <area>350,375,250,40</area> 798 803 <value>/path/to/the/thing.jpg</value> 799 804 </textarea> 800 805 806 <button name="trailer_button"> 807 <area>310,400,32,32</area> 808 <statetype name="buttonstate"> 809 <state name="active"> 810 <imagetype name="background"> 811 <filename>blankbutton_off.png</filename> 812 </imagetype> 813 </state> 814 <state name="selected" from="active"> 815 <imagetype name="background"> 816 <filename>blankbutton_on.png</filename> 817 </imagetype> 818 </state> 819 <state name="disabled" from="active" /> 820 <state name="pushed" from="active"> 821 <imagetype name="background"> 822 <filename>blankbutton_pushed.png</filename> 823 </imagetype> 824 </state> 825 </statetype> 826 </button> 827 828 <textarea name="trailer_text" from="basetextarea"> 829 <area>350,405,250,40</area> 830 <value>/path/to/the/thing.jpg</value> 831 </textarea> 832 833 801 834 <textedit name="player_edit" from="basetextedit"> 802 835 <position>310,435</position> 803 836 </textedit> -
mythvideo/theme/default-wide/video-ui.xml
727 727 </textarea> 728 728 729 729 <textarea name="browse_text" from="title_text"> 730 <position>50,3 40</position>730 <position>50,337</position> 731 731 <value>Include while Browsing:</value> 732 732 </textarea> 733 733 734 734 <textarea name="coverart_text_label" from="title_text"> 735 <position>50,3 90</position>735 <position>50,375</position> 736 736 <value>Cover Art:</value> 737 737 </textarea> 738 738 739 <textarea name="trailer_text_label" from="title_text"> 740 <position>50,405</position> 741 <value>Trailer:</value> 742 </textarea> 743 739 744 <textarea name="player_text" from="title_text"> 740 745 <position>50,445</position> 741 746 <value>Unique Player Command:</value> … … 764 769 </checkbox> 765 770 766 771 <button name="coverart_button"> 767 <area>310,3 85,32,32</area>772 <area>310,370,32,32</area> 768 773 <statetype name="buttonstate"> 769 774 <state name="active"> 770 775 <imagetype name="background"> … … 786 791 </button> 787 792 788 793 <textarea name="coverart_text" from="basetextarea"> 789 <area>350,3 90,250,40</area>794 <area>350,375,250,40</area> 790 795 <value>/path/to/the/thing.jpg</value> 791 796 </textarea> 792 797 798 <button name="trailer_button"> 799 <area>310,400,32,32</area> 800 <statetype name="buttonstate"> 801 <state name="active"> 802 <imagetype name="background"> 803 <filename>blankbutton_off.png</filename> 804 </imagetype> 805 </state> 806 <state name="selected" from="active"> 807 <imagetype name="background"> 808 <filename>blankbutton_on.png</filename> 809 </imagetype> 810 </state> 811 <state name="disabled" from="active" /> 812 <state name="pushed" from="active"> 813 <imagetype name="background"> 814 <filename>blankbutton_pushed.png</filename> 815 </imagetype> 816 </state> 817 </statetype> 818 </button> 819 820 <textarea name="trailer_text" from="basetextarea"> 821 <area>350,405,250,40</area> 822 <value>/path/to/the/thing.jpg</value> 823 </textarea> 824 793 825 <textedit name="player_edit" from="basetextedit"> 794 826 <position>310,435</position> 795 827 </textedit> -
mythvideo/mythvideo/videodlg.h
58 58 void SetCurrentNode(MythGenericTree *); 59 59 60 60 void playVideo(); 61 void playTrailer(); 61 62 62 63 void SwitchTree(); 63 64 void SwitchGallery(); -
mythvideo/mythvideo/metadatalistmanager.cpp
113 113 const QString BaseMetadataQuery( 114 114 "SELECT title, director, plot, rating, year, userrating," 115 115 "length, filename, showlevel, coverfile, inetref, childid," 116 "browse, playcommand, category, intid FROM videometadata");116 "browse, playcommand, category, intid, trailer FROM videometadata"); 117 117 118 118 query.prepare(BaseMetadataQuery); 119 119 -
mythvideo/mythvideo/metadata.cpp
87 87 typedef Metadata::cast_list cast_list; 88 88 89 89 public: 90 MetadataImp(const QString &filename, const QString & coverfile,90 MetadataImp(const QString &filename, const QString &trailer, const QString &coverfile, 91 91 const QString &title, int year, 92 92 const QString &inetref, const QString &director, 93 93 const QString &plot, float userrating, … … 102 102 m_inetref(inetref), m_director(director), m_plot(plot), 103 103 m_rating(rating), m_playcommand(playcommand), m_category(category), 104 104 m_genres(genres), m_countries(countries), m_cast(cast), 105 m_filename(filename), m_ coverfile(coverfile),105 m_filename(filename), m_trailer(trailer), m_coverfile(coverfile), 106 106 m_categoryID(categoryID), m_childID(childID), m_year(year), 107 107 m_length(length), m_showlevel(showlevel), m_browse(browse), m_id(id), 108 108 m_userrating(userrating) … … 135 135 m_countries = rhs.m_countries; 136 136 m_cast = rhs.m_cast; 137 137 m_filename = rhs.m_filename; 138 m_trailer = rhs.m_trailer; 138 139 m_coverfile = rhs.m_coverfile; 139 140 140 141 m_categoryID = rhs.m_categoryID; … … 212 213 const QString &getFilename() const { return m_filename; } 213 214 void setFilename(const QString &filename) { m_filename = filename; } 214 215 216 const QString &getTrailer() const { return m_trailer; } 217 void setTrailer(const QString &trailer) { m_trailer = trailer; } 218 215 219 QString getFilenameNoPrefix() const 216 220 { 217 221 QString ret(m_filename); … … 293 297 country_list m_countries; 294 298 cast_list m_cast; 295 299 QString m_filename; 300 QString m_trailer; 296 301 QString m_coverfile; 297 302 298 303 int m_categoryID; … … 393 398 394 399 void MetadataImp::Reset() 395 400 { 396 MetadataImp tmp(m_filename, VIDEO_ COVERFILE_DEFAULT,401 MetadataImp tmp(m_filename, VIDEO_TRAILER_DEFAULT, VIDEO_COVERFILE_DEFAULT, 397 402 Metadata::FilenameToTitle(m_filename), VIDEO_YEAR_DEFAULT, 398 403 VIDEO_INETREF_DEFAULT, VIDEO_DIRECTOR_DEFAULT, 399 404 VIDEO_PLOT_DEFAULT, 0.0, VIDEO_RATING_DEFAULT, 0, m_id, … … 485 490 m_playcommand = query.value(13).toString(); 486 491 m_categoryID = query.value(14).toInt(); 487 492 m_id = query.value(15).toInt(); 493 m_trailer = query.value(16).toString(); 488 494 489 495 VideoCategory::getCategory().get(m_categoryID, m_category); 490 496 … … 510 516 m_rating = VIDEO_RATING_DEFAULT; 511 517 if (m_coverfile.isEmpty()) 512 518 m_coverfile = VIDEO_COVERFILE_DEFAULT; 519 if (m_trailer.isEmpty()) 520 m_trailer = VIDEO_TRAILER_DEFAULT; 513 521 if (m_inetref.isEmpty()) 514 522 m_inetref = VIDEO_INETREF_DEFAULT; 515 523 if (isnan(m_userrating)) … … 527 535 528 536 query.prepare("INSERT INTO videometadata (title,director,plot," 529 537 "rating,year,userrating,length,filename,showlevel," 530 "coverfile,inetref,browse ) VALUES (:TITLE, :DIRECTOR, "538 "coverfile,inetref,browse,trailer) VALUES (:TITLE, :DIRECTOR, " 531 539 ":PLOT, :RATING, :YEAR, :USERRATING, :LENGTH, " 532 ":FILENAME, :SHOWLEVEL, :COVERFILE, :INETREF, :BROWSE )");540 ":FILENAME, :SHOWLEVEL, :COVERFILE, :INETREF, :BROWSE, :TRAILER)"); 533 541 534 542 } 535 543 else … … 537 545 query.prepare("UPDATE videometadata SET title = :TITLE, " 538 546 "director = :DIRECTOR, plot = :PLOT, rating= :RATING, " 539 547 "year = :YEAR, userrating = :USERRATING, " 540 "length = :LENGTH, filename = :FILENAME, "548 "length = :LENGTH, filename = :FILENAME, trailer = :TRAILER, " 541 549 "showlevel = :SHOWLEVEL, coverfile = :COVERFILE, " 542 550 "inetref = :INETREF, browse = :BROWSE, " 543 551 "playcommand = :PLAYCOMMAND, childid = :CHILDID, " … … 557 565 query.bindValue(":USERRATING", m_userrating); 558 566 query.bindValue(":LENGTH", m_length); 559 567 query.bindValue(":FILENAME", m_filename); 568 query.bindValue(":TRAILER", m_trailer); 560 569 query.bindValue(":SHOWLEVEL", m_showlevel); 561 570 query.bindValue(":COVERFILE", m_coverfile); 562 571 query.bindValue(":INETREF", m_inetref); … … 892 901 return false; 893 902 } 894 903 895 Metadata::Metadata(const QString &filename, const QString & coverfile,904 Metadata::Metadata(const QString &filename, const QString &trailer, const QString &coverfile, 896 905 const QString &title, int year, 897 906 const QString &inetref, const QString &director, 898 907 const QString &plot, float userrating, … … 904 913 const country_list &countries, 905 914 const cast_list &cast) 906 915 { 907 m_imp = new MetadataImp(filename, coverfile, title, year, inetref, director,916 m_imp = new MetadataImp(filename, trailer, coverfile, title, year, inetref, director, 908 917 plot, userrating, rating, length, id, showlevel, 909 918 categoryID, childID, browse, playcommand, category, 910 919 genres, countries, cast); … … 1116 1125 return m_imp->getFilenameNoPrefix(); 1117 1126 } 1118 1127 1128 const QString &Metadata::Trailer() const 1129 { 1130 return m_imp->getTrailer(); 1131 } 1132 1133 void Metadata::setTrailer(const QString &trailer) 1134 { 1135 m_imp->setTrailer(trailer); 1136 } 1137 1119 1138 const QString &Metadata::CoverFile() const 1120 1139 { 1121 1140 return m_imp->getCoverFile(); -
mythvideo/mythvideo/globals.cpp
15 15 const QString VIDEO_DIRECTOR_DEFAULT = VIDEO_DIRECTOR_UNKNOWN; 16 16 const QString VIDEO_INETREF_DEFAULT = "00000000"; 17 17 const QString VIDEO_COVERFILE_DEFAULT = QObject::tr("No Cover"); 18 const QString VIDEO_TRAILER_DEFAULT = QObject::tr("No Trailer"); 18 19 const QString VIDEO_RATING_DEFAULT = QObject::tr("NR"); 19 20 const QString VIDEO_PLOT_DEFAULT = QObject::tr("None"); 20 21 const QString VIDEO_CAST_DEFAULT = VIDEO_CAST_UNKNOWN; -
mythvideo/mythvideo/editmetadata.h
60 60 MythUICheckBox *m_browseCheck; 61 61 MythUIButton *m_coverartButton; 62 62 MythUIText *m_coverartText; 63 MythUIButton *m_trailerButton; 64 MythUIText *m_trailerText; 63 65 MythUIButton *m_doneButton; 64 66 65 67 // -
mythvideo/mythvideo/videodlg.cpp
23 23 #include <mythtv/libmythui/mythuistatetype.h> 24 24 #include <mythtv/libmythui/mythdialogbox.h> 25 25 #include <mythtv/libmythui/mythgenerictree.h> 26 #include "mythtv/libmythui/mythmainwindow.h" 26 27 27 28 #include "videodlg.h" 28 29 #include "videoscan.h" … … 1366 1367 if (node && node->getInt() >= 0) 1367 1368 { 1368 1369 m_menuPopup->AddButton(tr("Watch This Video"), SLOT(playVideo())); 1370 1371 Metadata *metadata = GetMetadata(GetItemCurrent()); 1372 // QString trailerFile = QString("%1.trailer").arg(metadata->Filename()); 1373 QString trailerFile = QString("%1").arg(metadata->Trailer()); 1374 if (QFile::exists(trailerFile)) 1375 { 1376 m_menuPopup->AddButton(tr("Watch Trailer"), SLOT(playTrailer())); 1377 } 1378 1369 1379 m_menuPopup->AddButton(tr("Video Info"), SLOT(InfoMenu())); 1370 1380 m_menuPopup->AddButton(tr("Manage Video"), SLOT(ManageMenu())); 1371 1381 } … … 1563 1573 gContext->GetMainWindow()->currentWidget()->setFocus(); 1564 1574 } 1565 1575 1576 void VideoDialog::playTrailer() 1577 { 1578 Metadata *metadata = GetMetadata(GetItemCurrent()); 1579 QString trailerFile = QString("%1").arg(metadata->Trailer()); 1580 QString command_string = "Internal"; 1581 1582 gContext->GetMainWindow()->HandleMedia(command_string, trailerFile); 1583 gContext->GetMainWindow()->raise(); 1584 gContext->GetMainWindow()->activateWindow(); 1585 if (gContext->GetMainWindow()->currentWidget()) 1586 gContext->GetMainWindow()->currentWidget()->setFocus(); 1587 } 1588 1566 1589 void VideoDialog::setParentalLevel(const ParentalLevel::Level &level) 1567 1590 { 1568 1591 m_private->m_parentalLevel.SetLevel(level); -
mythvideo/mythvideo/videoscan.cpp
181 181 // add files not already in the DB 182 182 if (!p->second) 183 183 { 184 Metadata newFile(p->first, VIDEO_ COVERFILE_DEFAULT,184 Metadata newFile(p->first, VIDEO_TRAILER_DEFAULT, VIDEO_COVERFILE_DEFAULT, 185 185 Metadata::FilenameToTitle(p->first), 186 186 VIDEO_YEAR_DEFAULT, 187 187 VIDEO_INETREF_DEFAULT, VIDEO_DIRECTOR_DEFAULT, -
mythvideo/mythvideo/metadata.h
53 53 bool &use_default); 54 54 55 55 public: 56 Metadata(const QString &filename = "", const QString & coverfile = "",56 Metadata(const QString &filename = "", const QString &trailer = "", const QString &coverfile = "", 57 57 const QString &title = "", int year = VIDEO_YEAR_DEFAULT, 58 58 const QString &inetref = "", const QString &director = "", 59 59 const QString &plot = "", float userrating = 0.0, 60 60 const QString &rating = "", int length = 0, 61 int id = 0, 61 int id = 0, 62 62 ParentalLevel::Level showlevel = ParentalLevel::plLowest, 63 63 int categoryID = 0, 64 64 int childID = -1, bool browse = true, … … 125 125 const QString& Filename() const; 126 126 void setFilename(const QString &filename); 127 127 128 const QString& Trailer() const; 129 void setTrailer(const QString &trailer); 130 128 131 QString getFilenameNoPrefix() const; 129 132 130 133 const QString &CoverFile() const; -
mythvideo/mythvideo/editmetadata.cpp
22 22 const MetadataListManager &cache) : MythScreenType(lparent, lname), 23 23 m_origMetadata(source_metadata), m_titleEdit(0), m_playerEdit(0), 24 24 m_categoryList(0), m_levelList(0), m_childList(0), m_browseCheck(0), 25 m_coverartButton(0), m_coverartText(0), m_doneButton(0), 25 m_coverartButton(0), m_coverartText(0), 26 m_trailerButton(0), m_trailerText(0), m_doneButton(0), 26 27 cachedChildSelection(0), m_metaCache(cache) 27 28 { 28 29 m_workingMetadata = new Metadata(*m_origMetadata); … … 44 45 UIUtilE::Assign(this, m_playerEdit, "player_edit"); 45 46 46 47 UIUtilE::Assign(this, m_coverartText, "coverart_text"); 48 UIUtilE::Assign(this, m_trailerText, "trailer_text"); 47 49 48 50 UIUtilE::Assign(this, m_categoryList, "category_select"); 49 51 UIUtilE::Assign(this, m_levelList, "level_select"); … … 214 216 if (m_workingMetadata->Browse()) 215 217 m_browseCheck->SetCheckState(MythUIStateType::Full); 216 218 m_coverartText->SetText(m_workingMetadata->CoverFile()); 219 m_trailerText->SetText(m_workingMetadata->Trailer()); 217 220 m_playerEdit->SetText(m_workingMetadata->PlayCommand()); 218 221 } 219 222 -
mythvideo/mythvideo/globals.h
13 13 extern const QString VIDEO_DIRECTOR_DEFAULT; 14 14 extern const QString VIDEO_INETREF_DEFAULT; 15 15 extern const QString VIDEO_COVERFILE_DEFAULT; 16 extern const QString VIDEO_TRAILER_DEFAULT; 16 17 extern const QString VIDEO_RATING_DEFAULT; 17 18 extern const QString VIDEO_PLOT_DEFAULT; 18 19 extern const QString VIDEO_CAST_DEFAULT;