-
-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[tests] Fix scenario tests due to unpropagated change after interval …
…stopped auto-ticking on start
- Loading branch information
Showing
14 changed files
with
214 additions
and
141 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
#include "fade.hpp" | ||
namespace ossia::snd | ||
{ | ||
|
||
void do_fade( | ||
bool start_discontinuous, bool end_discontinuous, audio_channel& ap, | ||
std::size_t start, std::size_t end) | ||
{ | ||
using namespace std; | ||
if(end < start) | ||
swap(start, end); | ||
const auto decrement = (1. / (end - start)); | ||
double gain = 1.0; | ||
|
||
if(!start_discontinuous && !end_discontinuous) | ||
return; | ||
else if(start_discontinuous && !end_discontinuous) | ||
{ | ||
for(std::size_t j = start; j < end; j++) | ||
{ | ||
ap[j] *= (1. - gain); | ||
gain -= decrement; | ||
} | ||
} | ||
else if(!start_discontinuous && end_discontinuous) | ||
{ | ||
for(std::size_t j = start; j < end; j++) | ||
{ | ||
ap[j] *= std::pow(2., gain) - 1.; | ||
gain -= decrement; | ||
} | ||
} | ||
else | ||
{ | ||
for(std::size_t j = start; j < end; j++) | ||
{ | ||
ap[j] *= (2. * (gain * (1. - gain))); | ||
gain -= decrement; | ||
} | ||
} | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
#pragma once | ||
#include <ossia/dataflow/nodes/media.hpp> | ||
|
||
namespace ossia::snd | ||
{ | ||
OSSIA_EXPORT | ||
void do_fade( | ||
bool start_discontinuous, bool end_discontinuous, audio_channel& ap, | ||
std::size_t start, std::size_t end); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,7 +9,6 @@ | |
|
||
#include <boost/config.hpp> | ||
|
||
#include <algorithm> | ||
#include <csignal> | ||
|
||
namespace ossia | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.