Mercurial > hg > svcore
comparison base/BaseTypes.h @ 1530:bf32b26d1dad zoom
Fix (bodgily) things broken in the merge
author | Chris Cannam |
---|---|
date | Tue, 18 Sep 2018 16:03:29 +0100 |
parents | c1c45c5146bb |
children | 5360f7aba189 |
comparison
equal
deleted
inserted
replaced
1529:c1c45c5146bb | 1530:bf32b26d1dad |
---|---|
65 PixelsPerFrame // zoomed in beyond 1-1 (interpolating the waveform) | 65 PixelsPerFrame // zoomed in beyond 1-1 (interpolating the waveform) |
66 }; | 66 }; |
67 Zone zone; | 67 Zone zone; |
68 int level; | 68 int level; |
69 | 69 |
70 ZoomLevel(Zone z, int l) : zone(z), level(l) { } | |
71 | |
70 bool operator<(const ZoomLevel &other) const { | 72 bool operator<(const ZoomLevel &other) const { |
71 if (zone == FramesPerPixel) { | 73 if (zone == FramesPerPixel) { |
72 if (other.zone == zone) { | 74 if (other.zone == zone) { |
73 return level < other.level; | 75 return level < other.level; |
74 } else { | 76 } else { |
81 return false; | 83 return false; |
82 } | 84 } |
83 } | 85 } |
84 } | 86 } |
85 | 87 |
88 bool operator==(const ZoomLevel &other) const { | |
89 return (zone == other.zone && level == other.level); | |
90 } | |
91 | |
86 ZoomLevel incremented() const { | 92 ZoomLevel incremented() const { |
87 if (zone == FramesPerPixel) { | 93 if (zone == FramesPerPixel) { |
88 return { zone, level + 1 }; | 94 return { zone, level + 1 }; |
89 } else if (level == 1) { | 95 } else if (level == 1) { |
90 return { FramesPerPixel, 2 }; | 96 return { FramesPerPixel, 2 }; |