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

Be generic over both Input and Output sample types #74

Closed
mitchmindtree opened this issue Nov 30, 2014 · 7 comments
Closed

Be generic over both Input and Output sample types #74

mitchmindtree opened this issue Nov 30, 2014 · 7 comments
Labels

Comments

@mitchmindtree
Copy link
Member

It looks like we're about to hit the classic use-case for associated types!

I just realised there are a couple changes that need to be made to the Node's audio_received method (not included in the test example).

  • Rather than taking B where B DspBuffer<O>, O: OutputSample, audio_received should take Vec<I> where I: InputSample
  • This means our trait should probably be Node<B, I, O> where B: DspBuffer<O>, I: InputSample, O: OutputSample

The amount of type parameters will likely get very frustrating very quickly, but we'll be able to clean up nicely once associated types land.

@mitchmindtree
Copy link
Member Author

I'm going to have a go at using the feature gated associated types, just to see how far I get...

@mitchmindtree
Copy link
Member Author

Didn't get very far at all! I'll change it over to Node<B=Vec<f32>, I=f32, O=f32> until assoc types stabilise a bit further

@bvssvni
Copy link
Contributor

bvssvni commented Dec 1, 2014

One day... the associated types will prevail! :P

@mitchmindtree
Copy link
Member Author

This was implemented (I accidently pushed it straight to the repo)

@mitchmindtree
Copy link
Member Author

@mitchmindtree mitchmindtree reopened this Dec 17, 2014
@bvssvni
Copy link
Contributor

bvssvni commented Dec 17, 2014

This is exciting!

@mitchmindtree
Copy link
Member Author

This has been implemented and the abstraction has it's own crate.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants