summaryrefslogtreecommitdiff
path: root/drumgizmo/input/midifile.cc
diff options
context:
space:
mode:
authorChristian Glöckner <cgloeckner@freenet.de>2016-01-25 15:51:53 +0100
committerAndré Nusser <andre.nusser@googlemail.com>2016-02-09 09:03:17 +0100
commitd3554736c13531898fb720b34772a595620e661a (patch)
tree85e6f76e2b37785405ddf6685801ab9e9f9125cb /drumgizmo/input/midifile.cc
parent100e2d3bd46f64df730c8a375559680c577036ef (diff)
reformatting fix
Diffstat (limited to 'drumgizmo/input/midifile.cc')
-rw-r--r--drumgizmo/input/midifile.cc44
1 files changed, 29 insertions, 15 deletions
diff --git a/drumgizmo/input/midifile.cc b/drumgizmo/input/midifile.cc
index 0cc9dea..4e36c9d 100644
--- a/drumgizmo/input/midifile.cc
+++ b/drumgizmo/input/midifile.cc
@@ -28,13 +28,17 @@
#include "midifile.h"
-int const NOTE_ON = 0x90;
+static int const NOTE_ON = 0x90;
MidifileInputEngine::MidifileInputEngine()
- : smf{nullptr}, current_event{nullptr}, file{}, midimap{}, speed{1.f},
- track{-1} // all tracks
- ,
- loop{false}, offset{0.0}
+ : smf{nullptr}
+ , current_event{nullptr}
+ , file{}
+ , midimap{}
+ , speed{1.f}
+ , track{-1} // all tracks
+ , loop{false}
+ , offset{0.0}
{
}
@@ -46,9 +50,12 @@ MidifileInputEngine::~MidifileInputEngine()
}
}
-bool MidifileInputEngine::isMidiEngine() { return true; }
+bool MidifileInputEngine::isMidiEngine()
+{
+ return true;
+}
-bool MidifileInputEngine::init(Instruments &instruments)
+bool MidifileInputEngine::init(Instruments& instruments)
{
if (file == "")
{
@@ -119,11 +126,18 @@ void MidifileInputEngine::setParm(std::string parm, std::string value)
}
}
-bool MidifileInputEngine::start() { return true; }
+bool MidifileInputEngine::start()
+{
+ return true;
+}
-void MidifileInputEngine::stop() {}
+void MidifileInputEngine::stop()
+{
+}
-void MidifileInputEngine::pre() {}
+void MidifileInputEngine::pre()
+{
+}
event_t *MidifileInputEngine::run(size_t pos, size_t len, size_t *nevents)
{
@@ -151,8 +165,7 @@ event_t *MidifileInputEngine::run(size_t pos, size_t len, size_t *nevents)
if (evs == nullptr)
{
- printf("Owning raw pointer at drumgizmo/input/midifile.cc - GET RID "
- "OF THEM!\n");
+ // todo: get rid of malloc
evs = (event_t *)malloc(sizeof(event_t) * 1000);
}
@@ -193,8 +206,7 @@ event_t *MidifileInputEngine::run(size_t pos, size_t len, size_t *nevents)
{
if (evs == nullptr)
{
- printf("Owning raw pointer at drumgizmo/input/midifile.cc - GET RID OF "
- "THEM!\n");
+ // todo: get rid of malloc
evs = (event_t *)malloc(sizeof(event_t) * 1000);
}
evs[num_events].type = TYPE_STOP;
@@ -206,4 +218,6 @@ event_t *MidifileInputEngine::run(size_t pos, size_t len, size_t *nevents)
return evs;
}
-void MidifileInputEngine::post() {}
+void MidifileInputEngine::post()
+{
+}