Mercurial > hg > svcore
comparison data/model/Labeller.h @ 306:4669894a89ad
* textual changes
author | Chris Cannam |
---|---|
date | Tue, 09 Oct 2007 16:21:10 +0000 |
parents | fc656505c573 |
children | b1a3f7bc035d |
comparison
equal
deleted
inserted
replaced
305:fc656505c573 | 306:4669894a89ad |
---|---|
80 | 80 |
81 typedef std::map<ValueType, QString> TypeNameMap; | 81 typedef std::map<ValueType, QString> TypeNameMap; |
82 TypeNameMap getTypeNames() const { | 82 TypeNameMap getTypeNames() const { |
83 TypeNameMap m; | 83 TypeNameMap m; |
84 m[ValueNone] = tr("No numbering"); | 84 m[ValueNone] = tr("No numbering"); |
85 m[ValueFromSimpleCounter] = tr("Simple counter starting from 1"); | 85 m[ValueFromSimpleCounter] = tr("Simple counter"); |
86 m[ValueFromCyclicalCounter] = tr("Cyclical counter starting from 1"); | 86 m[ValueFromCyclicalCounter] = tr("Cyclical counter"); |
87 m[ValueFromTwoLevelCounter] = tr("Cyclical two-level counter (bar/beat)"); | 87 m[ValueFromTwoLevelCounter] = tr("Cyclical two-level counter (bar/beat)"); |
88 m[ValueFromFrameNumber] = tr("Audio sample frame number"); | 88 m[ValueFromFrameNumber] = tr("Audio sample frame number"); |
89 m[ValueFromRealTime] = tr("Time in seconds"); | 89 m[ValueFromRealTime] = tr("Time in seconds"); |
90 m[ValueFromRealTimeDifference] = tr("Duration to the following item"); | 90 m[ValueFromRealTimeDifference] = tr("Duration to the following item"); |
91 m[ValueFromTempo] = tr("Tempo (bpm) based on duration to following item"); | 91 m[ValueFromTempo] = tr("Tempo (bpm) based on duration to following item"); |
92 m[ValueFromExistingNeighbour] = tr("Same value as the nearest previous item"); | 92 m[ValueFromExistingNeighbour] = tr("Same as the nearest previous item"); |
93 m[ValueFromLabel] = tr("Value extracted from the item's label (where possible)"); | 93 m[ValueFromLabel] = tr("Value extracted from the item's label (where possible)"); |
94 return m; | 94 return m; |
95 } | 95 } |
96 | 96 |
97 ValueType getType() const { return m_type; } | 97 ValueType getType() const { return m_type; } |
131 if (m_type == ValueNone) { | 131 if (m_type == ValueNone) { |
132 newPoint.label = ""; | 132 newPoint.label = ""; |
133 } else if (m_type == ValueFromTwoLevelCounter) { | 133 } else if (m_type == ValueFromTwoLevelCounter) { |
134 newPoint.label = tr("%1.%2").arg(m_counter2).arg(m_counter); | 134 newPoint.label = tr("%1.%2").arg(m_counter2).arg(m_counter); |
135 incrementCounter(); | 135 incrementCounter(); |
136 } else if (m_type == ValueFromFrameNumber) { | |
137 // avoid going through floating-point value | |
138 newPoint.label = tr("%1").arg(newPoint.frame); | |
136 } else { | 139 } else { |
137 float value = getValueFor<PointType>(newPoint, prevPoint); | 140 float value = getValueFor<PointType>(newPoint, prevPoint); |
138 if (actingOnPrevPoint() && prevPoint) { | 141 if (actingOnPrevPoint() && prevPoint) { |
139 prevPoint->label = QString("%1").arg(value); | 142 prevPoint->label = QString("%1").arg(value); |
140 } else { | 143 } else { |