Mercurial > hg > svgui
annotate widgets/TransformFinder.h @ 1362:d79e21855aef
Add mechanism for saving/loading colour maps by name/id rather than by numerical index, for future compatibility when adding to or changing the supported colour maps. Add two new colour maps (and one old one). Write out backward-compatible numerical indices for use when reloading in older versions. Also add a mechanism to invert the colour map, though I don't think it turns out useful enough to include in the UI.
author | Chris Cannam |
---|---|
date | Thu, 18 Oct 2018 13:21:56 +0100 |
parents | 35b7cbcfc2d0 |
children | 05d614f6e46d |
rev | line source |
---|---|
Chris@416 | 1 /* -*- c-basic-offset: 4 indent-tabs-mode: nil -*- vi:set ts=8 sts=4 sw=4: */ |
Chris@416 | 2 |
Chris@416 | 3 /* |
Chris@416 | 4 Sonic Visualiser |
Chris@416 | 5 An audio file viewer and annotation editor. |
Chris@416 | 6 Centre for Digital Music, Queen Mary, University of London. |
Chris@416 | 7 This file copyright 2008 QMUL. |
Chris@416 | 8 |
Chris@416 | 9 This program is free software; you can redistribute it and/or |
Chris@416 | 10 modify it under the terms of the GNU General Public License as |
Chris@416 | 11 published by the Free Software Foundation; either version 2 of the |
Chris@416 | 12 License, or (at your option) any later version. See the file |
Chris@416 | 13 COPYING included with this distribution for more information. |
Chris@416 | 14 */ |
Chris@416 | 15 |
Chris@416 | 16 #ifndef _TRANSFORM_FINDER_H_ |
Chris@416 | 17 #define _TRANSFORM_FINDER_H_ |
Chris@416 | 18 |
Chris@416 | 19 #include <QDialog> |
Chris@416 | 20 |
Chris@417 | 21 #include <vector> |
Chris@417 | 22 |
Chris@416 | 23 #include "transform/Transform.h" |
Chris@424 | 24 #include "transform/TransformFactory.h" |
Chris@416 | 25 |
Chris@421 | 26 class QVBoxLayout; |
Chris@416 | 27 class QScrollArea; |
Chris@417 | 28 class QLabel; |
Chris@419 | 29 class SelectableLabel; |
Chris@417 | 30 class QWidget; |
Chris@424 | 31 class QTimer; |
Chris@419 | 32 |
Chris@416 | 33 class TransformFinder : public QDialog |
Chris@416 | 34 { |
Chris@416 | 35 Q_OBJECT |
Chris@416 | 36 |
Chris@416 | 37 public: |
Chris@416 | 38 TransformFinder(QWidget *parent = 0); |
Chris@416 | 39 ~TransformFinder(); |
Chris@416 | 40 |
Chris@416 | 41 TransformId getTransform() const; |
Chris@416 | 42 |
Chris@416 | 43 protected slots: |
Chris@416 | 44 void searchTextChanged(const QString &); |
Chris@420 | 45 void selectedLabelChanged(); |
Chris@448 | 46 void labelDoubleClicked(); |
Chris@424 | 47 void timeout(); |
Chris@426 | 48 void up(); |
Chris@426 | 49 void down(); |
Chris@420 | 50 |
Chris@416 | 51 protected: |
Chris@448 | 52 QLabel *m_infoLabel; |
Chris@448 | 53 QLabel *m_beforeSearchLabel; |
Chris@448 | 54 QLabel *m_noResultsLabel; |
Chris@448 | 55 |
Chris@416 | 56 QScrollArea *m_resultsScroll; |
Chris@417 | 57 QWidget *m_resultsFrame; |
Chris@421 | 58 QVBoxLayout *m_resultsLayout; |
Chris@419 | 59 std::vector<SelectableLabel *> m_labels; |
Chris@420 | 60 TransformId m_selectedTransform; |
Chris@424 | 61 QTimer *m_timer; |
Chris@424 | 62 |
Chris@450 | 63 void setupBeforeSearchLabel(); |
Chris@450 | 64 |
Chris@424 | 65 QString m_newSearchText; |
Chris@431 | 66 typedef std::vector<TextMatcher::Match> SortedResults; |
Chris@424 | 67 SortedResults m_sortedResults; |
Chris@424 | 68 int m_upToDateCount; |
Chris@416 | 69 }; |
Chris@416 | 70 |
Chris@416 | 71 #endif |
Chris@416 | 72 |