Ticket #1010: mythlcdserver.diff
File mythlcdserver.diff, 4.3 KB (added by , 18 years ago) |
---|
-
lcdprocclient.cpp
432 432 sendToServer("screen_add Music"); 433 433 setPriority("Music", LOW); 434 434 sendToServer("widget_add Music topWidget string"); 435 sendToServer("widget_add Music topWidget2 string"); 435 436 sendToServer("widget_add Music timeWidget string"); 436 437 sendToServer("widget_add Music infoWidget string"); 437 438 sendToServer("widget_add Music progressBar hbar"); … … 928 929 929 930 void LCDProcClient::startMusic(QString artist, QString album, QString track) 930 931 { 932 // Playing music displays: 933 // For 2-line displays: 934 // <ArtistAlbumTitle> 935 // <Elapse/Remaining Time> 936 // For 3-line displays: 937 // <ArtistAlbumTitle> 938 // <Elapse/Remaining Time> 939 // <Info+ProgressBar> 940 // For displays with more than 3 lines: 941 // <ArtistAlbum> 942 // <Title> 943 // <Elapse/Remaining Time> 944 // <Info+ProgressBar> 945 946 // Clear the progressBar and timeWidget before activating the Music 947 // screen. This prevents the display of outdated junk. 948 sendToServer("widget_set Music progressBar 1 1 0"); 949 sendToServer("widget_set Music timeWidget 1 1 \"\""); 950 931 951 QString aString; 932 952 music_progress = 0.0f; 933 if (lcd_showmusic)934 setPriority("Music", HIGH);935 953 aString = artist; 936 954 if (lcd_showmusic_items == "ArtistAlbumTitle") { 937 955 aString += " ["; 938 956 aString += album; 939 957 aString += "] "; 940 } else {958 } else if (lcdHeight < 4) { 941 959 aString += " - "; 942 960 } 943 aString += track; 961 962 if (lcdHeight < 4) { 963 aString += track; 964 } 965 else { 966 assignScrollingText(track, "Music", "topWidget2", 2); 967 } 968 assignScrollingText(aString, "Music"); 969 970 971 // OK, every this is at least somewhat initialised. Activate 972 // the music screen. 944 973 activeScreen = "Music"; 945 assignScrollingText(aString, "Music"); 974 if (lcd_showmusic) 975 setPriority("Music", HIGH); 946 976 } 947 977 948 978 void LCDProcClient::startChannel(QString channum, QString title, QString subtitle) … … 1783 1813 1784 1814 void LCDProcClient::outputMusic() 1785 1815 { 1786 outputCenteredText("Music", music_time, "timeWidget", 2);1816 int info_width = 0; 1787 1817 1818 // See startMusic() for a discription of the Music screen contents 1819 1820 outputCenteredText("Music", music_time, "timeWidget", 1821 lcdHeight < 4 ? 2 : 3); 1822 1788 1823 if (lcdHeight > 2) 1789 1824 { 1790 QString props;1791 QString shuffle = " 1792 QString repeat = " 1825 QString aString; 1826 QString shuffle = ""; 1827 QString repeat = ""; 1793 1828 1794 1829 if (music_shuffle == 1) 1795 1830 { 1796 shuffle = "S hfl ?";1831 shuffle = "S:? "; 1797 1832 } 1798 1833 else if (music_shuffle == 2) 1799 1834 { 1800 shuffle = "S hfl i";1835 shuffle = "S:i "; 1801 1836 } 1802 1837 1803 1838 if (music_repeat == 1) 1804 1839 { 1805 repeat = "R pt 1";1840 repeat = "R:1 "; 1806 1841 } 1807 1842 else if (music_repeat == 2) 1808 1843 { 1809 repeat = "R pt *";1844 repeat = "R:* "; 1810 1845 } 1811 1846 1812 props.sprintf("%s %s", shuffle.ascii(), repeat.ascii()); 1847 if (shuffle.length() != 0 || repeat.length() != 0) { 1848 aString.sprintf("%s%s", shuffle.ascii(), repeat.ascii()); 1813 1849 1814 outputCenteredText("Music", props, "infoWidget", lcdHeight); 1815 } 1850 info_width = aString.length(); 1851 outputLeftText("Music", aString, "infoWidget", lcdHeight); 1852 } 1853 else 1854 outputLeftText("Music", " ", "infoWidget", lcdHeight); 1816 1855 1817 if (lcdHeight > 3) 1818 { 1819 QString aString; 1820 aString = "widget_set Music progressBar 1 3 "; 1821 aString += QString::number((int)rint(music_progress * lcdWidth * 1822 cellWidth)); 1856 aString = "widget_set Music progressBar "; 1857 aString += QString::number(info_width + 1); 1858 aString += " "; 1859 aString += QString::number(lcdHeight); 1860 aString += " "; 1861 aString += QString::number((int)rint(music_progress * 1862 (lcdWidth - info_width) * cellWidth)); 1823 1863 sendToServer(aString); 1864 1824 1865 } 1825 1866 } 1826 1867