aboutsummaryrefslogtreecommitdiff
path: root/qmidiplayer-desktop/qmpmainwindow.hpp
diff options
context:
space:
mode:
authorGravatar Chris Xiong <chirs241097@gmail.com> 2019-05-25 22:40:15 +0800
committerGravatar Chris Xiong <chirs241097@gmail.com> 2019-05-25 22:40:15 +0800
commit3f72121ac41741d53e4916f1275cbd4f93259c4d (patch)
tree15bba079c86de0e241812cd657ad190eb0c2c41a /qmidiplayer-desktop/qmpmainwindow.hpp
parenteba45fdf11a98113b439db0510b55f14845db8fb (diff)
downloadQMidiPlayer-3f72121ac41741d53e4916f1275cbd4f93259c4d.tar.xz
Massive code refactor en cours!
Less complain from compilers: - use nullptr instead of NULL - use types for event fields - explicit type casting added Stop saving parameters of meta events in p1/p2 fields of SEvent. callback_t now uses std::function, deprecating ICallback. Not recommended for daily usage, or even testing: the code refactor is still a work in progress.
Diffstat (limited to 'qmidiplayer-desktop/qmpmainwindow.hpp')
-rw-r--r--qmidiplayer-desktop/qmpmainwindow.hpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/qmidiplayer-desktop/qmpmainwindow.hpp b/qmidiplayer-desktop/qmpmainwindow.hpp
index a456dec..262bc2e 100644
--- a/qmidiplayer-desktop/qmpmainwindow.hpp
+++ b/qmidiplayer-desktop/qmpmainwindow.hpp
@@ -66,7 +66,7 @@ class QReflectiveAction:public QAction
}
public:
explicit QReflectiveAction(const QIcon& icon,const QString& text,const std::string& ref):
- QAction(icon,text,NULL),reflt(ref){
+ QAction(icon,text,nullptr),reflt(ref){
connect(this,SIGNAL(triggered(bool)),this,SLOT(triggerslot()));
}
};
@@ -102,7 +102,7 @@ class qmpFuncPrivate
public:
qmpFuncPrivate(){}
qmpFuncPrivate(qmpFuncBaseIntf* i,std::string _desc,const char* icon,int iconlen,bool checkable);
- ~qmpFuncPrivate(){asgna=NULL;asgnb=NULL;}
+ ~qmpFuncPrivate(){asgna=nullptr;asgnb=nullptr;}
qmpFuncBaseIntf* i(){return _i;}
void setAssignedControl(QReflectiveAction* a){asgna=a;if(!a)return;asgna->setCheckable(_checkable);asgna->setChecked(checked);}
void setAssignedControl(QReflectivePushButton* a){asgnb=a;if(!a)return;asgnb->setCheckable(_checkable);asgnb->setChecked(checked);}
@@ -125,9 +125,9 @@ class qmpCallBack
ICallBack* cbc;
callback_t cbf;
public:
- qmpCallBack(){t=-1;cbc=NULL;cbf=NULL;}
- qmpCallBack(ICallBack* _cb){t=0;cbc=_cb;cbf=NULL;}
- qmpCallBack(callback_t _cb){t=1;cbf=_cb;cbc=NULL;}
+ qmpCallBack(){t=-1;cbc=nullptr;cbf=nullptr;}
+ qmpCallBack(ICallBack* _cb){t=0;cbc=_cb;cbf=nullptr;}
+ qmpCallBack(callback_t _cb){t=1;cbf=_cb;cbc=nullptr;}
void operator ()(void* cbd,void* usrd)
{
if(t<0)return;
@@ -196,8 +196,8 @@ class qmpMainWindow:public QMainWindow
Ui::qmpMainWindow *ui;
QTimer *timer;
bool playing,stopped,dragging,fin,havemidi;
- std::thread *playerTh=NULL;
- std::thread *renderTh=NULL;
+ std::thread *playerTh=nullptr;
+ std::thread *renderTh=nullptr;
std::chrono::steady_clock::time_point st;
double offset;
CMidiPlayer *player;