Mercurial > hg > sonic-visualiser
comparison main/MainWindow.cpp @ 310:8e750332dc77
* Activity log updates
* Update range lists in play source when a new model is added
* Fill cache with empty background in colour 3d plot
| author | Chris Cannam |
|---|---|
| date | Fri, 27 Feb 2009 13:33:16 +0000 |
| parents | 6a276fea550d |
| children | db14b2b3aedd |
comparison
equal
deleted
inserted
replaced
| 309:6a276fea550d | 310:8e750332dc77 |
|---|---|
| 276 connect(m_viewManager, SIGNAL(activity(QString)), | 276 connect(m_viewManager, SIGNAL(activity(QString)), |
| 277 m_activityLog, SLOT(activityHappened(QString))); | 277 m_activityLog, SLOT(activityHappened(QString))); |
| 278 connect(m_playSource, SIGNAL(activity(QString)), | 278 connect(m_playSource, SIGNAL(activity(QString)), |
| 279 m_activityLog, SLOT(activityHappened(QString))); | 279 m_activityLog, SLOT(activityHappened(QString))); |
| 280 connect(CommandHistory::getInstance(), SIGNAL(activity(QString)), | 280 connect(CommandHistory::getInstance(), SIGNAL(activity(QString)), |
| 281 m_activityLog, SLOT(activityHappened(QString))); | |
| 282 connect(this, SIGNAL(activity(QString)), | |
| 281 m_activityLog, SLOT(activityHappened(QString))); | 283 m_activityLog, SLOT(activityHappened(QString))); |
| 282 connect(this, SIGNAL(replacedDocument()), this, SLOT(documentReplaced())); | 284 connect(this, SIGNAL(replacedDocument()), this, SLOT(documentReplaced())); |
| 283 m_activityLog->hide(); | 285 m_activityLog->hide(); |
| 284 | 286 |
| 285 newSession(); | 287 newSession(); |
| 2180 ok = writer.isOK(); | 2182 ok = writer.isOK(); |
| 2181 error = writer.getError(); | 2183 error = writer.getError(); |
| 2182 } | 2184 } |
| 2183 | 2185 |
| 2184 if (ok) { | 2186 if (ok) { |
| 2185 if (!multiple) { | 2187 if (multiple) { |
| 2188 emit activity(tr("Export multiple audio files")); | |
| 2189 } else { | |
| 2190 emit activity(tr("Export audio to \"%1\"").arg(path)); | |
| 2186 m_recentFiles.addFile(path); | 2191 m_recentFiles.addFile(path); |
| 2187 } | 2192 } |
| 2188 } else { | 2193 } else { |
| 2189 QMessageBox::critical(this, tr("Failed to write file"), error); | 2194 QMessageBox::critical(this, tr("Failed to write file"), error); |
| 2190 } | 2195 } |
| 2310 | 2315 |
| 2311 if (error != "") { | 2316 if (error != "") { |
| 2312 QMessageBox::critical(this, tr("Failed to write file"), error); | 2317 QMessageBox::critical(this, tr("Failed to write file"), error); |
| 2313 } else { | 2318 } else { |
| 2314 m_recentFiles.addFile(path); | 2319 m_recentFiles.addFile(path); |
| 2320 emit activity(tr("Export layer to \"%1\"").arg(path)); | |
| 2315 } | 2321 } |
| 2316 } | 2322 } |
| 2317 | 2323 |
| 2318 void | 2324 void |
| 2319 MainWindow::exportImage() | 2325 MainWindow::exportImage() |
| 2742 .arg(QDateTime::currentDateTime().toString("yyyyMMddhhmmsszzz")); | 2748 .arg(QDateTime::currentDateTime().toString("yyyyMMddhhmmsszzz")); |
| 2743 #endif | 2749 #endif |
| 2744 QString fpath = QDir(svDir).filePath(fname); | 2750 QString fpath = QDir(svDir).filePath(fname); |
| 2745 if (saveSessionFile(fpath)) { | 2751 if (saveSessionFile(fpath)) { |
| 2746 m_recentFiles.addFile(fpath); | 2752 m_recentFiles.addFile(fpath); |
| 2753 emit activity(tr("Export image to \"%1\"").arg(fpath)); | |
| 2747 return true; | 2754 return true; |
| 2748 } else { | 2755 } else { |
| 2749 return false; | 2756 return false; |
| 2750 } | 2757 } |
| 2751 } | 2758 } |
| 2856 .arg(QFileInfo(path).fileName())); | 2863 .arg(QFileInfo(path).fileName())); |
| 2857 m_sessionFile = path; | 2864 m_sessionFile = path; |
| 2858 CommandHistory::getInstance()->documentSaved(); | 2865 CommandHistory::getInstance()->documentSaved(); |
| 2859 documentRestored(); | 2866 documentRestored(); |
| 2860 m_recentFiles.addFile(path); | 2867 m_recentFiles.addFile(path); |
| 2868 emit activity(tr("Save session as \"%1\"").arg(path)); | |
| 2861 } | 2869 } |
| 2862 } | 2870 } |
| 2863 | 2871 |
| 2864 void | 2872 void |
| 2865 MainWindow::preferenceChanged(PropertyContainer::PropertyName name) | 2873 MainWindow::preferenceChanged(PropertyContainer::PropertyName name) |
| 3459 (ev.getMessageType() == MIDIConstants::MIDI_NOTE_ON && | 3467 (ev.getMessageType() == MIDIConstants::MIDI_NOTE_ON && |
| 3460 ev.getVelocity() == 0)); | 3468 ev.getVelocity() == 0)); |
| 3461 | 3469 |
| 3462 if (currentNoteLayer) { | 3470 if (currentNoteLayer) { |
| 3463 | 3471 |
| 3472 if (!m_playSource || !m_playSource->isPlaying()) continue; | |
| 3473 | |
| 3464 if (noteOn) { | 3474 if (noteOn) { |
| 3465 | 3475 |
| 3466 currentNoteLayer->addNoteOn(frame, | 3476 currentNoteLayer->addNoteOn(frame, |
| 3467 ev.getPitch(), | 3477 ev.getPitch(), |
| 3468 ev.getVelocity()); | 3478 ev.getVelocity()); |
| 3478 } | 3488 } |
| 3479 | 3489 |
| 3480 if (currentTimeValueLayer) { | 3490 if (currentTimeValueLayer) { |
| 3481 | 3491 |
| 3482 if (!noteOn) continue; | 3492 if (!noteOn) continue; |
| 3493 | |
| 3494 if (!m_playSource || !m_playSource->isPlaying()) continue; | |
| 3495 | |
| 3483 Model *model = static_cast<Layer *>(currentTimeValueLayer)->getModel(); | 3496 Model *model = static_cast<Layer *>(currentTimeValueLayer)->getModel(); |
| 3484 SparseTimeValueModel *tvm = | 3497 SparseTimeValueModel *tvm = |
| 3485 dynamic_cast<SparseTimeValueModel *>(model); | 3498 dynamic_cast<SparseTimeValueModel *>(model); |
| 3486 if (tvm) { | 3499 if (tvm) { |
| 3487 SparseTimeValueModel::Point point(frame, ev.getPitch() % 12, ""); | 3500 SparseTimeValueModel::Point point(frame, ev.getPitch() % 12, ""); |
