Ticket #3676: mythmusic.patch
File mythmusic.patch, 7.8 KB (added by , 17 years ago) |
---|
-
./mythmusic/mythmusic/playbackbox.cpp
old new PlaybackBoxMusic::PlaybackBoxMusic(MythM 93 93 show_album_art = gContext->GetNumSetting("VisualAlbumArtOnSongChange", 0); 94 94 random_visualizer = gContext->GetNumSetting("VisualRandomize", 0); 95 95 96 m_pushedButton = NULL; 96 m_pushedButton = NULL; 97 m_ShuffleIcon = NULL; 98 m_RepeatIcon = NULL; 97 99 98 100 // Through the magic of themes, our "GUI" already exists we just need to 99 101 // wire up it … … void PlaybackBoxMusic::setShuffleMode(un 1563 1565 else 1564 1566 shuffle_button->setText(tr("Shuffle: Smart")); 1565 1567 } 1568 1569 if (m_ShuffleIcon) 1570 m_ShuffleIcon->hide(); 1571 1572 if (shuffle_icon_intelligent) 1573 shuffle_icon_intelligent->show(); 1574 1575 m_ShuffleIcon = shuffle_icon_intelligent; 1576 1566 1577 music_tree_list->scrambleParents(true); 1567 1578 1568 1579 if (class LCD *lcd = LCD::Get()) … … void PlaybackBoxMusic::setShuffleMode(un 1578 1589 else 1579 1590 shuffle_button->setText(tr("Shuffle: Rand")); 1580 1591 } 1592 1593 if (m_ShuffleIcon) 1594 m_ShuffleIcon->hide(); 1595 1596 if (shuffle_icon_random) 1597 shuffle_icon_random->show(); 1598 1599 m_ShuffleIcon = shuffle_icon_random; 1600 1581 1601 music_tree_list->scrambleParents(true); 1582 1602 1583 1603 if (class LCD *lcd = LCD::Get()) … … void PlaybackBoxMusic::setShuffleMode(un 1593 1613 else 1594 1614 shuffle_button->setText(tr("Shuffle: Album")); 1595 1615 } 1616 1617 if (m_ShuffleIcon) 1618 m_ShuffleIcon->hide(); 1619 1620 if (shuffle_icon_album) 1621 shuffle_icon_album->show(); 1622 1623 m_ShuffleIcon = shuffle_icon_album; 1624 1596 1625 music_tree_list->scrambleParents(true); 1597 1626 1598 1627 if (class LCD *lcd = LCD::Get()) … … void PlaybackBoxMusic::setShuffleMode(un 1608 1637 else 1609 1638 shuffle_button->setText(tr("Shuffle: None")); 1610 1639 } 1640 1641 if (m_ShuffleIcon) 1642 m_ShuffleIcon->hide(); 1643 1644 m_ShuffleIcon = NULL; 1645 1611 1646 music_tree_list->scrambleParents(false); 1612 1647 1613 1648 if (class LCD *lcd = LCD::Get()) … … void PlaybackBoxMusic::setRepeatMode(uns 1671 1706 switch (repeatmode) 1672 1707 { 1673 1708 case REPEAT_ALL: 1674 if (keyboard_accelerators) 1675 repeat_button->setText(tr("2 Repeat: All")); 1676 else 1677 repeat_button->setText(tr("Repeat: All")); 1709 if (repeat_button) 1710 { 1711 if (keyboard_accelerators) 1712 repeat_button->setText(tr("2 Repeat: All")); 1713 else 1714 repeat_button->setText(tr("Repeat: All")); 1715 } 1716 1717 if (m_RepeatIcon) 1718 m_RepeatIcon->hide(); 1719 1720 if (repeat_icon_all) 1721 repeat_icon_all->show(); 1722 1723 m_RepeatIcon = repeat_icon_all; 1678 1724 1679 1725 if (class LCD *lcd = LCD::Get()) 1680 1726 lcd->setMusicRepeat (LCD::MUSIC_REPEAT_ALL); … … void PlaybackBoxMusic::setRepeatMode(uns 1682 1728 bannerEnable(tr("Repeat: All"), 4000); 1683 1729 break; 1684 1730 case REPEAT_TRACK: 1685 if (keyboard_accelerators) 1686 repeat_button->setText(tr("2 Repeat: Track")); 1687 else 1688 repeat_button->setText(tr("Repeat: Track")); 1731 if (repeat_button) 1732 { 1733 if (keyboard_accelerators) 1734 repeat_button->setText(tr("2 Repeat: Track")); 1735 else 1736 repeat_button->setText(tr("Repeat: Track")); 1737 } 1738 1739 if (m_RepeatIcon) 1740 m_RepeatIcon->hide(); 1741 1742 if (repeat_icon_track) 1743 repeat_icon_track->show(); 1744 1745 m_RepeatIcon = repeat_icon_track; 1689 1746 1690 1747 if (class LCD *lcd = LCD::Get()) 1691 1748 lcd->setMusicRepeat (LCD::MUSIC_REPEAT_TRACK); … … void PlaybackBoxMusic::setRepeatMode(uns 1693 1750 bannerEnable(tr("Repeat: Track"), 4000); 1694 1751 break; 1695 1752 default: 1696 if (keyboard_accelerators) 1697 repeat_button->setText(tr("2 Repeat: None")); 1698 else 1699 repeat_button->setText(tr("Repeat: None")); 1753 if (repeat_button) 1754 { 1755 if (keyboard_accelerators) 1756 repeat_button->setText(tr("2 Repeat: None")); 1757 else 1758 repeat_button->setText(tr("Repeat: None")); 1759 } 1760 1761 if (m_RepeatIcon) 1762 m_RepeatIcon->hide(); 1763 1764 m_RepeatIcon = NULL; 1700 1765 1701 1766 if (class LCD *lcd = LCD::Get()) 1702 1767 lcd->setMusicRepeat (LCD::MUSIC_REPEAT_NONE); … … void PlaybackBoxMusic::wipeTrackInfo() 2027 2092 ratings_image->setRepeat(0); 2028 2093 if (current_visualization_text) 2029 2094 current_visualization_text->SetText(""); 2095 2096 if (albumart_image) 2097 WipeAlbumArt(); 2030 2098 } 2031 2099 2032 2100 void PlaybackBoxMusic::updateTrackInfo(Metadata *mdata) … … void PlaybackBoxMusic::updateTrackInfo(M 2038 2106 if (album_text) 2039 2107 album_text->SetText(mdata->Album()); 2040 2108 2109 if (albumart_image) 2110 ShowAlbumArtImage(mdata); 2111 2041 2112 setTrackOnLCD(mdata); 2042 2113 } 2043 2114 2115 void PlaybackBoxMusic::ShowAlbumArtImage(Metadata *mdata) 2116 { 2117 QSize img_size = albumart_image->GetSize(true); 2118 2119 QImage albumArt = mdata->getAlbumArt(IT_FRONTCOVER); 2120 2121 if (!albumArt.isNull()) 2122 { 2123 // draw the albumArt image 2124 albumArt = albumArt.smoothScale(img_size.width(), img_size.height(), QImage::ScaleMin); 2125 2126 QPixmap img(img_size.width(), img_size.height()); 2127 2128 if (img.convertFromImage(albumArt)) 2129 { 2130 albumart_image->SetImage(img); 2131 albumart_image->show(); 2132 } 2133 else 2134 albumart_image->hide(); 2135 } 2136 else 2137 albumart_image->hide(); 2138 } 2139 2140 void PlaybackBoxMusic::WipeAlbumArt() 2141 { 2142 albumart_image->hide(); 2143 } 2144 2044 2145 void PlaybackBoxMusic::openOutputDevice(void) 2045 2146 { 2046 2147 QString adevice; … … void PlaybackBoxMusic::wireUpTheme() 2207 2308 } 2208 2309 visual_blackhole = getUIBlackHoleType("visual_blackhole"); 2209 2310 2311 albumart_image = getUIImageType("albumart"); 2312 albumart_image->hide(); 2313 2210 2314 // Buttons 2211 2315 prev_button = getUIPushButtonType("prev_button"); 2212 2316 if (prev_button) … … void PlaybackBoxMusic::wireUpTheme() 2250 2354 if (repeat_button) 2251 2355 connect(repeat_button, SIGNAL(pushed()), this, SLOT(toggleRepeat())); 2252 2356 2357 shuffle_icon_random = getUIImageType("icon-shuffle-random"); 2358 shuffle_icon_intelligent = getUIImageType("icon-shuffle-intelligent"); 2359 shuffle_icon_album = getUIImageType("icon-shuffle-album"); 2360 shuffle_icon_random->hide(); 2361 shuffle_icon_intelligent->hide(); 2362 shuffle_icon_album->hide(); 2363 2364 repeat_icon_track = getUIImageType("icon-repeat-track"); 2365 repeat_icon_all = getUIImageType("icon-repeat-all"); 2366 repeat_icon_track->hide(); 2367 repeat_icon_all->hide(); 2368 2253 2369 pledit_button = getUITextButtonType("pledit_button"); 2254 2370 if (pledit_button) 2255 2371 connect(pledit_button, SIGNAL(pushed()), this, SLOT(editPlaylist())); -
./mythmusic/mythmusic/playbackbox.h
old new class PlaybackBoxMusic : public MythThem 76 76 void toggleFullBlankVisualizer(); 77 77 void end(); 78 78 void resetScrollCount(); 79 void ShowAlbumArtImage(Metadata *mdata); 80 void WipeAlbumArt(); 79 81 80 82 void handlePush(QString buttonname); 81 83 … … class PlaybackBoxMusic : public MythThem 234 236 235 237 UIPushButtonType *m_pushedButton; 236 238 239 UIImageType *m_ShuffleIcon; 240 UIImageType *m_RepeatIcon; 241 242 UIImageType *shuffle_icon_off; 243 UIImageType *shuffle_icon_random; 244 UIImageType *shuffle_icon_intelligent; 245 UIImageType *shuffle_icon_album; 246 247 UIImageType *repeat_icon_off; 248 UIImageType *repeat_icon_track; 249 UIImageType *repeat_icon_all; 250 UIImageType *albumart_image; 251 237 252 UITextButtonType *shuffle_button; 238 253 UITextButtonType *repeat_button; 239 254 UITextButtonType *pledit_button;