Mercurial > hg > sonic-visualiser
comparison main/MainWindow.cpp @ 291:f262f283a655
* Permit viewing (though not editing) colour 3d plot layer data in
the spreadsheet data viewer dialog
* Add somewhat simplistic RDF export for layers
* Fix display of peak frequencies in spectrum layer
* Fix (I hope) sizing of plugin parameter dialog
author | Chris Cannam |
---|---|
date | Tue, 02 Dec 2008 17:17:25 +0000 |
parents | 8e13520c9078 |
children | 975f6b6c414c |
comparison
equal
deleted
inserted
replaced
290:8e13520c9078 | 291:f262f283a655 |
---|---|
70 #include "base/Profiler.h" | 70 #include "base/Profiler.h" |
71 #include "base/Clipboard.h" | 71 #include "base/Clipboard.h" |
72 #include "base/UnitDatabase.h" | 72 #include "base/UnitDatabase.h" |
73 #include "layer/ColourDatabase.h" | 73 #include "layer/ColourDatabase.h" |
74 #include "widgets/ModelDataTableDialog.h" | 74 #include "widgets/ModelDataTableDialog.h" |
75 | |
76 #include "rdf/PluginRDFIndexer.h" | 75 #include "rdf/PluginRDFIndexer.h" |
76 #include "rdf/RDFExporter.h" | |
77 | 77 |
78 // For version information | 78 // For version information |
79 #include <vamp/vamp.h> | 79 #include <vamp/vamp.h> |
80 #include <vamp-hostsdk/PluginBase.h> | 80 #include <vamp-hostsdk/PluginBase.h> |
81 #include "plugin/api/ladspa.h" | 81 #include "plugin/api/ladspa.h" |
1193 | 1193 |
1194 QAction *eaction = new QAction(tr("Edit Layer Data"), this); | 1194 QAction *eaction = new QAction(tr("Edit Layer Data"), this); |
1195 eaction->setShortcut(tr("E")); | 1195 eaction->setShortcut(tr("E")); |
1196 eaction->setStatusTip(tr("Edit the currently active layer as a data grid")); | 1196 eaction->setStatusTip(tr("Edit the currently active layer as a data grid")); |
1197 connect(eaction, SIGNAL(triggered()), this, SLOT(editCurrentLayer())); | 1197 connect(eaction, SIGNAL(triggered()), this, SLOT(editCurrentLayer())); |
1198 connect(this, SIGNAL(canEditLayer(bool)), eaction, SLOT(setEnabled(bool))); | 1198 connect(this, SIGNAL(canEditLayerTabular(bool)), eaction, SLOT(setEnabled(bool))); |
1199 menu->addAction(eaction); | 1199 menu->addAction(eaction); |
1200 m_rightButtonLayerMenu->addAction(eaction); | 1200 m_rightButtonLayerMenu->addAction(eaction); |
1201 | 1201 |
1202 action = new QAction(il.load("editdelete"), tr("&Delete Layer"), this); | 1202 action = new QAction(il.load("editdelete"), tr("&Delete Layer"), this); |
1203 action->setShortcut(tr("Ctrl+D")); | 1203 action->setShortcut(tr("Ctrl+D")); |
2248 if (!writer.isOK()) { | 2248 if (!writer.isOK()) { |
2249 error = writer.getError(); | 2249 error = writer.getError(); |
2250 } | 2250 } |
2251 } | 2251 } |
2252 | 2252 |
2253 } else if (suffix == "ttl" || suffix == "n3") { | |
2254 | |
2255 RDFExporter exporter(path, model); | |
2256 exporter.write(); | |
2257 if (!exporter.isOK()) { | |
2258 error = exporter.getError(); | |
2259 } | |
2260 | |
2253 } else { | 2261 } else { |
2254 | 2262 |
2255 CSVFileWriter writer(path, model, | 2263 CSVFileWriter writer(path, model, |
2256 ((suffix == "csv") ? "," : "\t")); | 2264 ((suffix == "csv") ? "," : "\t")); |
2257 writer.write(); | 2265 writer.write(); |
2722 bool | 2730 bool |
2723 MainWindow::shouldCreateNewSessionForRDFAudio() | 2731 MainWindow::shouldCreateNewSessionForRDFAudio() |
2724 { | 2732 { |
2725 QMessageBox mb; | 2733 QMessageBox mb; |
2726 mb.setWindowTitle("Open as new session?"); | 2734 mb.setWindowTitle("Open as new session?"); |
2727 mb.setText("<b>RDF refers to audio files</b><p>This RDF document refers to one or more audio files.<br>Do you want to load it as a new session, or as a set of additional panes in the existing session?"); | 2735 mb.setText("<b>RDF refers to audio files</b><p>This RDF document refers to one or more audio files.<br>Do you want to start a new session for it?"); |
2728 QPushButton *a = mb.addButton(tr("Create new session"), QMessageBox::AcceptRole); | 2736 QPushButton *a = mb.addButton(tr("Create new session"), QMessageBox::AcceptRole); |
2729 QPushButton *b = mb.addButton(tr("Add to current session"), QMessageBox::RejectRole); | 2737 QPushButton *b = mb.addButton(tr("Add to current session"), QMessageBox::RejectRole); |
2730 mb.setDefaultButton(a); | 2738 mb.setDefaultButton(a); |
2731 mb.exec(); | 2739 mb.exec(); |
2732 if (mb.clickedButton() == a) { | 2740 if (mb.clickedButton() == a) { |