Mercurial > hg > svgui
comparison layer/TimeInstantLayer.cpp @ 587:4806715f7a19
Seems to be a bad idea to use plain DEBUG symbol on OS/X (system wants it)
author | Chris Cannam |
---|---|
date | Tue, 14 Jun 2011 15:27:05 +0100 |
parents | f4960f8ce798 |
children | 3c29f7c1f079 |
comparison
equal
deleted
inserted
replaced
586:1ae54a29e59e | 587:4806715f7a19 |
---|---|
58 m_model = model; | 58 m_model = model; |
59 | 59 |
60 connectSignals(m_model); | 60 connectSignals(m_model); |
61 | 61 |
62 #ifdef DEBUG_TIME_INSTANT_LAYER | 62 #ifdef DEBUG_TIME_INSTANT_LAYER |
63 DEBUG << "TimeInstantLayer::setModel(" << model << ")" << endl; | 63 SVDEBUG << "TimeInstantLayer::setModel(" << model << ")" << endl; |
64 #endif | 64 #endif |
65 | 65 |
66 if (m_model && m_model->getRDFTypeURI().endsWith("Segment")) { | 66 if (m_model && m_model->getRDFTypeURI().endsWith("Segment")) { |
67 setPlotStyle(PlotSegmentation); | 67 setPlotStyle(PlotSegmentation); |
68 } | 68 } |
361 oddBrushColour = oddBrushColour.light(150); | 361 oddBrushColour = oddBrushColour.light(150); |
362 } | 362 } |
363 oddBrushColour.setAlpha(100); | 363 oddBrushColour.setAlpha(100); |
364 } | 364 } |
365 | 365 |
366 // DEBUG << "TimeInstantLayer::paint: resolution is " | 366 // SVDEBUG << "TimeInstantLayer::paint: resolution is " |
367 // << m_model->getResolution() << " frames" << endl; | 367 // << m_model->getResolution() << " frames" << endl; |
368 | 368 |
369 QPoint localPos; | 369 QPoint localPos; |
370 long illuminateFrame = -1; | 370 long illuminateFrame = -1; |
371 | 371 |
467 | 467 |
468 void | 468 void |
469 TimeInstantLayer::drawStart(View *v, QMouseEvent *e) | 469 TimeInstantLayer::drawStart(View *v, QMouseEvent *e) |
470 { | 470 { |
471 #ifdef DEBUG_TIME_INSTANT_LAYER | 471 #ifdef DEBUG_TIME_INSTANT_LAYER |
472 DEBUG << "TimeInstantLayer::drawStart(" << e->x() << ")" << endl; | 472 SVDEBUG << "TimeInstantLayer::drawStart(" << e->x() << ")" << endl; |
473 #endif | 473 #endif |
474 | 474 |
475 if (!m_model) return; | 475 if (!m_model) return; |
476 | 476 |
477 long frame = v->getFrameForX(e->x()); | 477 long frame = v->getFrameForX(e->x()); |
490 | 490 |
491 void | 491 void |
492 TimeInstantLayer::drawDrag(View *v, QMouseEvent *e) | 492 TimeInstantLayer::drawDrag(View *v, QMouseEvent *e) |
493 { | 493 { |
494 #ifdef DEBUG_TIME_INSTANT_LAYER | 494 #ifdef DEBUG_TIME_INSTANT_LAYER |
495 DEBUG << "TimeInstantLayer::drawDrag(" << e->x() << ")" << endl; | 495 SVDEBUG << "TimeInstantLayer::drawDrag(" << e->x() << ")" << endl; |
496 #endif | 496 #endif |
497 | 497 |
498 if (!m_model || !m_editing) return; | 498 if (!m_model || !m_editing) return; |
499 | 499 |
500 long frame = v->getFrameForX(e->x()); | 500 long frame = v->getFrameForX(e->x()); |
507 | 507 |
508 void | 508 void |
509 TimeInstantLayer::drawEnd(View *, QMouseEvent *e) | 509 TimeInstantLayer::drawEnd(View *, QMouseEvent *e) |
510 { | 510 { |
511 #ifdef DEBUG_TIME_INSTANT_LAYER | 511 #ifdef DEBUG_TIME_INSTANT_LAYER |
512 DEBUG << "TimeInstantLayer::drawEnd(" << e->x() << ")" << endl; | 512 SVDEBUG << "TimeInstantLayer::drawEnd(" << e->x() << ")" << endl; |
513 #endif | 513 #endif |
514 if (!m_model || !m_editing) return; | 514 if (!m_model || !m_editing) return; |
515 QString newName = tr("Add Point at %1 s") | 515 QString newName = tr("Add Point at %1 s") |
516 .arg(RealTime::frame2RealTime(m_editingPoint.frame, | 516 .arg(RealTime::frame2RealTime(m_editingPoint.frame, |
517 m_model->getSampleRate()) | 517 m_model->getSampleRate()) |
568 | 568 |
569 void | 569 void |
570 TimeInstantLayer::editStart(View *v, QMouseEvent *e) | 570 TimeInstantLayer::editStart(View *v, QMouseEvent *e) |
571 { | 571 { |
572 #ifdef DEBUG_TIME_INSTANT_LAYER | 572 #ifdef DEBUG_TIME_INSTANT_LAYER |
573 DEBUG << "TimeInstantLayer::editStart(" << e->x() << ")" << endl; | 573 SVDEBUG << "TimeInstantLayer::editStart(" << e->x() << ")" << endl; |
574 #endif | 574 #endif |
575 | 575 |
576 if (!m_model) return; | 576 if (!m_model) return; |
577 | 577 |
578 SparseOneDimensionalModel::PointList points = getLocalPoints(v, e->x()); | 578 SparseOneDimensionalModel::PointList points = getLocalPoints(v, e->x()); |
590 | 590 |
591 void | 591 void |
592 TimeInstantLayer::editDrag(View *v, QMouseEvent *e) | 592 TimeInstantLayer::editDrag(View *v, QMouseEvent *e) |
593 { | 593 { |
594 #ifdef DEBUG_TIME_INSTANT_LAYER | 594 #ifdef DEBUG_TIME_INSTANT_LAYER |
595 DEBUG << "TimeInstantLayer::editDrag(" << e->x() << ")" << endl; | 595 SVDEBUG << "TimeInstantLayer::editDrag(" << e->x() << ")" << endl; |
596 #endif | 596 #endif |
597 | 597 |
598 if (!m_model || !m_editing) return; | 598 if (!m_model || !m_editing) return; |
599 | 599 |
600 long frame = v->getFrameForX(e->x()); | 600 long frame = v->getFrameForX(e->x()); |
613 | 613 |
614 void | 614 void |
615 TimeInstantLayer::editEnd(View *, QMouseEvent *e) | 615 TimeInstantLayer::editEnd(View *, QMouseEvent *e) |
616 { | 616 { |
617 #ifdef DEBUG_TIME_INSTANT_LAYER | 617 #ifdef DEBUG_TIME_INSTANT_LAYER |
618 DEBUG << "TimeInstantLayer::editEnd(" << e->x() << ")" << endl; | 618 SVDEBUG << "TimeInstantLayer::editEnd(" << e->x() << ")" << endl; |
619 #endif | 619 #endif |
620 if (!m_model || !m_editing) return; | 620 if (!m_model || !m_editing) return; |
621 if (m_editingCommand) { | 621 if (m_editingCommand) { |
622 QString newName = tr("Move Point to %1 s") | 622 QString newName = tr("Move Point to %1 s") |
623 .arg(RealTime::frame2RealTime(m_editingPoint.frame, | 623 .arg(RealTime::frame2RealTime(m_editingPoint.frame, |