Mercurial > hg > svgui
comparison view/Pane.cpp @ 335:2f83b6e3b8ca
* 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)
author | Chris Cannam |
---|---|
date | Fri, 23 Nov 2007 16:48:23 +0000 |
parents | e74b56f07c73 |
children | 1d3b27e69bf0 0895517bb2d1 |
comparison
equal
deleted
inserted
replaced
334:0a74248af622 | 335:2f83b6e3b8ca |
---|---|
1292 Layer *layer = getSelectedLayer(); | 1292 Layer *layer = getSelectedLayer(); |
1293 if (layer && layer->isLayerEditable()) { | 1293 if (layer && layer->isLayerEditable()) { |
1294 layer->drawStart(this, e); | 1294 layer->drawStart(this, e); |
1295 } | 1295 } |
1296 | 1296 |
1297 } else if (mode == ViewManager::EraseMode) { | |
1298 | |
1299 Layer *layer = getSelectedLayer(); | |
1300 if (layer && layer->isLayerEditable()) { | |
1301 layer->eraseStart(this, e); | |
1302 } | |
1303 | |
1297 } else if (mode == ViewManager::EditMode) { | 1304 } else if (mode == ViewManager::EditMode) { |
1298 | 1305 |
1299 if (!editSelectionStart(e)) { | 1306 if (!editSelectionStart(e)) { |
1300 Layer *layer = getSelectedLayer(); | 1307 Layer *layer = getSelectedLayer(); |
1301 if (layer && layer->isLayerEditable()) { | 1308 if (layer && layer->isLayerEditable()) { |
1377 if (layer && layer->isLayerEditable()) { | 1384 if (layer && layer->isLayerEditable()) { |
1378 layer->drawEnd(this, e); | 1385 layer->drawEnd(this, e); |
1379 update(); | 1386 update(); |
1380 } | 1387 } |
1381 | 1388 |
1389 } else if (mode == ViewManager::EraseMode) { | |
1390 | |
1391 Layer *layer = getSelectedLayer(); | |
1392 if (layer && layer->isLayerEditable()) { | |
1393 layer->eraseEnd(this, e); | |
1394 update(); | |
1395 } | |
1396 | |
1382 } else if (mode == ViewManager::EditMode) { | 1397 } else if (mode == ViewManager::EditMode) { |
1383 | 1398 |
1384 if (!editSelectionEnd(e)) { | 1399 if (!editSelectionEnd(e)) { |
1385 Layer *layer = getSelectedLayer(); | 1400 Layer *layer = getSelectedLayer(); |
1386 if (layer && layer->isLayerEditable()) { | 1401 if (layer && layer->isLayerEditable()) { |
1481 } else if (mode == ViewManager::DrawMode) { | 1496 } else if (mode == ViewManager::DrawMode) { |
1482 | 1497 |
1483 Layer *layer = getSelectedLayer(); | 1498 Layer *layer = getSelectedLayer(); |
1484 if (layer && layer->isLayerEditable()) { | 1499 if (layer && layer->isLayerEditable()) { |
1485 layer->drawDrag(this, e); | 1500 layer->drawDrag(this, e); |
1501 } | |
1502 | |
1503 } else if (mode == ViewManager::EraseMode) { | |
1504 | |
1505 Layer *layer = getSelectedLayer(); | |
1506 if (layer && layer->isLayerEditable()) { | |
1507 layer->eraseDrag(this, e); | |
1486 } | 1508 } |
1487 | 1509 |
1488 } else if (mode == ViewManager::EditMode) { | 1510 } else if (mode == ViewManager::EditMode) { |
1489 | 1511 |
1490 if (!editSelectionDrag(e)) { | 1512 if (!editSelectionDrag(e)) { |
2187 break; | 2209 break; |
2188 | 2210 |
2189 case ViewManager::DrawMode: | 2211 case ViewManager::DrawMode: |
2190 setCursor(Qt::CrossCursor); | 2212 setCursor(Qt::CrossCursor); |
2191 break; | 2213 break; |
2214 | |
2215 case ViewManager::EraseMode: | |
2216 setCursor(Qt::CrossCursor); | |
2217 break; | |
2192 | 2218 |
2193 case ViewManager::MeasureMode: | 2219 case ViewManager::MeasureMode: |
2194 if (m_measureCursor1) setCursor(*m_measureCursor1); | 2220 if (m_measureCursor1) setCursor(*m_measureCursor1); |
2195 break; | 2221 break; |
2196 | 2222 |
2326 | 2352 |
2327 //!!! could call through to a layer function to find out exact meaning | 2353 //!!! could call through to a layer function to find out exact meaning |
2328 if (editable) { | 2354 if (editable) { |
2329 help = tr("Click to add a new item in the active layer"); | 2355 help = tr("Click to add a new item in the active layer"); |
2330 } | 2356 } |
2357 | |
2358 } else if (mode == ViewManager::EraseMode) { | |
2359 | |
2360 //!!! could call through to a layer function to find out exact meaning | |
2361 if (editable) { | |
2362 help = tr("Click to erase an item from the active layer"); | |
2363 } | |
2331 | 2364 |
2332 } else if (mode == ViewManager::EditMode) { | 2365 } else if (mode == ViewManager::EditMode) { |
2333 | 2366 |
2334 //!!! could call through to layer | 2367 //!!! could call through to layer |
2335 if (editable) { | 2368 if (editable) { |