comparison main/MainWindow.cpp @ 137:006c90387f40

* Fix many compile warnings, remove some debug output
author Chris Cannam
date Mon, 30 Apr 2007 13:36:23 +0000
parents 37c26877ca5f
children 834ff910e3d2
comparison
equal deleted inserted replaced
136:37c26877ca5f 137:006c90387f40
290 newSession(); 290 newSession();
291 } 291 }
292 292
293 MainWindow::~MainWindow() 293 MainWindow::~MainWindow()
294 { 294 {
295 std::cerr << "MainWindow::~MainWindow()" << std::endl; 295 // std::cerr << "MainWindow::~MainWindow()" << std::endl;
296 296
297 if (!m_abandoning) { 297 if (!m_abandoning) {
298 closeSession(); 298 closeSession();
299 } 299 }
300 delete m_playTarget; 300 delete m_playTarget;
1416 for (int j = 0; j < pane->getLayerCount(); ++j) { 1416 for (int j = 0; j < pane->getLayerCount(); ++j) {
1417 1417
1418 Layer *layer = pane->getLayer(j); 1418 Layer *layer = pane->getLayer(j);
1419 if (!layer) continue; 1419 if (!layer) continue;
1420 if (observedLayers.find(layer) != observedLayers.end()) { 1420 if (observedLayers.find(layer) != observedLayers.end()) {
1421 std::cerr << "found duplicate layer " << layer << std::endl; 1421 // std::cerr << "found duplicate layer " << layer << std::endl;
1422 continue; 1422 continue;
1423 } 1423 }
1424 1424
1425 // std::cerr << "found new layer " << layer << " (name = " 1425 // std::cerr << "found new layer " << layer << " (name = "
1426 // << layer->getLayerPresentationName().toStdString() << ")" << std::endl; 1426 // << layer->getLayerPresentationName().toStdString() << ")" << std::endl;
1434 } 1434 }
1435 } 1435 }
1436 1436
1437 map<QString, int> observedNames; 1437 map<QString, int> observedNames;
1438 1438
1439 for (int i = 0; i < orderedLayers.size(); ++i) { 1439 for (size_t i = 0; i < orderedLayers.size(); ++i) {
1440 1440
1441 Layer *layer = orderedLayers[i]; 1441 Layer *layer = orderedLayers[i];
1442 1442
1443 QString name = layer->getLayerPresentationName(); 1443 QString name = layer->getLayerPresentationName();
1444 int n = ++observedNames[name]; 1444 int n = ++observedNames[name];
2895 } 2895 }
2896 2896
2897 void 2897 void
2898 MainWindow::closeEvent(QCloseEvent *e) 2898 MainWindow::closeEvent(QCloseEvent *e)
2899 { 2899 {
2900 std::cerr << "MainWindow::closeEvent" << std::endl; 2900 // std::cerr << "MainWindow::closeEvent" << std::endl;
2901 2901
2902 if (m_openingAudioFile) { 2902 if (m_openingAudioFile) {
2903 std::cerr << "Busy - ignoring close event" << std::endl; 2903 // std::cerr << "Busy - ignoring close event" << std::endl;
2904 e->ignore(); 2904 e->ignore();
2905 return; 2905 return;
2906 } 2906 }
2907 2907
2908 if (!m_abandoning && !checkSaveModified()) { 2908 if (!m_abandoning && !checkSaveModified()) {
2909 std::cerr << "Ignoring close event" << std::endl; 2909 // std::cerr << "Ignoring close event" << std::endl;
2910 e->ignore(); 2910 e->ignore();
2911 return; 2911 return;
2912 } 2912 }
2913 2913
2914 QSettings settings; 2914 QSettings settings;
3795 3795
3796 statusBar()->showMessage(m_myStatusMessage); 3796 statusBar()->showMessage(m_myStatusMessage);
3797 } 3797 }
3798 3798
3799 void 3799 void
3800 MainWindow::globalCentreFrameChanged(unsigned long frame) 3800 MainWindow::globalCentreFrameChanged(unsigned long )
3801 { 3801 {
3802 if ((m_playSource && m_playSource->isPlaying()) || !getMainModel()) return; 3802 if ((m_playSource && m_playSource->isPlaying()) || !getMainModel()) return;
3803 Pane *p = 0; 3803 Pane *p = 0;
3804 if (!m_paneStack || !(p = m_paneStack->getCurrentPane())) return; 3804 if (!m_paneStack || !(p = m_paneStack->getCurrentPane())) return;
3805 if (!p->getFollowGlobalPan()) return; 3805 if (!p->getFollowGlobalPan()) return;
3806 updateVisibleRangeDisplay(p); 3806 updateVisibleRangeDisplay(p);
3807 } 3807 }
3808 3808
3809 void 3809 void
3810 MainWindow::viewCentreFrameChanged(View *v, unsigned long frame) 3810 MainWindow::viewCentreFrameChanged(View *v, unsigned long )
3811 { 3811 {
3812 if ((m_playSource && m_playSource->isPlaying()) || !getMainModel()) return; 3812 if ((m_playSource && m_playSource->isPlaying()) || !getMainModel()) return;
3813 Pane *p = 0; 3813 Pane *p = 0;
3814 if (!m_paneStack || !(p = m_paneStack->getCurrentPane())) return; 3814 if (!m_paneStack || !(p = m_paneStack->getCurrentPane())) return;
3815 if (v == p) updateVisibleRangeDisplay(p); 3815 if (v == p) updateVisibleRangeDisplay(p);
3816 } 3816 }
3817 3817
3818 void 3818 void
3819 MainWindow::viewZoomLevelChanged(View *v, unsigned long zoom, bool locked) 3819 MainWindow::viewZoomLevelChanged(View *v, unsigned long , bool )
3820 { 3820 {
3821 if ((m_playSource && m_playSource->isPlaying()) || !getMainModel()) return; 3821 if ((m_playSource && m_playSource->isPlaying()) || !getMainModel()) return;
3822 Pane *p = 0; 3822 Pane *p = 0;
3823 if (!m_paneStack || !(p = m_paneStack->getCurrentPane())) return; 3823 if (!m_paneStack || !(p = m_paneStack->getCurrentPane())) return;
3824 if (v == p) updateVisibleRangeDisplay(p); 3824 if (v == p) updateVisibleRangeDisplay(p);
3904 (this, tr("Audio processing overload"), 3904 (this, tr("Audio processing overload"),
3905 tr("Audio effects plugin auditioning has been disabled\ndue to a processing overload.")); 3905 tr("Audio effects plugin auditioning has been disabled\ndue to a processing overload."));
3906 } 3906 }
3907 3907
3908 void 3908 void
3909 MainWindow::layerAdded(Layer *layer) 3909 MainWindow::layerAdded(Layer *)
3910 { 3910 {
3911 // std::cerr << "MainWindow::layerAdded(" << layer << ")" << std::endl; 3911 // std::cerr << "MainWindow::layerAdded(" << layer << ")" << std::endl;
3912 // setupExistingLayersMenu(); 3912 // setupExistingLayersMenu();
3913 updateMenuStates(); 3913 updateMenuStates();
3914 } 3914 }
3915 3915
3916 void 3916 void
3917 MainWindow::layerRemoved(Layer *layer) 3917 MainWindow::layerRemoved(Layer *)
3918 { 3918 {
3919 // std::cerr << "MainWindow::layerRemoved(" << layer << ")" << std::endl; 3919 // std::cerr << "MainWindow::layerRemoved(" << layer << ")" << std::endl;
3920 setupExistingLayersMenus(); 3920 setupExistingLayersMenus();
3921 updateMenuStates(); 3921 updateMenuStates();
3922 } 3922 }
4101 message.getArgCount() == 1 && 4101 message.getArgCount() == 1 &&
4102 message.getArg(0).canConvert(QVariant::Int)) { 4102 message.getArg(0).canConvert(QVariant::Int)) {
4103 n = message.getArg(0).toInt() - 1; 4103 n = message.getArg(0).toInt() - 1;
4104 } 4104 }
4105 std::vector<QString> recent = m_recentFiles.getRecent(); 4105 std::vector<QString> recent = m_recentFiles.getRecent();
4106 if (n >= 0 && n < recent.size()) { 4106 if (n >= 0 && n < int(recent.size())) {
4107 if (openSomeFile(recent[n], ReplaceMainModel) != FileOpenSucceeded) { 4107 if (openSomeFile(recent[n], ReplaceMainModel) != FileOpenSucceeded) {
4108 std::cerr << "MainWindow::handleOSCMessage: File open failed for path \"" 4108 std::cerr << "MainWindow::handleOSCMessage: File open failed for path \""
4109 << recent[n].toStdString() << "\"" << std::endl; 4109 << recent[n].toStdString() << "\"" << std::endl;
4110 } 4110 }
4111 } 4111 }
4278 int channel = -1; 4278 int channel = -1;
4279 if (message.getArgCount() == 2 && 4279 if (message.getArgCount() == 2 &&
4280 message.getArg(0).canConvert(QVariant::Int)) { 4280 message.getArg(0).canConvert(QVariant::Int)) {
4281 channel = message.getArg(0).toInt(); 4281 channel = message.getArg(0).toInt();
4282 if (channel < -1 || 4282 if (channel < -1 ||
4283 channel > getMainModel()->getChannelCount()) { 4283 channel > int(getMainModel()->getChannelCount())) {
4284 std::cerr << "WARNING: MainWindow::handleOSCMessage: channel " 4284 std::cerr << "WARNING: MainWindow::handleOSCMessage: channel "
4285 << channel << " out of range" << std::endl; 4285 << channel << " out of range" << std::endl;
4286 channel = -1; 4286 channel = -1;
4287 } 4287 }
4288 } 4288 }