changeset 151:152619d379e0

* Add a measurement mode tool -- no functionality yet
author Chris Cannam
date Wed, 13 Jun 2007 12:00:01 +0000
parents e2f13213c2f1
children f0c47d8988bc
files icons/measure.png icons/measure1cursor.xbm icons/measure1mask.xbm icons/measure2cursor.xbm icons/measure2mask.xbm main/MainWindow.cpp main/MainWindow.h sonic-visualiser.qrc
diffstat 8 files changed, 81 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
Binary file icons/measure.png has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/icons/measure1cursor.xbm	Wed Jun 13 12:00:01 2007 +0000
@@ -0,0 +1,16 @@
+#define measure1cursor_width 32
+#define measure1cursor_height 32
+#define measure1cursor_x_hot 15
+#define measure1cursor_y_hot 14
+static unsigned char measure1cursor_bits[] = {
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00,
+   0x00, 0xc0, 0x00, 0x00, 0x00, 0xe0, 0x00, 0x00, 0x00, 0xf0, 0x00, 0x00,
+   0x00, 0x98, 0x00, 0x00, 0x00, 0x8c, 0x00, 0x00, 0x00, 0x86, 0x00, 0x00,
+   0x00, 0x83, 0x00, 0x00, 0x80, 0x03, 0x00, 0x00, 0xe0, 0x3f, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/icons/measure1mask.xbm	Wed Jun 13 12:00:01 2007 +0000
@@ -0,0 +1,14 @@
+#define measure1mask_width 32
+#define measure1mask_height 32
+static unsigned char measure1mask_bits[] = {
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x01, 0x00, 0x00, 0xc0, 0x01, 0x00,
+   0x00, 0xe0, 0x01, 0x00, 0x00, 0xf0, 0x01, 0x00, 0x00, 0xf8, 0x01, 0x00,
+   0x00, 0xfc, 0x01, 0x00, 0x00, 0xde, 0x01, 0x00, 0x00, 0xcf, 0x01, 0x00,
+   0x80, 0xc7, 0x01, 0x00, 0xe0, 0x3f, 0x00, 0x00, 0xe0, 0x3f, 0x00, 0x00,
+   0xe0, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/icons/measure2cursor.xbm	Wed Jun 13 12:00:01 2007 +0000
@@ -0,0 +1,16 @@
+#define measure2cursor_width 32
+#define measure2cursor_height 32
+#define measure2cursor_x_hot 16
+#define measure2cursor_y_hot 17
+static unsigned char measure2cursor_bits[] = {
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, 0x07,
+   0x00, 0x00, 0xc0, 0x01, 0x00, 0x00, 0xc1, 0x00, 0x00, 0x00, 0x61, 0x00,
+   0x00, 0x00, 0x31, 0x00, 0x00, 0x00, 0x19, 0x00, 0x00, 0x00, 0x0f, 0x00,
+   0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x01, 0x00,
+   0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/icons/measure2mask.xbm	Wed Jun 13 12:00:01 2007 +0000
@@ -0,0 +1,14 @@
+#define measure2mask_width 32
+#define measure2mask_height 32
+static unsigned char measure2mask_bits[] = {
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, 0x07, 0x00, 0x00, 0xfc, 0x07,
+   0x00, 0x00, 0xfc, 0x07, 0x00, 0x80, 0xe3, 0x01, 0x00, 0x80, 0xf3, 0x00,
+   0x00, 0x80, 0x7b, 0x00, 0x00, 0x80, 0x3f, 0x00, 0x00, 0x80, 0x1f, 0x00,
+   0x00, 0x80, 0x0f, 0x00, 0x00, 0x80, 0x07, 0x00, 0x00, 0x80, 0x03, 0x00,
+   0x00, 0x80, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
--- a/main/MainWindow.cpp	Mon Jun 11 12:14:52 2007 +0000
+++ b/main/MainWindow.cpp	Wed Jun 13 12:00:01 2007 +0000
@@ -1588,6 +1588,15 @@
     group->addAction(action);
     m_toolActions[ViewManager::DrawMode] = action;
 
+    action = toolbar->addAction(QIcon(":/icons/measure.png"),
+				tr("Measure"));
+    action->setCheckable(true);
+    action->setShortcut(tr("5"));
+    action->setStatusTip(tr("Make measurements in layer"));
+    connect(action, SIGNAL(triggered()), this, SLOT(toolMeasureSelected()));
+    group->addAction(action);
+    m_toolActions[ViewManager::MeasureMode] = action;
+
 //    action = toolbar->addAction(QIcon(":/icons/text.png"),
 //				tr("Text"));
 //    action->setCheckable(true);
@@ -1781,6 +1790,12 @@
     m_viewManager->setToolMode(ViewManager::DrawMode);
 }
 
+void
+MainWindow::toolMeasureSelected()
+{
+    m_viewManager->setToolMode(ViewManager::MeasureMode);
+}
+
 //void
 //MainWindow::toolTextSelected()
 //{
--- a/main/MainWindow.h	Mon Jun 11 12:14:52 2007 +0000
+++ b/main/MainWindow.h	Wed Jun 13 12:00:01 2007 +0000
@@ -183,6 +183,7 @@
     void toolSelectSelected();
     void toolEditSelected();
     void toolDrawSelected();
+    void toolMeasureSelected();
 
     void selectAll();
     void selectToStart();
--- a/sonic-visualiser.qrc	Mon Jun 11 12:14:52 2007 +0000
+++ b/sonic-visualiser.qrc	Wed Jun 13 12:00:01 2007 +0000
@@ -25,6 +25,11 @@
     <file>icons/text.png</file>
     <file>icons/draw.png</file>
     <file>icons/draw-curve.png</file>
+    <file>icons/measure.png</file>
+    <file>icons/measure1cursor.xbm</file>
+    <file>icons/measure1mask.xbm</file>
+    <file>icons/measure2cursor.xbm</file>
+    <file>icons/measure2mask.xbm</file>
     <file>icons/move.png</file>
     <file>icons/navigate.png</file>
     <file>icons/zoom.png</file>