diff layer/Layer.h @ 904:e0f08e108064 cxx11

Move to using double rather than float for floating-point calculations (float only for storage); more build fixes
author Chris Cannam
date Mon, 09 Mar 2015 12:02:10 +0000
parents 4c8ca536b54f
children b66fb15de477
line wrap: on
line diff
--- a/layer/Layer.h	Mon Mar 09 08:43:20 2015 +0000
+++ b/layer/Layer.h	Mon Mar 09 12:02:10 2015 +0000
@@ -180,8 +180,8 @@
      * (and leave frame unmodified).  If returning true, also return
      * the resolution of the model in this layer in sample frames.
      */
-    virtual bool snapToFeatureFrame(View *   /* v */,
-				    int &    /* frame */,
+    virtual bool snapToFeatureFrame(View * /* v */,
+				    sv_frame_t & /* frame */,
 				    int &resolution,
 				    SnapType /* snap */) const {
 	resolution = 1;
@@ -204,8 +204,8 @@
      * (and leave frame unmodified).  If returning true, also return
      * the resolution of the model in this layer in sample frames.
      */
-    virtual bool snapToSimilarFeature(View *   /* v */,
-                                      int &    /* source frame */,
+    virtual bool snapToSimilarFeature(View * /* v */,
+                                      sv_frame_t & /* source frame */,
                                       int &resolution,
                                       SnapType /* snap */) const {
 	resolution = 1;
@@ -269,7 +269,7 @@
      */
     virtual bool paste(View *,
                        const Clipboard & /* from */,
-                       int /* frameOffset */,
+                       sv_frame_t /* frameOffset */,
                        bool /* interactive */) { return false; }
 
     // Text mode:
@@ -423,7 +423,7 @@
      * This function returns the "normal" extents for the layer, not
      * necessarily the extents actually in use in the display.
      */
-    virtual bool getValueExtents(float &min, float &max,
+    virtual bool getValueExtents(double &min, double &max,
                                  bool &logarithmic, QString &unit) const = 0;
 
     /**
@@ -434,8 +434,8 @@
      * extent (using the normal layer extents or deferring to whatever
      * is in use for the same units elsewhere in the view).
      */
-    virtual bool getDisplayExtents(float & /* min */,
-                                   float & /* max */) const {
+    virtual bool getDisplayExtents(double & /* min */,
+                                   double & /* max */) const {
         return false;
     }
 
@@ -446,8 +446,8 @@
      * return false for getDisplayExtents should also return false for
      * this function.
      */
-    virtual bool setDisplayExtents(float /* min */,
-                                   float /* max */) {
+    virtual bool setDisplayExtents(double /* min */,
+                                   double /* max */) {
         return false;
     }
 
@@ -458,14 +458,14 @@
      * if the layer hasTimeXAxis().
      */
     virtual bool getXScaleValue(const View *v, int x,
-                                float &value, QString &unit) const;
+                                double &value, QString &unit) const;
 
     /** 
      * Return the value and unit at the given y coordinate in the
      * given view.
      */
     virtual bool getYScaleValue(const View *, int /* y */,
-                                float &/* value */, QString &/* unit */) const {
+                                double &/* value */, QString &/* unit */) const {
         return false;
     }
 
@@ -476,7 +476,7 @@
      * returns the difference, with the same unit.
      */
     virtual bool getYScaleDifference(const View *v, int y0, int y1,
-                                     float &diff, QString &unit) const;
+                                     double &diff, QString &unit) const;
         
     /**
      * Get the number of vertical zoom steps available for this layer.
@@ -538,8 +538,8 @@
 protected:
     void connectSignals(const Model *);
 
-    virtual int alignToReference(View *v, int frame) const;
-    virtual int alignFromReference(View *v, int frame) const;
+    virtual sv_frame_t alignToReference(View *v, sv_frame_t frame) const;
+    virtual sv_frame_t alignFromReference(View *v, sv_frame_t frame) const;
     bool clipboardHasDifferentAlignment(View *v, const Clipboard &clip) const;
 
     struct MeasureRect {