Mercurial > hg > svgui
comparison view/Pane.cpp @ 132:5d3a483856ff
* Add Thumbwheel widget for all our zooming needs
* Use QSettings to save/restore window size and position -- precursor to
switching our preferences to QSettings as well -- wish I'd noticed it sooner
* Only suspend writes (not reads from the underlying cache objects) from the
fft caches when repainting the spectrogram -- performance should now be
significantly better
author | Chris Cannam |
---|---|
date | Thu, 03 Aug 2006 15:40:11 +0000 |
parents | 33929e0c3c6b |
children | 9e6b3e239b9d |
comparison
equal
deleted
inserted
replaced
131:eaae73b6bd28 | 132:5d3a483856ff |
---|---|
20 #include "base/RealTime.h" | 20 #include "base/RealTime.h" |
21 #include "base/Profiler.h" | 21 #include "base/Profiler.h" |
22 #include "ViewManager.h" | 22 #include "ViewManager.h" |
23 #include "base/CommandHistory.h" | 23 #include "base/CommandHistory.h" |
24 #include "layer/WaveformLayer.h" | 24 #include "layer/WaveformLayer.h" |
25 #include "widgets/Thumbwheel.h" | |
25 | 26 |
26 #include <QPaintEvent> | 27 #include <QPaintEvent> |
27 #include <QPainter> | 28 #include <QPainter> |
28 #include <iostream> | 29 #include <iostream> |
29 #include <cmath> | 30 #include <cmath> |
41 m_resizing(false), | 42 m_resizing(false), |
42 m_centreLineVisible(true) | 43 m_centreLineVisible(true) |
43 { | 44 { |
44 setObjectName("Pane"); | 45 setObjectName("Pane"); |
45 setMouseTracking(true); | 46 setMouseTracking(true); |
47 /* | |
48 int count = 0; | |
49 int currentLevel = 1; | |
50 int level = 1; | |
51 while (true) { | |
52 if (getZoomLevel() == level) currentLevel = count; | |
53 int newLevel = getZoomConstraintBlockSize(level + 1, | |
54 ZoomConstraint::RoundUp); | |
55 if (newLevel == level) break; | |
56 if (newLevel == 131072) break; //!!! just because | |
57 level = newLevel; | |
58 ++count; | |
59 } | |
60 | |
61 std::cerr << "Have " << count+1 << " zoom levels" << std::endl; | |
62 */ | |
63 /* | |
64 Thumbwheel *thumbwheel = new Thumbwheel(0, 40, 5, | |
65 Qt::Vertical, this); | |
66 thumbwheel->move(10, 10); | |
67 connect(thumbwheel, SIGNAL(valueChanged(int)), this, | |
68 SLOT(horizontalThumbwheelMoved(int))); | |
69 */ | |
46 } | 70 } |
47 | 71 |
48 bool | 72 bool |
49 Pane::shouldIlluminateLocalFeatures(const Layer *layer, QPoint &pos) const | 73 Pane::shouldIlluminateLocalFeatures(const Layer *layer, QPoint &pos) const |
50 { | 74 { |
967 } | 991 } |
968 | 992 |
969 emit paneInteractedWith(); | 993 emit paneInteractedWith(); |
970 } | 994 } |
971 | 995 |
996 void | |
997 Pane::horizontalThumbwheelMoved(int value) | |
998 { | |
999 int count = 0; | |
1000 int level = 1; | |
1001 while (true) { | |
1002 if (value == count) break; | |
1003 int newLevel = getZoomConstraintBlockSize(level + 1, | |
1004 ZoomConstraint::RoundUp); | |
1005 if (newLevel == level) break; | |
1006 level = newLevel; | |
1007 ++count; | |
1008 } | |
1009 | |
1010 std::cerr << "new level is " << level << std::endl; | |
1011 setZoomLevel(level); | |
1012 } | |
1013 | |
1014 void | |
1015 Pane::verticalThumbwheelMoved(int value) | |
1016 { | |
1017 } | |
1018 | |
972 bool | 1019 bool |
973 Pane::editSelectionStart(QMouseEvent *e) | 1020 Pane::editSelectionStart(QMouseEvent *e) |
974 { | 1021 { |
975 if (!m_identifyFeatures || | 1022 if (!m_identifyFeatures || |
976 !m_manager || | 1023 !m_manager || |