Commit graph

23 commits

Author SHA1 Message Date
Jan Andre Ikenmeyer
a1a14459c1
Update MPL license to https (part 3) 2018-11-19 14:47:12 +01:00
Agustin Chiappe Berrini
75eb94afca Unify the task source and task canceller API
I moved away from the `Window` struct all the logic to handle task
sources, into a new struct called `TaskManager`. In a happy world, I'd
be able to just have there two functions, of the types:

```rust
fn task_source<T: TaskSource>(&self, name: TaskSourceName) -> Box<T>
fn task_source_with_canceller<T: TaskSource>(&self, name: TaskSourceName)
  -> (Box<T>, TaskSourceCanceller)
```

And not so much duplicated code. However, because TaskSource can't be a
trait object (because it has generic type parameters), that's not
possible. Instead, I decided to reduce duplicated logic through macros.

For reasons[1], I have to pass both the name of the function with
canceller and the name of the function without, as I'm not able to
concatenate them in the macro itself. I could probably use
`concat_idents` to create both types already defined and reduce the
amount of arguments by one, but that macro is nightly only. At the same
time, not being able to declare macros inside `impl` forces me to pass
`self` as an argument.

All this makes this solution more verbose than it would be ideally. It
does reduce duplication, but it doesn't reduce the size of the file.

[1](https://github.com/rust-lang/rust/issues/29599)
2018-11-14 06:36:44 -05:00
Pyfisch
9e92eb205a Reorder imports 2018-11-06 22:35:07 +01:00
Simon Sapin
76e59a46d3 Sort use statements 2018-11-06 15:26:02 +01:00
Simon Sapin
45f7199eee cargo fix --edition 2018-11-06 15:26:02 +01:00
Manish Goregaokar
40641ac8a4 More accurate names for .started and .stopped 2018-10-11 14:28:05 -07:00
Fernando Jiménez Moreno
bc6586a9d0 Throw if time given to AudioScheduledSourceNode.stop is negative 2018-09-25 17:16:17 +02:00
chansuke
c37a345dc9 Format script component 2018-09-19 17:40:47 -04:00
Manish Goregaokar
9254606b01 Pass down ChannelInfo to create_node 2018-09-11 19:24:01 +05:30
Manish Goregaokar
28c21421ca Throw on out-of-bounds channelCount in AudioNodes 2018-09-03 20:31:52 +05:30
Manish Goregaokar
4b48cfa3ec Upgrade to latest servo-media 2018-08-23 13:33:40 -07:00
Fernando Jiménez Moreno
acb03603b6 Fire AudioScheduledSourceNode.onended when playback stops 2018-07-30 14:23:46 +02:00
Fernando Jiménez Moreno
21cb160be3 test-tidy fixes 2018-07-30 14:21:48 +02:00
Fernando Jiménez Moreno
8a6ea00f58 Reference issue to support the AudioScheduledSourceNode.ended event 2018-07-30 14:21:47 +02:00
Fernando Jiménez Moreno
b26a3bd31b rustfmt 2018-07-30 14:21:46 +02:00
Manish Goregaokar
f0d04249f9 Use new params impl (#4)
* AudioNodeType -> AudioNodeInit

* Use new param type system, clean up
2018-07-30 14:21:44 +02:00
Fernando Jiménez Moreno
356d7fd7a6 createBufferSource and buffer setter on buffer source node 2018-07-30 14:21:43 +02:00
Fernando Jiménez Moreno
7380f69f77 Initial AudioParam bindings 2018-07-30 14:21:41 +02:00
Fernando Jiménez Moreno
07c0450e29 Get destination node engine from context 2018-07-30 14:21:40 +02:00
Fernando Jiménez Moreno
cdd7995d34 AudioScheduledSourceNode start and stop 2018-07-30 14:21:40 +02:00
Fernando Jiménez Moreno
53d4933a40 Update to use latest servo-media API 2018-07-30 14:21:37 +02:00
Fernando Jiménez Moreno
d8365111c9 Test OscillatorNode with servo_media 2018-07-30 14:21:37 +02:00
Fernando Jiménez Moreno
7ee42e4223 Initial WebAudio API stubs 2018-07-30 14:21:36 +02:00