comparison widgets/AudioDial.cpp @ 189:5b7472db612b

* Add large chunks of context help in the optional status bar * Add an extra overlay mode in which even the centre frame is disabled * Fixes to FTP retrieval
author Chris Cannam
date Fri, 19 Jan 2007 13:13:14 +0000
parents e7cf6044c2a0
children 53835534a9d3
comparison
equal deleted inserted replaced
188:dd573e090eed 189:5b7472db612b
64 #define AUDIO_DIAL_MIN (0.25 * M_PI) 64 #define AUDIO_DIAL_MIN (0.25 * M_PI)
65 #define AUDIO_DIAL_MAX (1.75 * M_PI) 65 #define AUDIO_DIAL_MAX (1.75 * M_PI)
66 #define AUDIO_DIAL_RANGE (AUDIO_DIAL_MAX - AUDIO_DIAL_MIN) 66 #define AUDIO_DIAL_RANGE (AUDIO_DIAL_MAX - AUDIO_DIAL_MIN)
67 67
68 68
69 static int dialsExtant = 0;
70
71
69 // Constructor. 72 // Constructor.
70 AudioDial::AudioDial(QWidget *parent) : 73 AudioDial::AudioDial(QWidget *parent) :
71 QDial(parent), 74 QDial(parent),
72 m_knobColor(Qt::black), 75 m_knobColor(Qt::black),
73 m_meterColor(Qt::white), 76 m_meterColor(Qt::white),
77 m_showTooltip(true), 80 m_showTooltip(true),
78 m_rangeMapper(0) 81 m_rangeMapper(0)
79 { 82 {
80 m_mouseDial = false; 83 m_mouseDial = false;
81 m_mousePressed = false; 84 m_mousePressed = false;
85 ++dialsExtant;
82 } 86 }
83 87
84 88
85 // Destructor. 89 // Destructor.
86 AudioDial::~AudioDial (void) 90 AudioDial::~AudioDial (void)
87 { 91 {
88 delete m_rangeMapper; 92 delete m_rangeMapper;
93 --dialsExtant;
89 } 94 }
90 95
91 96
92 void AudioDial::setRangeMapper(RangeMapper *mapper) 97 void AudioDial::setRangeMapper(RangeMapper *mapper)
93 { 98 {
99 std::cerr << "AudioDial[" << this << "][\"" << objectName().toStdString() << "\"::setRangeMapper(" << mapper << ") [current is " << m_rangeMapper << "] (have " << dialsExtant << " dials extant)" << std::endl;
100
94 if (m_rangeMapper == mapper) return; 101 if (m_rangeMapper == mapper) return;
95 102
96 if (!m_rangeMapper && mapper) { 103 if (!m_rangeMapper && mapper) {
97 connect(this, SIGNAL(valueChanged(int)), 104 connect(this, SIGNAL(valueChanged(int)),
98 this, SLOT(updateMappedValue(int))); 105 this, SLOT(updateMappedValue(int)));
513 } else if (m_mousePressed) { 520 } else if (m_mousePressed) {
514 m_mousePressed = false; 521 m_mousePressed = false;
515 } 522 }
516 } 523 }
517 524
525 void
526 AudioDial::enterEvent(QEvent *e)
527 {
528 QDial::enterEvent(e);
529 emit mouseEntered();
530 }
531
532 void
533 AudioDial::leaveEvent(QEvent *e)
534 {
535 QDial::enterEvent(e);
536 emit mouseLeft();
537 }
538
518 #ifdef INCLUDE_MOCFILES 539 #ifdef INCLUDE_MOCFILES
519 #include "AudioDial.moc.cpp" 540 #include "AudioDial.moc.cpp"
520 #endif 541 #endif
521 542