Repository navigation
Remove nbr_frames from write_to_device, take Copy enums by value - #85
Merged
Merged
Conversation
Direction, Role, ShareMode, StreamMode and SampleType are all Copy, but several methods took them by reference. Newer methods like get_buffer_size_limits already take TimingMode by value, so this makes the API consistent. Affects get_device_collection, get_default_device, get_default_device_for_role, is_supported, initialize_client and WaveFormat::new. Callers drop the `&`.
The slice length already gives the number of frames, so the argument only duplicated it. It has been there since the first commit, copied from the deque variant, where it is needed since the deque can hold more than one buffer. write_to_device_from_deque keeps it. A slice that is not a whole number of frames still gives DataLengthMismatch, and an empty slice is still a no-op. Fixes #84
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Two breaking API cleanups.
AudioRenderClient::write_to_deviceno longer takesnbr_frames, the slice length gives the frame count. A slice that isn't a whole number of frames still givesDataLengthMismatch.write_to_device_from_dequekeeps its frame count.Direction,Role,ShareMode,StreamModeandSampleTypeare taken by value instead of by reference, inget_device_collection,get_default_device,get_default_device_for_role,is_supported,initialize_clientandWaveFormat::new.Fixes #84