diff data/model/NoteData.h @ 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 48e9f538e6e9
line wrap: on
line diff
--- a/data/model/NoteData.h	Tue Mar 03 09:33:59 2015 +0000
+++ b/data/model/NoteData.h	Tue Mar 03 15:18:24 2015 +0000
@@ -21,12 +21,12 @@
 
 struct NoteData
 {
-    NoteData(int _start, int _dur, int _mp, int _vel) :
+    NoteData(sv_frame_t _start, sv_frame_t _dur, int _mp, int _vel) :
 	start(_start), duration(_dur), midiPitch(_mp), frequency(0),
 	isMidiPitchQuantized(true), velocity(_vel), channel(0) { };
             
-    int start;       // audio sample frame
-    int duration;    // in audio sample frames
+    sv_frame_t start;       // audio sample frame
+    sv_frame_t duration;    // in audio sample frames
     int midiPitch;   // 0-127
     float frequency; // Hz, to be used if isMidiPitchQuantized false
     bool isMidiPitchQuantized;
@@ -35,7 +35,7 @@
 
     float getFrequency() const {
         if (isMidiPitchQuantized) {
-            return Pitch::getFrequencyForPitch(midiPitch);
+            return float(Pitch::getFrequencyForPitch(midiPitch));
         } else {
             return frequency;
         }
@@ -48,7 +48,7 @@
 {
 public:
     virtual NoteList getNotes() const = 0;
-    virtual NoteList getNotesWithin(int startFrame, int endFrame) const = 0;
+    virtual NoteList getNotesWithin(sv_frame_t startFrame, sv_frame_t endFrame) const = 0;
 };
 
 #endif