Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implemented constant_source #164

Merged
merged 76 commits into from Dec 7, 2018
Merged
Changes from 1 commit
Commits
Show all changes
76 commits
Select commit Hold shift + click to select a range
b5e153a
added oscillator.rs
Nov 2, 2018
5318fc6
Added example oscillator node file, and code to handle sine, sawtooth…
arvindmohan9683 Nov 8, 2018
2a794c4
Implemented triangle
arvindmohan9683 Nov 8, 2018
c13e4e3
Implemented Triangle and modified example file
arvindmohan9683 Nov 8, 2018
90891d7
ready for pull request
arvindmohan9683 Nov 8, 2018
829225c
removed extra print statements
arvindmohan9683 Nov 8, 2018
5d8cdfc
Formatted files from previous commit using rustfmt
Avanthikaa Nov 9, 2018
ed2742c
Incomplete Constructor for periodicWvaeOptions
arvindmohan9683 Nov 15, 2018
683699d
Merge branch 'master' of https://github.com/Avanthikaa/media
arvindmohan9683 Nov 15, 2018
b0dcf9b
Added file constant_node.rs with gain_node code
Nov 15, 2018
4f7fcc1
Added functions and classes for Constant_source.rs
arvindmohan9683 Nov 15, 2018
2560800
Working imports for constant source node
arvindmohan9683 Nov 16, 2018
cb52d33
renamed constant_source_node to constant_source
Nov 16, 2018
697a456
renamed constant_source_node to constant_source
Nov 16, 2018
d9f94d2
Added Custom Periodic Wave Options
Priyankha12 Nov 16, 2018
0426b9c
ConstantSourceNode commit
Priyankha12 Nov 16, 2018
1045217
Periodic wave using vectors
Avanthikaa Nov 20, 2018
32c37cf
Reverting changes for pull request
Avanthikaa Nov 20, 2018
800f684
Ran rustfmt on modified files
Avanthikaa Nov 20, 2018
e437279
Ran rustfmt on constant_node and related files
Avanthikaa Nov 21, 2018
5d6fbe8
removed explicit silence check
arvindmohan9683 Nov 27, 2018
4047212
altered debug.assert statement
arvindmohan9683 Nov 27, 2018
4dae6e0
Derived AudioSchedulerSourceNode in constant source
arvindmohan9683 Nov 27, 2018
deb3bef
added example for constant source node
Nov 27, 2018
84a517a
Added message handler to constant_source
arvindmohan9683 Nov 28, 2018
76a0a44
completed rustfmt on constantSourceNode and it's example
Nov 28, 2018
3763c61
added oscillator.rs
Nov 2, 2018
7ef514a
Added example oscillator node file, and code to handle sine, sawtooth…
arvindmohan9683 Nov 8, 2018
8392723
Implemented triangle
arvindmohan9683 Nov 8, 2018
99bfd89
Implemented Triangle and modified example file
arvindmohan9683 Nov 8, 2018
221bc4a
ready for pull request
arvindmohan9683 Nov 8, 2018
87a1351
removed extra print statements
arvindmohan9683 Nov 8, 2018
43b8b20
Incomplete Constructor for periodicWvaeOptions
arvindmohan9683 Nov 15, 2018
16f2a98
Formatted files from previous commit using rustfmt
Avanthikaa Nov 9, 2018
ac4fb92
Added file constant_node.rs with gain_node code
Nov 15, 2018
3d3c7b6
Added functions and classes for Constant_source.rs
arvindmohan9683 Nov 15, 2018
6be0677
Working imports for constant source node
arvindmohan9683 Nov 16, 2018
5c2ce7b
renamed constant_source_node to constant_source
Nov 16, 2018
8141782
renamed constant_source_node to constant_source
Nov 16, 2018
e3b059e
Periodic wave using vectors
Avanthikaa Nov 20, 2018
0dfe431
Reverting changes for pull request
Avanthikaa Nov 20, 2018
e4a76a4
Ran rustfmt on modified files
Avanthikaa Nov 20, 2018
e4a8d7d
Ran rustfmt on constant_node and related files
Avanthikaa Nov 21, 2018
7d2ef49
removed explicit silence check
arvindmohan9683 Nov 27, 2018
9c12a50
altered debug.assert statement
arvindmohan9683 Nov 27, 2018
2f3f2f2
Derived AudioSchedulerSourceNode in constant source
arvindmohan9683 Nov 27, 2018
97efbe0
added example for constant source node
Nov 27, 2018
6e3b79a
Added message handler to constant_source
arvindmohan9683 Nov 28, 2018
c08eab6
Added .DS_Store to gitignore
Nov 28, 2018
c42aa15
modified constant_source example
Dec 1, 2018
9b83e94
removed conflicts
Dec 1, 2018
29f1fd3
removed conflicts
Dec 4, 2018
87aefce
Normalizing the custom wave
Priyankha12 Dec 4, 2018
477c704
Merging changes
Priyankha12 Dec 4, 2018
af3d76a
Working imports for constant source node
arvindmohan9683 Nov 16, 2018
50fce97
renamed constant_source_node to constant_source
Nov 16, 2018
72f04dc
renamed constant_source_node to constant_source
Nov 16, 2018
3121311
Periodic wave using vectors
Avanthikaa Nov 20, 2018
e4b7ee2
Reverting changes for pull request
Avanthikaa Nov 20, 2018
9086eef
Ran rustfmt on modified files
Avanthikaa Nov 20, 2018
5180cde
Ran rustfmt on constant_node and related files
Avanthikaa Nov 21, 2018
611d423
removed explicit silence check
arvindmohan9683 Nov 27, 2018
119bd7e
altered debug.assert statement
arvindmohan9683 Nov 27, 2018
1001525
Derived AudioSchedulerSourceNode in constant source
arvindmohan9683 Nov 27, 2018
08e0ae7
added example for constant source node
Nov 27, 2018
64e2655
Added message handler to constant_source
arvindmohan9683 Nov 28, 2018
128a526
Added .DS_Store to gitignore
Nov 28, 2018
96cf7b8
Fixed constant_source example, minor changes in other examples
arvindmohan9683 Dec 6, 2018
3aa2ce3
Local changes
Priyankha12 Dec 6, 2018
ec6fc6c
Removed audio/src/constant_source.rs
Priyankha12 Dec 7, 2018
dd93f56
Ran rustfmt on modified files
Priyankha12 Dec 7, 2018
7e65252
Update .gitignore
Priyankha12 Dec 7, 2018
6824ee6
Removed .DS_Store
Priyankha12 Dec 7, 2018
aca99b7
Merge branch 'master' of https://github.com/Avanthikaa/media into new…
Priyankha12 Dec 7, 2018
82a63f4
Made changes for pull request
Avanthikaa Dec 7, 2018
bbd207f
Removed periodic_wave_options from constructor
arvindmohan9683 Dec 7, 2018
File filter...
Filter file types
Jump to…
Jump to file
Failed to load files.

Always

Just for now

Derived AudioSchedulerSourceNode in constant source

  • Loading branch information
arvindmohan9683 authored and Avanthikaa committed Dec 4, 2018
commit 1001525ca457408f40750944893993b5724fa219
@@ -1,8 +1,8 @@
use block::Chunk;
use block::Tick;
use node::AudioNodeEngine;
use node::{AudioNodeEngine, AudioScheduledSourceNodeMessage, OnEndedCallback};
use node::BlockInfo;
use node::{AudioNodeType, ChannelInfo};
use node::{AudioNodeType, ChannelInfo, ShouldPlay};
use param::{Param, ParamType};

#[derive(Copy, Clone, Debug)]
@@ -16,17 +16,23 @@ impl Default for ConstantSourceNodeOptions {
}
}

#[derive(AudioNodeCommon)]
#[derive(AudioScheduledSourceNode,AudioNodeCommon)]
pub(crate) struct ConstantSourceNode {
channel_info: ChannelInfo,
offset: Param,
start_at: Option<Tick>,
stop_at: Option<Tick>,
onended_callback: Option<OnEndedCallback>,
}

impl ConstantSourceNode {
pub fn new(options: ConstantSourceNodeOptions, channel_info: ChannelInfo) -> Self {
Self {
channel_info,
offset: Param::new(options.offset),
start_at: None,
stop_at: None,
onended_callback: None,
}
}

@@ -42,12 +48,27 @@ impl AudioNodeEngine for ConstantSourceNode {

fn process(&mut self, mut inputs: Chunk, info: &BlockInfo) -> Chunk {
debug_assert!(inputs.len() == 0);
inputs.blocks[0].explicit_silence();
inputs.blocks.push(Default::default());
let (start_at, stop_at) = match self.should_play_at(info.frame) {
ShouldPlay::No => {
return inputs;
}
ShouldPlay::Between(start, end) => (start, end),
};


{
inputs.blocks[0].explicit_silence();

let mut iter = inputs.blocks[0].iter();
let mut offset = self.offset.value();
while let Some(mut frame) = iter.next() {
let tick = frame.tick();
if tick < start_at {
continue;
} else if tick > stop_at {
break;
}
if self.update_parameters(info, frame.tick()) {
offset = self.offset.value();
}
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.