Revision 0:abed8a293168
| main/MainWindow.cpp | ||
|---|---|---|
| 67 | 67 |
#include "base/UnitDatabase.h" |
| 68 | 68 |
#include "layer/ColourDatabase.h" |
| 69 | 69 |
#include "data/osc/OSCQueue.h" |
| 70 |
#include "rdf/PluginRDFDescription.h" |
|
| 71 | 70 |
|
| 72 | 71 |
//!!! |
| 73 | 72 |
#include "data/model/AggregateWaveModel.h" |
| ... | ... | |
| 123 | 122 |
m_recentFilesMenu(0), |
| 124 | 123 |
m_rightButtonMenu(0), |
| 125 | 124 |
m_rightButtonPlaybackMenu(0), |
| 126 |
m_segmentersMenu(0), |
|
| 127 | 125 |
m_deleteSelectedAction(0), |
| 128 | 126 |
m_ffwdAction(0), |
| 129 | 127 |
m_rwdAction(0), |
| ... | ... | |
| 132 | 130 |
m_keyReference(new KeyReference()), |
| 133 | 131 |
m_displayMode(WaveformMode) |
| 134 | 132 |
{
|
| 135 |
setWindowTitle(QApplication::applicationName());
|
|
| 133 |
setWindowTitle(tr("Vect"));
|
|
| 136 | 134 |
|
| 137 | 135 |
StorageAdviser::setFixedRecommendation |
| 138 | 136 |
(StorageAdviser::Recommendation(StorageAdviser::UseDisc | |
| ... | ... | |
| 167 | 165 |
|
| 168 | 166 |
settings.setValue("waveform",
|
| 169 | 167 |
QString("<layer scale=\"%1\" channelMode=\"%2\"/>")
|
| 170 |
// .arg(int(WaveformLayer::MeterScale))
|
|
| 171 |
.arg(int(WaveformLayer::LinearScale)) |
|
| 168 |
.arg(int(WaveformLayer::MeterScale)) |
|
| 169 |
// .arg(int(WaveformLayer::LinearScale))
|
|
| 172 | 170 |
.arg(int(WaveformLayer::MergeChannels))); |
| 173 | 171 |
|
| 174 | 172 |
settings.setValue("timevalues",
|
| 175 | 173 |
QString("<layer plotStyle=\"%1\"/>")
|
| 176 |
// .arg(int(TimeValueLayer::PlotStems))); |
|
| 177 |
.arg(int(TimeValueLayer::PlotCurve))); |
|
| 174 |
.arg(int(TimeValueLayer::PlotStems))); |
|
| 178 | 175 |
|
| 179 | 176 |
settings.setValue("spectrogram",
|
| 180 | 177 |
QString("<layer channel=\"-1\" windowSize=\"2048\" windowHopLevel=\"2\"/>"));
|
| ... | ... | |
| 188 | 185 |
settings.setValue("showstatusbar", false);
|
| 189 | 186 |
settings.endGroup(); |
| 190 | 187 |
|
| 191 |
// m_viewManager->setAlignMode(true);
|
|
| 192 |
// m_viewManager->setPlaySoloMode(true);
|
|
| 188 |
m_viewManager->setAlignMode(true); |
|
| 189 |
m_viewManager->setPlaySoloMode(true); |
|
| 193 | 190 |
m_viewManager->setToolMode(ViewManager::NavigateMode); |
| 194 | 191 |
m_viewManager->setZoomWheelsEnabled(false); |
| 195 | 192 |
m_viewManager->setIlluminateLocalFeatures(false); |
| ... | ... | |
| 322 | 319 |
|
| 323 | 320 |
frame->setLayout(layout); |
| 324 | 321 |
|
| 325 |
findSegmentationTransforms(); |
|
| 326 |
|
|
| 327 | 322 |
setupMenus(); |
| 328 | 323 |
setupToolbars(); |
| 329 | 324 |
setupHelpMenu(); |
| ... | ... | |
| 364 | 359 |
setupFileMenu(); |
| 365 | 360 |
// setupEditMenu(); |
| 366 | 361 |
setupViewMenu(); |
| 367 |
setupSegmentersMenu(); |
|
| 368 | 362 |
|
| 369 | 363 |
m_mainMenusCreated = true; |
| 370 | 364 |
} |
| ... | ... | |
| 426 | 420 |
menu->addSeparator(); |
| 427 | 421 |
action = new QAction(il.load("exit"), tr("&Quit"), this);
|
| 428 | 422 |
action->setShortcut(tr("Ctrl+Q"));
|
| 429 |
action->setStatusTip(tr("Exit %1").arg(QApplication::applicationName()));
|
|
| 423 |
action->setStatusTip(tr("Exit Vect"));
|
|
| 430 | 424 |
connect(action, SIGNAL(triggered()), this, SLOT(close())); |
| 431 | 425 |
m_keyReference->registerShortcut(action); |
| 432 | 426 |
menu->addAction(action); |
| ... | ... | |
| 617 | 611 |
} |
| 618 | 612 |
|
| 619 | 613 |
void |
| 620 |
MainWindow::setupSegmentersMenu() |
|
| 621 |
{
|
|
| 622 |
if (m_segmentersMenu) {
|
|
| 623 |
m_segmenterActions.clear(); |
|
| 624 |
m_segmentersMenu->clear(); |
|
| 625 |
} else {
|
|
| 626 |
m_segmentersMenu = menuBar()->addMenu(tr("&Segmenters"));
|
|
| 627 |
m_segmentersMenu->setTearOffEnabled(true); |
|
| 628 |
m_segmentersMenu->setSeparatorsCollapsible(true); |
|
| 629 |
} |
|
| 630 |
|
|
| 631 |
std::set<QString> seenNames, duplicateNames, seenPluginNames, duplicatePluginNames; |
|
| 632 |
for (unsigned int i = 0; i < m_segmentationTransforms.size(); ++i) {
|
|
| 633 |
QString name = m_segmentationTransforms[i].name; |
|
| 634 |
QString pluginName = name.section(": ", 0, 0);
|
|
| 635 |
if (seenNames.find(name) != seenNames.end()) {
|
|
| 636 |
duplicateNames.insert(name); |
|
| 637 |
} else {
|
|
| 638 |
seenNames.insert(name); |
|
| 639 |
} |
|
| 640 |
if (seenPluginNames.find(pluginName) != seenPluginNames.end()) {
|
|
| 641 |
duplicatePluginNames.insert(pluginName); |
|
| 642 |
} else {
|
|
| 643 |
seenPluginNames.insert(pluginName); |
|
| 644 |
} |
|
| 645 |
} |
|
| 646 |
|
|
| 647 |
for (unsigned int i = 0; i < m_segmentationTransforms.size(); ++i) {
|
|
| 648 |
|
|
| 649 |
QString name = m_segmentationTransforms[i].name; |
|
| 650 |
if (name == "") name = m_segmentationTransforms[i].identifier; |
|
| 651 |
|
|
| 652 |
QString maker = m_segmentationTransforms[i].maker; |
|
| 653 |
if (maker == "") maker = tr("Unknown");
|
|
| 654 |
maker.replace(QRegExp(tr(" [\\(<].*$")), "");
|
|
| 655 |
|
|
| 656 |
QString pluginName = name.section(": ", 0, 0);
|
|
| 657 |
QString output = name.section(": ", 1);
|
|
| 658 |
|
|
| 659 |
if (duplicateNames.find(pluginName) != duplicateNames.end()) {
|
|
| 660 |
pluginName = QString("%1 <%2>")
|
|
| 661 |
.arg(pluginName) |
|
| 662 |
.arg(m_segmentationTransforms[i].identifier.section(':', 1, 1));
|
|
| 663 |
if (output == "") {
|
|
| 664 |
name = pluginName; |
|
| 665 |
} else {
|
|
| 666 |
name = QString("%1: %2")
|
|
| 667 |
.arg(pluginName) |
|
| 668 |
.arg(output); |
|
| 669 |
} |
|
| 670 |
} else if (duplicatePluginNames.find(pluginName) == |
|
| 671 |
duplicatePluginNames.end()) {
|
|
| 672 |
name = pluginName; |
|
| 673 |
} |
|
| 674 |
|
|
| 675 |
QAction *action = new QAction(tr("%1...").arg(name), this);
|
|
| 676 |
connect(action, SIGNAL(triggered()), this, SLOT(addSegmentation())); |
|
| 677 |
m_segmenterActions[action] = m_segmentationTransforms[i].identifier; |
|
| 678 |
connect(this, SIGNAL(canAddLayer(bool)), action, SLOT(setEnabled(bool))); |
|
| 679 |
action->setStatusTip(m_segmentationTransforms[i].longDescription); |
|
| 680 |
|
|
| 681 |
m_segmentersMenu->addAction(action); |
|
| 682 |
} |
|
| 683 |
} |
|
| 684 |
|
|
| 685 |
void |
|
| 686 | 614 |
MainWindow::setupHelpMenu() |
| 687 | 615 |
{
|
| 688 | 616 |
QMenu *menu = menuBar()->addMenu(tr("&Help"));
|
| ... | ... | |
| 1000 | 928 |
createDocument(); |
| 1001 | 929 |
m_document->setAutoAlignment(true); |
| 1002 | 930 |
|
| 1003 |
Pane *pane; |
|
| 1004 |
Layer *waveform; |
|
| 931 |
Pane *pane = m_paneStack->addPane(); |
|
| 1005 | 932 |
|
| 1006 |
for (int i = 0; i < 2; ++i) {
|
|
| 1007 |
pane = m_paneStack->addPane(); |
|
| 1008 |
pane->setFollowGlobalPan(false); |
|
| 1009 |
connect(pane, SIGNAL(contextHelpChanged(const QString &)), |
|
| 1010 |
this, SLOT(contextHelpChanged(const QString &))); |
|
| 1011 |
waveform = m_document->createMainModelLayer(LayerFactory::Waveform); |
|
| 1012 |
m_document->addLayerToView(pane, waveform); |
|
| 1013 |
m_overview->registerView(pane); |
|
| 1014 |
} |
|
| 933 |
connect(pane, SIGNAL(contextHelpChanged(const QString &)), |
|
| 934 |
this, SLOT(contextHelpChanged(const QString &))); |
|
| 935 |
|
|
| 936 |
Layer *waveform = m_document->createMainModelLayer(LayerFactory::Waveform); |
|
| 937 |
m_document->addLayerToView(pane, waveform); |
|
| 938 |
|
|
| 939 |
m_overview->registerView(pane); |
|
| 1015 | 940 |
|
| 1016 | 941 |
CommandHistory::getInstance()->clear(); |
| 1017 | 942 |
CommandHistory::getInstance()->documentSaved(); |
| ... | ... | |
| 1057 | 982 |
m_timeRulerLayer = 0; // document owned this |
| 1058 | 983 |
|
| 1059 | 984 |
m_sessionFile = ""; |
| 1060 |
setWindowTitle(QApplication::applicationName());
|
|
| 985 |
setWindowTitle(tr("Vect"));
|
|
| 1061 | 986 |
|
| 1062 | 987 |
CommandHistory::getInstance()->clear(); |
| 1063 | 988 |
CommandHistory::getInstance()->documentSaved(); |
| ... | ... | |
| 1148 | 1073 |
} |
| 1149 | 1074 |
} |
| 1150 | 1075 |
|
| 1151 |
bool
|
|
| 1076 |
Model *
|
|
| 1152 | 1077 |
MainWindow::selectExistingModeLayer(Pane *pane, QString name) |
| 1153 | 1078 |
{
|
| 1154 |
// return false if we do not need to go on and create a new layer |
|
| 1155 |
// -- either because a suitable hidden one has been dredged up, or |
|
| 1156 |
// because no layer that needed replacing was found in this pane |
|
| 1079 |
Model *model = 0; |
|
| 1157 | 1080 |
|
| 1158 |
if (!m_document) return false; |
|
| 1159 |
|
|
| 1160 |
bool required = false; |
|
| 1081 |
bool have = false; |
|
| 1161 | 1082 |
|
| 1162 | 1083 |
for (int i = 0; i < pane->getLayerCount(); ++i) {
|
| 1163 | 1084 |
|
| ... | ... | |
| 1166 | 1087 |
|
| 1167 | 1088 |
Model *lm = layer->getModel(); |
| 1168 | 1089 |
while (lm && lm->getSourceModel()) lm = lm->getSourceModel(); |
| 1169 |
if (dynamic_cast<WaveFileModel *>(lm)) {
|
|
| 1170 |
if (lm == m_document->getMainModel()) {
|
|
| 1171 |
required = true; |
|
| 1172 |
break; |
|
| 1173 |
} |
|
| 1174 |
} |
|
| 1175 |
} |
|
| 1176 |
|
|
| 1177 |
if (!required) return false; |
|
| 1178 |
|
|
| 1179 |
for (int i = 0; i < pane->getLayerCount(); ++i) {
|
|
| 1180 |
|
|
| 1181 |
Layer *layer = pane->getLayer(i); |
|
| 1182 |
if (!layer) continue; |
|
| 1090 |
if (dynamic_cast<WaveFileModel *>(lm)) model = lm; |
|
| 1183 | 1091 |
|
| 1184 | 1092 |
QString ln = layer->objectName(); |
| 1185 | 1093 |
if (ln != name) {
|
| ... | ... | |
| 1187 | 1095 |
m_document->removeLayerFromView(pane, layer); |
| 1188 | 1096 |
continue; |
| 1189 | 1097 |
} |
| 1098 |
|
|
| 1099 |
have = true; |
|
| 1190 | 1100 |
} |
| 1101 |
|
|
| 1102 |
if (have) return 0; |
|
| 1191 | 1103 |
|
| 1192 | 1104 |
LayerSet &ls = m_hiddenLayers[pane]; |
| 1193 | 1105 |
bool found = false; |
| ... | ... | |
| 1200 | 1112 |
} |
| 1201 | 1113 |
} |
| 1202 | 1114 |
|
| 1203 |
return !found; |
|
| 1204 |
} |
|
| 1115 |
if (found) return 0; |
|
| 1205 | 1116 |
|
| 1206 |
void |
|
| 1207 |
MainWindow::addSegmentation() |
|
| 1208 |
{
|
|
| 1209 |
QObject *s = sender(); |
|
| 1210 |
QAction *action = dynamic_cast<QAction *>(s); |
|
| 1211 |
|
|
| 1212 |
if (!action) {
|
|
| 1213 |
std::cerr << "WARNING: MainWindow::addSegmentation: sender is not an action" |
|
| 1214 |
<< std::endl; |
|
| 1215 |
return; |
|
| 1216 |
} |
|
| 1217 |
|
|
| 1218 |
TransformActionMap::iterator i = m_segmenterActions.find(action); |
|
| 1219 |
if (i == m_segmenterActions.end()) return; |
|
| 1220 |
|
|
| 1221 |
// We always ask for configuration, even if the plugin isn't |
|
| 1222 |
// supposed to be configurable, because we need to let the user |
|
| 1223 |
// change the execution context (block size etc). |
|
| 1224 |
|
|
| 1225 |
QString transformId = i->second; |
|
| 1226 |
|
|
| 1227 |
Transform transform = TransformFactory::getInstance()-> |
|
| 1228 |
getDefaultTransformFor(transformId); |
|
| 1229 |
|
|
| 1230 |
Model *defaultInputModel = m_document->getMainModel(); |
|
| 1231 |
std::vector<Model *> candidateInputModels; |
|
| 1232 |
candidateInputModels.push_back(defaultInputModel); |
|
| 1233 |
|
|
| 1234 |
ModelTransformer::Input input = ModelTransformerFactory::getInstance()-> |
|
| 1235 |
getConfigurationForTransform |
|
| 1236 |
(transform, |
|
| 1237 |
candidateInputModels, |
|
| 1238 |
defaultInputModel, |
|
| 1239 |
m_playSource, |
|
| 1240 |
0, |
|
| 1241 |
0); |
|
| 1242 |
|
|
| 1243 |
if (!input.getModel()) return; |
|
| 1244 |
|
|
| 1245 |
// std::cerr << "MainWindow::addLayer: Input model is " << input.getModel() << " \"" << input.getModel()->objectName().toStdString() << "\"" << std::endl << "transform:" << std::endl << transform.toXmlString().toStdString() << std::endl; |
|
| 1246 |
|
|
| 1247 |
Layer *newLayer = m_document->createDerivedLayer(transform, input); |
|
| 1248 |
|
|
| 1249 |
if (newLayer) {
|
|
| 1250 |
|
|
| 1251 |
// Set the source model to NULL to avoid us treating it as a |
|
| 1252 |
// different visualisation for the main model and replacing it |
|
| 1253 |
// when one of the visualisation mode toggles is activated |
|
| 1254 |
newLayer->getModel()->setSourceModel(0); |
|
| 1255 |
m_document->setChannel(newLayer, input.getChannel()); |
|
| 1256 |
|
|
| 1257 |
Pane *pane = m_paneStack->insertPane(0); |
|
| 1258 |
m_document->addLayerToView(pane, newLayer); |
|
| 1259 |
|
|
| 1260 |
pane = m_paneStack->insertPane(m_paneStack->getPaneCount()); |
|
| 1261 |
m_document->addLayerToView(pane, newLayer); |
|
| 1262 |
} |
|
| 1263 |
|
|
| 1264 |
updateMenuStates(); |
|
| 1265 |
} |
|
| 1266 |
|
|
| 1267 |
void |
|
| 1268 |
MainWindow::findSegmentationTransforms() |
|
| 1269 |
{
|
|
| 1270 |
m_segmentationTransforms.clear(); |
|
| 1271 |
TransformList all = |
|
| 1272 |
TransformFactory::getInstance()->getAllTransformDescriptions(); |
|
| 1273 |
for (TransformList::iterator i = all.begin(); i != all.end(); ++i) {
|
|
| 1274 |
if (i->type != Transform::FeatureExtraction) continue; |
|
| 1275 |
Transform t; |
|
| 1276 |
t.setIdentifier(i->identifier); |
|
| 1277 |
QString pluginId = t.getPluginIdentifier(); |
|
| 1278 |
QString outputId = t.getOutput(); |
|
| 1279 |
PluginRDFDescription desc(pluginId); |
|
| 1280 |
if (!desc.haveDescription()) continue; |
|
| 1281 |
QString feature = desc.getOutputEventTypeURI(outputId); |
|
| 1282 |
if (feature == "") continue; |
|
| 1283 |
std::cerr << "Feature: " << feature.toStdString() << std::endl; |
|
| 1284 |
//!!! This is grotesque |
|
| 1285 |
if (feature.endsWith("Segment") || feature.endsWith("Change")) {
|
|
| 1286 |
m_segmentationTransforms.push_back(*i); |
|
| 1287 |
} |
|
| 1288 |
} |
|
| 1289 |
std::cerr << "MainWindow::findSegmentationTransforms: Found " |
|
| 1290 |
<< m_segmentationTransforms.size() << " transforms" << std::endl; |
|
| 1117 |
return model; |
|
| 1291 | 1118 |
} |
| 1292 | 1119 |
|
| 1293 | 1120 |
void |
| ... | ... | |
| 1300 | 1127 |
Pane *pane = m_paneStack->getPane(i); |
| 1301 | 1128 |
if (!pane) continue; |
| 1302 | 1129 |
|
| 1303 |
if (!selectExistingModeLayer(pane, name)) continue; |
|
| 1304 |
Model *model = m_document->getMainModel(); |
|
| 1130 |
Model *model = selectExistingModeLayer(pane, name); |
|
| 1305 | 1131 |
if (!model) continue; |
| 1306 | 1132 |
|
| 1307 | 1133 |
TransformId id = "vamp:qm-vamp-plugins:qm-onsetdetector:detection_fn"; |
| ... | ... | |
| 1319 | 1145 |
|
| 1320 | 1146 |
//!!! no equivalent for this yet context.updates = false; |
| 1321 | 1147 |
|
| 1322 |
Layer *newLayer = m_document->createDerivedLayer |
|
| 1323 |
(transform, model); |
|
| 1148 |
Layer *newLayer = m_document->createDerivedLayer(transform, model); |
|
| 1324 | 1149 |
|
| 1325 | 1150 |
if (newLayer) {
|
| 1326 | 1151 |
newLayer->setObjectName(name); |
| ... | ... | |
| 1329 | 1154 |
} |
| 1330 | 1155 |
|
| 1331 | 1156 |
} else {
|
| 1332 |
std::cerr << "No QM onset detector plugin available" << std::endl;
|
|
| 1157 |
std::cerr << "No Aubio onset detector plugin available" << std::endl;
|
|
| 1333 | 1158 |
} |
| 1334 | 1159 |
} |
| 1335 | 1160 |
|
| ... | ... | |
| 1346 | 1171 |
Pane *pane = m_paneStack->getPane(i); |
| 1347 | 1172 |
if (!pane) continue; |
| 1348 | 1173 |
|
| 1349 |
if (!selectExistingModeLayer(pane, name)) continue; |
|
| 1350 |
Model *model = m_document->getMainModel(); |
|
| 1174 |
Model *model = selectExistingModeLayer(pane, name); |
|
| 1351 | 1175 |
if (!model) continue; |
| 1352 | 1176 |
|
| 1353 | 1177 |
Layer *newLayer = m_document->createLayer(LayerFactory::Waveform); |
| ... | ... | |
| 1370 | 1194 |
Pane *pane = m_paneStack->getPane(i); |
| 1371 | 1195 |
if (!pane) continue; |
| 1372 | 1196 |
|
| 1373 |
if (!selectExistingModeLayer(pane, name)) continue; |
|
| 1374 |
Model *model = m_document->getMainModel(); |
|
| 1197 |
Model *model = selectExistingModeLayer(pane, name); |
|
| 1375 | 1198 |
if (!model) continue; |
| 1376 | 1199 |
|
| 1377 | 1200 |
Layer *newLayer = m_document->createLayer(LayerFactory::Spectrogram); |
| ... | ... | |
| 1394 | 1217 |
Pane *pane = m_paneStack->getPane(i); |
| 1395 | 1218 |
if (!pane) continue; |
| 1396 | 1219 |
|
| 1397 |
if (!selectExistingModeLayer(pane, name)) continue; |
|
| 1398 |
Model *model = m_document->getMainModel(); |
|
| 1220 |
Model *model = selectExistingModeLayer(pane, name); |
|
| 1399 | 1221 |
if (!model) continue; |
| 1400 | 1222 |
|
| 1401 | 1223 |
Layer *newLayer = m_document->createLayer |
| ... | ... | |
| 1878 | 1700 |
void |
| 1879 | 1701 |
MainWindow::layerInAView(Layer *layer, bool inAView) |
| 1880 | 1702 |
{
|
| 1881 |
// std::cerr << "MainWindow::layerInAView(" << layer << "," << inAView << ")" << std::endl;
|
|
| 1882 |
|
|
| 1883 |
if (!inAView) removeLayerEditDialog(layer); |
|
| 1884 |
|
|
| 1885 |
// Check whether we need to add or remove model from play source |
|
| 1886 |
Model *model = layer->getModel(); |
|
| 1887 |
if (model) {
|
|
| 1888 |
Model *source = model->getSourceModel(); |
|
| 1889 |
if (inAView) {
|
|
| 1890 |
m_playSource->addModel(model); |
|
| 1891 |
if (source && source != model) {
|
|
| 1892 |
m_playSource->addModel(source); |
|
| 1893 |
} |
|
| 1894 |
} else {
|
|
| 1895 |
bool found = false; |
|
| 1896 |
for (int i = 0; i < m_paneStack->getPaneCount(); ++i) {
|
|
| 1897 |
Pane *pane = m_paneStack->getPane(i); |
|
| 1898 |
if (!pane) continue; |
|
| 1899 |
for (int j = 0; j < pane->getLayerCount(); ++j) {
|
|
| 1900 |
Layer *pl = pane->getLayer(j); |
|
| 1901 |
if (pl && (pl->getModel() == model || |
|
| 1902 |
pl->getModel() == source)) {
|
|
| 1903 |
found = true; |
|
| 1904 |
break; |
|
| 1905 |
} |
|
| 1906 |
} |
|
| 1907 |
if (found) break; |
|
| 1908 |
} |
|
| 1909 |
if (!found) {
|
|
| 1910 |
m_playSource->removeModel(model); |
|
| 1911 |
if (source && source != model) {
|
|
| 1912 |
m_playSource->removeModel(source); |
|
| 1913 |
} |
|
| 1914 |
} |
|
| 1915 |
} |
|
| 1916 |
} |
|
| 1917 |
|
|
| 1918 |
updateMenuStates(); |
|
| 1703 |
MainWindowBase::layerInAView(layer, inAView); |
|
| 1919 | 1704 |
} |
| 1920 | 1705 |
|
| 1921 | 1706 |
void |
| main/MainWindow.h | ||
|---|---|---|
| 29 | 29 |
#include "base/RecentFiles.h" |
| 30 | 30 |
#include "layer/LayerFactory.h" |
| 31 | 31 |
#include "transform/Transform.h" |
| 32 |
#include "transform/TransformDescription.h" |
|
| 33 | 32 |
#include "framework/SVFileReader.h" |
| 34 |
#include "data/fileio/FileFinder.h"
|
|
| 33 |
#include "widgets/FileFinder.h"
|
|
| 35 | 34 |
#include <map> |
| 36 | 35 |
|
| 37 | 36 |
class Document; |
| ... | ... | |
| 132 | 131 |
|
| 133 | 132 |
virtual void setupRecentFilesMenu(); |
| 134 | 133 |
|
| 135 |
virtual void addSegmentation(); |
|
| 136 |
|
|
| 137 | 134 |
virtual void showLayerTree(); |
| 138 | 135 |
|
| 139 | 136 |
virtual void handleOSCMessage(const OSCMessage &); |
| ... | ... | |
| 159 | 156 |
QMenu *m_recentFilesMenu; |
| 160 | 157 |
QMenu *m_rightButtonMenu; |
| 161 | 158 |
QMenu *m_rightButtonPlaybackMenu; |
| 162 |
QMenu *m_segmentersMenu; |
|
| 163 | 159 |
|
| 164 | 160 |
QAction *m_deleteSelectedAction; |
| 165 | 161 |
QAction *m_ffwdAction; |
| ... | ... | |
| 174 | 170 |
typedef std::map<Pane *, LayerSet> PaneLayerMap; |
| 175 | 171 |
PaneLayerMap m_hiddenLayers; |
| 176 | 172 |
|
| 177 |
TransformList m_segmentationTransforms; |
|
| 178 |
|
|
| 179 |
void findSegmentationTransforms(); |
|
| 180 |
|
|
| 181 | 173 |
virtual void setupMenus(); |
| 182 | 174 |
virtual void setupFileMenu(); |
| 183 | 175 |
virtual void setupEditMenu(); |
| 184 | 176 |
virtual void setupViewMenu(); |
| 185 |
virtual void setupSegmentersMenu(); |
|
| 186 | 177 |
virtual void setupHelpMenu(); |
| 187 | 178 |
virtual void setupToolbars(); |
| 188 | 179 |
|
| ... | ... | |
| 198 | 189 |
typedef std::map<Model *, Model *> ModelPairMap; |
| 199 | 190 |
ModelPairMap m_fftModelMap; |
| 200 | 191 |
|
| 201 |
typedef std::map<QAction *, TransformId> TransformActionMap; |
|
| 202 |
TransformActionMap m_segmenterActions; |
|
| 203 |
|
|
| 204 | 192 |
virtual void closeEvent(QCloseEvent *e); |
| 205 | 193 |
bool checkSaveModified(); |
| 206 | 194 |
|
| 207 | 195 |
virtual void configureNewPane(Pane *p); |
| 208 |
virtual bool selectExistingModeLayer(Pane *, QString);
|
|
| 196 |
virtual Model *selectExistingModeLayer(Pane *, QString);
|
|
| 209 | 197 |
|
| 210 | 198 |
virtual void updateVisibleRangeDisplay(Pane *p) const; |
| 211 | 199 |
}; |
| main/main.cpp | ||
|---|---|---|
| 105 | 105 |
|
| 106 | 106 |
QApplication::setOrganizationName("sonic-visualiser");
|
| 107 | 107 |
QApplication::setOrganizationDomain("sonicvisualiser.org");
|
| 108 |
QApplication::setApplicationName("Sonic Segmenter");
|
|
| 108 |
QApplication::setApplicationName("Vect");
|
|
| 109 | 109 |
|
| 110 | 110 |
QIcon icon; |
| 111 | 111 |
int sizes[] = { 16, 22, 24, 32, 48, 64, 128 };
|
| main/main.pro | ||
|---|---|---|
| 1 |
|
|
| 2 |
TEMPLATE = app |
|
| 3 |
|
|
| 4 |
SV_UNIT_PACKAGES = vamp vamp-hostsdk fftw3f samplerate libpulse jack portaudio-2.0 mad id3tag oggz fishsound lrdf raptor rasqal redland sndfile liblo rubberband fftw3 |
|
| 5 |
load(../prf/sv.prf) |
|
| 6 |
|
|
| 7 |
CONFIG += release sv qt thread warn_on stl rtti exceptions |
|
| 8 |
QT += xml network |
|
| 9 |
|
|
| 10 |
linux-g++:QMAKE_CXXFLAGS_RELEASE += -DNDEBUG -DNO_TIMING -O3 -march=pentium-m -msse -msse2 -msse3 -mmmx |
|
| 11 |
|
|
| 12 |
TARGET = sonic-segmenter |
|
| 13 |
|
|
| 14 |
ICON = icons/sv-macicon.icns |
|
| 15 |
|
|
| 16 |
DEPENDPATH += . .. i18n main |
|
| 17 |
INCLUDEPATH += . .. main |
|
| 18 |
LIBPATH = ../framework ../audioio ../view ../layer ../data ../widgets ../plugin ../transform ../rdf ../base ../system $$LIBPATH |
|
| 19 |
|
|
| 20 |
contains(DEFINES, BUILD_STATIC):LIBS -= -ljack |
|
| 21 |
|
|
| 22 |
LIBS = -lsvframework -lsvaudioio -lsvview -lsvlayer -lsvwidgets -lsvdata -lsvtransform -lsvrdf -lsvtransform -lsvdata -lsvplugin -lsvbase -lsvsystem $$LIBS |
|
| 23 |
|
|
| 24 |
PRE_TARGETDEPS += ../framework/libsvframework.a \ |
|
| 25 |
../audioio/libsvaudioio.a \ |
|
| 26 |
../view/libsvview.a \ |
|
| 27 |
../layer/libsvlayer.a \ |
|
| 28 |
../rdf/libsvrdf.a \ |
|
| 29 |
../data/libsvdata.a \ |
|
| 30 |
../widgets/libsvwidgets.a \ |
|
| 31 |
../transform/libsvtransform.a \ |
|
| 32 |
../plugin/libsvplugin.a \ |
|
| 33 |
../base/libsvbase.a \ |
|
| 34 |
../system/libsvsystem.a |
|
| 35 |
|
|
| 36 |
OBJECTS_DIR = tmp_obj |
|
| 37 |
MOC_DIR = tmp_moc |
|
| 38 |
|
|
| 39 |
# Input |
|
| 40 |
HEADERS += MainWindow.h \ |
|
| 41 |
PreferencesDialog.h |
|
| 42 |
SOURCES += main.cpp \ |
|
| 43 |
MainWindow.cpp \ |
|
| 44 |
PreferencesDialog.cpp |
|
| 45 |
|
|
| 46 |
RESOURCES += ../sonic-segmenter.qrc |
|
| 47 |
|
|
| 48 |
|
|
| sonic-segmenter.pro | ||
|---|---|---|
| 1 |
|
|
| 2 |
TEMPLATE = subdirs |
|
| 3 |
|
|
| 4 |
CONFIG += ordered |
|
| 5 |
|
|
| 6 |
SUBDIRS = audioio base data framework plugin rdf system transform layer view widgets main |
|
| 7 |
|
|
| sonic-segmenter.qrc | ||
|---|---|---|
| 1 |
<!DOCTYPE RCC><RCC version="1.0"> |
|
| 2 |
<qresource> |
|
| 3 |
<file>icons/waveform.png</file> |
|
| 4 |
<file>icons/spectrum.png</file> |
|
| 5 |
<file>icons/spectrogram.png</file> |
|
| 6 |
<file>icons/melodogram.png</file> |
|
| 7 |
<file>icons/timeruler.png</file> |
|
| 8 |
<file>icons/pane.png</file> |
|
| 9 |
<file>icons/instants.png</file> |
|
| 10 |
<file>icons/notes.png</file> |
|
| 11 |
<file>icons/values.png</file> |
|
| 12 |
<file>icons/colour3d.png</file> |
|
| 13 |
<file>icons/playpause.png</file> |
|
| 14 |
<file>icons/ffwd.png</file> |
|
| 15 |
<file>icons/ffwd-end.png</file> |
|
| 16 |
<file>icons/rewind.png</file> |
|
| 17 |
<file>icons/rewind-start.png</file> |
|
| 18 |
<file>icons/playselection.png</file> |
|
| 19 |
<file>icons/playloop.png</file> |
|
| 20 |
<file>icons/solo.png</file> |
|
| 21 |
<file>icons/fader_background.png</file> |
|
| 22 |
<file>icons/fader_knob.png</file> |
|
| 23 |
<file>icons/fader_knob_red.png</file> |
|
| 24 |
<file>icons/fader_leds.png</file> |
|
| 25 |
<file>icons/faders.png</file> |
|
| 26 |
<file>icons/select.png</file> |
|
| 27 |
<file>icons/text.png</file> |
|
| 28 |
<file>icons/draw.png</file> |
|
| 29 |
<file>icons/draw-curve.png</file> |
|
| 30 |
<file>icons/measure.png</file> |
|
| 31 |
<file>icons/measure1cursor.xbm</file> |
|
| 32 |
<file>icons/measure1mask.xbm</file> |
|
| 33 |
<file>icons/measure2cursor.xbm</file> |
|
| 34 |
<file>icons/measure2mask.xbm</file> |
|
| 35 |
<file>icons/move.png</file> |
|
| 36 |
<file>icons/navigate.png</file> |
|
| 37 |
<file>icons/zoom.png</file> |
|
| 38 |
<file>icons/zoom-in.png</file> |
|
| 39 |
<file>icons/zoom-out.png</file> |
|
| 40 |
<file>icons/zoom-fit.png</file> |
|
| 41 |
<file>icons/undo.png</file> |
|
| 42 |
<file>icons/redo.png</file> |
|
| 43 |
<file>icons/new.png</file> |
|
| 44 |
<file>icons/exit.png</file> |
|
| 45 |
<file>icons/speaker.png</file> |
|
| 46 |
<file>icons/annotation.png</file> |
|
| 47 |
<file>icons/fileopen.png</file> |
|
| 48 |
<file>icons/fileopensession.png</file> |
|
| 49 |
<file>icons/fileopenaudio.png</file> |
|
| 50 |
<file>icons/fileopen-22.png</file> |
|
| 51 |
<file>icons/fileclose.png</file> |
|
| 52 |
<file>icons/filenew.png</file> |
|
| 53 |
<file>icons/filenew-22.png</file> |
|
| 54 |
<file>icons/filesave.png</file> |
|
| 55 |
<file>icons/filesave-22.png</file> |
|
| 56 |
<file>icons/filesaveas.png</file> |
|
| 57 |
<file>icons/filesaveas-22.png</file> |
|
| 58 |
<file>icons/editdelete.png</file> |
|
| 59 |
<file>icons/editcut.png</file> |
|
| 60 |
<file>icons/editcopy.png</file> |
|
| 61 |
<file>icons/editpaste.png</file> |
|
| 62 |
<file>icons/mono.png</file> |
|
| 63 |
<file>icons/stereo.png</file> |
|
| 64 |
<file>icons/sharpen.png</file> |
|
| 65 |
<file>icons/help.png</file> |
|
| 66 |
<file>icons/cross.png</file> |
|
| 67 |
<file>icons/sv-16x16.png</file> |
|
| 68 |
<file>icons/sv-22x22.png</file> |
|
| 69 |
<file>icons/sv-24x24.png</file> |
|
| 70 |
<file>icons/sv-32x32.png</file> |
|
| 71 |
<file>icons/sv-48x48.png</file> |
|
| 72 |
<file>icons/sv-64x64.png</file> |
|
| 73 |
<file>icons/sv-128x128.png</file> |
|
| 74 |
<file>samples/bass.wav</file> |
|
| 75 |
<file>samples/beep.wav</file> |
|
| 76 |
<file>samples/bounce.wav</file> |
|
| 77 |
<file>samples/clap.wav</file> |
|
| 78 |
<file>samples/click.wav</file> |
|
| 79 |
<file>samples/cowbell.wav</file> |
|
| 80 |
<file>samples/hihat.wav</file> |
|
| 81 |
<file>samples/kick.wav</file> |
|
| 82 |
<file>samples/organ.wav</file> |
|
| 83 |
<file>samples/piano.wav</file> |
|
| 84 |
<file>samples/snare.wav</file> |
|
| 85 |
<file>samples/stick.wav</file> |
|
| 86 |
<file>samples/strike.wav</file> |
|
| 87 |
<file>samples/tap.wav</file> |
|
| 88 |
<file>i18n/sonic-visualiser_ru.qm</file> |
|
| 89 |
<file>i18n/sonic-visualiser_en_GB.qm</file> |
|
| 90 |
<file>i18n/tips_en.xml</file> |
|
| 91 |
</qresource> |
|
| 92 |
</RCC> |
|
| svn-commit.sh | ||
|---|---|---|
| 1 |
#!/bin/sh |
|
| 2 |
|
|
| 3 |
svn commit || exit |
|
| 4 |
|
|
| 5 |
for x in audioio base data framework plugin prf rdf system transform view widgets; do |
|
| 6 |
svn commit $x || exit |
|
| 7 |
done |
|
| 8 |
|
|
| vect.pro | ||
|---|---|---|
| 1 |
|
|
| 2 |
TEMPLATE = app |
|
| 3 |
|
|
| 4 |
SV_UNIT_PACKAGES = vamp vamp-hostsdk fftw3f samplerate libpulse jack portaudio-2.0 mad id3tag oggz fishsound lrdf raptor rasqal redland sndfile liblo rubberband fftw3 |
|
| 5 |
load(../sonic-visualiser/sv.prf) |
|
| 6 |
|
|
| 7 |
CONFIG += release sv qt thread warn_on stl rtti exceptions |
|
| 8 |
QT += xml network |
|
| 9 |
|
|
| 10 |
linux-g++:QMAKE_CXXFLAGS_RELEASE += -DNDEBUG -DNO_TIMING -O3 -march=pentium-m -msse -msse2 -msse3 -mmmx |
|
| 11 |
|
|
| 12 |
TARGET = vect |
|
| 13 |
|
|
| 14 |
ICON = icons/sv-macicon.icns |
|
| 15 |
|
|
| 16 |
DEPENDPATH += . ../sonic-visualiser i18n main |
|
| 17 |
INCLUDEPATH += . ../sonic-visualiser main |
|
| 18 |
LIBPATH = ../sonic-visualiser/framework ../sonic-visualiser/audioio ../sonic-visualiser/view ../sonic-visualiser/layer ../sonic-visualiser/data ../sonic-visualiser/widgets ../sonic-visualiser/plugin ../sonic-visualiser/transform ../sonic-visualiser/rdf ../sonic-visualiser/base ../sonic-visualiser/system $$LIBPATH |
|
| 19 |
|
|
| 20 |
contains(DEFINES, BUILD_STATIC):LIBS -= -ljack |
|
| 21 |
|
|
| 22 |
LIBS = -lsvframework -lsvaudioio -lsvview -lsvlayer -lsvwidgets -lsvdata -lsvtransform -lsvrdf -lsvtransform -lsvdata -lsvplugin -lsvbase -lsvsystem $$LIBS |
|
| 23 |
|
|
| 24 |
PRE_TARGETDEPS += ../sonic-visualiser/framework/libsvframework.a \ |
|
| 25 |
../sonic-visualiser/audioio/libsvaudioio.a \ |
|
| 26 |
../sonic-visualiser/view/libsvview.a \ |
|
| 27 |
../sonic-visualiser/layer/libsvlayer.a \ |
|
| 28 |
../sonic-visualiser/rdf/libsvrdf.a \ |
|
| 29 |
../sonic-visualiser/data/libsvdata.a \ |
|
| 30 |
../sonic-visualiser/widgets/libsvwidgets.a \ |
|
| 31 |
../sonic-visualiser/transform/libsvtransform.a \ |
|
| 32 |
../sonic-visualiser/plugin/libsvplugin.a \ |
|
| 33 |
../sonic-visualiser/base/libsvbase.a \ |
|
| 34 |
../sonic-visualiser/system/libsvsystem.a |
|
| 35 |
|
|
| 36 |
OBJECTS_DIR = tmp_obj |
|
| 37 |
MOC_DIR = tmp_moc |
|
| 38 |
|
|
| 39 |
# Input |
|
| 40 |
HEADERS += main/MainWindow.h \ |
|
| 41 |
main/PreferencesDialog.h |
|
| 42 |
SOURCES += main/main.cpp \ |
|
| 43 |
main/MainWindow.cpp \ |
|
| 44 |
main/PreferencesDialog.cpp |
|
| 45 |
|
|
| 46 |
RESOURCES += vect.qrc |
|
| 47 |
|
|
| 48 |
|
|
| vect.qrc | ||
|---|---|---|
| 1 |
<!DOCTYPE RCC><RCC version="1.0"> |
|
| 2 |
<qresource> |
|
| 3 |
<file>icons/waveform.png</file> |
|
| 4 |
<file>icons/spectrum.png</file> |
|
| 5 |
<file>icons/spectrogram.png</file> |
|
| 6 |
<file>icons/melodogram.png</file> |
|
| 7 |
<file>icons/timeruler.png</file> |
|
| 8 |
<file>icons/pane.png</file> |
|
| 9 |
<file>icons/instants.png</file> |
|
| 10 |
<file>icons/notes.png</file> |
|
| 11 |
<file>icons/values.png</file> |
|
| 12 |
<file>icons/colour3d.png</file> |
|
| 13 |
<file>icons/playpause.png</file> |
|
| 14 |
<file>icons/ffwd.png</file> |
|
| 15 |
<file>icons/ffwd-end.png</file> |
|
| 16 |
<file>icons/rewind.png</file> |
|
| 17 |
<file>icons/rewind-start.png</file> |
|
| 18 |
<file>icons/playselection.png</file> |
|
| 19 |
<file>icons/playloop.png</file> |
|
| 20 |
<file>icons/solo.png</file> |
|
| 21 |
<file>icons/fader_background.png</file> |
|
| 22 |
<file>icons/fader_knob.png</file> |
|
| 23 |
<file>icons/fader_knob_red.png</file> |
|
| 24 |
<file>icons/fader_leds.png</file> |
|
| 25 |
<file>icons/faders.png</file> |
|
| 26 |
<file>icons/select.png</file> |
|
| 27 |
<file>icons/text.png</file> |
|
| 28 |
<file>icons/draw.png</file> |
|
| 29 |
<file>icons/draw-curve.png</file> |
|
| 30 |
<file>icons/measure.png</file> |
|
| 31 |
<file>icons/measure1cursor.xbm</file> |
|
| 32 |
<file>icons/measure1mask.xbm</file> |
|
| 33 |
<file>icons/measure2cursor.xbm</file> |
|
| 34 |
<file>icons/measure2mask.xbm</file> |
|
| 35 |
<file>icons/move.png</file> |
|
| 36 |
<file>icons/navigate.png</file> |
|
| 37 |
<file>icons/zoom.png</file> |
|
| 38 |
<file>icons/zoom-in.png</file> |
|
| 39 |
<file>icons/zoom-out.png</file> |
|
| 40 |
<file>icons/zoom-fit.png</file> |
|
| 41 |
<file>icons/undo.png</file> |
|
| 42 |
<file>icons/redo.png</file> |
|
| 43 |
<file>icons/new.png</file> |
|
| 44 |
<file>icons/exit.png</file> |
|
| 45 |
<file>icons/speaker.png</file> |
|
| 46 |
<file>icons/annotation.png</file> |
|
| 47 |
<file>icons/fileopen.png</file> |
|
| 48 |
<file>icons/fileopensession.png</file> |
|
| 49 |
<file>icons/fileopenaudio.png</file> |
|
| 50 |
<file>icons/fileopen-22.png</file> |
|
| 51 |
<file>icons/fileclose.png</file> |
|
| 52 |
<file>icons/filenew.png</file> |
|
| 53 |
<file>icons/filenew-22.png</file> |
|
| 54 |
<file>icons/filesave.png</file> |
|
| 55 |
<file>icons/filesave-22.png</file> |
|
| 56 |
<file>icons/filesaveas.png</file> |
|
| 57 |
<file>icons/filesaveas-22.png</file> |
|
| 58 |
<file>icons/editdelete.png</file> |
|
| 59 |
<file>icons/editcut.png</file> |
|
| 60 |
<file>icons/editcopy.png</file> |
|
| 61 |
<file>icons/editpaste.png</file> |
|
| 62 |
<file>icons/mono.png</file> |
|
| 63 |
<file>icons/stereo.png</file> |
|
| 64 |
<file>icons/sharpen.png</file> |
|
| 65 |
<file>icons/help.png</file> |
|
| 66 |
<file>icons/cross.png</file> |
|
| 67 |
<file>icons/sv-16x16.png</file> |
|
| 68 |
<file>icons/sv-22x22.png</file> |
|
| 69 |
<file>icons/sv-24x24.png</file> |
|
| 70 |
<file>icons/sv-32x32.png</file> |
|
| 71 |
<file>icons/sv-48x48.png</file> |
|
| 72 |
<file>icons/sv-64x64.png</file> |
|
| 73 |
<file>icons/sv-128x128.png</file> |
|
| 74 |
<file>samples/bass.wav</file> |
|
| 75 |
<file>samples/beep.wav</file> |
|
| 76 |
<file>samples/bounce.wav</file> |
|
| 77 |
<file>samples/clap.wav</file> |
|
| 78 |
<file>samples/click.wav</file> |
|
| 79 |
<file>samples/cowbell.wav</file> |
|
| 80 |
<file>samples/hihat.wav</file> |
|
| 81 |
<file>samples/kick.wav</file> |
|
| 82 |
<file>samples/organ.wav</file> |
|
| 83 |
<file>samples/piano.wav</file> |
|
| 84 |
<file>samples/snare.wav</file> |
|
| 85 |
<file>samples/stick.wav</file> |
|
| 86 |
<file>samples/strike.wav</file> |
|
| 87 |
<file>samples/tap.wav</file> |
|
| 88 |
<file>i18n/sonic-visualiser_ru.qm</file> |
|
| 89 |
<file>i18n/sonic-visualiser_en_GB.qm</file> |
|
| 90 |
<file>i18n/tips_en.xml</file> |
|
| 91 |
</qresource> |
|
| 92 |
</RCC> |
|
| version.h | ||
|---|---|---|
| 1 |
#define VERSION "[segmenter] 0.1" |
|
| 1 |
#define VECT_VERSION "[vect] 0.1" |
|
Also available in: Unified diff