diff data/fileio/MIDIFileWriter.cpp @ 1038:cc27f35aa75c cxx11

Introducing the signed 64-bit frame index type, and fixing build failures from inclusion of -Wconversion with -Werror. Not finished yet.
author Chris Cannam
date Tue, 03 Mar 2015 15:18:24 +0000
parents 0d3d1ec7dfde
children c7e9afcbf070
line wrap: on
line diff
--- a/data/fileio/MIDIFileWriter.cpp	Tue Mar 03 09:33:59 2015 +0000
+++ b/data/fileio/MIDIFileWriter.cpp	Tue Mar 03 15:18:24 2015 +0000
@@ -89,8 +89,8 @@
     MIDIByte upper;
     MIDIByte lower;
 
-    upper = (number & 0xFF00) >> 8;
-    lower = (number & 0x00FF);
+    upper = MIDIByte((number & 0xFF00) >> 8);
+    lower = MIDIByte( number & 0x00FF);
 
     string rv;
     rv += upper;
@@ -106,10 +106,10 @@
     MIDIByte upper2;
     MIDIByte lower2;
 
-    upper1 = (number & 0xff000000) >> 24;
-    lower1 = (number & 0x00ff0000) >> 16;
-    upper2 = (number & 0x0000ff00) >> 8;
-    lower2 = (number & 0x000000ff);
+    upper1 = MIDIByte((number & 0xff000000) >> 24);
+    lower1 = MIDIByte((number & 0x00ff0000) >> 16);
+    upper2 = MIDIByte((number & 0x0000ff00) >> 8);
+    lower2 = MIDIByte((number & 0x000000ff));
 
     string rv;
     rv += upper1;
@@ -344,8 +344,8 @@
 
     for (NoteList::const_iterator i = notes.begin(); i != notes.end(); ++i) {
 
-        int frame = i->start;
-        int duration = i->duration;
+        sv_frame_t frame = i->start;
+        sv_frame_t duration = i->duration;
         int pitch = i->midiPitch;
         int velocity = i->velocity;
         int channel = i->channel;