annotate layer/HorizontalScaleProvider.h @ 1551:e79731086b0f

Fixes to NoteLayer, particularly to calculation of vertical scale when model unit is not Hz. To avoid inconsistency we now behave as if the unit is always Hz from the point of view of the external API and display, converting at the point where we obtain values from the events themselves. Also various fixes to editing.
author Chris Cannam
date Thu, 21 Nov 2019 14:02:57 +0000
parents b4cb11ca8233
children
rev   line source
Chris@1276 1 /* -*- c-basic-offset: 4 indent-tabs-mode: nil -*- vi:set ts=8 sts=4 sw=4: */
Chris@1276 2
Chris@1276 3 /*
Chris@1276 4 Sonic Visualiser
Chris@1276 5 An audio file viewer and annotation editor.
Chris@1276 6 Centre for Digital Music, Queen Mary, University of London.
Chris@1276 7 This file copyright 2006-2018 Chris Cannam and QMUL.
Chris@1276 8
Chris@1276 9 This program is free software; you can redistribute it and/or
Chris@1276 10 modify it under the terms of the GNU General Public License as
Chris@1276 11 published by the Free Software Foundation; either version 2 of the
Chris@1276 12 License, or (at your option) any later version. See the file
Chris@1276 13 COPYING included with this distribution for more information.
Chris@1276 14 */
Chris@1276 15
Chris@1276 16 #ifndef SV_HORIZONTAL_SCALE_PROVIDER_H
Chris@1276 17 #define SV_HORIZONTAL_SCALE_PROVIDER_H
Chris@1276 18
Chris@1276 19 class LayerGeometryProvider;
Chris@1276 20
Chris@1276 21 /**
Chris@1276 22 * Interface to be implemented by objects, such as layers or objects
Chris@1276 23 * they delegate to, in which the X axis corresponds to frequency. For
Chris@1276 24 * example, SpectrumLayer.
Chris@1276 25 */
Chris@1276 26 class HorizontalScaleProvider
Chris@1276 27 {
Chris@1276 28 public:
Chris@1276 29 virtual double getFrequencyForX(const LayerGeometryProvider *,
Chris@1276 30 double x)
Chris@1276 31 const = 0;
Chris@1276 32
Chris@1276 33 virtual double getXForFrequency(const LayerGeometryProvider *,
Chris@1276 34 double freq)
Chris@1276 35 const = 0;
Chris@1276 36 };
Chris@1276 37
Chris@1276 38 #endif