Mercurial > hg > sonic-visualiser
comparison main/MainWindow.cpp @ 340:3211f8cef51a sv-v1.7.1
* Layer data editor window: fix sorting for columns in region model,
add Find feature
* RDF import: assign names to layers based on event types, if no suitable
labels are found in the RDF
* Add label to status bar showing the last text that was passed in current
layer (so e.g. counting 1, 2, 3, 4 if that's what beats are labelled)
* Better layout of text labels for region layers in segmentation mode when
they are close together
* Give text layer the same method for finding "nearest point" as region and
note layers, should improve its editability
author | Chris Cannam |
---|---|
date | Thu, 22 Oct 2009 15:54:21 +0000 |
parents | 33ae130b951f |
children | 1fc7ee4ff506 |
comparison
equal
deleted
inserted
replaced
339:e91910707283 | 340:3211f8cef51a |
---|---|
35 #include "layer/NoteLayer.h" | 35 #include "layer/NoteLayer.h" |
36 #include "layer/Colour3DPlotLayer.h" | 36 #include "layer/Colour3DPlotLayer.h" |
37 #include "layer/SliceLayer.h" | 37 #include "layer/SliceLayer.h" |
38 #include "layer/SliceableLayer.h" | 38 #include "layer/SliceableLayer.h" |
39 #include "layer/ImageLayer.h" | 39 #include "layer/ImageLayer.h" |
40 #include "layer/RegionLayer.h" | |
40 #include "widgets/Fader.h" | 41 #include "widgets/Fader.h" |
41 #include "view/Overview.h" | 42 #include "view/Overview.h" |
42 #include "widgets/PropertyBox.h" | 43 #include "widgets/PropertyBox.h" |
43 #include "widgets/PropertyStack.h" | 44 #include "widgets/PropertyStack.h" |
44 #include "widgets/AudioDial.h" | 45 #include "widgets/AudioDial.h" |
275 setupMenus(); | 276 setupMenus(); |
276 setupToolbars(); | 277 setupToolbars(); |
277 setupHelpMenu(); | 278 setupHelpMenu(); |
278 | 279 |
279 statusBar(); | 280 statusBar(); |
281 m_currentLabel = new QLabel; | |
282 statusBar()->addPermanentWidget(m_currentLabel); | |
280 | 283 |
281 connect(m_viewManager, SIGNAL(activity(QString)), | 284 connect(m_viewManager, SIGNAL(activity(QString)), |
282 m_activityLog, SLOT(activityHappened(QString))); | 285 m_activityLog, SLOT(activityHappened(QString))); |
283 connect(m_playSource, SIGNAL(activity(QString)), | 286 connect(m_playSource, SIGNAL(activity(QString)), |
284 m_activityLog, SLOT(activityHappened(QString))); | 287 m_activityLog, SLOT(activityHappened(QString))); |
3489 m_myStatusMessage = tr("Visible: %1 to %2 (duration %3)") | 3492 m_myStatusMessage = tr("Visible: %1 to %2 (duration %3)") |
3490 .arg(startStr).arg(endStr).arg(durationStr); | 3493 .arg(startStr).arg(endStr).arg(durationStr); |
3491 } | 3494 } |
3492 | 3495 |
3493 statusBar()->showMessage(m_myStatusMessage); | 3496 statusBar()->showMessage(m_myStatusMessage); |
3497 | |
3498 updatePositionStatusDisplays(); | |
3499 } | |
3500 | |
3501 void | |
3502 MainWindow::updatePositionStatusDisplays() const | |
3503 { | |
3504 if (!statusBar()->isVisible()) return; | |
3505 | |
3506 Pane *pane = 0; | |
3507 size_t frame = m_viewManager->getPlaybackFrame(); | |
3508 | |
3509 if (m_paneStack) pane = m_paneStack->getCurrentPane(); | |
3510 if (!pane) return; | |
3511 | |
3512 int layers = pane->getLayerCount(); | |
3513 if (layers == 0) m_currentLabel->setText(""); | |
3514 | |
3515 for (int i = layers-1; i >= 0; --i) { | |
3516 Layer *layer = pane->getLayer(i); | |
3517 if (!layer) continue; | |
3518 if (!layer->isLayerEditable()) continue; | |
3519 QString label = layer->getLabelPreceding | |
3520 (pane->alignFromReference(frame)); | |
3521 m_currentLabel->setText(label); | |
3522 break; | |
3523 } | |
3494 } | 3524 } |
3495 | 3525 |
3496 void | 3526 void |
3497 MainWindow::outputLevelsChanged(float left, float right) | 3527 MainWindow::outputLevelsChanged(float left, float right) |
3498 { | 3528 { |