Mercurial > hg > svgui
comparison view/ViewManager.cpp @ 682:1a0dfcbffaf1
Drop std:: from cout, cerr, endl -- pull these in through Debug.h
author | Chris Cannam |
---|---|
date | Tue, 26 Nov 2013 14:06:40 +0000 |
parents | 77fa3fdbfc7e |
children | 917039d333bb d8fc9659a206 |
comparison
equal
deleted
inserted
replaced
681:eaf4446a1bef | 682:1a0dfcbffaf1 |
---|---|
68 settings.value("show-centre-line", m_showCentreLine).toBool(); | 68 settings.value("show-centre-line", m_showCentreLine).toBool(); |
69 settings.endGroup(); | 69 settings.endGroup(); |
70 | 70 |
71 if (getGlobalDarkBackground()) { | 71 if (getGlobalDarkBackground()) { |
72 /* | 72 /* |
73 std::cerr << "dark palette:" << std::endl; | 73 cerr << "dark palette:" << endl; |
74 std::cerr << "window = " << QApplication::palette().color(QPalette::Window).name() << std::endl; | 74 cerr << "window = " << QApplication::palette().color(QPalette::Window).name() << endl; |
75 std::cerr << "windowtext = " << QApplication::palette().color(QPalette::WindowText).name() << std::endl; | 75 cerr << "windowtext = " << QApplication::palette().color(QPalette::WindowText).name() << endl; |
76 std::cerr << "base = " << QApplication::palette().color(QPalette::Base).name() << std::endl; | 76 cerr << "base = " << QApplication::palette().color(QPalette::Base).name() << endl; |
77 std::cerr << "alternatebase = " << QApplication::palette().color(QPalette::AlternateBase).name() << std::endl; | 77 cerr << "alternatebase = " << QApplication::palette().color(QPalette::AlternateBase).name() << endl; |
78 std::cerr << "text = " << QApplication::palette().color(QPalette::Text).name() << std::endl; | 78 cerr << "text = " << QApplication::palette().color(QPalette::Text).name() << endl; |
79 std::cerr << "button = " << QApplication::palette().color(QPalette::Button).name() << std::endl; | 79 cerr << "button = " << QApplication::palette().color(QPalette::Button).name() << endl; |
80 std::cerr << "buttontext = " << QApplication::palette().color(QPalette::ButtonText).name() << std::endl; | 80 cerr << "buttontext = " << QApplication::palette().color(QPalette::ButtonText).name() << endl; |
81 std::cerr << "brighttext = " << QApplication::palette().color(QPalette::BrightText).name() << std::endl; | 81 cerr << "brighttext = " << QApplication::palette().color(QPalette::BrightText).name() << endl; |
82 std::cerr << "light = " << QApplication::palette().color(QPalette::Light).name() << std::endl; | 82 cerr << "light = " << QApplication::palette().color(QPalette::Light).name() << endl; |
83 std::cerr << "dark = " << QApplication::palette().color(QPalette::Dark).name() << std::endl; | 83 cerr << "dark = " << QApplication::palette().color(QPalette::Dark).name() << endl; |
84 std::cerr << "mid = " << QApplication::palette().color(QPalette::Mid).name() << std::endl; | 84 cerr << "mid = " << QApplication::palette().color(QPalette::Mid).name() << endl; |
85 */ | 85 */ |
86 m_lightPalette = QPalette(QColor("#000000"), // WindowText | 86 m_lightPalette = QPalette(QColor("#000000"), // WindowText |
87 QColor("#dddfe4"), // Button | 87 QColor("#dddfe4"), // Button |
88 QColor("#ffffff"), // Light | 88 QColor("#ffffff"), // Light |
89 QColor("#555555"), // Dark | 89 QColor("#555555"), // Dark |
94 QColor("#efefef")); // Window | 94 QColor("#efefef")); // Window |
95 | 95 |
96 | 96 |
97 } else { | 97 } else { |
98 /* | 98 /* |
99 std::cerr << "light palette:" << std::endl; | 99 cerr << "light palette:" << endl; |
100 std::cerr << "window = " << QApplication::palette().color(QPalette::Window).name() << std::endl; | 100 cerr << "window = " << QApplication::palette().color(QPalette::Window).name() << endl; |
101 std::cerr << "windowtext = " << QApplication::palette().color(QPalette::WindowText).name() << std::endl; | 101 cerr << "windowtext = " << QApplication::palette().color(QPalette::WindowText).name() << endl; |
102 std::cerr << "base = " << QApplication::palette().color(QPalette::Base).name() << std::endl; | 102 cerr << "base = " << QApplication::palette().color(QPalette::Base).name() << endl; |
103 std::cerr << "alternatebase = " << QApplication::palette().color(QPalette::AlternateBase).name() << std::endl; | 103 cerr << "alternatebase = " << QApplication::palette().color(QPalette::AlternateBase).name() << endl; |
104 std::cerr << "text = " << QApplication::palette().color(QPalette::Text).name() << std::endl; | 104 cerr << "text = " << QApplication::palette().color(QPalette::Text).name() << endl; |
105 std::cerr << "button = " << QApplication::palette().color(QPalette::Button).name() << std::endl; | 105 cerr << "button = " << QApplication::palette().color(QPalette::Button).name() << endl; |
106 std::cerr << "buttontext = " << QApplication::palette().color(QPalette::ButtonText).name() << std::endl; | 106 cerr << "buttontext = " << QApplication::palette().color(QPalette::ButtonText).name() << endl; |
107 std::cerr << "brighttext = " << QApplication::palette().color(QPalette::BrightText).name() << std::endl; | 107 cerr << "brighttext = " << QApplication::palette().color(QPalette::BrightText).name() << endl; |
108 std::cerr << "light = " << QApplication::palette().color(QPalette::Light).name() << std::endl; | 108 cerr << "light = " << QApplication::palette().color(QPalette::Light).name() << endl; |
109 std::cerr << "dark = " << QApplication::palette().color(QPalette::Dark).name() << std::endl; | 109 cerr << "dark = " << QApplication::palette().color(QPalette::Dark).name() << endl; |
110 std::cerr << "mid = " << QApplication::palette().color(QPalette::Mid).name() << std::endl; | 110 cerr << "mid = " << QApplication::palette().color(QPalette::Mid).name() << endl; |
111 */ | 111 */ |
112 m_darkPalette = QPalette(QColor("#ffffff"), // WindowText | 112 m_darkPalette = QPalette(QColor("#ffffff"), // WindowText |
113 QColor("#3e3e3e"), // Button | 113 QColor("#3e3e3e"), // Button |
114 QColor("#808080"), // Light | 114 QColor("#808080"), // Light |
115 QColor("#1e1e1e"), // Dark | 115 QColor("#1e1e1e"), // Dark |
127 | 127 |
128 unsigned long | 128 unsigned long |
129 ViewManager::getGlobalCentreFrame() const | 129 ViewManager::getGlobalCentreFrame() const |
130 { | 130 { |
131 #ifdef DEBUG_VIEW_MANAGER | 131 #ifdef DEBUG_VIEW_MANAGER |
132 std::cerr << "ViewManager::getGlobalCentreFrame: returning " << m_globalCentreFrame << std::endl; | 132 cerr << "ViewManager::getGlobalCentreFrame: returning " << m_globalCentreFrame << endl; |
133 #endif | 133 #endif |
134 return m_globalCentreFrame; | 134 return m_globalCentreFrame; |
135 } | 135 } |
136 | 136 |
137 void | 137 void |
138 ViewManager::setGlobalCentreFrame(unsigned long f) | 138 ViewManager::setGlobalCentreFrame(unsigned long f) |
139 { | 139 { |
140 #ifdef DEBUG_VIEW_MANAGER | 140 #ifdef DEBUG_VIEW_MANAGER |
141 std::cerr << "ViewManager::setGlobalCentreFrame to " << f << std::endl; | 141 cerr << "ViewManager::setGlobalCentreFrame to " << f << endl; |
142 #endif | 142 #endif |
143 m_globalCentreFrame = f; | 143 m_globalCentreFrame = f; |
144 emit globalCentreFrameChanged(f); | 144 emit globalCentreFrameChanged(f); |
145 } | 145 } |
146 | 146 |
147 unsigned long | 147 unsigned long |
148 ViewManager::getGlobalZoom() const | 148 ViewManager::getGlobalZoom() const |
149 { | 149 { |
150 #ifdef DEBUG_VIEW_MANAGER | 150 #ifdef DEBUG_VIEW_MANAGER |
151 std::cerr << "ViewManager::getGlobalZoom: returning " << m_globalZoom << std::endl; | 151 cerr << "ViewManager::getGlobalZoom: returning " << m_globalZoom << endl; |
152 #endif | 152 #endif |
153 return m_globalZoom; | 153 return m_globalZoom; |
154 } | 154 } |
155 | 155 |
156 unsigned long | 156 unsigned long |
471 } | 471 } |
472 | 472 |
473 m_playbackFrame = m_playSource->getCurrentPlayingFrame(); | 473 m_playbackFrame = m_playSource->getCurrentPlayingFrame(); |
474 | 474 |
475 #ifdef DEBUG_VIEW_MANAGER | 475 #ifdef DEBUG_VIEW_MANAGER |
476 std::cerr << "ViewManager::checkPlayStatus: Playing, frame " << m_playbackFrame << ", levels " << m_lastLeft << "," << m_lastRight << std::endl; | 476 cerr << "ViewManager::checkPlayStatus: Playing, frame " << m_playbackFrame << ", levels " << m_lastLeft << "," << m_lastRight << endl; |
477 #endif | 477 #endif |
478 | 478 |
479 emit playbackFrameChanged(m_playbackFrame); | 479 emit playbackFrameChanged(m_playbackFrame); |
480 | 480 |
481 QTimer::singleShot(20, this, SLOT(checkPlayStatus())); | 481 QTimer::singleShot(20, this, SLOT(checkPlayStatus())); |
489 m_lastLeft = 0.0; | 489 m_lastLeft = 0.0; |
490 m_lastRight = 0.0; | 490 m_lastRight = 0.0; |
491 } | 491 } |
492 | 492 |
493 #ifdef DEBUG_VIEW_MANAGER | 493 #ifdef DEBUG_VIEW_MANAGER |
494 // std::cerr << "ViewManager::checkPlayStatus: Not playing" << std::endl; | 494 // cerr << "ViewManager::checkPlayStatus: Not playing" << endl; |
495 #endif | 495 #endif |
496 } | 496 } |
497 } | 497 } |
498 | 498 |
499 bool | 499 bool |
507 PlaybackFollowMode mode) | 507 PlaybackFollowMode mode) |
508 { | 508 { |
509 View *v = dynamic_cast<View *>(sender()); | 509 View *v = dynamic_cast<View *>(sender()); |
510 | 510 |
511 #ifdef DEBUG_VIEW_MANAGER | 511 #ifdef DEBUG_VIEW_MANAGER |
512 std::cerr << "ViewManager::viewCentreFrameChanged(" << f << ", " << locked << ", " << mode << "), view is " << v << std::endl; | 512 cerr << "ViewManager::viewCentreFrameChanged(" << f << ", " << locked << ", " << mode << "), view is " << v << endl; |
513 #endif | 513 #endif |
514 | 514 |
515 if (locked) { | 515 if (locked) { |
516 m_globalCentreFrame = f; | 516 m_globalCentreFrame = f; |
517 emit globalCentreFrameChanged(f); | 517 emit globalCentreFrameChanged(f); |
536 | 536 |
537 void | 537 void |
538 ViewManager::seek(unsigned long f) | 538 ViewManager::seek(unsigned long f) |
539 { | 539 { |
540 #ifdef DEBUG_VIEW_MANAGER | 540 #ifdef DEBUG_VIEW_MANAGER |
541 std::cerr << "ViewManager::seek(" << f << ")" << std::endl; | 541 cerr << "ViewManager::seek(" << f << ")" << endl; |
542 #endif | 542 #endif |
543 | 543 |
544 if (m_playSource && m_playSource->isPlaying()) { | 544 if (m_playSource && m_playSource->isPlaying()) { |
545 unsigned long playFrame = m_playSource->getCurrentPlayingFrame(); | 545 unsigned long playFrame = m_playSource->getCurrentPlayingFrame(); |
546 unsigned long diff = std::max(f, playFrame) - std::min(f, playFrame); | 546 unsigned long diff = std::max(f, playFrame) - std::min(f, playFrame); |
547 if (diff > 20000) { | 547 if (diff > 20000) { |
548 m_playbackFrame = f; | 548 m_playbackFrame = f; |
549 m_playSource->play(f); | 549 m_playSource->play(f); |
550 #ifdef DEBUG_VIEW_MANAGER | 550 #ifdef DEBUG_VIEW_MANAGER |
551 std::cerr << "ViewManager::considerSeek: reseeking from " << playFrame << " to " << f << std::endl; | 551 cerr << "ViewManager::considerSeek: reseeking from " << playFrame << " to " << f << endl; |
552 #endif | 552 #endif |
553 emit playbackFrameChanged(f); | 553 emit playbackFrameChanged(f); |
554 } | 554 } |
555 } else { | 555 } else { |
556 if (m_playbackFrame != f) { | 556 if (m_playbackFrame != f) { |
575 if (locked) { | 575 if (locked) { |
576 m_globalZoom = z; | 576 m_globalZoom = z; |
577 } | 577 } |
578 | 578 |
579 #ifdef DEBUG_VIEW_MANAGER | 579 #ifdef DEBUG_VIEW_MANAGER |
580 std::cerr << "ViewManager::viewZoomLevelChanged(" << v << ", " << z << ", " << locked << ")" << std::endl; | 580 cerr << "ViewManager::viewZoomLevelChanged(" << v << ", " << z << ", " << locked << ")" << endl; |
581 #endif | 581 #endif |
582 | 582 |
583 emit viewZoomLevelChanged(v, z, locked); | 583 emit viewZoomLevelChanged(v, z, locked); |
584 | 584 |
585 if (!dynamic_cast<Overview *>(v)) { | 585 if (!dynamic_cast<Overview *>(v)) { |