Ticket #783: musicpause.patch
File musicpause.patch, 2.8 KB (added by , 18 years ago) |
---|
-
mythplugins/mythmusic/mythmusic/playbackbox.cpp
48 48 progress = NULL; 49 49 50 50 lcd_volume_visible = false; 51 isplaying = false;51 state = IDLE; 52 52 tree_is_done = false; 53 53 first_playlist_check = true; 54 54 outputBufferSize = 256; … … 295 295 } 296 296 else if (action == "PAUSE") 297 297 { 298 if (is playing)298 if (isPlaying() || isPaused()) 299 299 { 300 300 if (pause_button) 301 301 pause_button->push(); … … 1036 1050 1037 1051 void PlaybackBoxMusic::play() 1038 1052 { 1039 if (is playing)1053 if (isPlaying()) 1040 1054 stop(); 1041 1055 1042 1056 if (curMeta) … … 1107 1121 1108 1122 decoder->start(); 1109 1123 1110 isplaying = true;1124 state = PLAYING; 1111 1125 curMeta->setLastPlay(); 1112 1126 curMeta->incPlayCount(); 1113 1127 } … … 1115 1129 1116 1130 void PlaybackBoxMusic::visEnable() 1117 1131 { 1118 if (!visualizer_status != 2 && is playing)1132 if (!visualizer_status != 2 && isPlaying()) 1119 1133 { 1120 1134 setUpdatesEnabled(false); 1121 1135 mainvisual->setGeometry(0, 0, screenwidth, screenheight); … … 1199 1213 { 1200 1214 if (output) 1201 1215 { 1202 isplaying = !isplaying; 1203 output->Pause(!isplaying); //Note pause doesn't take effet instantly 1216 if (isPlaying()) 1217 state = PAUSED; 1218 else if (isPaused()) 1219 state = PLAYING; 1220 1221 output->Pause(isPaused()); //Note pause doesn't take effet instantly 1204 1222 } 1205 1223 // wake up threads 1206 1224 if (decoder) … … 1262 1280 if (info_text) 1263 1281 info_text->SetText(""); 1264 1282 1265 isplaying = false;1283 state = IDLE; 1266 1284 } 1267 1285 1268 1286 void PlaybackBoxMusic::stopAll() … … 1326 1344 { 1327 1345 stopDecoder(); 1328 1346 1329 isplaying = false;1347 state = IDLE; 1330 1348 1331 1349 if (repeatmode == REPEAT_TRACK) 1332 1350 play(); … … 1427 1445 music_tree_list->setVisualOrdering(1); 1428 1446 music_tree_list->refresh(); 1429 1447 1430 if (is playing)1448 if (isPlaying()) 1431 1449 setTrackOnLCD(curMeta); 1432 1450 } 1433 1451 -
mythplugins/mythmusic/mythmusic/playbackbox.h
142 142 unsigned int shufflemode; 143 143 unsigned int repeatmode; 144 144 145 bool isplaying; 145 typedef enum State { 146 IDLE, 147 PLAYING, 148 PAUSED 149 }; 150 State state; 151 152 bool isPlaying(void) { return state == PLAYING; } 153 bool isPaused(void) { return state == PAUSED; } 154 146 155 bool lcd_volume_visible; 147 156 148 157 bool menufilters;