diff options
| author | Carl Hetherington <cth@carlh.net> | 2016-02-18 17:42:58 +0000 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2016-02-18 17:42:58 +0000 |
| commit | d8a19dca28268e3ac92f117d00c1064c0b06515c (patch) | |
| tree | c3a9d9d6b25689c828578300c46361444bb72c1b /src/lib/audio_content.cc | |
| parent | 1b81ba7c24e7f117d1960021d7e28c8f0147009f (diff) | |
Various improvements to the content properties dialogue (including #791).
Diffstat (limited to 'src/lib/audio_content.cc')
| -rw-r--r-- | src/lib/audio_content.cc | 45 |
1 files changed, 43 insertions, 2 deletions
diff --git a/src/lib/audio_content.cc b/src/lib/audio_content.cc index 87a1d1803..c17893c5a 100644 --- a/src/lib/audio_content.cc +++ b/src/lib/audio_content.cc @@ -296,7 +296,48 @@ AudioContent::audio_channel_names () const } void -AudioContent::add_properties (list<pair<string, string> >& p) const +AudioContent::add_properties (list<UserProperty>& p) const { - p.push_back (make_pair (_("DCP audio frame rate"), raw_convert<string> (resampled_audio_frame_rate ()))); + shared_ptr<const AudioStream> stream; + if (audio_streams().size() == 1) { + stream = audio_streams().front (); + } + + if (stream) { + p.push_back (UserProperty (_("Audio"), _("Channels"), stream->channels ())); + p.push_back (UserProperty (_("Audio"), _("Content audio frame rate"), stream->frame_rate(), _("Hz"))); + } + + shared_ptr<const Film> film = _film.lock (); + DCPOMATIC_ASSERT (film); + + FrameRateChange const frc = film->active_frame_rate_change (position ()); + ContentTime const c (full_length(), frc); + + p.push_back ( + UserProperty (_("Length"), _("Full length in video frames at content rate"), c.frames_round(frc.source)) + ); + + if (stream) { + p.push_back ( + UserProperty ( + _("Length"), + _("Full length in audio frames at content rate"), + c.frames_round (stream->frame_rate ()) + ) + ); + } + + p.push_back (UserProperty (_("Audio"), _("DCP frame rate"), resampled_audio_frame_rate ())); + p.push_back (UserProperty (_("Length"), _("Full length in video frames at DCP rate"), c.frames_round (frc.dcp))); + + if (stream) { + p.push_back ( + UserProperty ( + _("Length"), + _("Full length in audio frames at DCP rate"), + c.frames_round (resampled_audio_frame_rate ()) + ) + ); + } } |
