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

Make mixer::Channel and mixer::Group fields public #708

Merged
merged 3 commits into from
Oct 1, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,11 @@ in `Texture`s in the `render` module.
* Adds the `Music::from_static_bytes` function, which creates a Music instance with the
static lifetime from a buffer that also has a static lifetime.

[PR #708](https://github.com/Rust-SDL2/rust-sdl2/pull/708)

* Makes the fields of the `sdl2::mixer::Channel(i32)` and `sdl::mixer::Group(i32)` structs
public so they can be instantiated directly, and deprecates `sdl2::mixer::channel(i32)`.

### v0.30

Re-exported sdl2\_sys as sdl2::sys
Expand Down
5 changes: 3 additions & 2 deletions src/sdl2/mixer/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -336,9 +336,10 @@ pub enum Fading {

/// Sound effect channel.
#[derive(Debug, Copy, Clone, PartialEq)]
pub struct Channel(i32);
pub struct Channel(pub i32);

/// Return a channel object.
#[deprecated(since = "0.31.0", note = "use `Channel(i32)` instead")]
pub fn channel(chan: i32) -> Channel {
Channel(chan)
}
Expand Down Expand Up @@ -629,7 +630,7 @@ pub fn reserve_channels(num: i32) -> i32 {

/// Sound effect channel grouping.
#[derive(Copy, Clone)]
pub struct Group(i32);
pub struct Group(pub i32);

impl default::Default for Group {
fn default() -> Group {
Expand Down