+void
+ContentMenu::join ()
+{
+ vector<shared_ptr<Content> > fc;
+ for (ContentList::const_iterator i = _content.begin(); i != _content.end(); ++i) {
+ shared_ptr<FFmpegContent> f = dynamic_pointer_cast<FFmpegContent> (*i);
+ if (f) {
+ fc.push_back (f);
+ }
+ }
+
+ assert (fc.size() > 1);
+
+ shared_ptr<Film> film = _film.lock ();
+ if (!film) {
+ return;
+ }
+
+ try {
+ shared_ptr<FFmpegContent> joined (new FFmpegContent (film, fc));
+ for (ContentList::const_iterator i = _content.begin(); i != _content.end(); ++i) {
+ film->remove_content (*i);
+ }
+ film->add_content (joined);
+ } catch (JoinError& e) {
+ error_dialog (_parent, std_to_wx (e.what ()));
+ }
+}
+