annotate audioio/PlaySpeedRangeMapper.h @ 59:1016a8ceceda

* Introduce PlaySpeedRangeMapper for playback speed dial
author Chris Cannam
date Tue, 17 Oct 2006 11:42:14 +0000
parents
children 06b3c3f437e6
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@59 29 float getFactorForPosition(int position) const;
Chris@59 30 float getFactorForValue(float value) const;
Chris@59 31
Chris@59 32 virtual QString getUnit() const;
Chris@59 33
Chris@59 34 protected:
Chris@59 35 int m_minpos;
Chris@59 36 int m_maxpos;
Chris@59 37 };
Chris@59 38
Chris@59 39
Chris@59 40 #endif