Ticket #3676: mythmusic-shuffle_repeat.patch
File mythmusic-shuffle_repeat.patch, 7.2 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::wireUpTheme() 2217 2334 connect(rew_button, SIGNAL(pushed()), this, SLOT(seekback())); 2218 2335 2219 2336 pause_button = getUIPushButtonType("pause_button"); 2220 pause_button->setLockOn();2337 2221 2338 if (pause_button) 2339 { 2340 pause_button->setLockOn(); 2222 2341 connect(pause_button, SIGNAL(pushed(QString)), this, 2223 2342 SLOT(handlePush(QString))); 2343 } 2224 2344 2225 2345 play_button = getUIPushButtonType("play_button"); 2226 play_button->setLockOn();2346 2227 2347 if (play_button) 2348 { 2349 play_button->setLockOn(); 2228 2350 connect(play_button, SIGNAL(pushed(QString)), this, 2229 2351 SLOT(handlePush(QString))); 2352 } 2230 2353 2231 2354 stop_button = getUIPushButtonType("stop_button"); 2232 stop_button->setLockOn();2355 2233 2356 if (stop_button) 2357 { 2358 stop_button->setLockOn(); 2234 2359 connect(stop_button, SIGNAL(pushed(QString)), this, 2235 2360 SLOT(handlePush(QString))); 2361 } 2236 2362 2237 2363 ff_button = getUIPushButtonType("ff_button"); 2238 2364 if (ff_button) … … void PlaybackBoxMusic::wireUpTheme() 2250 2376 if (repeat_button) 2251 2377 connect(repeat_button, SIGNAL(pushed()), this, SLOT(toggleRepeat())); 2252 2378 2379 shuffle_icon_random = getUIImageType("icon-shuffle-random"); 2380 shuffle_icon_intelligent = getUIImageType("icon-shuffle-intelligent"); 2381 shuffle_icon_album = getUIImageType("icon-shuffle-album"); 2382 2383 if (shuffle_icon_random) 2384 shuffle_icon_random->hide(); 2385 2386 if (shuffle_icon_intelligent) 2387 shuffle_icon_intelligent->hide(); 2388 2389 if (shuffle_icon_album) 2390 shuffle_icon_album->hide(); 2391 2392 repeat_icon_track = getUIImageType("icon-repeat-track"); 2393 repeat_icon_all = getUIImageType("icon-repeat-all"); 2394 2395 if (repeat_icon_track) 2396 repeat_icon_track->hide(); 2397 2398 if (repeat_icon_all) 2399 repeat_icon_all->hide(); 2400 2253 2401 pledit_button = getUITextButtonType("pledit_button"); 2254 2402 if (pledit_button) 2255 2403 connect(pledit_button, SIGNAL(pushed()), this, SLOT(editPlaylist())); -
./mythmusic/mythmusic/playbackbox.h
old new class PlaybackBoxMusic : public MythThem 234 234 235 235 UIPushButtonType *m_pushedButton; 236 236 237 UIImageType *m_ShuffleIcon; 238 UIImageType *m_RepeatIcon; 239 240 UIImageType *shuffle_icon_off; 241 UIImageType *shuffle_icon_random; 242 UIImageType *shuffle_icon_intelligent; 243 UIImageType *shuffle_icon_album; 244 245 UIImageType *repeat_icon_off; 246 UIImageType *repeat_icon_track; 247 UIImageType *repeat_icon_all; 248 237 249 UITextButtonType *shuffle_button; 238 250 UITextButtonType *repeat_button; 239 251 UITextButtonType *pledit_button;