From 10a00d5246e055230d666ed0455b5cf18aa00505 Mon Sep 17 00:00:00 2001 From: Kostya Shishkov Date: Tue, 23 May 2017 19:09:30 +0200 Subject: [PATCH] more utility code for formats.rs --- src/formats.rs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/formats.rs b/src/formats.rs index 03e6411..aa053b2 100644 --- a/src/formats.rs +++ b/src/formats.rs @@ -59,7 +59,7 @@ impl fmt::Display for NASoniton { } } -#[derive(Debug,Clone,Copy)] +#[derive(Debug,Clone,Copy,PartialEq)] pub enum NAChannelType { C, L, R, Cs, Ls, Rs, Lss, Rss, LFE, Lc, Rc, Lh, Rh, Ch, LFE2, Lw, Rw, Ov, Lhs, Rhs, Chs, Ll, Rl, Cl, Lt, Rt, Lo, Ro } @@ -142,6 +142,11 @@ impl NAChannelMap { pub fn add_channel(&mut self, ch: NAChannelType) { self.ids.push(ch); } + pub fn add_channels(&mut self, chs: &[NAChannelType]) { + for i in 0..chs.len() { + self.ids.push(chs[i]); + } + } pub fn num_channels(&self) -> usize { self.ids.len() } -- 2.39.5