diff options
author | Chris Xiong <chirs241097@gmail.com> | 2020-05-01 01:31:45 +0800 |
---|---|---|
committer | Chris Xiong <chirs241097@gmail.com> | 2020-05-01 01:31:45 +0800 |
commit | 893bec26cd1bc83fd85bb7dfdfd6225d9f6ee5b5 (patch) | |
tree | 3b7e7a4f772c8f8de93d61b549599b22902e83fc /visualization/renderer/qmpvisrendercore.hpp | |
parent | bd165c0254b9095bb9e5ea54def56b6404033ebe (diff) | |
download | QMidiPlayer-893bec26cd1bc83fd85bb7dfdfd6225d9f6ee5b5.tar.xz |
Visualization renderer now understands command line arguments.
Fixed wrong tick calculation in render mode.
Fixed most of the hangs and crashes associated with the renderer.
Do not write pixel data in the visualization thread.
Diffstat (limited to 'visualization/renderer/qmpvisrendercore.hpp')
-rw-r--r-- | visualization/renderer/qmpvisrendercore.hpp | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/visualization/renderer/qmpvisrendercore.hpp b/visualization/renderer/qmpvisrendercore.hpp index 0c024f1..27337ba 100644 --- a/visualization/renderer/qmpvisrendercore.hpp +++ b/visualization/renderer/qmpvisrendercore.hpp @@ -9,6 +9,7 @@ class qmpPluginAPIStub; class CMidiPlayer; class qmpSettingsRO; +class QCommandLineParser; class QProcess; @@ -16,14 +17,18 @@ class qmpVisRenderCore:public QObject { Q_OBJECT public: - qmpVisRenderCore(); - void loadVisualizationLibrary(); + qmpVisRenderCore(QCommandLineParser *_clp); + bool loadVisualizationLibrary(); void unloadVisualizationLibrary(); + void loadSettings(); void setMIDIFile(const char* url); void startRender(); qmpSettingsRO* settings(){return msettings;} +signals: + void frameRendered(void* px,size_t sz,uint32_t current_tick,uint32_t total_ticks); + private: qmpPluginIntf *vp; qmpFuncBaseIntf *vf; @@ -33,11 +38,13 @@ private: CMidiPlayer *player; qmpSettingsRO *msettings; QProcess *ffmpegproc; + QCommandLineParser *clp; + QStringList split_arguments(QString a); typedef qmpPluginIntf*(*GetInterface_func)(qmpPluginAPI*); - typedef void(*SwitchMode_func)(void(*frameCallback)(void*,size_t),bool hidewindow); + typedef void(*SwitchMode_func)(void(*frameCallback)(void*,size_t,uint32_t,uint32_t),bool hidewindow); friend class qmpPluginAPIStub; - static void framefunc(void* px,size_t sz); + static void framefunc(void* px, size_t sz, uint32_t curf, uint32_t totf); static qmpVisRenderCore *inst; }; |