annotate base/Pitch.h @ 117:c30728d5625c sv1-v0.9rc1

* Make vertical scale alignment modes work in note layer as well as time-value layer, and several significant fixes to it * Make it possible to draw notes properly on the note layer * Show units (and frequencies etc in note layer's case) in the time-value and note layer description boxes * Minor fix to item edit dialog layout * Some minor menu rearrangement * Comment out a lot of debug output * Add SV website and reference URLs to Help menu, and add code to (attempt to) open them in the user's preferred browser
author Chris Cannam
date Fri, 12 May 2006 14:40:43 +0000
parents d397ea0a79f5
children 4f26f623a8bc
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@19 24 static float getFrequencyForPitch(int midiPitch,
Chris@19 25 float centsOffset = 0,
Chris@19 26 float concertA = 440.0);
Chris@19 27
Chris@19 28 static int getPitchForFrequency(float frequency,
Chris@19 29 float *centsOffsetReturn = 0,
Chris@19 30 float concertA = 440.0);
Chris@19 31
Chris@19 32 static QString getPitchLabel(int midiPitch,
Chris@26 33 float centsOffset = 0,
Chris@26 34 bool useFlats = false);
Chris@19 35
Chris@19 36 static QString getPitchLabelForFrequency(float frequency,
Chris@26 37 float concertA = 440.0,
Chris@26 38 bool useFlats = false);
Chris@19 39 };
Chris@19 40
Chris@19 41
Chris@19 42 #endif