annotate base/Pitch.h @ 188:f86b74d1b143

* Simplify maker names in plugin menu * Make sure derived models have a name (based on the transform) * Don't start deriving a model from a derived model until the derived model is ready * Tidy up completion management in writable wave file model * Make writable models save/reload correctly from session file (i.e. regenerating from the original transform) * Same for dense 3d models -- don't save the data, just the transform details * Add a comment describing the SV file format
author Chris Cannam
date Fri, 13 Oct 2006 12:51:05 +0000
parents 4f26f623a8bc
children e412f65884ee
rev   line source
Chris@49 1 /* -*- c-basic-offset: 4 indent-tabs-mode: nil -*- vi:set ts=8 sts=4 sw=4: */
Chris@19 2
Chris@19 3 /*
Chris@52 4 Sonic Visualiser
Chris@52 5 An audio file viewer and annotation editor.
Chris@52 6 Centre for Digital Music, Queen Mary, University of London.
Chris@52 7 This file copyright 2006 Chris Cannam.
Chris@19 8
Chris@52 9 This program is free software; you can redistribute it and/or
Chris@52 10 modify it under the terms of the GNU General Public License as
Chris@52 11 published by the Free Software Foundation; either version 2 of the
Chris@52 12 License, or (at your option) any later version. See the file
Chris@52 13 COPYING included with this distribution for more information.
Chris@19 14 */
Chris@19 15
Chris@19 16 #ifndef _PITCH_H_
Chris@19 17 #define _PITCH_H_
Chris@19 18
Chris@19 19 #include <QString>
Chris@19 20
Chris@19 21 class Pitch
Chris@19 22 {
Chris@19 23 public:
Chris@141 24 /* If concertA <= 0, it will be taken from current preferences */
Chris@141 25
Chris@19 26 static float getFrequencyForPitch(int midiPitch,
Chris@19 27 float centsOffset = 0,
Chris@141 28 float concertA = 0.0);
Chris@19 29
Chris@19 30 static int getPitchForFrequency(float frequency,
Chris@19 31 float *centsOffsetReturn = 0,
Chris@141 32 float concertA = 0.0);
Chris@19 33
Chris@19 34 static QString getPitchLabel(int midiPitch,
Chris@26 35 float centsOffset = 0,
Chris@26 36 bool useFlats = false);
Chris@19 37
Chris@19 38 static QString getPitchLabelForFrequency(float frequency,
Chris@141 39 float concertA = 0.0,
Chris@26 40 bool useFlats = false);
Chris@19 41 };
Chris@19 42
Chris@19 43
Chris@19 44 #endif