comparison 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
comparison
equal deleted inserted replaced
1037:bf0e5944289b 1038:cc27f35aa75c
87 MIDIFileWriter::intToMIDIBytes(int number) const 87 MIDIFileWriter::intToMIDIBytes(int number) const
88 { 88 {
89 MIDIByte upper; 89 MIDIByte upper;
90 MIDIByte lower; 90 MIDIByte lower;
91 91
92 upper = (number & 0xFF00) >> 8; 92 upper = MIDIByte((number & 0xFF00) >> 8);
93 lower = (number & 0x00FF); 93 lower = MIDIByte( number & 0x00FF);
94 94
95 string rv; 95 string rv;
96 rv += upper; 96 rv += upper;
97 rv += lower; 97 rv += lower;
98 return rv; 98 return rv;
104 MIDIByte upper1; 104 MIDIByte upper1;
105 MIDIByte lower1; 105 MIDIByte lower1;
106 MIDIByte upper2; 106 MIDIByte upper2;
107 MIDIByte lower2; 107 MIDIByte lower2;
108 108
109 upper1 = (number & 0xff000000) >> 24; 109 upper1 = MIDIByte((number & 0xff000000) >> 24);
110 lower1 = (number & 0x00ff0000) >> 16; 110 lower1 = MIDIByte((number & 0x00ff0000) >> 16);
111 upper2 = (number & 0x0000ff00) >> 8; 111 upper2 = MIDIByte((number & 0x0000ff00) >> 8);
112 lower2 = (number & 0x000000ff); 112 lower2 = MIDIByte((number & 0x000000ff));
113 113
114 string rv; 114 string rv;
115 rv += upper1; 115 rv += upper1;
116 rv += lower1; 116 rv += lower1;
117 rv += upper2; 117 rv += upper2;
342 342
343 NoteList notes = m_exportable->getNotes(); 343 NoteList notes = m_exportable->getNotes();
344 344
345 for (NoteList::const_iterator i = notes.begin(); i != notes.end(); ++i) { 345 for (NoteList::const_iterator i = notes.begin(); i != notes.end(); ++i) {
346 346
347 int frame = i->start; 347 sv_frame_t frame = i->start;
348 int duration = i->duration; 348 sv_frame_t duration = i->duration;
349 int pitch = i->midiPitch; 349 int pitch = i->midiPitch;
350 int velocity = i->velocity; 350 int velocity = i->velocity;
351 int channel = i->channel; 351 int channel = i->channel;
352 352
353 if (pitch < 0) pitch = 0; 353 if (pitch < 0) pitch = 0;