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

Set up very basic messaging #26

Merged
merged 1 commit into from May 23, 2018
Merged

Set up very basic messaging #26

merged 1 commit into from May 23, 2018

Conversation

@Manishearth
Copy link
Member

Manishearth commented May 23, 2018

SetFloatParam is a dummy message, but the idea is to have this framework in place so that if I start working on AudioParams it won't clash with SchedulerNode work.

r? @ferjm

@ferjm
ferjm approved these changes May 23, 2018
Copy link
Member

ferjm left a comment

tbh I was hoping to have a nicer API. Something like:

let node: Box<OscillatorNode> = graph.get_node(0);
node.set_frequency(220.);

But I didn't thought too much about it, so let's merge this to unblock the dependent work. We can revisit this later.

@@ -13,7 +13,10 @@ fn main() {
options.gain = 0.5;
graph.create_node(AudioNodeType::GainNode(options));
graph.resume_processing();
thread::sleep(time::Duration::from_millis(5000));
thread::sleep(time::Duration::from_millis(2000));

This comment has been minimized.

@ferjm

ferjm May 23, 2018

Member

:) at this point I think I can reproduce the sine wave with my own voice

@@ -13,7 +13,10 @@ fn main() {
options.gain = 0.5;
graph.create_node(AudioNodeType::GainNode(options));
graph.resume_processing();
thread::sleep(time::Duration::from_millis(5000));
thread::sleep(time::Duration::from_millis(2000));
graph.message_node(0, AudioNodeMessage::SetFloatParam(220.));

This comment has been minimized.

@ferjm

ferjm May 23, 2018

Member

How would the API look like for two-way messaging (e.g. a getter)?

This comment has been minimized.

@Manishearth

Manishearth May 23, 2018

Author Member

We probably send it a channel to respond through.

@Manishearth Manishearth force-pushed the messaging branch 2 times, most recently from ab8d004 to 55d1728 May 23, 2018
@Manishearth Manishearth merged commit 6c82ceb into master May 23, 2018
@Manishearth Manishearth deleted the messaging branch May 23, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants
You can’t perform that action at this time.