aboutsummaryrefslogtreecommitdiff
path: root/visualization/qmpvisualization.cpp
diff options
context:
space:
mode:
authorGravatar Chris Xiong <chirs241097@gmail.com> 2017-02-13 17:31:42 +0800
committerGravatar Chris Xiong <chirs241097@gmail.com> 2017-02-13 17:31:42 +0800
commita0da9bca472043e7f13d4d6ea1809f6b63a598b0 (patch)
treef318a37656b5b25c4028739b8e59ebb4d132d34d /visualization/qmpvisualization.cpp
parent3312e495cf54a8bd6451552216f5aeea1a06d486 (diff)
downloadQMidiPlayer-a0da9bca472043e7f13d4d6ea1809f6b63a598b0.tar.xz
Fix pitch bend range handling.
Allow registering a string option as file path. Provide an easier way to set path values in options. Revert to old geometry storage mechanism and improved it. Hope this one will work on Windows. Make the time slider less ugly.
Diffstat (limited to 'visualization/qmpvisualization.cpp')
-rw-r--r--visualization/qmpvisualization.cpp15
1 files changed, 8 insertions, 7 deletions
diff --git a/visualization/qmpvisualization.cpp b/visualization/qmpvisualization.cpp
index 86b8900..831c1af 100644
--- a/visualization/qmpvisualization.cpp
+++ b/visualization/qmpvisualization.cpp
@@ -156,17 +156,18 @@ void qmpVisualization::showThread()
if(!api->getOptionString("Visualization/font2").length()||!font.loadTTF(api->getOptionString("Visualization/font2").c_str(),fontsize))
if(!font.loadTTF("/usr/share/fonts/truetype/freefont/FreeMono.ttf",fontsize))
if(!font.loadTTF("/usr/share/fonts/gnu-free/FreeMono.otf",fontsize))
- if(!font.loadTTF("C:/Windows/Fonts/cour.ttf",fontsize))
+ if(!font.loadTTF((std::string(getenv("windir"))+"/Fonts/cour.ttf").c_str(),fontsize))
printf("W: Font load failed.\n");
- if(!api->getOptionString("Visualization/font2").length()||!font.loadTTF(api->getOptionString("Visualization/font2").c_str(),180))
+ if(!api->getOptionString("Visualization/font2").length()||!fonthdpi.loadTTF(api->getOptionString("Visualization/font2").c_str(),180))
if(!fonthdpi.loadTTF("/usr/share/fonts/truetype/freefont/FreeMono.ttf",180))
if(!fonthdpi.loadTTF("/usr/share/fonts/gnu-free/FreeMono.otf",180))
- if(!fonthdpi.loadTTF("C:/Windows/Fonts/cour.ttf",180))
+ if(!fonthdpi.loadTTF((std::string(getenv("windir"))+"/Fonts/cour.ttf").c_str(),180))
printf("W: Font load failed.\n");
- if(!api->getOptionString("Visualization/font1").length()||!font.loadTTF(api->getOptionString("Visualization/font1").c_str(),fontsize))
+ if(!api->getOptionString("Visualization/font1").length()||!font2.loadTTF(api->getOptionString("Visualization/font1").c_str(),fontsize))
if(!font2.loadTTF("/usr/share/fonts/truetype/wqy/wqy-microhei.ttc",fontsize))
if(!font2.loadTTF("/usr/share/fonts/wenquanyi/wqy-microhei/wqy-microhei.ttc",fontsize))
- if(!font2.loadTTF("C:/Windows/Fonts/segoeui.ttf",fontsize))
+ if(!font2.loadTTF((std::string(getenv("windir"))+"/Fonts/msyh.ttc").c_str(),fontsize))
+ if(!font2.loadTTF((std::string(getenv("windir"))+"/Fonts/segoeui.ttf").c_str(),fontsize))
printf("W: Font load failed.\n");
if(horizontal)
{
@@ -778,8 +779,8 @@ void qmpVisualization::init()
std::vector<std::string> tv;tv.push_back("Bottom left");tv.push_back("Bottom right");tv.push_back("Top left");tv.push_back("Top right");tv.push_back("Hidden");
api->registerOptionEnumInt("Visualization-Video","OSD Position","Visualization/osdpos",tv,0);
api->registerOptionInt("Visualization-Video","Font Size","Visualization/fontsize",6,180,16);
- api->registerOptionString("Visualization-Video","Custom Sans Font","Visualization/font1","");
- api->registerOptionString("Visualization-Video","Custom Monospace Font","Visualization/font2","");
+ api->registerOptionString("Visualization-Video","Custom Sans Font","Visualization/font1","",true);
+ api->registerOptionString("Visualization-Video","Custom Monospace Font","Visualization/font2","",true);
api->registerOptionInt("Visualization-Appearance","View distance","Visualization/viewdist",20,1000,100);
api->registerOptionInt("Visualization-Appearance","Note stretch","Visualization/notestretch",20,500,100);
api->registerOptionInt("Visualization-Appearance","Minimum note length","Visualization/minnotelen",20,500,100);