aboutsummaryrefslogtreecommitdiff
path: root/core/qmpmidioutrtmidi.cpp
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 /core/qmpmidioutrtmidi.cpp
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 'core/qmpmidioutrtmidi.cpp')
-rw-r--r--core/qmpmidioutrtmidi.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/core/qmpmidioutrtmidi.cpp b/core/qmpmidioutrtmidi.cpp
index 1b897df..2d6d41f 100644
--- a/core/qmpmidioutrtmidi.cpp
+++ b/core/qmpmidioutrtmidi.cpp
@@ -6,13 +6,13 @@
qmpMidiOutRtMidi::qmpMidiOutRtMidi(unsigned _portid)
{
portid=_portid;
- outport=NULL;
+ outport=nullptr;
}
qmpMidiOutRtMidi::~qmpMidiOutRtMidi()
{
if(!outport)return;
if(outport->isPortOpen())outport->closePort();
- delete outport;outport=NULL;
+ delete outport;outport=nullptr;
}
void qmpMidiOutRtMidi::deviceInit()
{
@@ -23,7 +23,7 @@ void qmpMidiOutRtMidi::deviceInit()
catch(RtMidiError &e)
{
printf("Cannot create RtMidi Output instance: %s\n",e.what());
- outport=NULL;
+ outport=nullptr;
}
}
void qmpMidiOutRtMidi::deviceDeinit()
@@ -92,14 +92,14 @@ void qmpMidiOutRtMidi::onUnmapped(uint8_t ch,int refcnt)
if(!refcnt&&outport)outport->closePort();
}
-RtMidiOut* qmpRtMidiManager::dummy=NULL;
+RtMidiOut* qmpRtMidiManager::dummy=nullptr;
void qmpRtMidiManager::createDevices()
{
try{dummy=new RtMidiOut();}
catch(RtMidiError &e)
{
printf("Failed to initialize the dummy device: %s\n",e.what());
- dummy=NULL;return;
+ dummy=nullptr;return;
}
for(unsigned i=0;i<dummy->getPortCount();++i)
devices.push_back(std::make_pair(new qmpMidiOutRtMidi(i),dummy->getPortName(i)));