# HG changeset patch
# User Chris Cannam
# Date 1195836503 0
# Node ID 69f83e36b8e59ae243d73b3c7a0b5460ee341b82
# Parent 1fa0d271fd2c0aff6718bd8b6920b26d1bae2b80
* Add Erase tool and mode
* Add icons for Normalize buttons in property boxes, and for Show Peaks
* Add support for velocity in notes -- not yet reflected in display or
editable in the note edit dialog, but they are imported from MIDI,
played, and exported
* Begin work on making pastes align pasted times (subtler than I thought)
diff -r 1fa0d271fd2c -r 69f83e36b8e5 icons/draw.png
Binary file icons/draw.png has changed
diff -r 1fa0d271fd2c -r 69f83e36b8e5 icons/erase.png
Binary file icons/erase.png has changed
diff -r 1fa0d271fd2c -r 69f83e36b8e5 icons/normalise-columns.png
Binary file icons/normalise-columns.png has changed
diff -r 1fa0d271fd2c -r 69f83e36b8e5 icons/normalise.png
Binary file icons/normalise.png has changed
diff -r 1fa0d271fd2c -r 69f83e36b8e5 icons/select.png
Binary file icons/select.png has changed
diff -r 1fa0d271fd2c -r 69f83e36b8e5 icons/show-peaks.png
Binary file icons/show-peaks.png has changed
diff -r 1fa0d271fd2c -r 69f83e36b8e5 main/MainWindow.cpp
--- a/main/MainWindow.cpp Thu Nov 22 14:13:20 2007 +0000
+++ b/main/MainWindow.cpp Fri Nov 23 16:48:23 2007 +0000
@@ -1738,10 +1738,21 @@
m_keyReference->registerShortcut(action);
m_toolActions[ViewManager::DrawMode] = action;
+ action = toolbar->addAction(il.load("erase"),
+ tr("Erase"));
+ action->setCheckable(true);
+ action->setShortcut(tr("5"));
+ action->setStatusTip(tr("Erase items from layer"));
+ connect(action, SIGNAL(triggered()), this, SLOT(toolEraseSelected()));
+ connect(this, SIGNAL(canEditLayer(bool)), action, SLOT(setEnabled(bool)));
+ group->addAction(action);
+ m_keyReference->registerShortcut(action);
+ m_toolActions[ViewManager::EraseMode] = action;
+
action = toolbar->addAction(il.load("measure"),
tr("Measure"));
action->setCheckable(true);
- action->setShortcut(tr("5"));
+ action->setShortcut(tr("6"));
action->setStatusTip(tr("Make measurements in layer"));
connect(action, SIGNAL(triggered()), this, SLOT(toolMeasureSelected()));
connect(this, SIGNAL(canMeasureLayer(bool)), action, SLOT(setEnabled(bool)));
@@ -1749,14 +1760,6 @@
m_keyReference->registerShortcut(action);
m_toolActions[ViewManager::MeasureMode] = action;
-// action = toolbar->addAction(il.load("text"),
-// tr("Text"));
-// action->setCheckable(true);
-// action->setShortcut(tr("5"));
-// connect(action, SIGNAL(triggered()), this, SLOT(toolTextSelected()));
-// group->addAction(action);
-// m_toolActions[ViewManager::TextMode] = action;
-
toolNavigateSelected();
Pane::registerShortcuts(*m_keyReference);
@@ -1899,17 +1902,17 @@
}
void
+MainWindow::toolEraseSelected()
+{
+ m_viewManager->setToolMode(ViewManager::EraseMode);
+}
+
+void
MainWindow::toolMeasureSelected()
{
m_viewManager->setToolMode(ViewManager::MeasureMode);
}
-//void
-//MainWindow::toolTextSelected()
-//{
-// m_viewManager->setToolMode(ViewManager::TextMode);
-//}
-
void
MainWindow::importAudio()
{
@@ -2824,15 +2827,19 @@
if (emptyTypes.find(type) != emptyTypes.end()) {
newLayer = m_document->createEmptyLayer(type);
- m_toolActions[ViewManager::DrawMode]->trigger();
+ if (newLayer) {
+ m_toolActions[ViewManager::DrawMode]->trigger();
+ }
} else {
newLayer = m_document->createMainModelLayer(type);
}
- m_document->addLayerToView(pane, newLayer);
- m_paneStack->setCurrentLayer(pane, newLayer);
+ if (newLayer) {
+ m_document->addLayerToView(pane, newLayer);
+ m_paneStack->setCurrentLayer(pane, newLayer);
+ }
return;
}
diff -r 1fa0d271fd2c -r 69f83e36b8e5 main/MainWindow.h
--- a/main/MainWindow.h Thu Nov 22 14:13:20 2007 +0000
+++ b/main/MainWindow.h Fri Nov 23 16:48:23 2007 +0000
@@ -99,6 +99,7 @@
virtual void toolSelectSelected();
virtual void toolEditSelected();
virtual void toolDrawSelected();
+ virtual void toolEraseSelected();
virtual void toolMeasureSelected();
virtual void documentModified();
diff -r 1fa0d271fd2c -r 69f83e36b8e5 sonic-visualiser.qrc
--- a/sonic-visualiser.qrc Thu Nov 22 14:13:20 2007 +0000
+++ b/sonic-visualiser.qrc Fri Nov 23 16:48:23 2007 +0000
@@ -28,6 +28,7 @@
icons/text.png
icons/draw.png
icons/draw-curve.png
+ icons/erase.png
icons/measure.png
icons/measure1cursor.xbm
icons/measure1mask.xbm
@@ -66,6 +67,9 @@
icons/help.png
icons/emptypage.png
icons/cross.png
+ icons/normalise.png
+ icons/normalise-columns.png
+ icons/show-peaks.png
icons/sv-16x16.png
icons/sv-22x22.png
icons/sv-24x24.png