Mercurial > hg > svgui
comparison layer/TimeValueLayer.cpp @ 1492:a2fbcfeb2572
Debug
author | Chris Cannam |
---|---|
date | Thu, 08 Aug 2019 13:33:38 +0100 |
parents | e540aa5d89cd |
children | 37df1530519d |
comparison
equal
deleted
inserted
replaced
1491:2f505d843d14 | 1492:a2fbcfeb2572 |
---|---|
892 if (!model || !model->isOK()) return; | 892 if (!model || !model->isOK()) return; |
893 | 893 |
894 sv_samplerate_t sampleRate = model->getSampleRate(); | 894 sv_samplerate_t sampleRate = model->getSampleRate(); |
895 if (!sampleRate) return; | 895 if (!sampleRate) return; |
896 | 896 |
897 #ifdef DEBUG_TIME_VALUE_LAYER | |
898 SVCERR << "TimeValueLayer[" << this << ", model " << getModel() << "]::paint in " << v->getId() << endl; | |
899 #endif | |
900 | |
897 paint.setRenderHint(QPainter::Antialiasing, false); | 901 paint.setRenderHint(QPainter::Antialiasing, false); |
898 | 902 |
899 // Profiler profiler("TimeValueLayer::paint", true); | 903 // Profiler profiler("TimeValueLayer::paint", true); |
900 | 904 |
901 int x0 = rect.left(), x1 = rect.right(); | 905 int x0 = rect.left(), x1 = rect.right(); |
902 sv_frame_t frame0 = v->getFrameForX(x0); | 906 sv_frame_t frame0 = v->getFrameForX(x0); |
903 sv_frame_t frame1 = v->getFrameForX(x1); | 907 sv_frame_t frame1 = v->getFrameForX(x1); |
904 if (m_derivative) --frame0; | 908 if (m_derivative) --frame0; |
905 | 909 |
906 EventVector points(model->getEventsWithin(frame0, frame1 - frame0, 1)); | 910 EventVector points(model->getEventsWithin(frame0, frame1 - frame0, 1)); |
911 | |
912 #ifdef DEBUG_TIME_VALUE_LAYER | |
913 SVCERR << "TimeValueLayer[" << this << "]::paint in " << v->getId() | |
914 << ": pixel extents " << x0 << " to " << x1 << ", frame extents " | |
915 << frame0 << " to " << frame1 << " yielding " << points.size() | |
916 << " points (of " << model->getAllEvents().size() | |
917 << " from frames " << model->getStartFrame() << " to " | |
918 << model->getEndFrame() << ")" << endl; | |
919 #endif | |
920 | |
907 if (points.empty()) return; | 921 if (points.empty()) return; |
908 | 922 |
909 paint.setPen(getBaseQColor()); | 923 paint.setPen(getBaseQColor()); |
910 | 924 |
911 QColor brushColour(getBaseQColor()); | 925 QColor brushColour(getBaseQColor()); |