Add a couple more audio properties.
authorCarl Hetherington <cth@carlh.net>
Thu, 18 Feb 2016 00:11:44 +0000 (00:11 +0000)
committerCarl Hetherington <cth@carlh.net>
Thu, 18 Feb 2016 00:11:44 +0000 (00:11 +0000)
src/lib/audio_content.cc
src/lib/audio_content.h
src/lib/ffmpeg_content.cc
src/lib/single_stream_audio_content.cc

index 6d9c85ca20201c2719931216b114428163abb9ad..87a1d180343f563bb5fccb17926c7be2b8dbb84e 100644 (file)
@@ -1,5 +1,5 @@
 /*
-    Copyright (C) 2013-2015 Carl Hetherington <cth@carlh.net>
+    Copyright (C) 2013-2016 Carl Hetherington <cth@carlh.net>
 
     This program is free software; you can redistribute it and/or modify
     it under the terms of the GNU General Public License as published by
@@ -36,6 +36,8 @@ using std::cout;
 using std::vector;
 using std::stringstream;
 using std::fixed;
+using std::list;
+using std::pair;
 using std::setprecision;
 using boost::shared_ptr;
 using boost::dynamic_pointer_cast;
@@ -292,3 +294,9 @@ AudioContent::audio_channel_names () const
 
        return n;
 }
+
+void
+AudioContent::add_properties (list<pair<string, string> >& p) const
+{
+       p.push_back (make_pair (_("DCP audio frame rate"), raw_convert<string> (resampled_audio_frame_rate ())));
+}
index 82c95a513a3ca475d7d3312551fed1255000aeba..95231a7d742382990057e0ddf644e76d693ae9ae 100644 (file)
@@ -1,5 +1,5 @@
 /*
-    Copyright (C) 2013-2015 Carl Hetherington <cth@carlh.net>
+    Copyright (C) 2013-2016 Carl Hetherington <cth@carlh.net>
 
     This program is free software; you can redistribute it and/or modify
     it under the terms of the GNU General Public License as published by
@@ -77,6 +77,10 @@ public:
 
        std::string processing_description () const;
 
+protected:
+
+       void add_properties (std::list<std::pair<std::string, std::string> > &) const;
+
 private:
        /** Gain to apply to audio in dB */
        double _audio_gain;
index 5cd5d3729b9ef9fdafa0d3cf8bf1c6b471b8841a..f2fe06f36aca3b182b892fc719654aeda96bcb82 100644 (file)
@@ -1,5 +1,5 @@
 /*
-    Copyright (C) 2013-2015 Carl Hetherington <cth@carlh.net>
+    Copyright (C) 2013-2016 Carl Hetherington <cth@carlh.net>
 
     This program is free software; you can redistribute it and/or modify
     it under the terms of the GNU General Public License as published by
@@ -395,6 +395,7 @@ void
 FFmpegContent::add_properties (list<pair<string, string> >& p) const
 {
        VideoContent::add_properties (p);
+       AudioContent::add_properties (p);
 
        if (_bits_per_pixel) {
                int const sub = 219 * pow (2, _bits_per_pixel.get() - 8);
index 4c59420cbfe16b3c350e13235ff01926dbde1251..b3c74d901e58f25fcd2709a4d4868a0f9829f330 100644 (file)
@@ -88,6 +88,8 @@ SingleStreamAudioContent::audio_streams () const
 void
 SingleStreamAudioContent::add_properties (list<pair<string, string> >& p) const
 {
-       /* XXX: this could be better wrt audio streams */
        p.push_back (make_pair (_("Audio channels"), raw_convert<string> (audio_stream()->channels ())));
+       p.push_back (make_pair (_("Content audio frame rate"), raw_convert<string> (audio_stream()->frame_rate ())));
+
+       AudioContent::add_properties (p);
 }