Mercurial > hg > sonic-visualiser
annotate audioio/PlaySpeedRangeMapper.h @ 60:06b3c3f437e6
* Make audio dial remember its more accurate mapped value as well as its
display position
* Add tool tip support to audio dial to show values
author | Chris Cannam |
---|---|
date | Tue, 17 Oct 2006 13:04:49 +0000 |
parents | 1016a8ceceda |
children | bedc7517b6e8 |
rev | line source |
---|---|
Chris@59 | 1 /* -*- c-basic-offset: 4 indent-tabs-mode: nil -*- vi:set ts=8 sts=4 sw=4: */ |
Chris@59 | 2 |
Chris@59 | 3 /* |
Chris@59 | 4 Sonic Visualiser |
Chris@59 | 5 An audio file viewer and annotation editor. |
Chris@59 | 6 Centre for Digital Music, Queen Mary, University of London. |
Chris@59 | 7 This file copyright 2006 Chris Cannam. |
Chris@59 | 8 |
Chris@59 | 9 This program is free software; you can redistribute it and/or |
Chris@59 | 10 modify it under the terms of the GNU General Public License as |
Chris@59 | 11 published by the Free Software Foundation; either version 2 of the |
Chris@59 | 12 License, or (at your option) any later version. See the file |
Chris@59 | 13 COPYING included with this distribution for more information. |
Chris@59 | 14 */ |
Chris@59 | 15 |
Chris@59 | 16 #ifndef _PLAY_SPEED_RANGE_MAPPER_H_ |
Chris@59 | 17 #define _PLAY_SPEED_RANGE_MAPPER_H_ |
Chris@59 | 18 |
Chris@59 | 19 #include "base/RangeMapper.h" |
Chris@59 | 20 |
Chris@59 | 21 class PlaySpeedRangeMapper : public RangeMapper |
Chris@59 | 22 { |
Chris@59 | 23 public: |
Chris@59 | 24 PlaySpeedRangeMapper(int minpos, int maxpos); |
Chris@59 | 25 |
Chris@59 | 26 virtual int getPositionForValue(float value) const; |
Chris@59 | 27 virtual float getValueForPosition(int position) const; |
Chris@59 | 28 |
Chris@60 | 29 int getPositionForFactor(float factor) const; |
Chris@60 | 30 float getValueForFactor(float factor) const; |
Chris@60 | 31 |
Chris@59 | 32 float getFactorForPosition(int position) const; |
Chris@59 | 33 float getFactorForValue(float value) const; |
Chris@59 | 34 |
Chris@59 | 35 virtual QString getUnit() const; |
Chris@59 | 36 |
Chris@59 | 37 protected: |
Chris@59 | 38 int m_minpos; |
Chris@59 | 39 int m_maxpos; |
Chris@59 | 40 }; |
Chris@59 | 41 |
Chris@59 | 42 |
Chris@59 | 43 #endif |