Mercurial > hg > svgui
comparison view/Pane.cpp @ 187:e7cf6044c2a0
* better icon
* support range mappers in thumbwheel
* supply range mapper for vertical zoom from spectrogram
* fix bug in fftmodel for scaled ffts
* make the various widgets all respond to double-click for edit, middle-click
for reset, ctrl-left-click for reset
author | Chris Cannam |
---|---|
date | Fri, 12 Jan 2007 14:49:18 +0000 |
parents | 42118892f428 |
children | dd573e090eed |
comparison
equal
deleted
inserted
replaced
186:8dd247c4c5f1 | 187:e7cf6044c2a0 |
---|---|
56 } | 56 } |
57 | 57 |
58 void | 58 void |
59 Pane::updateHeadsUpDisplay() | 59 Pane::updateHeadsUpDisplay() |
60 { | 60 { |
61 Profiler profiler("Pane::updateHeadsUpDisplay", true); | |
62 | |
61 /* | 63 /* |
62 int count = 0; | 64 int count = 0; |
63 int currentLevel = 1; | 65 int currentLevel = 1; |
64 int level = 1; | 66 int level = 1; |
65 while (true) { | 67 while (true) { |
83 layout->setMargin(0); | 85 layout->setMargin(0); |
84 layout->setSpacing(0); | 86 layout->setSpacing(0); |
85 m_headsUpDisplay->setLayout(layout); | 87 m_headsUpDisplay->setLayout(layout); |
86 | 88 |
87 m_hthumb = new Thumbwheel(Qt::Horizontal); | 89 m_hthumb = new Thumbwheel(Qt::Horizontal); |
90 m_hthumb->setObjectName(tr("Horizontal Zoom")); | |
88 layout->addWidget(m_hthumb, 1, 0, 1, 2); | 91 layout->addWidget(m_hthumb, 1, 0, 1, 2); |
89 m_hthumb->setFixedWidth(70); | 92 m_hthumb->setFixedWidth(70); |
90 m_hthumb->setFixedHeight(16); | 93 m_hthumb->setFixedHeight(16); |
91 m_hthumb->setDefaultValue(0); | 94 m_hthumb->setDefaultValue(0); |
92 m_hthumb->setSpeed(0.6); | 95 m_hthumb->setSpeed(0.6); |
100 m_vpan->setAlpha(80, 130); | 103 m_vpan->setAlpha(80, 130); |
101 connect(m_vpan, SIGNAL(rectExtentsChanged(float, float, float, float)), | 104 connect(m_vpan, SIGNAL(rectExtentsChanged(float, float, float, float)), |
102 this, SLOT(verticalPannerMoved(float, float, float, float))); | 105 this, SLOT(verticalPannerMoved(float, float, float, float))); |
103 | 106 |
104 m_vthumb = new Thumbwheel(Qt::Vertical); | 107 m_vthumb = new Thumbwheel(Qt::Vertical); |
108 m_vthumb->setObjectName(tr("Vertical Zoom")); | |
105 layout->addWidget(m_vthumb, 0, 2); | 109 layout->addWidget(m_vthumb, 0, 2); |
106 m_vthumb->setFixedWidth(16); | 110 m_vthumb->setFixedWidth(16); |
107 m_vthumb->setFixedHeight(70); | 111 m_vthumb->setFixedHeight(70); |
108 connect(m_vthumb, SIGNAL(valueChanged(int)), this, | 112 connect(m_vthumb, SIGNAL(valueChanged(int)), this, |
109 SLOT(verticalThumbwheelMoved(int))); | 113 SLOT(verticalThumbwheelMoved(int))); |
182 int max = layer->getVerticalZoomSteps(defaultStep); | 186 int max = layer->getVerticalZoomSteps(defaultStep); |
183 if (max == 0) { | 187 if (max == 0) { |
184 m_vthumb->hide(); | 188 m_vthumb->hide(); |
185 } else { | 189 } else { |
186 m_vthumb->show(); | 190 m_vthumb->show(); |
191 m_vthumb->blockSignals(true); | |
187 m_vthumb->setMinimumValue(0); | 192 m_vthumb->setMinimumValue(0); |
188 m_vthumb->setMaximumValue(max); | 193 m_vthumb->setMaximumValue(max); |
189 m_vthumb->setDefaultValue(defaultStep); | 194 m_vthumb->setDefaultValue(defaultStep); |
190 m_vthumb->setValue(layer->getCurrentVerticalZoomStep()); | 195 m_vthumb->setValue(layer->getCurrentVerticalZoomStep()); |
196 m_vthumb->blockSignals(false); | |
191 | 197 |
192 std::cerr << "Vertical thumbwheel: min 0, max " << max | 198 std::cerr << "Vertical thumbwheel: min 0, max " << max |
193 << ", default " << defaultStep << ", value " | 199 << ", default " << defaultStep << ", value " |
194 << m_vthumb->getValue() << std::endl; | 200 << m_vthumb->getValue() << std::endl; |
195 | 201 |
1546 } | 1552 } |
1547 | 1553 |
1548 View::propertyContainerSelected(v, pc); | 1554 View::propertyContainerSelected(v, pc); |
1549 updateHeadsUpDisplay(); | 1555 updateHeadsUpDisplay(); |
1550 | 1556 |
1557 if (m_vthumb) { | |
1558 RangeMapper *rm = 0; | |
1559 if (layer) rm = layer->getNewVerticalZoomRangeMapper(); | |
1560 if (rm) m_vthumb->setRangeMapper(rm); | |
1561 } | |
1562 | |
1551 if (getLayerCount() > 0) { | 1563 if (getLayerCount() > 0) { |
1552 layer = getLayer(getLayerCount() - 1); | 1564 layer = getLayer(getLayerCount() - 1); |
1553 connect(layer, SIGNAL(verticalZoomChanged()), | 1565 connect(layer, SIGNAL(verticalZoomChanged()), |
1554 this, SLOT(verticalZoomChanged())); | 1566 this, SLOT(verticalZoomChanged())); |
1555 } | 1567 } |