more utility code for formats.rs
authorKostya Shishkov <kostya.shishkov@gmail.com>
Tue, 23 May 2017 17:09:30 +0000 (19:09 +0200)
committerKostya Shishkov <kostya.shishkov@gmail.com>
Tue, 23 May 2017 17:11:21 +0000 (19:11 +0200)
src/formats.rs

index 03e6411bf107e4e5e12cb7a8d73738db8f205d37..aa053b2e75f55df7eb5cf6b7e0b64b3121a89a35 100644 (file)
@@ -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()
     }