aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Chris Xiong <chirs241097@gmail.com> 2020-02-15 09:45:38 +0800
committerGravatar Chris Xiong <chirs241097@gmail.com> 2020-02-15 09:45:38 +0800
commit03d0aa4f39f72d27fed75020d2a3e80413ae029a (patch)
tree4da998bf1df1a2c1463858d13e372d6fb0bbbff4
parentbaa48d526c96a55c7c8caeb8fc5e379ef8afed10 (diff)
downloadQMidiPlayer-03d0aa4f39f72d27fed75020d2a3e80413ae029a.tar.xz
No more version numbers scattered through the files.
Added a debug screen for the visualization, which can be toggled by pressing B. Added version information for binaries for Windows.
-rw-r--r--CMakeLists.txt8
-rw-r--r--midifmt-plugin/CMakeLists.txt4
-rw-r--r--midifmt-plugin/midifmt-plugin.rc16
-rw-r--r--midifmt-plugin/midifmtplugin.cpp2
-rw-r--r--qmidiplayer-desktop/CMakeLists.txt5
-rw-r--r--qmidiplayer-desktop/qmidiplayer.exe.xml29
-rw-r--r--qmidiplayer-desktop/qmidiplayer.rc19
-rw-r--r--qmidiplayer-desktop/qmphelpwindow.hpp1
-rw-r--r--simple-visualization/CMakeLists.txt4
-rw-r--r--simple-visualization/simple-visualization.rc16
-rw-r--r--simple-visualization/simplevisualization.cpp2
-rw-r--r--visualization/CMakeLists.txt4
m---------visualization/SMELT0
-rw-r--r--visualization/qmpvisualization.cpp30
-rw-r--r--visualization/qmpvisualization.hpp2
-rw-r--r--visualization/visualization.rc16
16 files changed, 146 insertions, 12 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index e789ec8..32fc3c9 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1,6 +1,6 @@
cmake_minimum_required(VERSION 3.10.0)
-project(QMidiPlayer C CXX)
+project(QMidiPlayer VERSION 0.8.7 LANGUAGES C CXX)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
@@ -22,6 +22,12 @@ if(UNIX)
option(BUILD_PORTABLE "Instruct the built binary not to search system directories" OFF)
endif()
+add_definitions(-DAPP_VERSION=\"${PROJECT_VERSION}\")
+add_definitions(-DPLUGIN_VERSION=\"${PROJECT_VERSION}\")
+add_definitions(-DRC_VER_MAJOR=${PROJECT_VERSION_MAJOR})
+add_definitions(-DRC_VER_MINOR=${PROJECT_VERSION_MINOR})
+add_definitions(-DRC_VER_PATCH=${PROJECT_VERSION_PATCH})
+
add_subdirectory(core)
add_subdirectory(qmidiplayer-desktop)
add_subdirectory(sample-plugin)
diff --git a/midifmt-plugin/CMakeLists.txt b/midifmt-plugin/CMakeLists.txt
index 02cd4cc..d90ffe8 100644
--- a/midifmt-plugin/CMakeLists.txt
+++ b/midifmt-plugin/CMakeLists.txt
@@ -3,6 +3,10 @@ set(midifmt-plugin_SOURCES
midifmtplugin.cpp
)
+if(WIN32)
+ list(APPEND midifmt-plugin_SOURCES midifmt-plugin.rc)
+endif(WIN32)
+
include_directories(${PROJECT_SOURCE_DIR}/include/)
add_library(midifmt-plugin MODULE
diff --git a/midifmt-plugin/midifmt-plugin.rc b/midifmt-plugin/midifmt-plugin.rc
new file mode 100644
index 0000000..3489340
--- /dev/null
+++ b/midifmt-plugin/midifmt-plugin.rc
@@ -0,0 +1,16 @@
+1 VERSIONINFO
+FILEVERSION RC_VER_MAJOR,RC_VER_MINOR,RC_VER_PATCH,0
+PRODUCTVERSION RC_VER_MAJOR,RC_VER_MINOR,RC_VER_PATCH,0
+FILETYPE VFT_DLL
+BEGIN
+ BLOCK "StringFileInfo"
+ BEGIN
+ BLOCK "040904E4""
+ BEGIN
+ VALUE "FileDescription", "QMidiPlayer extra MIDI format support plugin"
+ VALUE "FileVersion", APP_VERSION
+ VALUE "ProductName", "QMidiPlayer extra MIDI format support plugin"
+ VALUE "ProductVersion", APP_VERSION
+ END
+ END
+END
diff --git a/midifmt-plugin/midifmtplugin.cpp b/midifmt-plugin/midifmtplugin.cpp
index fccb7cc..62a9af1 100644
--- a/midifmt-plugin/midifmtplugin.cpp
+++ b/midifmt-plugin/midifmtplugin.cpp
@@ -113,4 +113,4 @@ void qmpMidiFmtPlugin::deinit()
const char* qmpMidiFmtPlugin::pluginGetName()
{return "QMidiPlayer extra midi formats plugin";}
const char* qmpMidiFmtPlugin::pluginGetVersion()
-{return "0.8.7";}
+{return PLUGIN_VERSION;}
diff --git a/qmidiplayer-desktop/CMakeLists.txt b/qmidiplayer-desktop/CMakeLists.txt
index ca2b6b7..037a3f1 100644
--- a/qmidiplayer-desktop/CMakeLists.txt
+++ b/qmidiplayer-desktop/CMakeLists.txt
@@ -44,10 +44,7 @@ set(qmpdesktop_SOURCES
)
if(WIN32)
- set(qmpdesktop_SOURCES
- ${qmpdesktop_SOURCES}
- qmidiplayer.rc
- )
+ list(APPEND qmpdesktop_SOURCES qmidiplayer.rc)
endif(WIN32)
set(CMAKE_AUTOMOC ON)
diff --git a/qmidiplayer-desktop/qmidiplayer.exe.xml b/qmidiplayer-desktop/qmidiplayer.exe.xml
new file mode 100644
index 0000000..78814e9
--- /dev/null
+++ b/qmidiplayer-desktop/qmidiplayer.exe.xml
@@ -0,0 +1,29 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<assembly manifestVersion="1.0" xmlns="urn:schemas-microsoft-com:asm.v1" xmlns:asmv3="urn:schemas-microsoft-com:asm.v3">
+ <assemblyIdentity type="win32" name="Chrisoft.QMidiPlayer" version="0.0.0.0" processorArchitecture="x86"/>
+ <description>QMidiPlayer</description>
+ <compatibility xmlns="urn:schemas-microsoft-com:compatibility.v1">
+ <application>
+ <!-- Windows 10 -->
+ <supportedOS Id="{8e0f7a12-bfb3-4fe8-b9a5-48fd50a15a9a}"/>
+ <!-- Windows 8.1 -->
+ <supportedOS Id="{1f676c76-80e1-4239-95bb-83d0f6d0da78}"/>
+ <!-- Windows 8 -->
+ <supportedOS Id="{4a2f28e3-53b9-4441-ba9c-d69d4a4a6e38}"/>
+ <!-- Windows 7 -->
+ <supportedOS Id="{35138b9a-5d96-4fbd-8e2d-a2440225f93a}"/>
+ </application>
+ </compatibility>
+ <trustInfo xmlns="urn:schemas-microsoft-com:asm.v3">
+ <security>
+ <requestedPrivileges>
+ <requestedExecutionLevel level="asInvoker" uiAccess="false"/>
+ </requestedPrivileges>
+ </security>
+ </trustInfo>
+ <asmv3:application>
+ <asmv3:windowsSettings xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings">
+ <dpiAware>true</dpiAware>
+ </asmv3:windowsSettings>
+ </asmv3:application>
+</assembly>
diff --git a/qmidiplayer-desktop/qmidiplayer.rc b/qmidiplayer-desktop/qmidiplayer.rc
index ddf1bc1..ee00a3d 100644
--- a/qmidiplayer-desktop/qmidiplayer.rc
+++ b/qmidiplayer-desktop/qmidiplayer.rc
@@ -1 +1,18 @@
-IDI_ICON1 ICON DISCARDABLE "../img/qmidiplayer.ico"
+IDI_ICON1 ICON "../img/qmidiplayer.ico"
+1 VERSIONINFO
+FILEVERSION RC_VER_MAJOR,RC_VER_MINOR,RC_VER_PATCH,0
+PRODUCTVERSION RC_VER_MAJOR,RC_VER_MINOR,RC_VER_PATCH,0
+FILETYPE VFT_APP
+BEGIN
+ BLOCK "StringFileInfo"
+ BEGIN
+ BLOCK "040904E4""
+ BEGIN
+ VALUE "FileDescription", "QMidiPlayer"
+ VALUE "FileVersion", APP_VERSION
+ VALUE "ProductName", "QMidiPlayer"
+ VALUE "ProductVersion", APP_VERSION
+ END
+ END
+END
+1 RT_MANIFEST "qmidiplayer.exe.xml"
diff --git a/qmidiplayer-desktop/qmphelpwindow.hpp b/qmidiplayer-desktop/qmphelpwindow.hpp
index 2cde49d..a94da33 100644
--- a/qmidiplayer-desktop/qmphelpwindow.hpp
+++ b/qmidiplayer-desktop/qmphelpwindow.hpp
@@ -2,7 +2,6 @@
#define QMPHELPWINDOW_H
#include <QDialog>
-#define APP_VERSION "0.8.7"
#ifndef BUILD_MACHINE
#define BUILD_MACHINE UNKNOWN
#endif
diff --git a/simple-visualization/CMakeLists.txt b/simple-visualization/CMakeLists.txt
index 758d671..689dd99 100644
--- a/simple-visualization/CMakeLists.txt
+++ b/simple-visualization/CMakeLists.txt
@@ -7,6 +7,10 @@ set(simple-visualization_SOURCES
simplevisualization.cpp
)
+if(WIN32)
+ list(APPEND simple-visualization_SOURCES simple-visualization.rc)
+endif(WIN32)
+
set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTORCC ON)
set(CMAKE_AUTOUIC ON)
diff --git a/simple-visualization/simple-visualization.rc b/simple-visualization/simple-visualization.rc
new file mode 100644
index 0000000..92f11e6
--- /dev/null
+++ b/simple-visualization/simple-visualization.rc
@@ -0,0 +1,16 @@
+1 VERSIONINFO
+FILEVERSION RC_VER_MAJOR,RC_VER_MINOR,RC_VER_PATCH,0
+PRODUCTVERSION RC_VER_MAJOR,RC_VER_MINOR,RC_VER_PATCH,0
+FILETYPE VFT_DLL
+BEGIN
+ BLOCK "StringFileInfo"
+ BEGIN
+ BLOCK "040904E4""
+ BEGIN
+ VALUE "FileDescription", "QMidiPlayer simple visualization plugin"
+ VALUE "FileVersion", APP_VERSION
+ VALUE "ProductName", "QMidiPlayer simple visualization plugin"
+ VALUE "ProductVersion", APP_VERSION
+ END
+ END
+END
diff --git a/simple-visualization/simplevisualization.cpp b/simple-visualization/simplevisualization.cpp
index c8191b6..b93af30 100644
--- a/simple-visualization/simplevisualization.cpp
+++ b/simple-visualization/simplevisualization.cpp
@@ -30,4 +30,4 @@ void qmpSimpleVisualization::deinit()
const char* qmpSimpleVisualization::pluginGetName()
{return "QMidiPlayer Simple Visualization Plugin";}
const char* qmpSimpleVisualization::pluginGetVersion()
-{return "0.8.7";}
+{return PLUGIN_VERSION;}
diff --git a/visualization/CMakeLists.txt b/visualization/CMakeLists.txt
index 426f50c..bc7d568 100644
--- a/visualization/CMakeLists.txt
+++ b/visualization/CMakeLists.txt
@@ -7,6 +7,10 @@ set(visualization_SOURCES
qmpvisualization.cpp
)
+if(WIN32)
+ list(APPEND visualization_SOURCES visualization.rc)
+endif(WIN32)
+
set(BUILD_DUMB ON)
set(BUILD_EXAMPLE OFF)
add_subdirectory(SMELT)
diff --git a/visualization/SMELT b/visualization/SMELT
-Subproject 7398bdc3eb0f58cdfa9b588e1c6c8e5ef3797ac
+Subproject b47fce544c1c5ec98b326f69b56c916ba5be1c6
diff --git a/visualization/qmpvisualization.cpp b/visualization/qmpvisualization.cpp
index a3f9554..899597a 100644
--- a/visualization/qmpvisualization.cpp
+++ b/visualization/qmpvisualization.cpp
@@ -137,6 +137,7 @@ void qmpVisualization::showThread()
pos[0]=0;pos[1]=120;pos[2]=70;
rot[0]=0;rot[1]=75;rot[2]=90;
}
+ debug=false;
ctk=api->getCurrentTimeStamp();
if(savevp)
{
@@ -624,6 +625,8 @@ bool qmpVisualization::update()
api->playerSeek(api->getCurrentPlaybackPercentage()+(sm->smGetKeyState(SMK_SHIFT)?5:1));
if(sm->smGetKeyState(SMK_LEFT)==SMKST_HIT)
api->playerSeek(api->getCurrentPlaybackPercentage()-(sm->smGetKeyState(SMK_SHIFT)?5:1));
+ if(sm->smGetKeyState(SMK_B)==SMKST_HIT)
+ debug^=1;
if(playing)ctk+=1e6/api->getRawTempo()*api->getDivision()*sm->smGetDelta();
if(!flat)
updateVisualization3D();
@@ -658,7 +661,10 @@ bool qmpVisualization::update()
if(osdpos==4){sm->smRenderEnd();return shouldclose;}
int t,r;t=api->getKeySig();r=(int8_t)((t>>8)&0xFF)+7;t&=0xFF;
std::wstring ts(t?minors:majors);ts=ts.substr(2*r,2);
- int step=int(1.25*fontsize),xp=(osdpos&1)?wwidth-step-1:1,yp=osdpos<2?wheight-step*5-4:step+4,align=osdpos&1?ALIGN_RIGHT:ALIGN_LEFT;
+ int step=int(1.33*fontsize);
+ int xp=(osdpos&1)?wwidth-step-1:1;
+ int yp=osdpos<2?wheight-step*5-4:step+4;
+ int align=osdpos&1?ALIGN_RIGHT:ALIGN_LEFT;
font2.updateString(L"Title: %ls",api->getWTitle().c_str());
font2.render(xp,yp,0.5,0xFFFFFFFF,align);
font2.render(xp-1,yp-1,0.5,0xFF000000,align);
@@ -677,6 +683,26 @@ bool qmpVisualization::update()
font.updateString(L"FPS: %.2f",sm->smGetFPS());
font.render(xp,yp+=step,0.5,0xFFFFFFFF,align);
font.render(xp-1,yp-1,0.5,0xFF000000,align);
+ if(debug)
+ {
+ int dosdpos=(osdpos+1)%4;
+ xp=(dosdpos&1)?wwidth-step-1:1;
+ yp=dosdpos<2?wheight-step*5-4:step+4;
+ align=dosdpos&1?ALIGN_RIGHT:ALIGN_LEFT;
+ std::string tstr;
+ tstr=std::string(sm->smGetOSInfo());
+ font.updateString(L"OS: %ls",std::wstring({std::begin(tstr),std::end(tstr)}).c_str());
+ font.render(xp,yp,0.5,0xFFFFFFFF,align);
+ font.render(xp-1,yp-1,0.5,0xFF000000,align);
+ tstr=std::string(sm->smGetCPUModel());
+ font.updateString(L"CPU: %ls",std::wstring({std::begin(tstr),std::end(tstr)}).c_str());
+ font.render(xp,yp+=step,0.5,0xFFFFFFFF,align);
+ font.render(xp-1,yp-1,0.5,0xFF000000,align);
+ tstr=std::string(sm->smGetDispDriver());
+ font.updateString(L"Display: %ls",std::wstring({std::begin(tstr),std::end(tstr)}).c_str());
+ font.render(xp,yp+=3*step,0.5,0xFFFFFFFF,align);
+ font.render(xp-1,yp-1,0.5,0xFF000000,align);
+ }
sm->smRenderEnd();
return shouldclose;
}
@@ -845,7 +871,7 @@ void qmpVisualization::deinit()
const char* qmpVisualization::pluginGetName()
{return "QMidiPlayer Default Visualization Plugin";}
const char* qmpVisualization::pluginGetVersion()
-{return "0.8.7";}
+{return PLUGIN_VERSION;}
void qmpVisualization::pushNoteOn(uint32_t tc,uint32_t ch,uint32_t key,uint32_t vel)
{
diff --git a/visualization/qmpvisualization.hpp b/visualization/qmpvisualization.hpp
index 4aaeb0c..981ebe3 100644
--- a/visualization/qmpvisualization.hpp
+++ b/visualization/qmpvisualization.hpp
@@ -38,7 +38,7 @@ class qmpVisualization:public qmpPluginIntf,public qmpFuncBaseIntf
float pos[3],rot[3],lastx,lasty;
uint32_t ctc,ctk,elb;
double etps;
- bool shouldclose,playing;
+ bool shouldclose,playing,debug;
int herh,heh,hfrf;
int uihb,uihs,uihp,uihr;
std::vector<std::pair<uint32_t,uint32_t>>tspool;
diff --git a/visualization/visualization.rc b/visualization/visualization.rc
new file mode 100644
index 0000000..d5b47db
--- /dev/null
+++ b/visualization/visualization.rc
@@ -0,0 +1,16 @@
+1 VERSIONINFO
+FILEVERSION RC_VER_MAJOR,RC_VER_MINOR,RC_VER_PATCH,0
+PRODUCTVERSION RC_VER_MAJOR,RC_VER_MINOR,RC_VER_PATCH,0
+FILETYPE VFT_DLL
+BEGIN
+ BLOCK "StringFileInfo"
+ BEGIN
+ BLOCK "040904E4""
+ BEGIN
+ VALUE "FileDescription", "QMidiPlayer visualization plugin"
+ VALUE "FileVersion", APP_VERSION
+ VALUE "ProductName", "QMidiPlayer visualization plugin"
+ VALUE "ProductVersion", APP_VERSION
+ END
+ END
+END