Mercurial > hg > svcore
comparison base/View.cpp @ 18:4563a72c1d8b
* Add Zero Crossings output from zc plugin (as well as Zero Crossings Count)
* Use brief friendly names for layers instead of full transform descriptions
* Clearer command names for editing commands
* Some efficiencies in drawing dense points in TimeInstantLayer
author | Chris Cannam |
---|---|
date | Tue, 31 Jan 2006 17:19:45 +0000 |
parents | cc98d496d52b |
children | a7ed14263fe4 |
comparison
equal
deleted
inserted
replaced
17:2fb933f88604 | 18:4563a72c1d8b |
---|---|
21 #include <QApplication> | 21 #include <QApplication> |
22 | 22 |
23 #include <iostream> | 23 #include <iostream> |
24 #include <cassert> | 24 #include <cassert> |
25 | 25 |
26 #define DEBUG_VIEW_WIDGET_PAINT 1 | 26 //#define DEBUG_VIEW_WIDGET_PAINT 1 |
27 | 27 |
28 using std::cerr; | 28 using std::cerr; |
29 using std::endl; | 29 using std::endl; |
30 | 30 |
31 View::View(QWidget *w, bool showProgress) : | 31 View::View(QWidget *w, bool showProgress) : |
510 if (sender() != m_manager) return; | 510 if (sender() != m_manager) return; |
511 } | 511 } |
512 | 512 |
513 if (m_playPointerFrame == f) return; | 513 if (m_playPointerFrame == f) return; |
514 bool visible = (getXForFrame(m_playPointerFrame) != getXForFrame(f)); | 514 bool visible = (getXForFrame(m_playPointerFrame) != getXForFrame(f)); |
515 std::cerr << "old x = " << getXForFrame(m_playPointerFrame) | |
516 << ", new x = " << getXForFrame(f) | |
517 << ", visible = " << visible << std::endl; | |
518 size_t oldPlayPointerFrame = m_playPointerFrame; | 515 size_t oldPlayPointerFrame = m_playPointerFrame; |
519 m_playPointerFrame = f; | 516 m_playPointerFrame = f; |
520 if (!visible) return; | 517 if (!visible) return; |
521 | 518 |
522 switch (m_followPlay) { | 519 switch (m_followPlay) { |
556 | 553 |
557 // We don't consider scrolling unless the pointer is outside | 554 // We don't consider scrolling unless the pointer is outside |
558 // the clearly visible range already | 555 // the clearly visible range already |
559 | 556 |
560 int xnew = getXForFrame(m_playPointerFrame); | 557 int xnew = getXForFrame(m_playPointerFrame); |
558 | |
559 #ifdef DEBUG_VIEW_WIDGET_PAINT | |
560 std::cerr << "xnew = " << xnew << ", width = " << width() << std::endl; | |
561 #endif | |
561 | 562 |
562 if (xnew < width()/8 || xnew > (width()*7)/8) { | 563 if (xnew < width()/8 || xnew > (width()*7)/8) { |
563 if (QApplication::mouseButtons() == Qt::NoButton && | 564 if (QApplication::mouseButtons() == Qt::NoButton && |
564 QApplication::keyboardModifiers() == Qt::NoModifier) { | 565 QApplication::keyboardModifiers() == Qt::NoModifier) { |
565 long offset = getFrameForX(width()/2) - getStartFrame(); | 566 long offset = getFrameForX(width()/2) - getStartFrame(); |