Changeset 16624
- Timestamp:
- 06/17/12 13:20:00 (12 years ago)
- Location:
- titan
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
titan/plugins/tmc/tmc.h
r16622 r16624 10 10 //Mainmenu 11 11 int menu0pos = 0; 12 char* menu0[] = {"skin/tmcsettings.png", "skin/tmcpicture.png", "skin/tmcvideo.png", "skin/tmcaudio.png", "skin/tmc exit.png"};13 char* menu0txt[] = {"Settings", "Picture", "Video", "Audio", " Exit"};12 char* menu0[] = {"skin/tmcsettings.png", "skin/tmcpicture.png", "skin/tmcvideo.png", "skin/tmcaudio.png", "skin/tmcplaylist.png", "skin/tmcexit.png"}; 13 char* menu0txt[] = {"Settings", "Picture", "Video", "Audio", "Playlist", "Exit"}; 14 14 15 15 //Settings 16 16 int menu1pos = 0; 17 char* menu1[] = {"skin/tmcscan.png", "skin/tmcscandir.png", "skin/tmcsettings.png", "skin/tmcdb.png", "skin/tmc back.png"};18 char* menu1txt[] = {"Scan All", "Scan Dir", "Main", "Database Info", " Back"};17 char* menu1[] = {"skin/tmcscan.png", "skin/tmcscandir.png", "skin/tmcsettings.png", "skin/tmcdb.png", "skin/tmceditplaylist.png", "skin/tmcback.png"}; 18 char* menu1txt[] = {"Scan All", "Scan Dir", "Main", "Database Info", "Playlist Edit", "Back"}; 19 19 20 20 //Picture … … 545 545 } 546 546 547 //flag 0: editmode 548 //flag 1: showmode 549 struct mainplaylist* screentmcplaylist(int flag) 550 { 551 //TODO: 552 struct mainplaylist* mplaylist = NULL; 553 struct skin* playlist = getscreen("playlist"); 554 char* bg = NULL; 555 556 drawscreen(playlist, 2, 0); 557 bg = savescreen(playlist); 558 559 mplaylist = screenmainplaylist(flag); 560 561 restorescreen(bg, playlist); 562 blitfb(0); 563 564 return mplaylist; 565 } 566 547 567 void screentmcedit(char* file, int menuid) 548 568 { … … 955 975 { 956 976 int rcret = 0, menuid = 0, active = 1; 957 int audioplaytype = 0, picplaytype = 0 ;977 int audioplaytype = 0, picplaytype = 0, playlistplaytype = 0; 958 978 struct skin* tmcbg = getscreen("tmcbg"); 959 979 struct skin* load = getscreen("loading"); … … 1151 1171 screentmcdb(); 1152 1172 } 1173 else if(menuid == 1 && ostrcmp("Playlist Edit", tmcmenutxt->ret) == 0) 1174 { 1175 screentmcplaylist(0); 1176 } 1153 1177 else if(menuid == 1 && ostrcmp("Main", tmcmenutxt->ret) == 0) 1154 1178 { … … 1382 1406 tmcmenuscroll(menuid, active, tmcmenutxt, tmcmenu1, tmcmenu2, tmcmenu3, tmcmenu3p2, tmcmenu4, tmcmenu5, 0); 1383 1407 } 1408 else if(ostrcmp("Playlist", tmcmenutxt->ret) == 0) //playlist 1409 { 1410 int playlistret = 0; 1411 struct mainplaylist* mplaylist = NULL; 1412 1413 mplaylist = screentmcplaylist(1); 1414 if(mplaylist != NULL) 1415 { 1416 struct playlist* plist = mplaylist->playlist; 1417 drawscreen(skin, 0, 0); 1418 if(servicestop(status.aktservice, 1, 1) == 0) 1419 { 1420 while(plist != NULL) 1421 { 1422 //TODO: play playlist 1423 playlistret = screenplay(plist->file, 0, 0); 1424 if(playlistret == 1 || playlistret == 2) break; 1425 1426 if(playlistplaytype == 2) //random 1427 plist = getplaylistrandom(mplaylist->playlist, getplaylistmax(mplaylist->playlist)); 1428 else //next 1429 plist = plist->next; 1430 } 1431 1432 playstartservice(); 1433 } 1434 1435 drawscreen(tmcbg, 0, 1); 1436 tmcpicscroll(menuid, tmcpictitle, tmcpicstar, tmcstatus, tmcpic1, tmcpic2, tmcpic3, tmcpic4, tmcpic5, tmcpictitlebg, tmcpicstarbg, tmcstatusbg, 0); 1437 tmcmenuscroll(menuid, active, tmcmenutxt, tmcmenu1, tmcmenu2, tmcmenu3, tmcmenu3p2, tmcmenu4, tmcmenu5, 0); 1438 } 1439 } 1384 1440 1385 1441 continue; … … 1406 1462 mfilter = mediadbfilterpos; 1407 1463 1408 if(servicestop(status.aktservice, 1, 1) == 1)1464 if(servicestop(status.aktservice, 1, 1) == 0) 1409 1465 if(rcret == 0) 1410 1466 { -
titan/titan/playlist.h
r16511 r16624 492 492 } 493 493 494 void getplaylistmax(struct skin* playlist, int* maxdirs, int* maxfiles) 495 { 496 struct skin* node = playlist; 497 498 while(node != NULL) 499 { 500 if(node->del == 2) 501 { 502 if(node->input != NULL) 503 (*maxdirs)++; 504 else 505 (*maxfiles)++; 506 } 507 node = node->next; 508 } 509 } 510 511 struct skin* getplaylistrandom(struct skin* playlist, int maxdirs, int maxfiles) 494 int getplaylistmax(struct playlist* plist) 512 495 { 513 496 int count = 0; 514 struct skin* node = playlist; 497 struct skin* node = plist; 498 499 while(node != NULL) 500 { 501 count++; 502 node = node->next; 503 } 504 505 return count; 506 } 507 508 struct playlist* getplaylistrandom(struct playlist* plist, int max) 509 { 510 int count = 0; 511 struct skin* node = plist; 515 512 516 if(max files< 1) return NULL;513 if(max < 1) return NULL; 517 514 518 515 srand(time(NULL)); 519 int r = rand() % max files;516 int r = rand() % max; 520 517 r++; 521 518 522 519 while(node != NULL) 523 520 { 524 if(node->del == 2 && node->input == NULL) 525 { 526 count++; 527 if(count == r) break; 528 } 521 count++; 522 if(count == r) break; 529 523 530 524 node = node->next;
Note: See TracChangeset
for help on using the changeset viewer.