mirror of
https://github.com/HifiExperiments/overte.git
synced 2025-08-09 08:10:15 +02:00
add auto pause/resume to the Audio Scope App
This commit is contained in:
parent
5f3ee2e98f
commit
b8a2525f9e
1 changed files with 5 additions and 11 deletions
|
@ -13,7 +13,6 @@
|
||||||
|
|
||||||
(function () { // BEGIN LOCAL_SCOPE
|
(function () { // BEGIN LOCAL_SCOPE
|
||||||
|
|
||||||
var framesSinceOpened = 0;
|
|
||||||
var scopeVisibile = AudioScope.getVisible();
|
var scopeVisibile = AudioScope.getVisible();
|
||||||
var scopePaused = AudioScope.getPause();
|
var scopePaused = AudioScope.getPause();
|
||||||
var autoPause = false;
|
var autoPause = false;
|
||||||
|
@ -77,21 +76,16 @@
|
||||||
});
|
});
|
||||||
|
|
||||||
Audio.noiseGateOpened.connect(function(){
|
Audio.noiseGateOpened.connect(function(){
|
||||||
framesSinceOpened = 0;
|
if (autoPause) {
|
||||||
|
setScopePause(false);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
Audio.noiseGateClosed.connect(function(){
|
Audio.noiseGateClosed.connect(function(){
|
||||||
// noise gate closed
|
// noise gate closed
|
||||||
});
|
if (autoPause) {
|
||||||
|
setScopePause(true);
|
||||||
Audio.inputReceived.connect(function(){
|
|
||||||
if (autoPause && AudioScope.getVisible()) {
|
|
||||||
framesSinceOpened++;
|
|
||||||
if (framesSinceOpened > 50) {
|
|
||||||
setScopePause(true);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
}()); // END LOCAL_SCOPE
|
}()); // END LOCAL_SCOPE
|
Loading…
Reference in a new issue