[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Traverso-commit] traverso/src/traverso CorrelationMeterWidget.cp...
From: |
Nicola Doebelin |
Subject: |
[Traverso-commit] traverso/src/traverso CorrelationMeterWidget.cp... |
Date: |
Fri, 15 Feb 2008 14:15:43 +0000 |
CVSROOT: /sources/traverso
Module name: traverso
Changes by: Nicola Doebelin <n_doebelin> 08/02/15 14:15:43
Modified files:
src/traverso : CorrelationMeterWidget.cpp
CorrelationMeterWidget.h
Log message:
stops the correlation meter 3 seconds after transport has stopped
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/traverso/src/traverso/CorrelationMeterWidget.cpp?cvsroot=traverso&r1=1.30&r2=1.31
http://cvs.savannah.gnu.org/viewcvs/traverso/src/traverso/CorrelationMeterWidget.h?cvsroot=traverso&r1=1.12&r2=1.13
Patches:
Index: CorrelationMeterWidget.cpp
===================================================================
RCS file: /sources/traverso/traverso/src/traverso/CorrelationMeterWidget.cpp,v
retrieving revision 1.30
retrieving revision 1.31
diff -u -b -r1.30 -r1.31
--- CorrelationMeterWidget.cpp 21 Jan 2008 16:22:16 -0000 1.30
+++ CorrelationMeterWidget.cpp 15 Feb 2008 14:15:43 -0000 1.31
@@ -39,6 +39,7 @@
#include "Debugger.h"
static const float SMOOTH_SHIFT = 0.05;
+static const int STOP_DELAY = 3000; // in ms
CorrelationMeterWidget::CorrelationMeterWidget(QWidget* parent)
: ViewPort(parent)
@@ -125,7 +126,6 @@
// Connections to core:
connect(&pm(), SIGNAL(projectLoaded(Project*)), this,
SLOT(set_project(Project*)));
-
connect(&timer, SIGNAL(timeout()), this, SLOT(update_data()));
}
@@ -243,6 +243,8 @@
// FIXME The removed plugin still needs to be
deleted!!!!!!
Command::process_command(m_sheet->get_plugin_chain()->remove_plugin(m_meter,
false));
timer.stop();
+ disconnect(m_sheet, SIGNAL(transferStopped()), this,
SLOT(transport_stopped()));
+ disconnect(m_sheet, SIGNAL(transferStarted()), this,
SLOT(transport_started()));
}
}
@@ -252,13 +254,15 @@
return;
}
+ connect(m_sheet, SIGNAL(transferStopped()), this,
SLOT(transport_stopped()));
+ connect(m_sheet, SIGNAL(transferStarted()), this,
SLOT(transport_started()));
+
PluginChain* chain = m_sheet->get_plugin_chain();
foreach(Plugin* plugin, chain->get_plugin_list()) {
m_meter = dynamic_cast<CorrelationMeter*>(plugin);
if (m_meter) {
- timer.start(40);
return;
}
}
@@ -266,7 +270,6 @@
m_meter = new CorrelationMeter();
m_meter->init();
Command::process_command( chain->add_plugin(m_meter, false) );
- timer.start(40);
}
void CorrelationMeterView::hide_event()
@@ -305,6 +308,21 @@
return 0;
}
+void CorrelationMeterView::transport_started()
+{
+ timer.start(40);
+}
+
+void CorrelationMeterView::transport_stopped()
+{
+ QTimer::singleShot(STOP_DELAY, this, SLOT(delay_timeout()));
+}
+
+void CorrelationMeterView::delay_timeout()
+{
+ timer.stop();
+}
+
void CorrelationMeterView::save_configuration()
{
config().set_property("CorrelationMeter", "Range", range);
Index: CorrelationMeterWidget.h
===================================================================
RCS file: /sources/traverso/traverso/src/traverso/CorrelationMeterWidget.h,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -b -r1.12 -r1.13
--- CorrelationMeterWidget.h 21 Jan 2008 16:22:16 -0000 1.12
+++ CorrelationMeterWidget.h 15 Feb 2008 14:15:43 -0000 1.13
@@ -90,6 +90,9 @@
void set_project( Project* );
void set_sheet( Sheet* );
void update_data();
+ void transport_started();
+ void transport_stopped();
+ void delay_timeout();
public slots:
Command* set_mode();
- [Traverso-commit] traverso/src/traverso CorrelationMeterWidget.cp...,
Nicola Doebelin <=