aboutsummaryrefslogtreecommitdiffstats
path: root/taglib/it/itfile.cpp
diff options
context:
space:
mode:
authorMathias Panzenböck <grosser.meister.morti@gmx.net>2011-06-20 02:19:16 +0200
committerMathias Panzenböck <grosser.meister.morti@gmx.net>2011-06-20 02:19:16 +0200
commitd1cb8ae09db9f2379168696b51ba165846bcf9f6 (patch)
tree290aa47cd0ea61f5ae3d987fe656728c95ddbc8b /taglib/it/itfile.cpp
parent4b44f2504882f9c407a4c205112b0de53bece9c3 (diff)
IT: support channels property
Diffstat (limited to 'taglib/it/itfile.cpp')
-rw-r--r--taglib/it/itfile.cpp17
1 files changed, 17 insertions, 0 deletions
diff --git a/taglib/it/itfile.cpp b/taglib/it/itfile.cpp
index 1ec69313..d8040cdb 100644
--- a/taglib/it/itfile.cpp
+++ b/taglib/it/itfile.cpp
@@ -176,6 +176,23 @@ void IT::File::read(bool)
}
*/
+ seek(64);
+
+ ByteVector pannings = readBlock(64);
+ ByteVector volumes = readBlock(64);
+ READ_ASSERT(pannings.size() == 64 && volumes.size() == 64);
+ int channels = 0;
+ for(int i = 0; i < 64; ++ i)
+ {
+ // Strictly speaking an IT file has always 64 channels, but
+ // I don't count disabled and muted channels.
+ // But this always gives 64 channels for all my files anyway.
+ // Strangely VLC does report other values. I wonder how VLC
+ // gets it's values.
+ if(pannings[i] < 128 && volumes[i] > 0) ++ channels;
+ }
+ d->properties.setChannels(channels);
+
StringList comment;
// Note: I found files that have nil characters somewhere
// in the instrument/sample names and more characters