summaryrefslogtreecommitdiff
path: root/src/ui
diff options
context:
space:
mode:
authorCalvin Morrison <calvin@pobox.com>2026-05-17 09:44:33 -0400
committerCalvin Morrison <calvin@pobox.com>2026-05-17 09:44:33 -0400
commit83ff745b43ebda7b33c52ac1a80a1408c59bfa70 (patch)
tree3383f8d54d0523b3ed812957a56e70cb59a01b08 /src/ui
parent5ccdfbc97811847611ee366848aa4b4b767bd656 (diff)
for the pulse peak streams do nothing if windows aren't open to reduce cpu
Diffstat (limited to 'src/ui')
-rw-r--r--src/ui/levelmeter.cpp2
-rw-r--r--src/ui/mixerwindow.cpp8
-rw-r--r--src/ui/mixerwindow.h1
-rw-r--r--src/ui/tmixpopup.cpp7
-rw-r--r--src/ui/tmixpopup.h1
5 files changed, 18 insertions, 1 deletions
diff --git a/src/ui/levelmeter.cpp b/src/ui/levelmeter.cpp
index 52412de..906ef20 100644
--- a/src/ui/levelmeter.cpp
+++ b/src/ui/levelmeter.cpp
@@ -29,7 +29,7 @@ void LevelMeter::setLevel( float level )
if ( display > m_level )
m_level = m_level * 0.3f + display * 0.7f; // fast attack, not instant
else {
- m_level *= 0.94f; // slow decay ~1.5s to floor
+ m_level *= 0.925f; // slow decay ~1.5s to floor at 20Hz
if ( m_level < 0.001f ) m_level = 0.0f;
}
update();
diff --git a/src/ui/mixerwindow.cpp b/src/ui/mixerwindow.cpp
index 53113e6..d8463f1 100644
--- a/src/ui/mixerwindow.cpp
+++ b/src/ui/mixerwindow.cpp
@@ -448,6 +448,14 @@ void MixerWindow::showEvent( TQShowEvent *e )
c->setGroup("MainWindow");
if ( c->hasKey("XPos") && c->hasKey("YPos") )
move( c->readNumEntry("XPos"), c->readNumEntry("YPos") );
+
+ m_model->addLevelViewer();
+}
+
+void MixerWindow::hideEvent( TQHideEvent *e )
+{
+ TDEMainWindow::hideEvent( e );
+ m_model->removeLevelViewer();
}
#include "mixerwindow.moc"
diff --git a/src/ui/mixerwindow.h b/src/ui/mixerwindow.h
index fa613cd..8dc740d 100644
--- a/src/ui/mixerwindow.h
+++ b/src/ui/mixerwindow.h
@@ -32,6 +32,7 @@ protected:
bool queryClose();
bool eventFilter( TQObject *obj, TQEvent *e );
void showEvent( TQShowEvent *e );
+ void hideEvent( TQHideEvent *e );
public slots:
void bringToFront();
diff --git a/src/ui/tmixpopup.cpp b/src/ui/tmixpopup.cpp
index 85a0c54..2cdd16a 100644
--- a/src/ui/tmixpopup.cpp
+++ b/src/ui/tmixpopup.cpp
@@ -169,10 +169,17 @@ bool TmixPopup::justHidden() const
return m_hideTime.isValid() && m_hideTime.elapsed() < 100;
}
+void TmixPopup::showEvent( TQShowEvent *e )
+{
+ TQWidget::showEvent( e );
+ m_model->addLevelViewer();
+}
+
void TmixPopup::hideEvent( TQHideEvent *e )
{
TQWidget::hideEvent( e );
m_hideTime.start();
+ m_model->removeLevelViewer();
}
void TmixPopup::wheelEvent( TQWheelEvent *e )
diff --git a/src/ui/tmixpopup.h b/src/ui/tmixpopup.h
index 527f7f7..2f8e463 100644
--- a/src/ui/tmixpopup.h
+++ b/src/ui/tmixpopup.h
@@ -24,6 +24,7 @@ public:
bool justHidden() const;
protected:
+ void showEvent( TQShowEvent *e );
void hideEvent( TQHideEvent *e );
void wheelEvent( TQWheelEvent *e );