void MainWindow::replay() { if(wid->replay->isChecked()) { int i=p->currentIndex(); if(wid->slider->value()==wid->slider->maximum()) { p->setCurrentIndex(i); media->setMedia(p->currentMedia()); playmedia(); } } }
/* main routine */ int gui_main(void) { char rootpath[200]; int filenum; int stubnum; pspDebugScreenInit(); pspDebugScreenClear(); sprintf(rootpath, "ms0:/PSP/MUSIC/"); fillmedialist(rootpath); loopmode = !0; // Loop around, offering a mod, till they cancel filenum = 1; forceskip = 0; while (filenum >= 0) { // Setup screen so it doesnt get messy pspDebugScreenClear(); printf("%s\n\n", banner); { // Print out a list of the file extensions supported int c; printf("filetypes : "); for (c = 0; c < codecnum; c++) { unsigned char *ptr = stubs[c].extension; while (*ptr != 0) { printf("%s ", ptr); ptr += 4; } } printf("\n\n"); } // Filetype list printf("Media Path: %s\n\n", rootpath); filenum = selectmedia(); if (filenum >= 0) { playmedia(files_info[filenum].pathname, files_info[filenum].filename); } } return 0; }
void MainWindow::addtoplaylist() { QString str=QFileDialog::getOpenFileName(this,tr("Open File"), QDir::homePath(), tr("Music(*.mp3);;Video Files(*.mp4);;All Files(*.*)") ); list->addItem(str); p->addMedia(QUrl::fromLocalFile(str)); wid->netx->setEnabled(true); wid->prev->setEnabled(true); wid->replay->setEnabled(true); wid->tonext->setEnabled(true); if(media->state()!=QMediaPlayer::PlayingState) { p->setCurrentIndex(0); list->setCurrentRow(0); media->setMedia(p->currentMedia()); playmedia(); } }