-/* -*- c-basic-offset: 8; default-tab-width: 8; -*- */
-
/*
Copyright (C) 2013 Carl Hetherington <cth@carlh.net>
int const AudioContentProperty::AUDIO_FRAME_RATE = 202;
int const AudioContentProperty::AUDIO_GAIN = 203;
int const AudioContentProperty::AUDIO_DELAY = 204;
+int const AudioContentProperty::AUDIO_MAPPING = 205;
AudioContent::AudioContent (shared_ptr<const Film> f, Time s)
: Content (f, s)
static int const AUDIO_FRAME_RATE;
static int const AUDIO_GAIN;
static int const AUDIO_DELAY;
+ static int const AUDIO_MAPPING;
};
class AudioContent : public virtual Content
virtual int content_audio_frame_rate () const = 0;
virtual int output_audio_frame_rate () const = 0;
virtual AudioMapping audio_mapping () const = 0;
+ virtual void set_audio_mapping (AudioMapping) = 0;
void set_audio_gain (float);
void set_audio_delay (int);
-/* -*- c-basic-offset: 8; default-tab-width: 8; -*- */
-
/*
Copyright (C) 2013 Carl Hetherington <cth@carlh.net>
signal_changed (FFmpegContentProperty::FILTERS);
}
+void
+FFmpegContent::set_audio_mapping (AudioMapping m)
+{
+ audio_stream()->mapping = m;
+ signal_changed (AudioContentProperty::AUDIO_MAPPING);
+}
int content_audio_frame_rate () const;
int output_audio_frame_rate () const;
AudioMapping audio_mapping () const;
+ void set_audio_mapping (AudioMapping);
void set_filters (std::vector<Filter const *> const &);
AudioMapping audio_mapping () const {
return AudioMapping ();
}
+
+ void set_audio_mapping (AudioMapping) {}
Time length () const {
return _length;
-/* -*- c-basic-offset: 8; default-tab-width: 8; -*- */
-
/*
Copyright (C) 2013 Carl Hetherington <cth@carlh.net>
_audio_channels = node->number_child<int> ("AudioChannels");
_audio_length = node->number_child<ContentAudioFrame> ("AudioLength");
_audio_frame_rate = node->number_child<int> ("AudioFrameRate");
+ _audio_mapping = AudioMapping (node->node_child ("AudioMapping"));
}
string
signal_changed (AudioContentProperty::AUDIO_CHANNELS);
signal_changed (AudioContentProperty::AUDIO_LENGTH);
signal_changed (AudioContentProperty::AUDIO_FRAME_RATE);
+
+ /* XXX: do this in signal_changed...? */
+ _audio_mapping = AudioMapping (_audio_channels);
+ signal_changed (AudioContentProperty::AUDIO_MAPPING);
}
void
node->add_child("AudioChannels")->add_child_text (lexical_cast<string> (_audio_channels));
node->add_child("AudioLength")->add_child_text (lexical_cast<string> (_audio_length));
node->add_child("AudioFrameRate")->add_child_text (lexical_cast<string> (_audio_frame_rate));
+ _audio_mapping.as_xml (node->add_child("AudioMapping"));
}
Time
return film->dcp_audio_frame_rate ();
}
+
+void
+SndfileContent::set_audio_mapping (AudioMapping m)
+{
+ {
+ boost::mutex::scoped_lock lm (_mutex);
+ _audio_mapping = m;
+ }
+
+ signal_changed (AudioContentProperty::AUDIO_MAPPING);
+}
-/* -*- c-basic-offset: 8; default-tab-width: 8; -*- */
-
/*
Copyright (C) 2013 Carl Hetherington <cth@carlh.net>
boost::mutex::scoped_lock lm (_mutex);
return _audio_mapping;
}
+
+ void set_audio_mapping (AudioMapping);
static bool valid_file (boost::filesystem::path);
-/* -*- c-basic-offset: 8; default-tab-width: 8; -*- */
-
/*
Copyright (C) 2013 Carl Hetherington <cth@carlh.net>
}
void
-AudioMappingView::set_mapping (AudioMapping map)
+AudioMappingView::set (AudioMapping map)
{
if (_grid->GetNumberRows ()) {
_grid->DeleteRows (0, _grid->GetNumberRows ());
public:
AudioMappingView (wxWindow *);
- void set_mapping (AudioMapping);
+ void set (AudioMapping);
boost::signals2::signal<void (AudioMapping)> Changed;
ffmpeg_content = dynamic_pointer_cast<FFmpegContent> (content);
}
+ /* We can't use case {} here */
+
if (property == ContentProperty::START) {
if (content) {
_start->set (content->start (), _film->dcp_video_frame_rate ());
} else {
_start->set (0, 24);
}
+
} else if (property == VideoContentProperty::VIDEO_CROP) {
checked_set (_left_crop, video_content ? video_content->crop().left : 0);
checked_set (_right_crop, video_content ? video_content->crop().right : 0);
checked_set (_audio_gain, audio_content ? audio_content->audio_gain() : 0);
} else if (property == AudioContentProperty::AUDIO_DELAY) {
checked_set (_audio_delay, audio_content ? audio_content->audio_delay() : 0);
+ } else if (property == AudioContentProperty::AUDIO_MAPPING) {
+ _audio_mapping->set (audio_content ? audio_content->audio_mapping () : AudioMapping ());
} else if (property == FFmpegContentProperty::SUBTITLE_STREAMS) {
_subtitle_stream->Clear ();
if (ffmpeg_content) {
film_content_changed (boost::shared_ptr<Content> (), VideoContentProperty::VIDEO_CROP);
film_content_changed (boost::shared_ptr<Content> (), AudioContentProperty::AUDIO_GAIN);
film_content_changed (boost::shared_ptr<Content> (), AudioContentProperty::AUDIO_DELAY);
+ film_content_changed (boost::shared_ptr<Content> (), AudioContentProperty::AUDIO_MAPPING);
film_content_changed (boost::shared_ptr<Content> (), FFmpegContentProperty::SUBTITLE_STREAMS);
film_content_changed (boost::shared_ptr<Content> (), FFmpegContentProperty::SUBTITLE_STREAM);
film_content_changed (boost::shared_ptr<Content> (), FFmpegContentProperty::AUDIO_STREAMS);
film_content_changed (s, VideoContentProperty::VIDEO_CROP);
film_content_changed (s, AudioContentProperty::AUDIO_GAIN);
film_content_changed (s, AudioContentProperty::AUDIO_DELAY);
+ film_content_changed (s, AudioContentProperty::AUDIO_MAPPING);
film_content_changed (s, FFmpegContentProperty::AUDIO_STREAM);
film_content_changed (s, FFmpegContentProperty::AUDIO_STREAMS);
film_content_changed (s, FFmpegContentProperty::SUBTITLE_STREAM);
return;
}
- shared_ptr<FFmpegContent> fc = dynamic_pointer_cast<FFmpegContent> (c);
- if (!fc) {
+ shared_ptr<AudioContent> ac = dynamic_pointer_cast<AudioContent> (c);
+ if (!ac) {
return;
}
- /* XXX: should be general to audiocontent */
- fc->audio_stream()->mapping = m;
+ ac->set_audio_mapping (m);
}