diff options
author | Chris Xiong <chirs241097@gmail.com> | 2017-02-12 23:33:41 +0800 |
---|---|---|
committer | Chris Xiong <chirs241097@gmail.com> | 2017-02-12 23:33:41 +0800 |
commit | 3312e495cf54a8bd6451552216f5aeea1a06d486 (patch) | |
tree | 2de25e8b53ba2747c613451fa16c3203578fbd93 /qmidiplayer-desktop | |
parent | d779d32c8c32e0e0c22662046498620b11fa46de (diff) | |
download | QMidiPlayer-3312e495cf54a8bd6451552216f5aeea1a06d486.tar.xz |
UI revolution cont'd. Powered by @BLumia.
Expose new APIs to plugin developer.
Use svg icons.
Diffstat (limited to 'qmidiplayer-desktop')
-rw-r--r-- | qmidiplayer-desktop/qmpchannelswindow.cpp | 4 | ||||
-rw-r--r-- | qmidiplayer-desktop/qmpchannelswindow.hpp | 2 | ||||
-rw-r--r-- | qmidiplayer-desktop/qmpefxwindow.cpp | 2 | ||||
-rw-r--r-- | qmidiplayer-desktop/qmpefxwindow.ui | 2 | ||||
-rw-r--r-- | qmidiplayer-desktop/qmpinfowindow.cpp | 2 | ||||
-rw-r--r-- | qmidiplayer-desktop/qmpmainwindow.cpp | 96 | ||||
-rw-r--r-- | qmidiplayer-desktop/qmpmainwindow.hpp | 1 | ||||
-rw-r--r-- | qmidiplayer-desktop/qmpmainwindow.ui | 646 | ||||
-rw-r--r-- | qmidiplayer-desktop/qmpplistwindow.cpp | 53 | ||||
-rw-r--r-- | qmidiplayer-desktop/qmpplistwindow.hpp | 2 | ||||
-rw-r--r-- | qmidiplayer-desktop/qmpplistwindow.ui | 16 | ||||
-rw-r--r-- | qmidiplayer-desktop/qmpplugin.cpp | 6 | ||||
-rw-r--r-- | qmidiplayer-desktop/qmpsettingswindow.cpp | 17 | ||||
-rw-r--r-- | qmidiplayer-desktop/qmpsettingswindow.ui | 33 | ||||
-rw-r--r-- | qmidiplayer-desktop/resources.qrc | 108 |
15 files changed, 562 insertions, 428 deletions
diff --git a/qmidiplayer-desktop/qmpchannelswindow.cpp b/qmidiplayer-desktop/qmpchannelswindow.cpp index fc7c686..bd021f1 100644 --- a/qmidiplayer-desktop/qmpchannelswindow.cpp +++ b/qmidiplayer-desktop/qmpchannelswindow.cpp @@ -16,7 +16,7 @@ qmpChannelsWindow::qmpChannelsWindow(QWidget *parent) : pselectw=new qmpPresetSelector(this); ceditw=new qmpChannelEditor(this); mapper=qmpMainWindow::getInstance()->getPlayer()->getMidiMapper(); - cha=new QPixmap(":/img/ledon.png");chi=new QPixmap(":/img/ledoff.png"); + cha=new QIcon(":/img/ledon.svg");chi=new QIcon(":/img/ledoff.svg"); cb=new qmpCWNoteOnCB();fused=callbacksc=cbcnt=0; qmpMainWindow::getInstance()->getPlayer()->setEventHandlerCB(cb,NULL); connect(cb,SIGNAL(onNoteOn()),this,SLOT(updateChannelActivity())); @@ -76,7 +76,7 @@ qmpChannelsWindow::qmpChannelsWindow(QWidget *parent) : chnlf=new qmpChannelFunc(this), std::string("Channel"), tr("Channel").toStdString(), - getThemedIconc(":/img/channel.png"), + getThemedIconc(":/img/channel.svg"), 0, true ); diff --git a/qmidiplayer-desktop/qmpchannelswindow.hpp b/qmidiplayer-desktop/qmpchannelswindow.hpp index 4502b21..57be0ca 100644 --- a/qmidiplayer-desktop/qmpchannelswindow.hpp +++ b/qmidiplayer-desktop/qmpchannelswindow.hpp @@ -107,7 +107,7 @@ class qmpChannelsWindow:public QDialog qmpPresetSelector *pselectw; qmpChannelEditor *ceditw; qmpMidiMapperRtMidi *mapper; - QPixmap *cha,*chi; + QIcon *cha,*chi; qmpCWNoteOnCB *cb; qmpChannelFunc *chnlf; //callback fuse... (avoid black midi blocking the main thread) diff --git a/qmidiplayer-desktop/qmpefxwindow.cpp b/qmidiplayer-desktop/qmpefxwindow.cpp index 04a7e8d..507880e 100644 --- a/qmidiplayer-desktop/qmpefxwindow.cpp +++ b/qmidiplayer-desktop/qmpefxwindow.cpp @@ -32,7 +32,7 @@ qmpEfxWindow::qmpEfxWindow(QWidget *parent) : efxf=new qmpEfxFunc(this), std::string("Effects"), tr("Effects").toStdString(), - getThemedIconc(":/img/effects.png"), + getThemedIconc(":/img/effects.svg"), 0, true ); diff --git a/qmidiplayer-desktop/qmpefxwindow.ui b/qmidiplayer-desktop/qmpefxwindow.ui index d7e2245..97a0d58 100644 --- a/qmidiplayer-desktop/qmpefxwindow.ui +++ b/qmidiplayer-desktop/qmpefxwindow.ui @@ -50,7 +50,7 @@ <item> <widget class="QCheckBox" name="cbEnabledR"> <property name="sizePolicy"> - <sizepolicy hsizetype="Fixed" vsizetype="Fixed"> + <sizepolicy hsizetype="Expanding" vsizetype="Fixed"> <horstretch>0</horstretch> <verstretch>0</verstretch> </sizepolicy> diff --git a/qmidiplayer-desktop/qmpinfowindow.cpp b/qmidiplayer-desktop/qmpinfowindow.cpp index 03084c1..de853aa 100644 --- a/qmidiplayer-desktop/qmpinfowindow.cpp +++ b/qmidiplayer-desktop/qmpinfowindow.cpp @@ -19,7 +19,7 @@ qmpInfoWindow::qmpInfoWindow(QWidget *parent) : infof=new qmpInfoFunc(this), std::string("FileInfo"), tr("File Information").toStdString(), - NULL, + getThemedIconc(":/img/info.svg"), 0, true ); diff --git a/qmidiplayer-desktop/qmpmainwindow.cpp b/qmidiplayer-desktop/qmpmainwindow.cpp index cbec3f5..fc7f850 100644 --- a/qmidiplayer-desktop/qmpmainwindow.cpp +++ b/qmidiplayer-desktop/qmpmainwindow.cpp @@ -54,11 +54,11 @@ qmpMainWindow::qmpMainWindow(QWidget *parent) : ui(new Ui::qmpMainWindow) { ui->setupUi(this); - ui->lnPolyphone->display("00000-00000"); + ui->lbCurPoly->setText("00000");ui->lbMaxPoly->setText("00000"); ui->lbFileName->setText("");ref=this;ui->verticalLayout->setAlignment(ui->pushButton,Qt::AlignRight); int w=size().width(),h=size().height();w=w*(logicalDpiX()/96.);h=h*(logicalDpiY()/96.); setMaximumWidth(w);setMaximumHeight(h);setMinimumWidth(w);setMinimumHeight(h); - setButtonHeight(ui->pbNext,36);setButtonHeight(ui->pbPlayPause,36); + setButtonHeight(ui->pbNext,36);setButtonHeight(ui->pbPlayPause,36);setButtonHeight(ui->pbAdd,36); setButtonHeight(ui->pbPrev,36);setButtonHeight(ui->pbSettings,36);setButtonHeight(ui->pbStop,36); //setButtonHeight(ui->pbChannels,36);setButtonHeight(ui->pbPList,36); //setButtonHeight(ui->pbEfx,36);setButtonHeight(ui->pbVisualization,36); @@ -93,9 +93,9 @@ void qmpMainWindow::init() renderf=new qmpRenderFunc(this); panicf=new qmpPanicFunc(this); reloadsynf=new qmpReloadSynthFunc(this); - registerFunctionality(renderf,"Render",tr("Render to wave").toStdString(),NULL,0,false); - registerFunctionality(panicf,"Panic",tr("Panic").toStdString(),NULL,0,false); - registerFunctionality(reloadsynf,"ReloadSynth",tr("Restart fluidsynth").toStdString(),NULL,0,false); + registerFunctionality(renderf,"Render",tr("Render to wave").toStdString(),getThemedIconc(":/img/render.svg"),0,false); + registerFunctionality(panicf,"Panic",tr("Panic").toStdString(),getThemedIconc(":/img/panic.svg"),0,false); + registerFunctionality(reloadsynf,"ReloadSynth",tr("Restart fluidsynth").toStdString(),getThemedIconc(":/img/repeat-base.svg"),0,false); pmgr->scanPlugins();settingsw->updatePluginList(pmgr);pmgr->initPlugins(); if(singleFS){player->fluidPreInitialize();playerSetup();player->fluidInitialize(); for(int i=settingsw->getSFWidget()->rowCount()-1;i>=0;--i){if(!((QCheckBox*)settingsw->getSFWidget()->cellWidget(i,0))->isChecked())continue; @@ -114,15 +114,12 @@ void qmpMainWindow::init() connect(timer,SIGNAL(timeout()),this,SLOT(updateWidgets())); connect(timer,SIGNAL(timeout()),chnlw,SLOT(channelWindowsUpdate())); connect(timer,SIGNAL(timeout()),infow,SLOT(updateInfo())); - ui->pbNext->setIcon(QIcon(getThemedIcon(":/img/next.png"))); - ui->pbPrev->setIcon(QIcon(getThemedIcon(":/img/prev.png"))); - ui->pbPlayPause->setIcon(QIcon(getThemedIcon(":/img/play.png"))); - ui->pbStop->setIcon(QIcon(getThemedIcon(":/img/stop.png"))); - //ui->pbChannels->setIcon(QIcon(getThemedIcon(":/img/channel.png"))); - //ui->pbEfx->setIcon(QIcon(getThemedIcon(":/img/effects.png"))); - //ui->pbPList->setIcon(QIcon(getThemedIcon(":/img/list.png"))); - //ui->pbVisualization->setIcon(QIcon(getThemedIcon(":/img/visualization.png"))); - ui->pbSettings->setIcon(QIcon(getThemedIcon(":/img/settings.png"))); + ui->pbNext->setIcon(QIcon(getThemedIcon(":/img/next.svg"))); + ui->pbPrev->setIcon(QIcon(getThemedIcon(":/img/prev.svg"))); + ui->pbPlayPause->setIcon(QIcon(getThemedIcon(":/img/play.svg"))); + ui->pbStop->setIcon(QIcon(getThemedIcon(":/img/stop.svg"))); + ui->pbSettings->setIcon(QIcon(getThemedIcon(":/img/settings.svg"))); + ui->pbAdd->setIcon(QIcon(getThemedIcon(":/img/open.svg"))); if(havemidi)on_pbPlayPause_clicked(); setupWidget(); } @@ -246,9 +243,9 @@ void qmpMainWindow::updateWidgets() delete playerTh;playerTh=NULL; if(singleFS)player->playerPanic(true); chnlw->on_pbUnmute_clicked();chnlw->on_pbUnsolo_clicked(); - ui->pbPlayPause->setIcon(QIcon(getThemedIcon(":/img/play.png"))); + ui->pbPlayPause->setIcon(QIcon(getThemedIcon(":/img/play.svg"))); ui->hsTimer->setValue(0); - ui->lnPolyphone->display("00000-00000"); + ui->lbCurPoly->setText("00000");ui->lbMaxPoly->setText("00000"); ui->lbCurTime->setText("00:00"); } else @@ -283,20 +280,22 @@ void qmpMainWindow::updateWidgets() char ts[100]; sprintf(ts,"%02d:%02d",(int)(elapsed.count()+offset)/60,(int)(elapsed.count()+offset)%60); ui->lbCurTime->setText(ts); - //sprintf(ts,"Poly: %d/%d",player->getPolyphone(),player->getMaxPolyphone()); - ui->lnPolyphone->display(QString("%1-%2").arg(player->getPolyphone(),5,10,QChar('0')) - .arg(player->getMaxPolyphone(),5,10,QChar('0'))); + ui->lbCurPoly->setText(QString("%1").arg(player->getPolyphone(),5,10,QChar('0'))); + ui->lbMaxPoly->setText(QString("%1").arg(player->getMaxPolyphone(),5,10,QChar('0'))); } } QString qmpMainWindow::getFileName(){return ui->lbFileName->text();} void qmpMainWindow::switchTrack(QString s) { - timer->stop();player->playerDeinit();playerTh->join(); - delete playerTh;playerTh=NULL; - ui->hsTimer->setValue(0); + stopped=false;playing=true; + setFuncEnabled("Render",stopped);setFuncEnabled("ReloadSynth",stopped); + ui->pbPlayPause->setIcon(QIcon(getThemedIcon(":/img/pause.svg"))); + timer->stop();player->playerDeinit(); for(auto i=mfunc.begin();i!=mfunc.end();++i)if(i->second.isVisualization())((qmpVisualizationIntf*)(i->second.i()))->stop(); + if(playerTh){playerTh->join();delete playerTh;playerTh=NULL;} if(singleFS)player->playerPanic(true); + ui->hsTimer->setValue(0); chnlw->on_pbUnmute_clicked();chnlw->on_pbUnsolo_clicked(); QString fns=s;setWindowTitle(QUrl::fromLocalFile(fns).fileName().left(QUrl::fromLocalFile(fns).fileName().lastIndexOf('.'))+" - QMidiPlayer"); ui->lbFileName->setText(QUrl::fromLocalFile(fns).fileName().left(QUrl::fromLocalFile(fns).fileName().lastIndexOf('.'))); @@ -383,7 +382,7 @@ void qmpMainWindow::on_pbPlayPause_clicked() QString fns=plistw->getFirstItem(); if(!fns.length()) { - plistw->on_pbAdd_clicked(); + if(!plistw->on_pbAdd_clicked()){playing=false;return;} fns=plistw->getFirstItem(); if(!fns.length())return(void)(playing=false); }setWindowTitle(QUrl::fromLocalFile(fns).fileName().left(QUrl::fromLocalFile(fns).fileName().lastIndexOf('.'))+" - QMidiPlayer"); @@ -424,7 +423,7 @@ void qmpMainWindow::on_pbPlayPause_clicked() player->setTCpaused(!playing); for(auto i=mfunc.begin();i!=mfunc.end();++i)if(i->second.isVisualization())((qmpVisualizationIntf*)(i->second.i()))->pause(); } - ui->pbPlayPause->setIcon(QIcon(getThemedIcon(playing?":/img/pause.png":":/img/play.png"))); + ui->pbPlayPause->setIcon(QIcon(getThemedIcon(playing?":/img/pause.svg":":/img/play.svg"))); } void qmpMainWindow::on_hsTimer_sliderPressed() @@ -495,9 +494,9 @@ void qmpMainWindow::on_pbStop_clicked() if(singleFS)player->playerPanic(true);chnlw->resetAcitivity(); if(playerTh){playerTh->join();delete playerTh;playerTh=NULL;} chnlw->on_pbUnmute_clicked();chnlw->on_pbUnsolo_clicked(); - ui->pbPlayPause->setIcon(QIcon(getThemedIcon(":/img/play.png"))); + ui->pbPlayPause->setIcon(QIcon(getThemedIcon(":/img/play.svg"))); ui->hsTimer->setValue(0); - ui->lnPolyphone->display("00000-00000"); + ui->lbCurPoly->setText("00000");ui->lbMaxPoly->setText("00000"); ui->lbCurTime->setText("00:00"); } } @@ -519,35 +518,7 @@ void qmpMainWindow::on_pbNext_clicked() void qmpMainWindow::selectionChanged() { - stopped=false;playing=true; - ui->pbPlayPause->setIcon(QIcon(getThemedIcon(":/img/pause.png"))); - timer->stop();player->playerDeinit(); - for(auto i=mfunc.begin();i!=mfunc.end();++i)if(i->second.isVisualization())((qmpVisualizationIntf*)(i->second.i()))->stop(); - if(playerTh){playerTh->join();delete playerTh;playerTh=NULL;} - if(singleFS)player->playerPanic(true); - ui->hsTimer->setValue(0); - chnlw->on_pbUnmute_clicked();chnlw->on_pbUnsolo_clicked(); - QString fns=plistw->getSelectedItem(); - ui->lbFileName->setText(QUrl::fromLocalFile(fns).fileName().left(QUrl::fromLocalFile(fns).fileName().lastIndexOf('.'))); - setWindowTitle(QUrl::fromLocalFile(fns).fileName().left(QUrl::fromLocalFile(fns).fileName().lastIndexOf('.'))+" - QMidiPlayer"); - onfnChanged(); - LOAD_FILE; - char ts[100]; - sprintf(ts,"%02d:%02d",(int)player->getFtime()/60,(int)player->getFtime()%60); - ui->lbFinTime->setText(ts); - player->playerInit();if(!singleFS){playerSetup();player->fluidInitialize(); - for(int i=settingsw->getSFWidget()->rowCount()-1;i>=0;--i){if(!((QCheckBox*)settingsw->getSFWidget()->cellWidget(i,0))->isChecked())continue; - LOAD_SOUNDFONT; - }} - for(auto i=mfunc.begin();i!=mfunc.end();++i)if(i->second.isVisualization())((qmpVisualizationIntf*)(i->second.i()))->start(); - player->setGain(ui->vsMasterVol->value()/250.);efxw->sendEfxChange(); - player->setWaitVoice(qmpSettingsWindow::getSettingsIntf()->value("Midi/WaitVoice",1).toInt()); - playerTh=new std::thread(&CMidiPlayer::playerThread,player); -#ifdef _WIN32 - SetThreadPriority(playerTh->native_handle(),THREAD_PRIORITY_TIME_CRITICAL); -#endif - st=std::chrono::steady_clock::now();offset=0; - timer->start(UPDATE_INTERVAL); + switchTrack(plistw->getSelectedItem()); } void qmpMainWindow::on_lbFileName_customContextMenuRequested(const QPoint &pos) @@ -645,6 +616,9 @@ std::map<std::string,qmpFuncPrivate>& qmpMainWindow::getFunc() void qmpMainWindow::setupWidget() { + for(auto i=mfunc.begin();i!=mfunc.end();++i) + i->second.setAssignedControl((QReflectiveAction*)NULL), + i->second.setAssignedControl((QReflectivePushButton*)NULL); QList<QWidget*>w=ui->buttonwidget->findChildren<QWidget*>("",Qt::FindDirectChildrenOnly); for(unsigned i=0;i<w.size();++i) delete w[i]; @@ -662,6 +636,12 @@ void qmpMainWindow::setupWidget() enabled_buttons[i] ); setButtonHeight(pb,32); + if(getSettingsWindow()->getSettingsIntf()->value("Behavior/ShowButtonLabel",0).toInt()) + { + pb->setText(tr(mfunc[enabled_buttons[i]].desc().c_str())); + pb->setSizePolicy(QSizePolicy::Expanding,QSizePolicy::Fixed); + } + else setButtonWidth(pb,32); ui->buttonwidget->layout()->addWidget(pb); mfunc[enabled_buttons[i]].setAssignedControl(pb); @@ -720,3 +700,9 @@ qmpFuncPrivate::qmpFuncPrivate(qmpFuncBaseIntf *i,std::string _desc,const char * checked=false; asgna=NULL;asgnb=NULL; } + +void qmpMainWindow::on_pbAdd_clicked() +{ + if(plistw->on_pbAdd_clicked()) + switchTrack(plistw->getLastItem()); +} diff --git a/qmidiplayer-desktop/qmpmainwindow.hpp b/qmidiplayer-desktop/qmpmainwindow.hpp index 395b833..9a80dec 100644 --- a/qmidiplayer-desktop/qmpmainwindow.hpp +++ b/qmidiplayer-desktop/qmpmainwindow.hpp @@ -166,6 +166,7 @@ class qmpMainWindow:public QMainWindow void on_pbSettings_clicked(); void funcReflector(std::string reflt); void on_pushButton_clicked(); + void on_pbAdd_clicked(); public slots: void dialogClosed(); diff --git a/qmidiplayer-desktop/qmpmainwindow.ui b/qmidiplayer-desktop/qmpmainwindow.ui index 8f41b4b..9ed0849 100644 --- a/qmidiplayer-desktop/qmpmainwindow.ui +++ b/qmidiplayer-desktop/qmpmainwindow.ui @@ -6,20 +6,20 @@ <rect> <x>0</x> <y>0</y> - <width>450</width> - <height>245</height> + <width>495</width> + <height>200</height> </rect> </property> <property name="minimumSize"> <size> - <width>450</width> - <height>245</height> + <width>495</width> + <height>200</height> </size> </property> <property name="maximumSize"> <size> - <width>450</width> - <height>245</height> + <width>495</width> + <height>200</height> </size> </property> <property name="acceptDrops"> @@ -33,24 +33,30 @@ <normaloff>:/img/qmidiplyr.png</normaloff>:/img/qmidiplyr.png</iconset> </property> <widget class="QWidget" name="centralWidget"> - <layout class="QHBoxLayout" name="horizontalLayout"> + <layout class="QVBoxLayout" name="verticalLayout_2"> + <property name="spacing"> + <number>1</number> + </property> <property name="leftMargin"> - <number>2</number> + <number>4</number> </property> <property name="topMargin"> - <number>2</number> + <number>0</number> </property> <property name="rightMargin"> - <number>2</number> + <number>4</number> </property> <property name="bottomMargin"> - <number>2</number> + <number>0</number> </property> <item> - <layout class="QVBoxLayout" name="verticalLayout_2"> + <layout class="QHBoxLayout" name="horizontalLayout"> <property name="spacing"> <number>0</number> </property> + <property name="bottomMargin"> + <number>0</number> + </property> <item> <widget class="QLabel" name="lbFileName"> <property name="sizePolicy"> @@ -71,401 +77,499 @@ <string>somefile.mid</string> </property> <property name="alignment"> - <set>Qt::AlignCenter</set> + <set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set> + </property> + <property name="margin"> + <number>0</number> </property> </widget> </item> <item> - <layout class="QHBoxLayout" name="horizontalLayout_2"> + <layout class="QVBoxLayout" name="verticalLayout_3"> <property name="spacing"> <number>0</number> </property> + <property name="bottomMargin"> + <number>3</number> + </property> <item> - <widget class="QLabel" name="lbCurTime"> + <widget class="QLabel" name="lbPolyphone"> <property name="sizePolicy"> - <sizepolicy hsizetype="Expanding" vsizetype="Preferred"> + <sizepolicy hsizetype="Minimum" vsizetype="Minimum"> <horstretch>0</horstretch> <verstretch>0</verstretch> </sizepolicy> </property> <property name="text"> - <string>00:00</string> + <string><html><head/><body><p>Poly</p></body></html></string> </property> <property name="alignment"> - <set>Qt::AlignBottom|Qt::AlignLeading|Qt::AlignLeft</set> + <set>Qt::AlignCenter</set> </property> </widget> </item> <item> - <layout class="QVBoxLayout" name="verticalLayout_3"> - <property name="spacing"> - <number>0</number> - </property> - <item> - <widget class="QLabel" name="lbPolyphone"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Minimum" vsizetype="Minimum"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="text"> - <string><html><head/><body><p>Poly</p></body></html></string> - </property> - <property name="alignment"> - <set>Qt::AlignBottom|Qt::AlignHCenter</set> - </property> - </widget> - </item> - <item> - <widget class="QLCDNumber" name="lnPolyphone"> - <property name="maximumSize"> - <size> - <width>84</width> - <height>16777215</height> - </size> - </property> - <property name="frameShape"> - <enum>QFrame::NoFrame</enum> - </property> - <property name="digitCount"> - <number>11</number> - </property> - <property name="segmentStyle"> - <enum>QLCDNumber::Flat</enum> - </property> - </widget> - </item> - </layout> - </item> - <item> - <widget class="QLabel" name="lbFinTime"> + <widget class="QLabel" name="lbCurPoly"> <property name="sizePolicy"> - <sizepolicy hsizetype="Expanding" vsizetype="Preferred"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="text"> - <string>00:00</string> - </property> - <property name="alignment"> - <set>Qt::AlignBottom|Qt::AlignRight|Qt::AlignTrailing</set> - </property> - </widget> - </item> - </layout> - </item> - <item> - <widget class="QClickableSlider" name="hsTimer"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Expanding" vsizetype="Fixed"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="maximum"> - <number>100</number> - </property> - <property name="pageStep"> - <number>0</number> - </property> - <property name="orientation"> - <enum>Qt::Horizontal</enum> - </property> - </widget> - </item> - <item> - <layout class="QHBoxLayout" name="horizontalLayout_3"> - <property name="spacing"> - <number>0</number> - </property> - <item> - <widget class="QPushButton" name="pbPlayPause"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Preferred" vsizetype="Minimum"> + <sizepolicy hsizetype="Minimum" vsizetype="Fixed"> <horstretch>0</horstretch> <verstretch>0</verstretch> </sizepolicy> </property> <property name="minimumSize"> <size> - <width>0</width> - <height>36</height> - </size> - </property> - <property name="maximumSize"> - <size> - <width>16777215</width> - <height>36</height> + <width>64</width> + <height>0</height> </size> </property> <property name="text"> - <string/> + <string>00000</string> </property> - <property name="icon"> - <iconset resource="resources.qrc"> - <normaloff>:/img/play.png</normaloff>:/img/play.png</iconset> - </property> - <property name="iconSize"> - <size> - <width>32</width> - <height>32</height> - </size> + <property name="alignment"> + <set>Qt::AlignCenter</set> </property> </widget> </item> <item> - <widget class="QPushButton" name="pbStop"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Preferred" vsizetype="Minimum"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> + <widget class="QFrame" name="fPolyLine"> <property name="minimumSize"> <size> <width>0</width> - <height>36</height> + <height>3</height> </size> </property> <property name="maximumSize"> <size> <width>16777215</width> - <height>36</height> + <height>3</height> </size> </property> - <property name="text"> - <string/> + <property name="frameShape"> + <enum>QFrame::HLine</enum> </property> - <property name="icon"> - <iconset resource="resources.qrc"> - <normaloff>:/img/stop.png</normaloff>:/img/stop.png</iconset> - </property> - <property name="iconSize"> - <size> - <width>32</width> - <height>32</height> - </size> + <property name="frameShadow"> + <enum>QFrame::Sunken</enum> </property> </widget> </item> <item> - <widget class="QPushButton" name="pbPrev"> + <widget class="QLabel" name="lbMaxPoly"> <property name="sizePolicy"> - <sizepolicy hsizetype="Preferred" vsizetype="Minimum"> + <sizepolicy hsizetype="Minimum" vsizetype="Fixed"> <horstretch>0</horstretch> <verstretch>0</verstretch> </sizepolicy> </property> <property name="minimumSize"> <size> - <width>0</width> - <height>36</height> - </size> - </property> - <property name="maximumSize"> - <size> - <width>16777215</width> - <height>36</height> + <width>64</width> + <height>0</height> </size> </property> <property name="text"> - <string/> + <string>00000</string> </property> - <property name="icon"> - <iconset resource="resources.qrc"> - <normaloff>:/img/prev.png</normaloff>:/img/prev.png</iconset> - </property> - <property name="iconSize"> - <size> - <width>32</width> - <height>32</height> - </size> + <property name="alignment"> + <set>Qt::AlignCenter</set> </property> </widget> </item> + </layout> + </item> + <item> + <layout class="QVBoxLayout" name="verticalLayout"> + <property name="topMargin"> + <number>0</number> + </property> <item> - <widget class="QPushButton" name="pbNext"> + <widget class="QPushButton" name="pushButton"> <property name="sizePolicy"> - <sizepolicy hsizetype="Preferred" vsizetype="Minimum"> + <sizepolicy hsizetype="Fixed" vsizetype="Fixed"> <horstretch>0</horstretch> <verstretch>0</verstretch> </sizepolicy> </property> - <property name="minimumSize"> - <size> - <width>0</width> - <height>36</height> - </size> - </property> <property name="maximumSize"> <size> - <width>16777215</width> - <height>36</height> + <width>21</width> + <height>21</height> </size> </property> <property name="text"> - <string/> - </property> - <property name="icon"> - <iconset resource="resources.qrc"> - <normaloff>:/img/next.png</normaloff>:/img/next.png</iconset> - </property> - <property name="iconSize"> - <size> - <width>32</width> - <height>32</height> - </size> + <string>?</string> </property> </widget> </item> <item> - <spacer name="horizontalSpacer"> + <spacer name="verticalSpacer"> <property name="orientation"> - <enum>Qt::Horizontal</enum> + <enum>Qt::Vertical</enum> </property> <property name="sizeType"> - <enum>QSizePolicy::Fixed</enum> + <enum>QSizePolicy::Expanding</enum> </property> <property name="sizeHint" stdset="0"> <size> - <width>32</width> - <height>32</height> + <width>20</width> + <height>40</height> </size> </property> </spacer> </item> - <item> - <widget class="QPushButton" name="pbSettings"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Preferred" vsizetype="Minimum"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="minimumSize"> - <size> - <width>0</width> - <height>36</height> - </size> - </property> - <property name="maximumSize"> - <size> - <width>16777215</width> - <height>36</height> - </size> - </property> - <property name="text"> - <string/> - </property> - <property name="icon"> - <iconset resource="resources.qrc"> - <normaloff>:/img/settings.png</normaloff>:/img/settings.png</iconset> - </property> - <property name="iconSize"> - <size> - <width>32</width> - <height>32</height> - </size> - </property> - <property name="checkable"> - <bool>true</bool> - </property> - </widget> - </item> </layout> </item> + </layout> + </item> + <item> + <layout class="QHBoxLayout" name="horizontalLayout_2"> + <property name="spacing"> + <number>0</number> + </property> + <item> + <widget class="QLabel" name="lbCurTime"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Expanding" vsizetype="Preferred"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="text"> + <string>00:00</string> + </property> + <property name="alignment"> + <set>Qt::AlignBottom|Qt::AlignLeading|Qt::AlignLeft</set> + </property> + </widget> + </item> <item> - <widget class="QWidget" name="buttonwidget" native="true"> - <property name="minimumSize"> - <size> - <width>0</width> - <height>32</height> - </size> + <widget class="QLabel" name="lbFinTime"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Expanding" vsizetype="Preferred"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="text"> + <string>00:00</string> + </property> + <property name="alignment"> + <set>Qt::AlignBottom|Qt::AlignRight|Qt::AlignTrailing</set> </property> - <layout class="QHBoxLayout" name="horizontalLayout_4"> - <property name="leftMargin"> - <number>0</number> - </property> - <property name="topMargin"> - <number>6</number> - </property> - <property name="rightMargin"> - <number>0</number> - </property> - <property name="bottomMargin"> - <number>6</number> - </property> - </layout> </widget> </item> </layout> </item> <item> - <layout class="QVBoxLayout" name="verticalLayout"> - <property name="spacing"> + <widget class="QClickableSlider" name="hsTimer"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Expanding" vsizetype="Fixed"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="styleSheet"> + <string notr="true">QSlider::handle{border:none;background:none;color:none;}</string> + </property> + <property name="maximum"> + <number>100</number> + </property> + <property name="pageStep"> <number>0</number> </property> - <property name="topMargin"> + <property name="orientation"> + <enum>Qt::Horizontal</enum> + </property> + </widget> + </item> + <item> + <layout class="QHBoxLayout" name="horizontalLayout_3"> + <property name="spacing"> <number>0</number> </property> <item> - <widget class="QPushButton" name="pushButton"> + <widget class="QPushButton" name="pbPlayPause"> <property name="sizePolicy"> - <sizepolicy hsizetype="Fixed" vsizetype="Fixed"> + <sizepolicy hsizetype="Preferred" vsizetype="Minimum"> <horstretch>0</horstretch> <verstretch>0</verstretch> </sizepolicy> </property> + <property name="minimumSize"> + <size> + <width>0</width> + <height>24</height> + </size> + </property> <property name="maximumSize"> <size> - <width>21</width> - <height>21</height> + <width>16777215</width> + <height>36</height> </size> </property> <property name="text"> - <string>?</string> + <string/> + </property> + <property name="icon"> + <iconset resource="resources.qrc"> + <normaloff>:/img/play.svg</normaloff>:/img/play.svg</iconset> + </property> + <property name="iconSize"> + <size> + <width>32</width> + <height>32</height> + </size> </property> </widget> </item> <item> - <widget class="QSlider" name="vsMasterVol"> + <widget class="QPushButton" name="pbStop"> <property name="sizePolicy"> - <sizepolicy hsizetype="Minimum" vsizetype="Expanding"> + <sizepolicy hsizetype="Preferred" vsizetype="Minimum"> <horstretch>0</horstretch> <verstretch>0</verstretch> </sizepolicy> </property> - <property name="maximum"> - <number>100</number> + <property name="minimumSize"> + <size> + <width>0</width> + <height>24</height> + </size> </property> - <property name="value"> - <number>50</number> + <property name="maximumSize"> + <size> + <width>16777215</width> + <height>36</height> + </size> + </property> + <property name="text"> + <string/> + </property> + <property name="icon"> + <iconset resource="resources.qrc"> + <normaloff>:/img/stop.svg</normaloff>:/img/stop.svg</iconset> + </property> + <property name="iconSize"> + <size> + <width>32</width> + <height>32</height> + </size> + </property> + </widget> + </item> + <item> + <widget class="QPushButton" name="pbPrev"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Preferred" vsizetype="Minimum"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="minimumSize"> + <size> + <width>0</width> + <height>24</height> + </size> + </property> + <property name="maximumSize"> + <size> + <width>16777215</width> + <height>36</height> + </size> + </property> + <property name="text"> + <string/> + </property> + <property name="icon"> + <iconset resource="resources.qrc"> + <normaloff>:/img/prev.svg</normaloff>:/img/prev.svg</iconset> + </property> + <property name="iconSize"> + <size> + <width>32</width> + <height>32</height> + </size> + </property> + </widget> + </item> + <item> + <widget class="QPushButton" name="pbNext"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Preferred" vsizetype="Minimum"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="minimumSize"> + <size> + <width>0</width> + <height>24</height> + </size> + </property> + <property name="maximumSize"> + <size> + <width>16777215</width> + <height>36</height> + </size> + </property> + <property name="text"> + <string/> + </property> + <property name="icon"> + <iconset resource="resources.qrc"> + <normaloff>:/img/next.svg</normaloff>:/img/next.svg</iconset> + </property> + <property name="iconSize"> + <size> + <width>32</width> + <height>32</height> + </size> </property> + </widget> + </item> + <item> + <spacer name="horizontalSpacer"> <property name="orientation"> - <enum>Qt::Vertical</enum> + <enum>Qt::Horizontal</enum> + </property> + <property name="sizeType"> + <enum>QSizePolicy::Fixed</enum> + </property> + <property name="sizeHint" stdset="0"> + <size> + <width>32</width> + <height>32</height> + </size> + </property> + </spacer> + </item> + <item> + <widget class="QPushButton" name="pbAdd"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Preferred" vsizetype="Minimum"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="minimumSize"> + <size> + <width>0</width> + <height>24</height> + </size> + </property> + <property name="maximumSize"> + <size> + <width>16777215</width> + <height>36</height> + </size> + </property> + <property name="text"> + <string/> + </property> + <property name="icon"> + <iconset resource="resources.qrc"> + <normaloff>:/img/open.svg</normaloff>:/img/open.svg</iconset> </property> </widget> </item> <item> - <widget class="QLabel" name="lbMasterVol"> + <widget class="QPushButton" name="pbSettings"> <property name="sizePolicy"> - <sizepolicy hsizetype="Minimum" vsizetype="Minimum"> + <sizepolicy hsizetype="Preferred" vsizetype="Minimum"> <horstretch>0</horstretch> <verstretch>0</verstretch> </sizepolicy> </property> + <property name="minimumSize"> + <size> + <width>0</width> + <height>24</height> + </size> + </property> + <property name="maximumSize"> + <size> + <width>16777215</width> + <height>36</height> + </size> + </property> <property name="text"> - <string>Master</string> + <string/> </property> - <property name="alignment"> - <set>Qt::AlignCenter</set> + <property name="icon"> + <iconset resource="resources.qrc"> + <normaloff>:/img/settings.svg</normaloff>:/img/settings.svg</iconset> + </property> + <property name="iconSize"> + <size> + <width>32</width> + <height>32</height> + </size> + </property> + <property name="checkable"> + <bool>true</bool> + </property> + </widget> + </item> + <item> + <widget class="QLabel" name="label"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Fixed" vsizetype="Fixed"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="text"> + <string>Vol.</string> + </property> + </widget> + </item> + <item> + <widget class="QSlider" name="vsMasterVol"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Preferred" vsizetype="Fixed"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="styleSheet"> + <string notr="true"/> + </property> + <property name="maximum"> + <number>100</number> + </property> + <property name="value"> + <number>50</number> + </property> + <property name="orientation"> + <enum>Qt::Horizontal</enum> </property> </widget> </item> </layout> </item> + <item> + <widget class="QWidget" name="buttonwidget" native="true"> + <property name="minimumSize"> + <size> + <width>0</width> + <height>24</height> + </size> + </property> + <layout class="QHBoxLayout" name="horizontalLayout_4"> + <property name="leftMargin"> + <number>0</number> + </property> + <property name="topMargin"> + <number>6</number> + </property> + <property name="rightMargin"> + <number>0</number> + </property> + <property name="bottomMargin"> + <number>6</number> + </property> + </layout> + </widget> + </item> </layout> </widget> </widget> @@ -477,6 +581,16 @@ <header>qmpmainwindow.hpp</header> </customwidget> </customwidgets> + <tabstops> + <tabstop>pbPlayPause</tabstop> + <tabstop>pbStop</tabstop> + <tabstop>pbNext</tabstop> + <tabstop>pbPrev</tabstop> + <tabstop>pbSettings</tabstop> + <tabstop>hsTimer</tabstop> + <tabstop>vsMasterVol</tabstop> + <tabstop>pushButton</tabstop> + </tabstops> <resources> <include location="resources.qrc"/> </resources> diff --git a/qmidiplayer-desktop/qmpplistwindow.cpp b/qmidiplayer-desktop/qmpplistwindow.cpp index b6b133e..d010198 100644 --- a/qmidiplayer-desktop/qmpplistwindow.cpp +++ b/qmidiplayer-desktop/qmpplistwindow.cpp @@ -36,43 +36,43 @@ qmpPlistWindow::qmpPlistWindow(QWidget *parent) : switch(shuffle) { case 1: - ui->pbShuffle->setIcon(QIcon(getThemedIcon(":/img/shuffle.png"))); + ui->pbShuffle->setIcon(QIcon(getThemedIcon(":/img/shuffle.svg"))); ui->pbShuffle->setText("Shuffle On"); break; case 0: default: - ui->pbShuffle->setIcon(QIcon(getThemedIcon(":/img/shuffle-off.png"))); + ui->pbShuffle->setIcon(QIcon(getThemedIcon(":/img/shuffle-off.svg"))); ui->pbShuffle->setText("Shuffle Off"); break; } switch(repeat) { case 0: - ui->pbRepeat->setIcon(QIcon(getThemedIcon(":/img/repeat-non.png"))); + ui->pbRepeat->setIcon(QIcon(getThemedIcon(":/img/repeat-non.svg"))); ui->pbRepeat->setText("Repeat Off"); break; case 1: - ui->pbRepeat->setIcon(QIcon(getThemedIcon(":/img/repeat-one.png"))); + ui->pbRepeat->setIcon(QIcon(getThemedIcon(":/img/repeat-one.svg"))); ui->pbRepeat->setText("Repeat One"); break; case 2: - ui->pbRepeat->setIcon(QIcon(getThemedIcon(":/img/repeat-all.png"))); + ui->pbRepeat->setIcon(QIcon(getThemedIcon(":/img/repeat-all.svg"))); ui->pbRepeat->setText("Repeat All"); break; } delete plist; } - ui->pbAdd->setIcon(QIcon(getThemedIcon(":/img/add.png"))); - ui->pbRemove->setIcon(QIcon(getThemedIcon(":/img/remove.png"))); - ui->pbClear->setIcon(QIcon(getThemedIcon(":/img/clear.png"))); - ui->pbAddFolder->setIcon(QIcon(getThemedIcon(":/img/addfolder.png"))); - ui->pbSave->setIcon(QIcon(getThemedIcon(":/img/save.png"))); - ui->pbLoad->setIcon(QIcon(getThemedIcon(":/img/load.png"))); + ui->pbAdd->setIcon(QIcon(getThemedIcon(":/img/add.svg"))); + ui->pbRemove->setIcon(QIcon(getThemedIcon(":/img/remove.svg"))); + ui->pbClear->setIcon(QIcon(getThemedIcon(":/img/clear.svg"))); + ui->pbAddFolder->setIcon(QIcon(getThemedIcon(":/img/addfolder.svg"))); + ui->pbSave->setIcon(QIcon(getThemedIcon(":/img/save.svg"))); + ui->pbLoad->setIcon(QIcon(getThemedIcon(":/img/load.svg"))); qmpMainWindow::getInstance()->registerFunctionality( plistf=new qmpPlistFunc(this), std::string("Playlist"), tr("Playlist").toStdString(), - getThemedIconc(":/img/list.png"), + getThemedIconc(":/img/list.svg"), 0, true ); @@ -103,6 +103,7 @@ void qmpPlistWindow::showEvent(QShowEvent *event) void qmpPlistWindow::closeEvent(QCloseEvent *event) { setVisible(false); + while(ui->lwFiles->count()>1)delete ui->lwFiles->item(0); if(!qmpMainWindow::getInstance()->isFinalizing()&&qmpSettingsWindow::getSettingsIntf()->value("Behavior/DialogStatus","").toInt()) { qmpSettingsWindow::getSettingsIntf()->setValue("DialogStatus/PListWShown",0); @@ -159,21 +160,21 @@ void qmpPlistWindow::insertItems(QStringList il) ui->lwFiles->addItems(il); } -void qmpPlistWindow::on_pbAdd_clicked() +int qmpPlistWindow::on_pbAdd_clicked() { QStringList sl; if(qmpSettingsWindow::getSettingsIntf()->value("Behavior/DialogStatus","").toInt()) sl=QFileDialog::getOpenFileNames(this,"Add File",qmpSettingsWindow::getSettingsIntf()->value("DialogStatus/FileDialogPath","").toString(),"Midi files (*.mid *.midi)"); else sl=QFileDialog::getOpenFileNames(this,"Add File","","Midi files (*.mid *.midi *.rmi)"); - if(sl.empty())return; + if(sl.empty())return 0; for(int i=0;i<sl.size();++i) - { ui->lwFiles->addItem(new QListWidgetItem(sl.at(i))); - } + if(!isVisible())while(ui->lwFiles->count()>1)delete ui->lwFiles->item(0); if(qmpSettingsWindow::getSettingsIntf()->value("Behavior/DialogStatus","").toInt()) qmpSettingsWindow::getSettingsIntf()->setValue("DialogStatus/FileDialogPath", QUrl(sl.at(0)).toString(QUrl::RemoveFilename)); + return 1; } void qmpPlistWindow::on_pbAddFolder_clicked() @@ -213,15 +214,15 @@ void qmpPlistWindow::on_pbRepeat_clicked() switch(repeat) { case 0: - ui->pbRepeat->setIcon(QIcon(":/img/repeat-non.png")); + ui->pbRepeat->setIcon(QIcon(":/img/repeat-non.svg")); ui->pbRepeat->setText(tr("Repeat Off")); break; case 1: - ui->pbRepeat->setIcon(QIcon(":/img/repeat-one.png")); + ui->pbRepeat->setIcon(QIcon(":/img/repeat-one.svg")); ui->pbRepeat->setText(tr("Repeat One")); break; case 2: - ui->pbRepeat->setIcon(QIcon(":/img/repeat-all.png")); + ui->pbRepeat->setIcon(QIcon(":/img/repeat-all.svg")); ui->pbRepeat->setText(tr("Repeat All")); break; } @@ -233,12 +234,12 @@ void qmpPlistWindow::on_pbShuffle_clicked() switch(shuffle) { case 1: - ui->pbShuffle->setIcon(QIcon(":/img/shuffle.png")); + ui->pbShuffle->setIcon(QIcon(":/img/shuffle.svg")); ui->pbShuffle->setText(tr("Shuffle On")); break; case 0: default: - ui->pbShuffle->setIcon(QIcon(":/img/shuffle-off.png")); + ui->pbShuffle->setIcon(QIcon(":/img/shuffle-off.svg")); ui->pbShuffle->setText(tr("Shuffle Off")); break; } @@ -317,27 +318,27 @@ void qmpPlistWindow::on_pbLoad_clicked() switch(shuffle) { case 1: - ui->pbShuffle->setIcon(QIcon(":/img/shuffle.png")); + ui->pbShuffle->setIcon(QIcon(":/img/shuffle.svg")); ui->pbShuffle->setText(tr("Shuffle On")); break; case 0: default: - ui->pbShuffle->setIcon(QIcon(":/img/shuffle-off.png")); + ui->pbShuffle->setIcon(QIcon(":/img/shuffle-off.svg")); ui->pbShuffle->setText(tr("Shuffle Off")); break; } switch(repeat) { case 0: - ui->pbRepeat->setIcon(QIcon(":/img/repeat-non.png")); + ui->pbRepeat->setIcon(QIcon(":/img/repeat-non.svg")); ui->pbRepeat->setText(tr("Repeat Off")); break; case 1: - ui->pbRepeat->setIcon(QIcon(":/img/repeat-one.png")); + ui->pbRepeat->setIcon(QIcon(":/img/repeat-one.svg")); ui->pbRepeat->setText(tr("Repeat One")); break; case 2: - ui->pbRepeat->setIcon(QIcon(":/img/repeat-all.png")); + ui->pbRepeat->setIcon(QIcon(":/img/repeat-all.svg")); ui->pbRepeat->setText(tr("Repeat All")); break; } diff --git a/qmidiplayer-desktop/qmpplistwindow.hpp b/qmidiplayer-desktop/qmpplistwindow.hpp index 9e78a8a..9e1b501 100644 --- a/qmidiplayer-desktop/qmpplistwindow.hpp +++ b/qmidiplayer-desktop/qmpplistwindow.hpp @@ -51,7 +51,7 @@ class qmpPlistWindow : public QDialog void selectionChanging(); public slots: - void on_pbAdd_clicked(); + int on_pbAdd_clicked(); private slots: void on_pbAddFolder_clicked(); void on_pbRemove_clicked(); diff --git a/qmidiplayer-desktop/qmpplistwindow.ui b/qmidiplayer-desktop/qmpplistwindow.ui index 7b4eaa5..4c4c786 100644 --- a/qmidiplayer-desktop/qmpplistwindow.ui +++ b/qmidiplayer-desktop/qmpplistwindow.ui @@ -66,7 +66,7 @@ </property> <property name="icon"> <iconset resource="resources.qrc"> - <normaloff>:/img/save.png</normaloff>:/img/save.png</iconset> + <normaloff>:/img/save.svg</normaloff>:/img/save.svg</iconset> </property> <property name="iconSize"> <size> @@ -98,7 +98,7 @@ </property> <property name="icon"> <iconset resource="resources.qrc"> - <normaloff>:/img/add.png</normaloff>:/img/add.png</iconset> + <normaloff>:/img/add.svg</normaloff>:/img/add.svg</iconset> </property> <property name="iconSize"> <size> @@ -130,7 +130,7 @@ </property> <property name="icon"> <iconset resource="resources.qrc"> - <normaloff>:/img/load.png</normaloff>:/img/load.png</iconset> + <normaloff>:/img/load.svg</normaloff>:/img/load.svg</iconset> </property> <property name="iconSize"> <size> @@ -162,7 +162,7 @@ </property> <property name="icon"> <iconset resource="resources.qrc"> - <normaloff>:/img/repeat-non.png</normaloff>:/img/repeat-non.png</iconset> + <normaloff>:/img/repeat-non.svg</normaloff>:/img/repeat-non.svg</iconset> </property> <property name="iconSize"> <size> @@ -194,7 +194,7 @@ </property> <property name="icon"> <iconset resource="resources.qrc"> - <normaloff>:/img/remove.png</normaloff>:/img/remove.png</iconset> + <normaloff>:/img/remove.svg</normaloff>:/img/remove.svg</iconset> </property> <property name="iconSize"> <size> @@ -226,7 +226,7 @@ </property> <property name="icon"> <iconset resource="resources.qrc"> - <normaloff>:/img/addfolder.png</normaloff>:/img/addfolder.png</iconset> + <normaloff>:/img/addfolder.svg</normaloff>:/img/addfolder.svg</iconset> </property> <property name="iconSize"> <size> @@ -258,7 +258,7 @@ </property> <property name="icon"> <iconset resource="resources.qrc"> - <normaloff>:/img/shuffle-off.png</normaloff>:/img/shuffle-off.png</iconset> + <normaloff>:/img/shuffle-off.svg</normaloff>:/img/shuffle-off.svg</iconset> </property> <property name="iconSize"> <size> @@ -290,7 +290,7 @@ </property> <property name="icon"> <iconset resource="resources.qrc"> - <normaloff>:/img/clear.png</normaloff>:/img/clear.png</iconset> + <normaloff>:/img/clear.svg</normaloff>:/img/clear.svg</iconset> </property> <property name="iconSize"> <size> diff --git a/qmidiplayer-desktop/qmpplugin.cpp b/qmidiplayer-desktop/qmpplugin.cpp index 7ff305c..f93cddf 100644 --- a/qmidiplayer-desktop/qmpplugin.cpp +++ b/qmidiplayer-desktop/qmpplugin.cpp @@ -179,6 +179,8 @@ bool qmpPluginAPI::isDarkTheme(){return qmw?qmw->isDarkTheme():false;} void qmpPluginAPI::discardCurrentEvent(){if(qmw&&qmw->getPlayer())qmw->getPlayer()->discardCurrentEvent();} void qmpPluginAPI::commitEventChange(SEventCallBackData d){if(qmw&&qmw->getPlayer())qmw->getPlayer()->commitEventChange(d);} void qmpPluginAPI::callEventReaderCB(SEventCallBackData d){if(qmw&&qmw->getPlayer())qmw->getPlayer()->callEventReaderCB(d);} +void qmpPluginAPI::setFuncState(std::string name,bool state){if(qmw)qmw->setFuncState(name,state);} +void qmpPluginAPI::setFuncEnabled(std::string name,bool enable){if(qmw)qmw->setFuncEnabled(name,enable);} int qmpPluginAPI::registerEventHandlerIntf(IMidiCallBack *cb,void *userdata) {return qmw->getPlayer()->setEventHandlerCB(cb,userdata);} @@ -192,6 +194,10 @@ void qmpPluginAPI::registerVisualizationIntf(qmpVisualizationIntf* intf,std::str {qmw->registerVisualizationIntf(intf,name,desc,icon,iconlen);} void qmpPluginAPI::unregisterVisualizationIntf(std::string name) {qmw->unregisterVisualizationIntf(name);} +void qmpPluginAPI::registerFunctionality(qmpFuncBaseIntf *i,std::string name,std::string desc,const char *icon,int iconlen,bool checkable) +{qmw->registerFunctionality(i,name,desc,icon,iconlen,checkable);} +void qmpPluginAPI::unregisterFunctionality(std::string name) +{qmw->unregisterFunctionality(name);} int qmpPluginAPI::registerFileReadFinishedHandlerIntf(IMidiCallBack* cb,void* userdata) {return qmw->getPlayer()->setFileReadFinishedCB(cb,userdata);} void qmpPluginAPI::unregisterFileReadFinishedHandlerIntf(int intfhandle) diff --git a/qmidiplayer-desktop/qmpsettingswindow.cpp b/qmidiplayer-desktop/qmpsettingswindow.cpp index abd8213..3be0a3e 100644 --- a/qmidiplayer-desktop/qmpsettingswindow.cpp +++ b/qmidiplayer-desktop/qmpsettingswindow.cpp @@ -8,7 +8,7 @@ QSettings* qmpSettingsWindow::settings=NULL; QComboBox* qmpSettingsWindow::outwidget=NULL; -void qmpFluidForEachOpt(void* data,char* /*name*/,char* option) +void qmpFluidForEachOpt(void* data,char*,char* option) { QComboBox *pcb=(QComboBox*)data; pcb->addItem(option); @@ -24,10 +24,10 @@ qmpSettingsWindow::qmpSettingsWindow(QWidget *parent) : connect(this,SIGNAL(dialogClosing()),parent,SLOT(dialogClosed())); settings=new QSettings(QDir::homePath()+QString("/.config/qmprc"),QSettings::IniFormat); settingsInit();outwidget=ui->cbOutputDevice; - ui->pbAdd->setIcon(QIcon(getThemedIcon(":/img/add.png"))); - ui->pbRemove->setIcon(QIcon(getThemedIcon(":/img/remove.png"))); - ui->pbDown->setIcon(QIcon(getThemedIcon(":/img/down.png"))); - ui->pbUp->setIcon(QIcon(getThemedIcon(":/img/up.png"))); + ui->pbAdd->setIcon(QIcon(getThemedIcon(":/img/add.svg"))); + ui->pbRemove->setIcon(QIcon(getThemedIcon(":/img/remove.svg"))); + ui->pbDown->setIcon(QIcon(getThemedIcon(":/img/down.svg"))); + ui->pbUp->setIcon(QIcon(getThemedIcon(":/img/up.svg"))); cw=new qmpCustomizeWindow(this); } @@ -52,6 +52,7 @@ QComboBox* qmpSettingsWindow::getDefaultOutWidget(){return outwidget;} void qmpSettingsWindow::on_buttonBox_accepted() { settingsUpdate(); + qmpMainWindow::getInstance()->setupWidget(); emit dialogClosing(); } @@ -66,7 +67,6 @@ void qmpSettingsWindow::settingsInit() fluid_settings_t *fsettings=new_fluid_settings(); settings->setValue("Midi/DefaultOutput",settings->value("Midi/DefaultOutput","Internal FluidSynth")); - //this item is still a stub... settings->setValue("Midi/DisableMapping",settings->value("Midi/DisableMapping",0)); ui->cbDisableMapping->setChecked(settings->value("Midi/DisableMapping",0).toInt()); @@ -187,6 +187,9 @@ void qmpSettingsWindow::settingsInit() settings->setValue("Behavior/SingleInstance",settings->value("Behavior/SingleInstance",0)); ui->cbPersistentfs->setChecked(settings->value("Behavior/SingleInstance",0).toInt()); + settings->setValue("Behavior/ShowButtonLabel",settings->value("Behavior/ShowButtonLabel",0)); + ui->cbShowLabel->setChecked(settings->value("Behavior/ShowButtonLabel",0).toInt()); + settings->setValue("Behavior/IconTheme",settings->value("Behavior/IconTheme",0)); ui->cbIconTheme->setCurrentIndex(settings->value("Behavior/IconTheme",0).toInt()); @@ -240,6 +243,8 @@ void qmpSettingsWindow::settingsUpdate() settings->setValue("Behavior/SingleInstance",ui->cbPersistentfs->isChecked()?1:0); + settings->setValue("Behavior/ShowButtonLabel",ui->cbShowLabel->isChecked()?1:0); + settings->setValue("Behavior/IconTheme",ui->cbIconTheme->currentIndex()); if(!ui->cbDialogStatus->isChecked()) diff --git a/qmidiplayer-desktop/qmpsettingswindow.ui b/qmidiplayer-desktop/qmpsettingswindow.ui index 6497d1c..ad359f7 100644 --- a/qmidiplayer-desktop/qmpsettingswindow.ui +++ b/qmidiplayer-desktop/qmpsettingswindow.ui @@ -23,7 +23,7 @@ <item> <widget class="QTabWidget" name="tabWidget"> <property name="currentIndex"> - <number>3</number> + <number>0</number> </property> <widget class="QWidget" name="tab"> <attribute name="title"> @@ -467,7 +467,7 @@ </property> <property name="icon"> <iconset resource="resources.qrc"> - <normaloff>:/img/add.png</normaloff>:/img/add.png</iconset> + <normaloff>:/img/add.svg</normaloff>:/img/add.svg</iconset> </property> <property name="iconSize"> <size> @@ -484,7 +484,7 @@ </property> <property name="icon"> <iconset resource="resources.qrc"> - <normaloff>:/img/remove.png</normaloff>:/img/remove.png</iconset> + <normaloff>:/img/remove.svg</normaloff>:/img/remove.svg</iconset> </property> <property name="iconSize"> <size> @@ -501,7 +501,7 @@ </property> <property name="icon"> <iconset resource="resources.qrc"> - <normaloff>:/img/up.png</normaloff>:/img/up.png</iconset> + <normaloff>:/img/up.svg</normaloff>:/img/up.svg</iconset> </property> <property name="iconSize"> <size> @@ -518,7 +518,7 @@ </property> <property name="icon"> <iconset resource="resources.qrc"> - <normaloff>:/img/down.png</normaloff>:/img/down.png</iconset> + <normaloff>:/img/down.svg</normaloff>:/img/down.svg</iconset> </property> <property name="iconSize"> <size> @@ -540,7 +540,7 @@ <item> <widget class="QCheckBox" name="cbRestorePlaylist"> <property name="sizePolicy"> - <sizepolicy hsizetype="Minimum" vsizetype="Preferred"> + <sizepolicy hsizetype="Minimum" vsizetype="Fixed"> <horstretch>0</horstretch> <verstretch>0</verstretch> </sizepolicy> @@ -553,7 +553,7 @@ <item> <widget class="QCheckBox" name="cbLoadFolder"> <property name="sizePolicy"> - <sizepolicy hsizetype="Minimum" vsizetype="Preferred"> + <sizepolicy hsizetype="Minimum" vsizetype="Fixed"> <horstretch>0</horstretch> <verstretch>0</verstretch> </sizepolicy> @@ -566,7 +566,7 @@ <item> <widget class="QCheckBox" name="cbDialogStatus"> <property name="sizePolicy"> - <sizepolicy hsizetype="Minimum" vsizetype="Preferred"> + <sizepolicy hsizetype="Minimum" vsizetype="Fixed"> <horstretch>0</horstretch> <verstretch>0</verstretch> </sizepolicy> @@ -579,7 +579,7 @@ <item> <widget class="QCheckBox" name="cbSaveEfxParam"> <property name="sizePolicy"> - <sizepolicy hsizetype="Minimum" vsizetype="Preferred"> + <sizepolicy hsizetype="Minimum" vsizetype="Fixed"> <horstretch>0</horstretch> <verstretch>0</verstretch> </sizepolicy> @@ -592,7 +592,7 @@ <item> <widget class="QCheckBox" name="cbPersistentfs"> <property name="sizePolicy"> - <sizepolicy hsizetype="Minimum" vsizetype="Preferred"> + <sizepolicy hsizetype="Minimum" vsizetype="Fixed"> <horstretch>0</horstretch> <verstretch>0</verstretch> </sizepolicy> @@ -603,6 +603,19 @@ </widget> </item> <item> + <widget class="QCheckBox" name="cbShowLabel"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Minimum" vsizetype="Fixed"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="text"> + <string>Show label beside icon in toolbar buttons</string> + </property> + </widget> + </item> + <item> <layout class="QHBoxLayout" name="horizontalLayout_2"> <item> <widget class="QLabel" name="label"> diff --git a/qmidiplayer-desktop/resources.qrc b/qmidiplayer-desktop/resources.qrc index 044acd8..1249307 100644 --- a/qmidiplayer-desktop/resources.qrc +++ b/qmidiplayer-desktop/resources.qrc @@ -1,56 +1,64 @@ <RCC> <qresource prefix="/"> - <file>../img/add.png</file> - <file>../img/list.png</file> - <file>../img/addfolder.png</file> - <file>../img/channel.png</file> - <file>../img/prev.png</file> + <file>../img/add.svg</file> + <file>../img/list.svg</file> + <file>../img/addfolder.svg</file> + <file>../img/channel.svg</file> + <file>../img/prev.svg</file> <file>../img/qmidiplyr.png</file> - <file>../img/remove.png</file> - <file>../img/clear.png</file> - <file>../img/down.png</file> - <file>../img/effects.png</file> - <file>../img/repeat-all.png</file> - <file>../img/repeat-base.png</file> - <file>../img/repeat-non.png</file> - <file>../img/load.png</file> - <file>../img/next.png</file> - <file>../img/repeat-one.png</file> - <file>../img/save.png</file> - <file>../img/settings.png</file> - <file>../img/pause.png</file> - <file>../img/play.png</file> - <file>../img/shuffle-off.png</file> - <file>../img/shuffle.png</file> - <file>../img/stop.png</file> - <file>../img/up.png</file> - <file>../img/visualization.png</file> - <file>../img/add_i.png</file> - <file>../img/list_i.png</file> - <file>../img/addfolder_i.png</file> - <file>../img/channel_i.png</file> - <file>../img/prev_i.png</file> - <file>../img/remove_i.png</file> - <file>../img/clear_i.png</file> - <file>../img/down_i.png</file> - <file>../img/effects_i.png</file> - <file>../img/repeat-all_i.png</file> - <file>../img/repeat-base_i.png</file> - <file>../img/repeat-non_i.png</file> - <file>../img/load_i.png</file> - <file>../img/next_i.png</file> - <file>../img/repeat-one_i.png</file> - <file>../img/save_i.png</file> - <file>../img/settings_i.png</file> - <file>../img/pause_i.png</file> - <file>../img/play_i.png</file> - <file>../img/shuffle-off_i.png</file> - <file>../img/shuffle_i.png</file> - <file>../img/stop_i.png</file> - <file>../img/up_i.png</file> - <file>../img/visualization_i.png</file> - <file>../img/ledon.png</file> - <file>../img/ledoff.png</file> + <file>../img/remove.svg</file> + <file>../img/clear.svg</file> + <file>../img/down.svg</file> + <file>../img/effects.svg</file> + <file>../img/repeat-all.svg</file> + <file>../img/repeat-non.svg</file> + <file>../img/load.svg</file> + <file>../img/next.svg</file> + <file>../img/repeat-one.svg</file> + <file>../img/repeat-base.svg</file> + <file>../img/save.svg</file> + <file>../img/settings.svg</file> + <file>../img/pause.svg</file> + <file>../img/play.svg</file> + <file>../img/shuffle-off.svg</file> + <file>../img/shuffle.svg</file> + <file>../img/stop.svg</file> + <file>../img/up.svg</file> + <file>../img/visualization.svg</file> + <file>../img/add_i.svg</file> + <file>../img/list_i.svg</file> + <file>../img/addfolder_i.svg</file> + <file>../img/channel_i.svg</file> + <file>../img/prev_i.svg</file> + <file>../img/remove_i.svg</file> + <file>../img/clear_i.svg</file> + <file>../img/down_i.svg</file> + <file>../img/effects_i.svg</file> + <file>../img/repeat-all_i.svg</file> + <file>../img/repeat-non_i.svg</file> + <file>../img/load_i.svg</file> + <file>../img/next_i.svg</file> + <file>../img/repeat-one_i.svg</file> + <file>../img/repeat-base_i.svg</file> + <file>../img/save_i.svg</file> + <file>../img/settings_i.svg</file> + <file>../img/pause_i.svg</file> + <file>../img/play_i.svg</file> + <file>../img/shuffle-off_i.svg</file> + <file>../img/shuffle_i.svg</file> + <file>../img/stop_i.svg</file> + <file>../img/up_i.svg</file> + <file>../img/visualization_i.svg</file> + <file>../img/open.svg</file> + <file>../img/info.svg</file> + <file>../img/render.svg</file> + <file>../img/panic.svg</file> + <file>../img/open_i.svg</file> + <file>../img/info_i.svg</file> + <file>../img/render_i.svg</file> + <file>../img/panic_i.svg</file> + <file>../img/ledon.svg</file> + <file>../img/ledoff.svg</file> <file>../doc/index_internal.html</file> <file>../doc/version_internal.html</file> <file>../doc/license_internal.html</file> |