mirror of
https://github.com/JulianGro/overte.git
synced 2025-04-10 11:33:23 +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
|
||||
|
||||
var framesSinceOpened = 0;
|
||||
var scopeVisibile = AudioScope.getVisible();
|
||||
var scopePaused = AudioScope.getPause();
|
||||
var autoPause = false;
|
||||
|
@ -77,21 +76,16 @@
|
|||
});
|
||||
|
||||
Audio.noiseGateOpened.connect(function(){
|
||||
framesSinceOpened = 0;
|
||||
if (autoPause) {
|
||||
setScopePause(false);
|
||||
}
|
||||
});
|
||||
|
||||
Audio.noiseGateClosed.connect(function(){
|
||||
// noise gate closed
|
||||
});
|
||||
|
||||
Audio.inputReceived.connect(function(){
|
||||
if (autoPause && AudioScope.getVisible()) {
|
||||
framesSinceOpened++;
|
||||
if (framesSinceOpened > 50) {
|
||||
setScopePause(true);
|
||||
}
|
||||
if (autoPause) {
|
||||
setScopePause(true);
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
}()); // END LOCAL_SCOPE
|
Loading…
Reference in a new issue