Skip to content

Commit

Permalink
Remove unused preset arg in Channel
Browse files Browse the repository at this point in the history
  • Loading branch information
PolyMeilex committed Dec 29, 2024
1 parent dbe38c3 commit 61c8061
Show file tree
Hide file tree
Showing 6 changed files with 5 additions and 10 deletions.
4 changes: 2 additions & 2 deletions oxisynth/src/core/channel_pool/channel.rs
Original file line number Diff line number Diff line change
Expand Up @@ -70,14 +70,14 @@ pub struct Channel {
}

impl Channel {
pub fn new(id: usize, preset: Option<Arc<Preset>>) -> Self {
pub fn new(id: usize) -> Self {
let mut chan = Self {
id,
sfontnum: None,
banknum: 0,
prognum: 0,

preset,
preset: None,

key_pressure: [0; 128],
channel_pressure: 0,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,18 +1,13 @@
use std::sync::Arc;

mod channel;
pub use channel::{Channel, InterpolationMethod};

use crate::core::soundfont::Preset;
use crate::OxiError;

pub struct ChannelPool(Vec<Channel>);

impl ChannelPool {
pub fn new(len: usize, preset: Option<Arc<Preset>>) -> Self {
let channels = (0..len)
.map(|id| Channel::new(id, preset.clone()))
.collect();
pub fn new(len: usize) -> Self {
let channels = (0..len).map(Channel::new).collect();
Self(channels)
}

Expand Down
2 changes: 1 addition & 1 deletion oxisynth/src/core/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ impl Core {

font_bank: FontBank::new(),

channels: ChannelPool::new(settings.midi_channels as usize, None),
channels: ChannelPool::new(settings.midi_channels as usize),
voices: VoicePool::new(settings.polyphony as usize, settings.sample_rate),

output: OutputBuffer::new(nbuf as usize),
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit 61c8061

Please sign in to comment.