diff options
-rw-r--r-- | core/qmpmidioutrtmidi.cpp | 24 | ||||
-rw-r--r-- | doc/optionsdialog.html | 4 | ||||
-rw-r--r-- | doc/qmidiplayer | 12 | ||||
-rw-r--r-- | doc/troubleshooting.html | 2 | ||||
-rw-r--r-- | doc/visualization.html | 28 | ||||
-rw-r--r-- | qmidiplayer-desktop/qmpplugin.cpp | 6 | ||||
-rw-r--r-- | visualization/qmpvisualization.cpp | 6 |
7 files changed, 49 insertions, 33 deletions
diff --git a/core/qmpmidioutrtmidi.cpp b/core/qmpmidioutrtmidi.cpp index 76b12e6..3ed8a4a 100644 --- a/core/qmpmidioutrtmidi.cpp +++ b/core/qmpmidioutrtmidi.cpp @@ -197,7 +197,7 @@ void qmpMidiOutRtMidi::deviceInit() } catch(RtMidiError &e) { - printf("Cannot create RtMidi Output instance: %s\n",e.what()); + fprintf(stderr,"Cannot create RtMidi Output instance: %s\n",e.what()); outport=nullptr; } } @@ -214,13 +214,27 @@ void qmpMidiOutRtMidi::basicMessage(uint8_t type,uint8_t p1,uint8_t p2) msg.push_back(p1); if(((type&0xF0)!=0xC0)&&((type&0xF0)!=0xD0)) msg.push_back(p2); - outport->sendMessage(&msg); + try + { + outport->sendMessage(&msg); + } + catch(RtMidiError &e) + { + fprintf(stderr,"Failed to send midi message: %s\n",e.what()); + } } void qmpMidiOutRtMidi::extendedMessage(uint32_t length,const char *data) { if(!outport||!outport->isPortOpen())return; std::vector<unsigned char>msg(data,data+length); - outport->sendMessage(&msg); + try + { + outport->sendMessage(&msg); + } + catch(RtMidiError &e) + { + fprintf(stderr,"Failed to send midi message: %s\n",e.what()); + } } void qmpMidiOutRtMidi::rpnMessage(uint8_t ch,uint16_t type,uint16_t val) { @@ -271,7 +285,7 @@ void qmpMidiOutRtMidi::onMapped(uint8_t,int) } catch(RtMidiError &e) { - printf("Device initialization failure: %s\n",e.what()); + fprintf(stderr,"Device initialization failure: %s\n",e.what()); } } @@ -333,7 +347,7 @@ std::vector<std::pair<qmpMidiOutRtMidi*,std::string>> qmpRtMidiManager::getDevic try{dummy=new RtMidiOut();} catch(RtMidiError &e) { - printf("Failed to initialize the dummy device: %s\n",e.what()); + fprintf(stderr,"Failed to initialize the dummy device: %s\n",e.what()); return{}; } for(unsigned i=0;i<dummy->getPortCount();++i) diff --git a/doc/optionsdialog.html b/doc/optionsdialog.html index 24a6ca7..b473b91 100644 --- a/doc/optionsdialog.html +++ b/doc/optionsdialog.html @@ -81,11 +81,11 @@ </ul> <img src="../img/options5.png" width="440"><br> Plugin manager. View details of plugins, enable or disable them here.<br> - Enabled plugin list is applied after a restart.<br> + Changes in this page require a restart to take effect. New plugins are enabled by default.<br> Plugin scanning follows the order below: <ul> <li>(*nix) /usr/lib/qmidiplayer</li> - <li>The folder containing QMidiPlayer's executable file.</li> + <li>a folder named "plugins" in the folder containing QMidiPlayer's executable file.</li> </ul> <br><a href="index.html">Return</a> </div> diff --git a/doc/qmidiplayer b/doc/qmidiplayer index 8dacdb1..4b318cd 100644 --- a/doc/qmidiplayer +++ b/doc/qmidiplayer @@ -1,15 +1,17 @@ .\" Manpage for qmidiplayer. -.TH man 1 "29 Dec 2016" "0.8.3" "qmidiplayer man page" +.TH man 1 "04 Dec 2019" "0.8.7" "qmidiplayer man page" .SH NAME -qmidiplayer \- Plays midi file +qmidiplayer \- A midi file player .SH SYNOPSIS qmidiplayer [Options] [Midi Files] .SH DESCRIPTION QMidiPlayer is a cross-platform midi file player based on libfluidsynth and Qt. .SH OPTIONS Possible options are: - -l, --load-all-files Load all files from the same folder. - --help Show this help and exit. - --version Show this version information and exit. + -h, --help Displays this help. + -v, --version Displays version information. + --plugin <plugin library> Load a plugin from <plugin library>. + -l, --load-all-files Load all files from the same folder. + .SH AUTHOR Chris Xiong (chirs241097@gmail.com) diff --git a/doc/troubleshooting.html b/doc/troubleshooting.html index 34b50b2..7caf8be 100644 --- a/doc/troubleshooting.html +++ b/doc/troubleshooting.html @@ -159,7 +159,7 @@ The data at memory address 0x000001d8 could not be read. 0x69bf6fd4 from [unknown module] in BaseThreadInitThunk (No symbols) 0x6b97cf31 from [unknown module] in RtlUserThreadStart (No symbols) </pre> - Append that to your issue report (make sure it doesn't contain any personal stuff first). + Append that to your issue report (make sure it doesn't contain any personal data first). For Linux users, you usually already have a coredump for the crash. Please refer to the documentation of your distribution for how to take a back trace from that coredump. </p> diff --git a/doc/visualization.html b/doc/visualization.html index 3507985..6ad44dd 100644 --- a/doc/visualization.html +++ b/doc/visualization.html @@ -30,18 +30,18 @@ To use the visualization, click the Visualization button in the main window.<br> The visualization plugin adds two new option tabs. <h3>Controls</h3> -<pre> - forward - | ↱Hold left mouse button and drag: - up | down ┌──┬──┐ Adjust viewport. - ↓ ↓ ↓ │ │ │ - Q W E R←reset viewport ├──┴──┤ - A S D │ │ - ↑ ↑ ↑ │ │ -left | right ← → │ │ - | Seek left/right └─────┘ - backward (Hold shift to seek 5% instead of 1%) -</pre> + <ul> + <li>W: move camera forward</li> + <li>A: move camera left</li> + <li>S: move camera backward</li> + <li>D: move camera right</li> + <li>Q: move camera up</li> + <li>E: move camera down</li> + <li>Left arrow key: seek backward 1%</li> + <li>Right arrow key: seek forward 1%</li> + <li>Shift: seed 5% instead of 1%</li> + <li>Left mouse button: hold and drag to orient the camera</li> + </ul> <h3>Options</h3> The options listed here are applied after closing and reopening the visualization. <ul> @@ -70,8 +70,8 @@ left | right ← → │ │ <li>Save Viewport: Restore last camera configuration when the visualization is started.</li> <li>Window Width/Height: Change the window size. If the size equals to your screen size, the visualization will start in fullscreen mode.</li> <li>FPS: FPS limit of the visualization.</li> - <li>Supersampling: Supersample anti-aliasing. 1 means no SSAA.</li> - <li>Multisampling: Multisample anti-aliasing. 0 means no MSAA.</li> + <li>Supersampling: Supersample anti-aliasing for the 3D visualization scene. 1 means no SSAA.</li> + <li>Multisampling: Multisample anti-aliasing for the 3D visualization scene. 0 means no MSAA.</li> <li>FOV: Field of view.</li> <li>OSD Position: Change position of the on screen display, or simply disable it.</li> <li>Font size: Change font size used by the visualization. Useful for HiDPI screens.</li> diff --git a/qmidiplayer-desktop/qmpplugin.cpp b/qmidiplayer-desktop/qmpplugin.cpp index 774f0da..8f16573 100644 --- a/qmidiplayer-desktop/qmpplugin.cpp +++ b/qmidiplayer-desktop/qmpplugin.cpp @@ -65,12 +65,12 @@ void qmpPluginManager::scanPlugins(const std::vector<std::string> &pp) } delete dir; #endif - dir=new QDirIterator("./"); + dir=new QDirIterator(QCoreApplication::applicationDirPath()+"/plugins/"); while(dir->hasNext()) { dir->next(); if(dir->fileInfo().suffix()=="so") - cpluginpaths.push_back(std::string("./")+dir->fileName().toStdString()); + cpluginpaths.push_back(QCoreApplication::applicationDirPath().toStdString()+std::string("/plugins/")+dir->fileName().toStdString()); } delete dir; for(unsigned i=0;i<cpluginpaths.size();++i) @@ -114,7 +114,7 @@ void qmpPluginManager::initPlugins() for(unsigned i=0;i<plugins.size();++i) { if(!plugins[i].enabled)continue; - printf("Loaded plugin: %s\n",plugins[i].path.c_str()); + fprintf(stderr,"Loaded plugin: %s\n",plugins[i].path.c_str()); plugins[i].pinterface->init();plugins[i].initialized=true; } } diff --git a/visualization/qmpvisualization.cpp b/visualization/qmpvisualization.cpp index c72cbf5..a3f9554 100644 --- a/visualization/qmpvisualization.cpp +++ b/visualization/qmpvisualization.cpp @@ -115,18 +115,18 @@ void qmpVisualization::showThread() 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((std::string(getenv("windir")?getenv("windir"):"")+"/Fonts/cour.ttf").c_str(),fontsize)) - printf("W: Font load failed.\n"); + fprintf(stderr,"W: Font load failed.\n"); 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((std::string(getenv("windir")?getenv("windir"):"")+"/Fonts/cour.ttf").c_str(),180)) - printf("W: Font load failed.\n"); + fprintf(stderr,"W: Font load failed.\n"); 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((std::string(getenv("windir")?getenv("windir"):"")+"/Fonts/msyh.ttc").c_str(),fontsize)) if(!font2.loadTTF((std::string(getenv("windir")?getenv("windir"):"")+"/Fonts/segoeui.ttf").c_str(),fontsize)) - printf("W: Font load failed.\n"); + fprintf(stderr,"W: Font load failed.\n"); if(horizontal) { pos[0]=-20;pos[1]=45;pos[2]=0; |