comparison layer/NoteLayer.h @ 101:0f36cdf407a6 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 4b98bda7e94d
children 47cb32bb35ab
comparison
equal deleted inserted replaced
100:0db5e7492ce8 101:0f36cdf407a6
71 71
72 void setBaseColour(QColor); 72 void setBaseColour(QColor);
73 QColor getBaseColour() const { return m_colour; } 73 QColor getBaseColour() const { return m_colour; }
74 74
75 enum VerticalScale { 75 enum VerticalScale {
76 MinMaxRangeScale, 76 AutoAlignScale,
77 MIDIRangeScale, 77 LinearScale,
78 FrequencyScale 78 LogScale,
79 MIDIRangeScale
79 }; 80 };
80 81
81 void setVerticalScale(VerticalScale scale); 82 void setVerticalScale(VerticalScale scale);
82 VerticalScale getVerticalScale() const { return m_verticalScale; } 83 VerticalScale getVerticalScale() const { return m_verticalScale; }
83 84
85 86
86 virtual bool isLayerEditable() const { return true; } 87 virtual bool isLayerEditable() const { return true; }
87 88
88 virtual int getCompletion() const { return m_model->getCompletion(); } 89 virtual int getCompletion() const { return m_model->getCompletion(); }
89 90
90 virtual bool getValueExtents(float &min, float &max, QString &unit) const; 91 virtual bool getValueExtents(float &min, float &max,
92 bool &log, QString &unit) const;
93
94 virtual bool getDisplayExtents(float &min, float &max) const;
91 95
92 virtual QString toXmlString(QString indent = "", 96 virtual QString toXmlString(QString indent = "",
93 QString extraAttributes = "") const; 97 QString extraAttributes = "") const;
94 98
95 void setProperties(const QXmlAttributes &attributes); 99 void setProperties(const QXmlAttributes &attributes);
96 100
97 protected: 101 protected:
102 void getScaleExtents(View *, float &min, float &max, bool &log) const;
98 int getYForValue(View *v, float value) const; 103 int getYForValue(View *v, float value) const;
99 float getValueForY(View *v, int y) const; 104 float getValueForY(View *v, int y) const;
105 bool shouldConvertMIDIToHz() const;
100 106
101 NoteModel::PointList getLocalPoints(View *v, int) const; 107 NoteModel::PointList getLocalPoints(View *v, int) const;
102 108
103 NoteModel *m_model; 109 NoteModel *m_model;
104 bool m_editing; 110 bool m_editing;