From 7fccb61519fe84b2ced274f1cc4859d5000e86c6 Mon Sep 17 00:00:00 2001 From: Chris Xiong Date: Wed, 6 Jan 2016 21:28:44 +0800 Subject: Maple Dream. (WTF) --- qmpmainwindow.cpp | 49 ++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 48 insertions(+), 1 deletion(-) (limited to 'qmpmainwindow.cpp') diff --git a/qmpmainwindow.cpp b/qmpmainwindow.cpp index 00e23ff..242e52f 100644 --- a/qmpmainwindow.cpp +++ b/qmpmainwindow.cpp @@ -1,5 +1,6 @@ #include #include +#include #include #include "qmpmainwindow.hpp" #include "ui_qmpmainwindow.h" @@ -33,7 +34,7 @@ qmpMainWindow::qmpMainWindow(QWidget *parent) : else setGeometry(QStyle::alignedRect( Qt::LeftToRight,Qt::AlignCenter,size(), qApp->desktop()->availableGeometry())); - } + }show(); if(qmpSettingsWindow::getSettingsIntf()->value("DialogStatus/PListWShown",0).toInt()) {ui->pbPList->setChecked(true);on_pbPList_clicked();} if(qmpSettingsWindow::getSettingsIntf()->value("DialogStatus/ChnlWShown",0).toInt()) @@ -53,6 +54,52 @@ qmpMainWindow::~qmpMainWindow() delete ui; } +int qmpMainWindow::pharseArgs(int argc,char** argv) +{ + bool havemidi=false,loadfolder=false; + for(int i=1;iemptyList();} + if(loadfolder||qmpSettingsWindow::getSettingsIntf()->value("Behavior/LoadFolder",0).toInt()) + { + QDirIterator di(QUrl(argv[i]).adjusted(QUrl::RemoveFilename).toString()); + while(di.hasNext()) + { + QString c=di.next(); + if((c.endsWith(".mid")||c.endsWith(".midi"))&&fluid_is_midifile(c.toStdString().c_str())) + plistw->insertItem(c.toStdString().c_str()); + } + } + else + plistw->insertItem(argv[i]); + } + } + if(havemidi)on_pbPlayPause_clicked(); + return 0; +} + void qmpMainWindow::closeEvent(QCloseEvent *event) { on_pbStop_clicked();fin=true; -- cgit v1.2.3