mirror of
https://github.com/italicsjenga/agb.git
synced 2024-12-24 00:31:34 +11:00
Rename get_channel to channel
This commit is contained in:
parent
518f73c01e
commit
48ddda9ae9
|
@ -25,7 +25,7 @@ fn main(mut gba: Gba) -> ! {
|
||||||
input.update();
|
input.update();
|
||||||
|
|
||||||
{
|
{
|
||||||
if let Some(channel) = mixer.get_channel(&channel_id) {
|
if let Some(channel) = mixer.channel(&channel_id) {
|
||||||
let half: Num<i16, 4> = Num::new(1) / 2;
|
let half: Num<i16, 4> = Num::new(1) / 2;
|
||||||
let half_usize: Num<usize, 8> = Num::new(1) / 2;
|
let half_usize: Num<usize, 8> = Num::new(1) / 2;
|
||||||
match input.x_tri() {
|
match input.x_tri() {
|
||||||
|
|
|
@ -85,7 +85,7 @@ impl<'a> Mixer<'a> {
|
||||||
panic!("Cannot play more than 8 sounds at once");
|
panic!("Cannot play more than 8 sounds at once");
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn get_channel(&mut self, id: &ChannelId) -> Option<&'_ mut SoundChannel> {
|
pub fn channel(&mut self, id: &ChannelId) -> Option<&'_ mut SoundChannel> {
|
||||||
if let Some(channel) = &mut self.channels[id.0] {
|
if let Some(channel) = &mut self.channels[id.0] {
|
||||||
if self.indices[id.0] == id.1 && !channel.is_done {
|
if self.indices[id.0] == id.1 && !channel.is_done {
|
||||||
return Some(channel);
|
return Some(channel);
|
||||||
|
|
|
@ -45,7 +45,7 @@ impl<'a> Sfx<'a> {
|
||||||
|
|
||||||
pub fn stop_music(&mut self) {
|
pub fn stop_music(&mut self) {
|
||||||
if let Some(bgm) = &self.bgm {
|
if let Some(bgm) = &self.bgm {
|
||||||
let channel = self.mixer.get_channel(bgm).unwrap();
|
let channel = self.mixer.channel(bgm).unwrap();
|
||||||
channel.stop();
|
channel.stop();
|
||||||
}
|
}
|
||||||
self.bgm = None;
|
self.bgm = None;
|
||||||
|
@ -53,7 +53,7 @@ impl<'a> Sfx<'a> {
|
||||||
|
|
||||||
pub fn purple_night(&mut self) {
|
pub fn purple_night(&mut self) {
|
||||||
if let Some(bgm) = &self.bgm {
|
if let Some(bgm) = &self.bgm {
|
||||||
let channel = self.mixer.get_channel(bgm).unwrap();
|
let channel = self.mixer.channel(bgm).unwrap();
|
||||||
channel.stop();
|
channel.stop();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -64,7 +64,7 @@ impl<'a> Sfx<'a> {
|
||||||
|
|
||||||
pub fn sunrise(&mut self) {
|
pub fn sunrise(&mut self) {
|
||||||
if let Some(bgm) = &self.bgm {
|
if let Some(bgm) = &self.bgm {
|
||||||
let channel = self.mixer.get_channel(bgm).unwrap();
|
let channel = self.mixer.channel(bgm).unwrap();
|
||||||
channel.stop();
|
channel.stop();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -75,7 +75,7 @@ impl<'a> Sfx<'a> {
|
||||||
|
|
||||||
pub fn boss(&mut self) {
|
pub fn boss(&mut self) {
|
||||||
if let Some(bgm) = &self.bgm {
|
if let Some(bgm) = &self.bgm {
|
||||||
let channel = self.mixer.get_channel(bgm).unwrap();
|
let channel = self.mixer.channel(bgm).unwrap();
|
||||||
channel.stop();
|
channel.stop();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue