diff options
author | Chris Xiong <chirs241097@gmail.com> | 2016-05-20 23:51:15 +0800 |
---|---|---|
committer | Chris Xiong <chirs241097@gmail.com> | 2016-05-20 23:51:15 +0800 |
commit | 1ec23952dd7c022e11afbb93d93be1bac5c94081 (patch) | |
tree | c38c321d2374c72f4f607bd3742a59188dae1e60 | |
parent | 78b384662f484e946a6a17c96e6c309df0c039da (diff) | |
download | QMidiPlayer-1ec23952dd7c022e11afbb93d93be1bac5c94081.tar.xz |
Scale GUI correctly on a high DPI device.
Fix building for Windows. RC-bugs still exist.
-rw-r--r-- | ChangeLog | 4 | ||||
-rw-r--r-- | core/qmpmidiplay.cpp | 2 | ||||
-rw-r--r-- | debian/changelog | 6 | ||||
-rw-r--r-- | debian/qmidiplayer-plugin-visualization.install | 3 | ||||
-rw-r--r-- | doc/license_internal.html | 12 | ||||
-rw-r--r-- | include/qmpcorepublic.hpp | 13 | ||||
-rw-r--r-- | qmidiplayer-desktop/qmpchanneleditor.cpp | 2 | ||||
-rw-r--r-- | qmidiplayer-desktop/qmpchannelswindow.cpp | 2 | ||||
-rw-r--r-- | qmidiplayer-desktop/qmpefxwindow.cpp | 2 | ||||
-rw-r--r-- | qmidiplayer-desktop/qmphelpwindow.cpp | 2 | ||||
-rw-r--r-- | qmidiplayer-desktop/qmpinfowindow.cpp | 2 | ||||
-rw-r--r-- | qmidiplayer-desktop/qmpmainwindow.cpp | 4 | ||||
-rw-r--r-- | qmidiplayer-desktop/qmpmainwindow.ui | 1035 | ||||
-rw-r--r-- | qmidiplayer-desktop/qmpplistwindow.cpp | 2 | ||||
-rw-r--r-- | qmidiplayer-desktop/qmpplugin.cpp | 17 | ||||
-rw-r--r-- | qmidiplayer-desktop/qmpplugin.hpp | 4 | ||||
-rw-r--r-- | qmidiplayer-desktop/qmpsettingswindow.cpp | 2 | ||||
-rw-r--r-- | sample-plugin/sampleplugin.hpp | 2 | ||||
-rw-r--r-- | visualization/qmpvisualization.hpp | 2 |
19 files changed, 577 insertions, 541 deletions
@@ -1,3 +1,7 @@ +2016-05-20 0.8.1 alpha +Scale GUI correctly on a high DPI device. +Fix building for Windows. RC-bugs still exist. + 2016-05-19 0.8.1 alpha Added a sample plugin as a template. Implemented scanPlugin for Windows. diff --git a/core/qmpmidiplay.cpp b/core/qmpmidiplay.cpp index 63c4dda..855ccb7 100644 --- a/core/qmpmidiplay.cpp +++ b/core/qmpmidiplay.cpp @@ -211,7 +211,7 @@ void CMidiPlayer::playEvents() if(resumed)resumed=false; else if(sendtime.count()<(midiFile->getEvent(tceptr)->time-ct)*dpt) -#if 0 +#if _WIN32 w32usleep((midiFile->getEvent(tceptr)->time-ct)*(dpt/1000)); #else std::this_thread::sleep_for(std::chrono::nanoseconds((midiFile->getEvent(tceptr)->time-ct)*dpt-sendtime.count())); diff --git a/debian/changelog b/debian/changelog index 5526c46..2cd03ae 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +qmidiplayer (0.8.1-0) UNRELEASED; urgency=low + + * New upstream release. + + -- chrisoft <chirs241097@gmail.com> Fri, 20 May 2016 21:54:58 +0800 + qmidiplayer (0.8.0-0) UNRELEASED; urgency=low * New upstream release. diff --git a/debian/qmidiplayer-plugin-visualization.install b/debian/qmidiplayer-plugin-visualization.install index 8b0b08d..b27fef9 100644 --- a/debian/qmidiplayer-plugin-visualization.install +++ b/debian/qmidiplayer-plugin-visualization.install @@ -1,2 +1,3 @@ usr/lib/qmidiplayer/* -usr/share/qmidiplayer/img/chequerboard.png
\ No newline at end of file +usr/share/qmidiplayer/img/chequerboard.png +usr/share/qmidiplayer/img/particle.png
\ No newline at end of file diff --git a/doc/license_internal.html b/doc/license_internal.html index ea83aa2..b15245a 100644 --- a/doc/license_internal.html +++ b/doc/license_internal.html @@ -111,13 +111,13 @@ public, and in some countries other activities as well.</p> parties to make or receive copies. Mere interaction with a user through a computer network, with no transfer of a copy, is not conveying.</p> -<p>An interactive user interface displays “Appropriate Legal Notices” +<p>An interactive user pinterface displays “Appropriate Legal Notices” to the extent that it includes a convenient and prominently visible feature that (1) displays an appropriate copyright notice, and (2) tells the user that there is no warranty for the work (except to the extent that warranties are provided), that licensees may convey the work under this License, and how to view a copy of this License. If -the interface presents a list of user commands or options, such as a +the pinterface presents a list of user commands or options, such as a menu, a prominent item in the list meets this criterion.</p> <h4><a name="section1"></a>1. Source Code.</h4> @@ -126,7 +126,7 @@ menu, a prominent item in the list meets this criterion.</p> for making modifications to it. “Object code” means any non-source form of a work.</p> -<p>A “Standard Interface” means an interface that either is an official +<p>A “Standard pinterface” means an pinterface that either is an official standard defined by a recognized standards body, or, in the case of interfaces specified for a particular programming language, one that is widely used among developers working in that language.</p> @@ -135,7 +135,7 @@ is widely used among developers working in that language.</p> than the work as a whole, that (a) is included in the normal form of packaging a Major Component, but which is not part of that Major Component, and (b) serves only to enable use of the work with that -Major Component, or to implement a Standard Interface for which an +Major Component, or to implement a Standard pinterface for which an implementation is available to the public in source code form. A “Major Component”, in this context, means a major essential component (kernel, window system, and so on) of the specific operating system @@ -149,7 +149,7 @@ control those activities. However, it does not include the work's System Libraries, or general-purpose tools or generally available free programs which are used unmodified in performing those activities but which are not part of the work. For example, Corresponding Source -includes interface definition files associated with source files for +includes pinterface definition files associated with source files for the work, and the source code for shared libraries and dynamically linked subprograms that the work is specifically designed to require, such as by intimate data communication or control flow between those @@ -678,7 +678,7 @@ notice like this when it starts in an interactive mode:</p> <p>The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, your program's commands -might be different; for a GUI interface, you would use an “about box”.</p> +might be different; for a GUI pinterface, you would use an “about box”.</p> <p>You should also get your employer (if you work as a programmer) or school, if any, to sign a “copyright disclaimer” for the program, if necessary. diff --git a/include/qmpcorepublic.hpp b/include/qmpcorepublic.hpp index 98b8936..17a3910 100644 --- a/include/qmpcorepublic.hpp +++ b/include/qmpcorepublic.hpp @@ -5,6 +5,11 @@ #include <string> //This struct is used by event reader callbacks and event handler callbacks //as caller data struct +#ifdef _WIN32 +#define EXPORTSYM __declspec(dllexport) +#else +#define EXPORTSYM __attribute__ ((visibility ("default"))) +#endif struct SEventCallBackData { uint32_t time,type,p1,p2; @@ -19,7 +24,7 @@ class IMidiCallBack virtual void callBack(void* callerdata,void* userdata)=0; virtual ~IMidiCallBack(){} }; -//Main plugin interface. +//Main plugin pinterface. class qmpPluginIntf { public: @@ -30,8 +35,8 @@ class qmpPluginIntf virtual const char* pluginGetName(){return "";} virtual const char* pluginGetVersion(){return "";} }; -//Visualization plugin interface. If your plugin implements a visualization, -//you should implement this interface. +//Visualization plugin pinterface. If your plugin implements a visualization, +//you should implement this pinterface. class qmpVisualizationIntf { public: @@ -103,6 +108,6 @@ class qmpPluginAPI //qmpPluginIntf* qmpPluginGetInterface(qmpPluginAPI* api) //as its entry point. A pointer to the core API is also passed to the plugin //through the parameter. This function should return a pointer to a class -//that implementes the plugin interface (qmpPluginIntf). +//that implementes the plugin pinterface (qmpPluginIntf). typedef qmpPluginIntf*(*qmpPluginEntry)(qmpPluginAPI*); #endif // QMPCOREPUBLIC_H diff --git a/qmidiplayer-desktop/qmpchanneleditor.cpp b/qmidiplayer-desktop/qmpchanneleditor.cpp index 206a2fa..2c58793 100644 --- a/qmidiplayer-desktop/qmpchanneleditor.cpp +++ b/qmidiplayer-desktop/qmpchanneleditor.cpp @@ -8,6 +8,8 @@ qmpChannelEditor::qmpChannelEditor(QWidget *parent) : ui(new Ui::qmpChannelEditor) { ui->setupUi(this);ch=0; + int w=size().width(),h=size().height();w=w*(logicalDpiX()/96.);h=h*(logicalDpiY()/96.); + setMaximumWidth(w);setMaximumHeight(h);setMinimumWidth(w);setMinimumHeight(h); styl=new QDialSkulptureStyle(); QList<QDial*> dials=findChildren<QDial*>(); for(int i=0;i<dials.count();++i) diff --git a/qmidiplayer-desktop/qmpchannelswindow.cpp b/qmidiplayer-desktop/qmpchannelswindow.cpp index e0a1522..a692852 100644 --- a/qmidiplayer-desktop/qmpchannelswindow.cpp +++ b/qmidiplayer-desktop/qmpchannelswindow.cpp @@ -11,6 +11,8 @@ qmpChannelsWindow::qmpChannelsWindow(QWidget *parent) : ui(new Ui::qmpChannelsWindow) { ui->setupUi(this); + int w=size().width(),h=size().height();w=w*(logicalDpiX()/96.);h=h*(logicalDpiY()/96.); + setMaximumWidth(w);setMaximumHeight(h);setMinimumWidth(w);setMinimumHeight(h); pselectw=new qmpPresetSelector(this); ceditw=new qmpChannelEditor(this); connect(this,SIGNAL(dialogClosing()),parent,SLOT(dialogClosed())); diff --git a/qmidiplayer-desktop/qmpefxwindow.cpp b/qmidiplayer-desktop/qmpefxwindow.cpp index 7d9c08e..25e9bf4 100644 --- a/qmidiplayer-desktop/qmpefxwindow.cpp +++ b/qmidiplayer-desktop/qmpefxwindow.cpp @@ -12,6 +12,8 @@ qmpEfxWindow::qmpEfxWindow(QWidget *parent) : QList<QDial*> dials=findChildren<QDial*>(); for(int i=0;i<dials.count();++i) dials.at(i)->setStyle(styl); + int w=size().width(),h=size().height();w=w*(logicalDpiX()/96.);h=h*(logicalDpiY()/96.); + setMaximumWidth(w);setMaximumHeight(h);setMinimumWidth(w);setMinimumHeight(h); connect(this,SIGNAL(dialogClosing()),parent,SLOT(dialogClosed())); //stub. read these from settings after the setting module is implemented QSettings *settings=qmpSettingsWindow::getSettingsIntf(); diff --git a/qmidiplayer-desktop/qmphelpwindow.cpp b/qmidiplayer-desktop/qmphelpwindow.cpp index 69e29d0..e3d2897 100644 --- a/qmidiplayer-desktop/qmphelpwindow.cpp +++ b/qmidiplayer-desktop/qmphelpwindow.cpp @@ -7,6 +7,8 @@ qmpHelpWindow::qmpHelpWindow(QWidget *parent) : ui(new Ui::qmpHelpWindow) { ui->setupUi(this); + int w=size().width(),h=size().height();w=w*(logicalDpiX()/96.);h=h*(logicalDpiY()/96.); + setMaximumWidth(w);setMaximumHeight(h);setMinimumWidth(w);setMinimumHeight(h); ui->textBrowser->setSearchPaths(QStringList(QString(":/doc"))+QStringList(QString(":/img"))); ui->textBrowser->setSource(QUrl("qrc:///doc/index_internal.html")); } diff --git a/qmidiplayer-desktop/qmpinfowindow.cpp b/qmidiplayer-desktop/qmpinfowindow.cpp index 95ad223..a4afd50 100644 --- a/qmidiplayer-desktop/qmpinfowindow.cpp +++ b/qmidiplayer-desktop/qmpinfowindow.cpp @@ -13,6 +13,8 @@ qmpInfoWindow::qmpInfoWindow(QWidget *parent) : ui(new Ui::qmpInfoWindow) { ui->setupUi(this); + int w=size().width(),h=size().height();w=w*(logicalDpiX()/96.);h=h*(logicalDpiY()/96.); + setMaximumWidth(w);setMaximumHeight(h);setMinimumWidth(w);setMinimumHeight(h); } qmpInfoWindow::~qmpInfoWindow() diff --git a/qmidiplayer-desktop/qmpmainwindow.cpp b/qmidiplayer-desktop/qmpmainwindow.cpp index f634375..c81816c 100644 --- a/qmidiplayer-desktop/qmpmainwindow.cpp +++ b/qmidiplayer-desktop/qmpmainwindow.cpp @@ -52,7 +52,9 @@ qmpMainWindow::qmpMainWindow(QWidget *parent) : { ui->setupUi(this); ui->lnPolyphone->display("00000-00000"); - ui->lbFileName->setText("");ref=this; + 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); playing=false;stopped=true;dragging=false;memset(VIs,0,sizeof(VIs)); settingsw=new qmpSettingsWindow(this);pmgr=new qmpPluginManager(); plistw=new qmpPlistWindow(this);player=NULL;timer=NULL; diff --git a/qmidiplayer-desktop/qmpmainwindow.ui b/qmidiplayer-desktop/qmpmainwindow.ui index 69a3496..9b4f3c3 100644 --- a/qmidiplayer-desktop/qmpmainwindow.ui +++ b/qmidiplayer-desktop/qmpmainwindow.ui @@ -33,525 +33,528 @@ <normaloff>:/img/qmidiplyr.png</normaloff>:/img/qmidiplyr.png</iconset> </property> <widget class="QWidget" name="centralWidget"> - <widget class="QPushButton" name="pushButton"> - <property name="geometry"> - <rect> - <x>0</x> - <y>0</y> - <width>21</width> - <height>21</height> - </rect> + <layout class="QHBoxLayout" name="horizontalLayout"> + <property name="leftMargin"> + <number>2</number> </property> - <property name="text"> - <string>?</string> + <property name="topMargin"> + <number>2</number> </property> - </widget> - <widget class="QWidget" name="horizontalLayoutWidget"> - <property name="geometry"> - <rect> - <x>0</x> - <y>0</y> - <width>441</width> - <height>241</height> - </rect> + <property name="rightMargin"> + <number>2</number> </property> - <layout class="QHBoxLayout" name="horizontalLayout"> - <property name="leftMargin"> - <number>4</number> - </property> - <item> - <layout class="QVBoxLayout" name="verticalLayout_2"> - <property name="spacing"> - <number>0</number> - </property> - <item> - <widget class="QLabel" name="lbFileName"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Expanding" vsizetype="Expanding"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="font"> - <font> - <pointsize>18</pointsize> - </font> - </property> - <property name="contextMenuPolicy"> - <enum>Qt::CustomContextMenu</enum> - </property> - <property name="text"> - <string>somefile.mid</string> - </property> - <property name="alignment"> - <set>Qt::AlignCenter</set> - </property> - </widget> - </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> - <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"> - <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="QVBoxLayout" name="verticalLayout_4"> - <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="Fixed"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="minimumSize"> - <size> - <width>0</width> - <height>0</height> - </size> - </property> - <property name="maximumSize"> - <size> - <width>16777215</width> - <height>34</height> - </size> - </property> - <property name="text"> - <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> - </widget> - </item> - <item> - <widget class="QPushButton" name="pbStop"> - <property name="minimumSize"> - <size> - <width>0</width> - <height>34</height> - </size> - </property> - <property name="maximumSize"> - <size> - <width>16777215</width> - <height>34</height> - </size> - </property> - <property name="text"> - <string/> - </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> - </widget> - </item> - <item> - <widget class="QPushButton" name="pbPrev"> - <property name="minimumSize"> - <size> - <width>0</width> - <height>34</height> - </size> - </property> - <property name="maximumSize"> - <size> - <width>16777215</width> - <height>34</height> - </size> - </property> - <property name="text"> - <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> - </widget> - </item> - <item> - <widget class="QPushButton" name="pbNext"> - <property name="minimumSize"> - <size> - <width>0</width> - <height>34</height> - </size> - </property> - <property name="maximumSize"> - <size> - <width>16777215</width> - <height>34</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> - </property> - </widget> - </item> - <item> - <spacer name="horizontalSpacer"> - <property name="orientation"> - <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="pbSettings"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Minimum" vsizetype="Fixed"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="minimumSize"> - <size> - <width>0</width> - <height>34</height> - </size> - </property> - <property name="maximumSize"> - <size> - <width>16777215</width> - <height>34</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> - <item> - <layout class="QGridLayout" name="gridLayout"> - <item row="0" column="0"> - <widget class="QPushButton" name="pbChannels"> - <property name="maximumSize"> - <size> - <width>16777215</width> - <height>36</height> - </size> - </property> - <property name="styleSheet"> - <string notr="true">text-align:left</string> - </property> - <property name="text"> - <string>Channels</string> - </property> - <property name="icon"> - <iconset resource="resources.qrc"> - <normaloff>:/img/channel.png</normaloff>:/img/channel.png</iconset> - </property> - <property name="iconSize"> - <size> - <width>32</width> - <height>32</height> - </size> - </property> - <property name="checkable"> - <bool>true</bool> - </property> - </widget> - </item> - <item row="0" column="1"> - <widget class="QPushButton" name="pbPList"> - <property name="maximumSize"> - <size> - <width>16777215</width> - <height>36</height> - </size> - </property> - <property name="styleSheet"> - <string notr="true">text-align:left</string> - </property> - <property name="text"> - <string>Playlist</string> - </property> - <property name="icon"> - <iconset resource="resources.qrc"> - <normaloff>:/img/list.png</normaloff>:/img/list.png</iconset> - </property> - <property name="iconSize"> - <size> - <width>32</width> - <height>32</height> - </size> - </property> - <property name="checkable"> - <bool>true</bool> - </property> - <property name="checked"> - <bool>false</bool> - </property> - <property name="flat"> - <bool>false</bool> - </property> - </widget> - </item> - <item row="1" column="0"> - <widget class="QPushButton" name="pbEfx"> - <property name="maximumSize"> - <size> - <width>16777215</width> - <height>36</height> - </size> - </property> - <property name="styleSheet"> - <string notr="true">text-align:left</string> - </property> - <property name="text"> - <string>Effects</string> - </property> - <property name="icon"> - <iconset resource="resources.qrc"> - <normaloff>:/img/effects.png</normaloff>:/img/effects.png</iconset> - </property> - <property name="iconSize"> - <size> - <width>32</width> - <height>32</height> - </size> - </property> - <property name="checkable"> - <bool>true</bool> - </property> - </widget> - </item> - <item row="1" column="1"> - <widget class="QPushButton" name="pbVisualization"> - <property name="maximumSize"> - <size> - <width>16777215</width> - <height>36</height> - </size> - </property> - <property name="styleSheet"> - <string notr="true">text-align:left</string> - </property> - <property name="text"> - <string>Visualization</string> - </property> - <property name="icon"> - <iconset resource="resources.qrc"> - <normaloff>:/img/visualization.png</normaloff>:/img/visualization.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> - </layout> - </item> - <item> - <layout class="QVBoxLayout" name="verticalLayout"> - <property name="spacing"> - <number>0</number> - </property> - <property name="topMargin"> - <number>4</number> - </property> - <item> - <widget class="QSlider" name="vsMasterVol"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Minimum" vsizetype="Expanding"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="maximum"> - <number>100</number> - </property> - <property name="value"> - <number>50</number> - </property> - <property name="orientation"> - <enum>Qt::Vertical</enum> - </property> - </widget> - </item> - <item> - <widget class="QLabel" name="lbMasterVol"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Minimum" vsizetype="Minimum"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="text"> - <string>Master</string> - </property> - <property name="alignment"> - <set>Qt::AlignCenter</set> - </property> - </widget> - </item> - </layout> - </item> - </layout> - </widget> - <zorder>horizontalLayoutWidget</zorder> - <zorder>pushButton</zorder> + <property name="bottomMargin"> + <number>2</number> + </property> + <item> + <layout class="QVBoxLayout" name="verticalLayout_2"> + <property name="spacing"> + <number>0</number> + </property> + <item> + <widget class="QLabel" name="lbFileName"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Expanding" vsizetype="Expanding"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="font"> + <font> + <pointsize>18</pointsize> + </font> + </property> + <property name="contextMenuPolicy"> + <enum>Qt::CustomContextMenu</enum> + </property> + <property name="text"> + <string>somefile.mid</string> + </property> + <property name="alignment"> + <set>Qt::AlignCenter</set> + </property> + </widget> + </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> + <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"> + <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="QVBoxLayout" name="verticalLayout_4"> + <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="Fixed"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="minimumSize"> + <size> + <width>0</width> + <height>0</height> + </size> + </property> + <property name="maximumSize"> + <size> + <width>16777215</width> + <height>34</height> + </size> + </property> + <property name="text"> + <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> + </widget> + </item> + <item> + <widget class="QPushButton" name="pbStop"> + <property name="minimumSize"> + <size> + <width>0</width> + <height>34</height> + </size> + </property> + <property name="maximumSize"> + <size> + <width>16777215</width> + <height>34</height> + </size> + </property> + <property name="text"> + <string/> + </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> + </widget> + </item> + <item> + <widget class="QPushButton" name="pbPrev"> + <property name="minimumSize"> + <size> + <width>0</width> + <height>34</height> + </size> + </property> + <property name="maximumSize"> + <size> + <width>16777215</width> + <height>34</height> + </size> + </property> + <property name="text"> + <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> + </widget> + </item> + <item> + <widget class="QPushButton" name="pbNext"> + <property name="minimumSize"> + <size> + <width>0</width> + <height>34</height> + </size> + </property> + <property name="maximumSize"> + <size> + <width>16777215</width> + <height>34</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> + </property> + </widget> + </item> + <item> + <spacer name="horizontalSpacer"> + <property name="orientation"> + <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="pbSettings"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Minimum" vsizetype="Fixed"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="minimumSize"> + <size> + <width>0</width> + <height>34</height> + </size> + </property> + <property name="maximumSize"> + <size> + <width>16777215</width> + <height>34</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> + <item> + <layout class="QGridLayout" name="gridLayout"> + <item row="0" column="0"> + <widget class="QPushButton" name="pbChannels"> + <property name="maximumSize"> + <size> + <width>16777215</width> + <height>36</height> + </size> + </property> + <property name="styleSheet"> + <string notr="true">text-align:left</string> + </property> + <property name="text"> + <string>Channels</string> + </property> + <property name="icon"> + <iconset resource="resources.qrc"> + <normaloff>:/img/channel.png</normaloff>:/img/channel.png</iconset> + </property> + <property name="iconSize"> + <size> + <width>32</width> + <height>32</height> + </size> + </property> + <property name="checkable"> + <bool>true</bool> + </property> + </widget> + </item> + <item row="0" column="1"> + <widget class="QPushButton" name="pbPList"> + <property name="maximumSize"> + <size> + <width>16777215</width> + <height>36</height> + </size> + </property> + <property name="styleSheet"> + <string notr="true">text-align:left</string> + </property> + <property name="text"> + <string>Playlist</string> + </property> + <property name="icon"> + <iconset resource="resources.qrc"> + <normaloff>:/img/list.png</normaloff>:/img/list.png</iconset> + </property> + <property name="iconSize"> + <size> + <width>32</width> + <height>32</height> + </size> + </property> + <property name="checkable"> + <bool>true</bool> + </property> + <property name="checked"> + <bool>false</bool> + </property> + <property name="flat"> + <bool>false</bool> + </property> + </widget> + </item> + <item row="1" column="0"> + <widget class="QPushButton" name="pbEfx"> + <property name="maximumSize"> + <size> + <width>16777215</width> + <height>36</height> + </size> + </property> + <property name="styleSheet"> + <string notr="true">text-align:left</string> + </property> + <property name="text"> + <string>Effects</string> + </property> + <property name="icon"> + <iconset resource="resources.qrc"> + <normaloff>:/img/effects.png</normaloff>:/img/effects.png</iconset> + </property> + <property name="iconSize"> + <size> + <width>32</width> + <height>32</height> + </size> + </property> + <property name="checkable"> + <bool>true</bool> + </property> + </widget> + </item> + <item row="1" column="1"> + <widget class="QPushButton" name="pbVisualization"> + <property name="maximumSize"> + <size> + <width>16777215</width> + <height>36</height> + </size> + </property> + <property name="styleSheet"> + <string notr="true">text-align:left</string> + </property> + <property name="text"> + <string>Visualization</string> + </property> + <property name="icon"> + <iconset resource="resources.qrc"> + <normaloff>:/img/visualization.png</normaloff>:/img/visualization.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> + </layout> + </item> + <item> + <layout class="QVBoxLayout" name="verticalLayout"> + <property name="spacing"> + <number>0</number> + </property> + <property name="topMargin"> + <number>0</number> + </property> + <item> + <widget class="QPushButton" name="pushButton"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Fixed" vsizetype="Fixed"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="maximumSize"> + <size> + <width>21</width> + <height>21</height> + </size> + </property> + <property name="text"> + <string>?</string> + </property> + </widget> + </item> + <item> + <widget class="QSlider" name="vsMasterVol"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Minimum" vsizetype="Expanding"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="maximum"> + <number>100</number> + </property> + <property name="value"> + <number>50</number> + </property> + <property name="orientation"> + <enum>Qt::Vertical</enum> + </property> + </widget> + </item> + <item> + <widget class="QLabel" name="lbMasterVol"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Minimum" vsizetype="Minimum"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="text"> + <string>Master</string> + </property> + <property name="alignment"> + <set>Qt::AlignCenter</set> + </property> + </widget> + </item> + </layout> + </item> + </layout> </widget> </widget> <layoutdefault spacing="6" margin="11"/> diff --git a/qmidiplayer-desktop/qmpplistwindow.cpp b/qmidiplayer-desktop/qmpplistwindow.cpp index 103027c..d315d80 100644 --- a/qmidiplayer-desktop/qmpplistwindow.cpp +++ b/qmidiplayer-desktop/qmpplistwindow.cpp @@ -15,6 +15,8 @@ qmpPlistWindow::qmpPlistWindow(QWidget *parent) : ui(new Ui::qmpPlistWindow) { ui->setupUi(this); + int w=size().width(),h=size().height();w=w*(logicalDpiX()/96.);h=h*(logicalDpiY()/96.); + setMaximumWidth(w);setMaximumHeight(h);setMinimumWidth(w);setMinimumHeight(h); connect(this,SIGNAL(dialogClosing()),parent,SLOT(dialogClosed())); connect(this,SIGNAL(selectionChanging()),parent,SLOT(selectionChanged())); repeat=0;shuffle=0; diff --git a/qmidiplayer-desktop/qmpplugin.cpp b/qmidiplayer-desktop/qmpplugin.cpp index 2117bcf..7dfb01f 100644 --- a/qmidiplayer-desktop/qmpplugin.cpp +++ b/qmidiplayer-desktop/qmpplugin.cpp @@ -18,23 +18,24 @@ void qmpPluginManager::scanPlugins() HANDLE dir; std::vector<std::string> cpluginpaths; //FindFirstFile, FindNextFile, FindClose - LPWIN32_FIND_DATA file; - dir=FindFirstFileA(L".\\plugins\\*.dll",file); + LPWIN32_FIND_DATAA file; + dir=FindFirstFileA(".\\plugins\\*.dll",file); if(dir!=INVALID_HANDLE_VALUE) { cpluginpaths.push_back(std::string(file->cFileName)); - while(FindNextFile(dir,file)) + while(FindNextFileA(dir,file)) cpluginpaths.push_back(std::string(file->cFileName)); } FindClose(dir); for(unsigned i=0;i<cpluginpaths.size();++i) { - HMODULE hso=LoadLibraryA(cpluginpaths[i].c_str()); + HMODULE hso=LoadLibraryA((std::string(".\\plugins\\")+cpluginpaths[i]).c_str()); if(!hso){fprintf(stderr,"Error while loading library: %d\n",GetLastError());continue;} FARPROC hndi=GetProcAddress(hso,"qmpPluginGetInterface"); if(!hndi){fprintf(stderr,"file %s doesn't seem to be a qmidiplayer plugin.\n",cpluginpaths[i].c_str());continue;} qmpPluginEntry e=(qmpPluginEntry)hndi; qmpPluginIntf* intf=e(pluginAPI); + //!!FIXME: Windows version crashes if intf->pluginGetVersion is called. Reason is still unknown. plugins.push_back(qmpPlugin(std::string(intf->pluginGetName()),std::string(intf->pluginGetVersion()),std::string(cpluginpaths[i]),intf)); } } @@ -82,8 +83,8 @@ qmpPluginManager::~qmpPluginManager() { for(unsigned i=0;i<plugins.size();++i) { - if(plugins[i].initialized)plugins[i].interface->deinit(); - delete plugins[i].interface; + if(plugins[i].initialized)plugins[i].pinterface->deinit(); + delete plugins[i].pinterface; } qmw=NULL;qsw=NULL;delete pluginAPI; } @@ -97,14 +98,14 @@ void qmpPluginManager::initPlugins() { if(!plugins[i].enabled)continue; printf("Loaded plugin: %s\n",plugins[i].path.c_str()); - plugins[i].interface->init();plugins[i].initialized=true; + plugins[i].pinterface->init();plugins[i].initialized=true; } } void qmpPluginManager::deinitPlugins() { for(unsigned i=0;i<plugins.size();++i) { - if(plugins[i].initialized)plugins[i].interface->deinit(); + if(plugins[i].initialized)plugins[i].pinterface->deinit(); plugins[i].enabled=plugins[i].initialized=false; } } diff --git a/qmidiplayer-desktop/qmpplugin.hpp b/qmidiplayer-desktop/qmpplugin.hpp index f689f71..d69adeb 100644 --- a/qmidiplayer-desktop/qmpplugin.hpp +++ b/qmidiplayer-desktop/qmpplugin.hpp @@ -7,10 +7,10 @@ struct qmpPlugin { std::string name,version,path; - qmpPluginIntf* interface; + qmpPluginIntf* pinterface; bool enabled,initialized; qmpPlugin(std::string _n,std::string _v,std::string _p,qmpPluginIntf* _i) - {name=_n;version=_v;path=_p;interface=_i;enabled=initialized=false;} + {name=_n;version=_v;path=_p;pinterface=_i;enabled=initialized=false;} }; class qmpPluginManager { diff --git a/qmidiplayer-desktop/qmpsettingswindow.cpp b/qmidiplayer-desktop/qmpsettingswindow.cpp index b47c2ba..7e441e8 100644 --- a/qmidiplayer-desktop/qmpsettingswindow.cpp +++ b/qmidiplayer-desktop/qmpsettingswindow.cpp @@ -19,6 +19,8 @@ qmpSettingsWindow::qmpSettingsWindow(QWidget *parent) : ui(new Ui::qmpSettingsWindow) { ui->setupUi(this);customOptions.clear();customOptPages.clear(); + int w=size().width(),h=size().height();w=w*(logicalDpiX()/96.);h=h*(logicalDpiY()/96.); + setMaximumWidth(w);setMaximumHeight(h);setMinimumWidth(w);setMinimumHeight(h); connect(this,SIGNAL(dialogClosing()),parent,SLOT(dialogClosed())); settings=new QSettings(QDir::homePath()+QString("/.config/qmprc"),QSettings::IniFormat); settingsInit();outwidget=ui->cbOutputDevice; diff --git a/sample-plugin/sampleplugin.hpp b/sample-plugin/sampleplugin.hpp index 75a5dcf..a47e037 100644 --- a/sample-plugin/sampleplugin.hpp +++ b/sample-plugin/sampleplugin.hpp @@ -17,7 +17,7 @@ class qmpSamplePlugin:public qmpPluginIntf }; extern "C"{ - qmpPluginIntf* qmpPluginGetInterface(qmpPluginAPI* api) + EXPORTSYM qmpPluginIntf* qmpPluginGetInterface(qmpPluginAPI* api) {return new qmpSamplePlugin(api);} } diff --git a/visualization/qmpvisualization.hpp b/visualization/qmpvisualization.hpp index b2a6464..e724961 100644 --- a/visualization/qmpvisualization.hpp +++ b/visualization/qmpvisualization.hpp @@ -115,7 +115,7 @@ class CDemoVisualization:public qmpVisualizationIntf }; extern "C"{ - qmpPluginIntf* qmpPluginGetInterface(qmpPluginAPI* api) + EXPORTSYM qmpPluginIntf* qmpPluginGetInterface(qmpPluginAPI* api) {return new qmpVisualization(api);} } |