Commit graph

22 commits

Author SHA1 Message Date
dvdsk
d1a809feac
formats everything with cargo fmt 2023-10-13 15:47:28 +02:00
dvdsk
10262f8134
removes can_seek in favor of rolling back seek operations (requires PR #510) 2023-10-13 15:45:40 +02:00
dvdsk
ebebe88339
turns SeekNotSupported into a SeekError 2023-10-13 15:45:40 +02:00
dvdsk
9a4dcb0c41
add can_seek method to source
document why Sink::can_seek does not exist
2023-10-13 15:45:27 +02:00
dvdsk
1f3f36a4c8
removes default try_seek impl, impl try_seek for decoders + refactors decoderimpl a bit 2023-10-13 15:45:06 +02:00
Chris Patuzzo
d40551db78 Extract DynamicMixer::sum_current_sources()
I think this makes the next() function easier to understand. We can
write this more efficiently by reusing a Vec on the struct rather than
allocating each time and a mem::swap to avoid shifting elements in a Vec.
2021-07-23 11:51:47 +02:00
Chris Patuzzo
437bcf4ce7 Fix sources sometimes playing in the wrong channels
For example, if a stereo source starts playing on an odd-numbered call
to DynamicMixer::next() then the output stream will play its first
sample in the right channel, its second in the left, etc. This is wrong.
The first sample should be played in the left channel.
2021-07-23 11:51:47 +02:00
Christopher Serr
181da2994b
Remove unnecessary 'static bound and cleanup (#356)
* Remove unnecessary 'static bound and cleanup

The decoder had an unnecessary 'static bound. Additionally I noticed
that there's a lot of (clippy) warnings, so I cleaned up the code a bit
as well. There's a few warnings left, but a few of those require
breaking changes.

* Address Review Comments
2021-03-06 18:46:52 +01:00
Alex Butler
c93adb2582
Migrate to edition 2018
* Remove unstable/legacy rustfmt config
* Run rustfmt
2020-05-02 13:33:57 +01:00
Alex Butler
0517ee7216
Add RodioDevice wrapper for cpal::Device
* Remove static/global facilities.
2020-05-02 13:33:56 +01:00
est31
70c2985b7c Add dyn to the traits
This fixes a few warnings on nightly
2019-08-10 23:03:19 +02:00
thiolliere
2933c3c0b2
fix dynamic mixer doc 2018-06-20 19:32:57 +02:00
Francesco Zardi
6a8c71bdb2 Run cargo fmt 2018-04-19 10:03:48 +02:00
Francesco Zardi
74ceb63c3c Update cpal dependency to 0.7
The update required adapting to the breaking changes introduced by the new version, as reported in the `cpal`'s
[changelog](a2fe9386af/CHANGELOG.md), namely:

- Rename `ChannelsCount` to `ChannelCount`.
- Rename `SamplesRate` to `SampleRate`.
- Rename the `min_samples_rate` field of `SupportedFormat` to `min_sample_rate`
- Rename the `with_max_samples_rate()` method of`SupportedFormat` to `with_max_sample_rate()`
- Rename the `samples_rate` field of `Format` to `sample_rate`
- Changed the type of the `channels` field of the `SupportedFormat` struct from `Vec<ChannelPosition>` to `ChannelCount` (an alias to `u16`)
2018-04-18 14:24:33 +02:00
Pierre Krieger
45c60ca155 Add a small basic test to dynamic_mixer 2017-07-30 18:56:24 +02:00
Pierre Krieger
88b0d40e4b Run rustfmt on the code 2017-07-03 10:10:00 +02:00
Pierre Krieger
44a8a2b923 Rustfmt 2017-05-04 13:51:33 +02:00
Pierre Krieger
7df741665d Rename methods of the Source trait 2017-05-01 11:11:33 +02:00
Pierre Krieger
e06f1f84e7 Use saturating_add for the samples, and fix the mixer 2017-02-10 09:50:12 +01:00
Pierre Krieger
c7bd21b75a Add tests for dynamic_mixer 2017-02-09 13:10:51 +01:00
Pierre Krieger
885caa6e74 Make the dynamic mixer drop finished sources 2017-02-07 11:11:14 +01:00
Pierre Krieger
78281513a1 Add dynamic_mixer 2017-02-07 08:51:11 +01:00