Mercurial > hg > sonic-visualiser
comparison main/MainWindow.cpp @ 65:77c083741589
* Rename the existing Panner to Overview (big duh!)
* Fixes to the new Panner.
author | Chris Cannam |
---|---|
date | Thu, 19 Oct 2006 09:57:27 +0000 |
parents | dc7a73ef69af |
children | cf27fc7feb7a |
comparison
equal
deleted
inserted
replaced
64:f7f676a533e5 | 65:77c083741589 |
---|---|
29 #include "layer/TimeRulerLayer.h" | 29 #include "layer/TimeRulerLayer.h" |
30 #include "layer/TimeInstantLayer.h" | 30 #include "layer/TimeInstantLayer.h" |
31 #include "layer/TimeValueLayer.h" | 31 #include "layer/TimeValueLayer.h" |
32 #include "layer/Colour3DPlotLayer.h" | 32 #include "layer/Colour3DPlotLayer.h" |
33 #include "widgets/Fader.h" | 33 #include "widgets/Fader.h" |
34 #include "view/Panner.h" | 34 #include "view/Overview.h" |
35 #include "widgets/PropertyBox.h" | 35 #include "widgets/PropertyBox.h" |
36 #include "widgets/PropertyStack.h" | 36 #include "widgets/PropertyStack.h" |
37 #include "widgets/AudioDial.h" | 37 #include "widgets/AudioDial.h" |
38 #include "widgets/LayerTree.h" | 38 #include "widgets/LayerTree.h" |
39 #include "widgets/ListInputDialog.h" | 39 #include "widgets/ListInputDialog.h" |
97 | 97 |
98 MainWindow::MainWindow(bool withAudioOutput) : | 98 MainWindow::MainWindow(bool withAudioOutput) : |
99 m_document(0), | 99 m_document(0), |
100 m_paneStack(0), | 100 m_paneStack(0), |
101 m_viewManager(0), | 101 m_viewManager(0), |
102 m_panner(0), | 102 m_overview(0), |
103 m_timeRulerLayer(0), | 103 m_timeRulerLayer(0), |
104 m_audioOutput(withAudioOutput), | 104 m_audioOutput(withAudioOutput), |
105 m_playSource(0), | 105 m_playSource(0), |
106 m_playTarget(0), | 106 m_playTarget(0), |
107 m_recentFiles("RecentFiles"), | 107 m_recentFiles("RecentFiles"), |
146 connect(m_paneStack, SIGNAL(currentLayerChanged(Pane *, Layer *)), | 146 connect(m_paneStack, SIGNAL(currentLayerChanged(Pane *, Layer *)), |
147 this, SLOT(currentLayerChanged(Pane *, Layer *))); | 147 this, SLOT(currentLayerChanged(Pane *, Layer *))); |
148 connect(m_paneStack, SIGNAL(rightButtonMenuRequested(Pane *, QPoint)), | 148 connect(m_paneStack, SIGNAL(rightButtonMenuRequested(Pane *, QPoint)), |
149 this, SLOT(rightButtonMenuRequested(Pane *, QPoint))); | 149 this, SLOT(rightButtonMenuRequested(Pane *, QPoint))); |
150 | 150 |
151 m_panner = new Panner(frame); | 151 m_overview = new Overview(frame); |
152 m_panner->setViewManager(m_viewManager); | 152 m_overview->setViewManager(m_viewManager); |
153 m_panner->setFixedHeight(40); | 153 m_overview->setFixedHeight(40); |
154 | 154 |
155 m_panLayer = new WaveformLayer; | 155 m_panLayer = new WaveformLayer; |
156 m_panLayer->setChannelMode(WaveformLayer::MergeChannels); | 156 m_panLayer->setChannelMode(WaveformLayer::MergeChannels); |
157 // m_panLayer->setScale(WaveformLayer::MeterScale); | 157 // m_panLayer->setScale(WaveformLayer::MeterScale); |
158 // m_panLayer->setAutoNormalize(true); | 158 // m_panLayer->setAutoNormalize(true); |
159 m_panLayer->setBaseColour(Qt::darkGreen); | 159 m_panLayer->setBaseColour(Qt::darkGreen); |
160 m_panLayer->setAggressiveCacheing(true); | 160 m_panLayer->setAggressiveCacheing(true); |
161 m_panner->addLayer(m_panLayer); | 161 m_overview->addLayer(m_panLayer); |
162 | 162 |
163 m_playSource = new AudioCallbackPlaySource(m_viewManager); | 163 m_playSource = new AudioCallbackPlaySource(m_viewManager); |
164 | 164 |
165 connect(m_playSource, SIGNAL(sampleRateMismatch(size_t, size_t, bool)), | 165 connect(m_playSource, SIGNAL(sampleRateMismatch(size_t, size_t, bool)), |
166 this, SLOT(sampleRateMismatch(size_t, size_t, bool))); | 166 this, SLOT(sampleRateMismatch(size_t, size_t, bool))); |
210 m_playSharpen->setChecked(settings.value("playsharpen", true).toBool()); | 210 m_playSharpen->setChecked(settings.value("playsharpen", true).toBool()); |
211 m_playMono->setChecked(settings.value("playmono", false).toBool()); | 211 m_playMono->setChecked(settings.value("playmono", false).toBool()); |
212 settings.endGroup(); | 212 settings.endGroup(); |
213 | 213 |
214 layout->addWidget(m_paneStack, 0, 0, 1, 5); | 214 layout->addWidget(m_paneStack, 0, 0, 1, 5); |
215 layout->addWidget(m_panner, 1, 0); | 215 layout->addWidget(m_overview, 1, 0); |
216 layout->addWidget(m_fader, 1, 1); | 216 layout->addWidget(m_fader, 1, 1); |
217 layout->addWidget(m_playSpeed, 1, 2); | 217 layout->addWidget(m_playSpeed, 1, 2); |
218 layout->addWidget(m_playSharpen, 1, 3); | 218 layout->addWidget(m_playSharpen, 1, 3); |
219 layout->addWidget(m_playMono, 1, 4); | 219 layout->addWidget(m_playMono, 1, 4); |
220 | 220 |
2079 m_document->addLayerToView(pane, m_timeRulerLayer); | 2079 m_document->addLayerToView(pane, m_timeRulerLayer); |
2080 | 2080 |
2081 Layer *waveform = m_document->createMainModelLayer(LayerFactory::Waveform); | 2081 Layer *waveform = m_document->createMainModelLayer(LayerFactory::Waveform); |
2082 m_document->addLayerToView(pane, waveform); | 2082 m_document->addLayerToView(pane, waveform); |
2083 | 2083 |
2084 m_panner->registerView(pane); | 2084 m_overview->registerView(pane); |
2085 | 2085 |
2086 CommandHistory::getInstance()->clear(); | 2086 CommandHistory::getInstance()->clear(); |
2087 CommandHistory::getInstance()->documentSaved(); | 2087 CommandHistory::getInstance()->documentSaved(); |
2088 documentRestored(); | 2088 documentRestored(); |
2089 updateMenuStates(); | 2089 updateMenuStates(); |
2128 while (pane->getLayerCount() > 0) { | 2128 while (pane->getLayerCount() > 0) { |
2129 m_document->removeLayerFromView | 2129 m_document->removeLayerFromView |
2130 (pane, pane->getLayer(pane->getLayerCount() - 1)); | 2130 (pane, pane->getLayer(pane->getLayerCount() - 1)); |
2131 } | 2131 } |
2132 | 2132 |
2133 m_panner->unregisterView(pane); | 2133 m_overview->unregisterView(pane); |
2134 m_paneStack->deletePane(pane); | 2134 m_paneStack->deletePane(pane); |
2135 } | 2135 } |
2136 | 2136 |
2137 while (m_paneStack->getHiddenPaneCount() > 0) { | 2137 while (m_paneStack->getHiddenPaneCount() > 0) { |
2138 | 2138 |
2142 while (pane->getLayerCount() > 0) { | 2142 while (pane->getLayerCount() > 0) { |
2143 m_document->removeLayerFromView | 2143 m_document->removeLayerFromView |
2144 (pane, pane->getLayer(pane->getLayerCount() - 1)); | 2144 (pane, pane->getLayer(pane->getLayerCount() - 1)); |
2145 } | 2145 } |
2146 | 2146 |
2147 m_panner->unregisterView(pane); | 2147 m_overview->unregisterView(pane); |
2148 m_paneStack->deletePane(pane); | 2148 m_paneStack->deletePane(pane); |
2149 } | 2149 } |
2150 | 2150 |
2151 delete m_document; | 2151 delete m_document; |
2152 m_document = 0; | 2152 m_document = 0; |
2837 } else { | 2837 } else { |
2838 m_mw->m_paneStack->showPane(m_pane); | 2838 m_mw->m_paneStack->showPane(m_pane); |
2839 } | 2839 } |
2840 | 2840 |
2841 m_mw->m_paneStack->setCurrentPane(m_pane); | 2841 m_mw->m_paneStack->setCurrentPane(m_pane); |
2842 m_mw->m_panner->registerView(m_pane); | 2842 m_mw->m_overview->registerView(m_pane); |
2843 m_added = true; | 2843 m_added = true; |
2844 } | 2844 } |
2845 | 2845 |
2846 void | 2846 void |
2847 MainWindow::AddPaneCommand::unexecute() | 2847 MainWindow::AddPaneCommand::unexecute() |
2848 { | 2848 { |
2849 m_mw->m_paneStack->hidePane(m_pane); | 2849 m_mw->m_paneStack->hidePane(m_pane); |
2850 m_mw->m_paneStack->setCurrentPane(m_prevCurrentPane); | 2850 m_mw->m_paneStack->setCurrentPane(m_prevCurrentPane); |
2851 m_mw->m_panner->unregisterView(m_pane); | 2851 m_mw->m_overview->unregisterView(m_pane); |
2852 m_added = false; | 2852 m_added = false; |
2853 } | 2853 } |
2854 | 2854 |
2855 MainWindow::RemovePaneCommand::RemovePaneCommand(MainWindow *mw, Pane *pane) : | 2855 MainWindow::RemovePaneCommand::RemovePaneCommand(MainWindow *mw, Pane *pane) : |
2856 m_mw(mw), | 2856 m_mw(mw), |
2875 void | 2875 void |
2876 MainWindow::RemovePaneCommand::execute() | 2876 MainWindow::RemovePaneCommand::execute() |
2877 { | 2877 { |
2878 m_prevCurrentPane = m_mw->m_paneStack->getCurrentPane(); | 2878 m_prevCurrentPane = m_mw->m_paneStack->getCurrentPane(); |
2879 m_mw->m_paneStack->hidePane(m_pane); | 2879 m_mw->m_paneStack->hidePane(m_pane); |
2880 m_mw->m_panner->unregisterView(m_pane); | 2880 m_mw->m_overview->unregisterView(m_pane); |
2881 m_added = false; | 2881 m_added = false; |
2882 } | 2882 } |
2883 | 2883 |
2884 void | 2884 void |
2885 MainWindow::RemovePaneCommand::unexecute() | 2885 MainWindow::RemovePaneCommand::unexecute() |
2886 { | 2886 { |
2887 m_mw->m_paneStack->showPane(m_pane); | 2887 m_mw->m_paneStack->showPane(m_pane); |
2888 m_mw->m_paneStack->setCurrentPane(m_prevCurrentPane); | 2888 m_mw->m_paneStack->setCurrentPane(m_prevCurrentPane); |
2889 m_mw->m_panner->registerView(m_pane); | 2889 m_mw->m_overview->registerView(m_pane); |
2890 m_added = true; | 2890 m_added = true; |
2891 } | 2891 } |
2892 | 2892 |
2893 void | 2893 void |
2894 MainWindow::addLayer() | 2894 MainWindow::addLayer() |