Skip to content

Commit

Permalink
Make mixer::Channel and mixer::Group fields public (#708)
Browse files Browse the repository at this point in the history
Also deprecate the now-unnecessary mixer::channel(i32) function.
  • Loading branch information
stephanwilliams authored and Cobrand committed Oct 1, 2017
1 parent 0f44d43 commit d18a82a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
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

0 comments on commit d18a82a

Please sign in to comment.