comparison layer/TimeInstantLayer.cpp @ 585:f4960f8ce798 debug-output

Convert many cerrs to DEBUGs
author Chris Cannam
date Mon, 16 May 2011 17:19:25 +0100
parents a4ba6c96b66d
children 4806715f7a19
comparison
equal deleted inserted replaced
584:1fe7951a61e8 585:f4960f8ce798
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 std::cerr << "TimeInstantLayer::setModel(" << model << ")" << std::endl; 63 DEBUG << "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 // std::cerr << "TimeInstantLayer::paint: resolution is " 366 // DEBUG << "TimeInstantLayer::paint: resolution is "
367 // << m_model->getResolution() << " frames" << std::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
372 if (v->shouldIlluminateLocalFeatures(this, localPos)) { 372 if (v->shouldIlluminateLocalFeatures(this, localPos)) {
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 std::cerr << "TimeInstantLayer::drawStart(" << e->x() << ")" << std::endl; 472 DEBUG << "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 std::cerr << "TimeInstantLayer::drawDrag(" << e->x() << ")" << std::endl; 495 DEBUG << "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 std::cerr << "TimeInstantLayer::drawEnd(" << e->x() << ")" << std::endl; 512 DEBUG << "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 std::cerr << "TimeInstantLayer::editStart(" << e->x() << ")" << std::endl; 573 DEBUG << "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 std::cerr << "TimeInstantLayer::editDrag(" << e->x() << ")" << std::endl; 595 DEBUG << "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 std::cerr << "TimeInstantLayer::editEnd(" << e->x() << ")" << std::endl; 618 DEBUG << "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,