AudioDialog::analysis_finished ()
{
shared_ptr<const Film> film = _film.lock ();
- DCPOMATIC_ASSERT (film);
+ if (!film) {
+ /* This should not happen, but if it does we should just give up quietly */
+ return;
+ }
if (!boost::filesystem::exists (film->audio_analysis_path (_playlist))) {
/* We analysed and still nothing showed up, so maybe it was cancelled or it failed.
d->set_reference_audio (_reference->GetValue ());
}
+
+void
+AudioPanel::set_film (shared_ptr<Film>)
+{
+ /* We are changing film, so destroy any audio dialog for the old one */
+ if (_audio_dialog) {
+ _audio_dialog->Destroy ();
+ _audio_dialog = 0;
+ }
+}
void film_changed (Film::Property);
void film_content_changed (int);
void content_selection_changed ();
+ void set_film (boost::shared_ptr<Film>);
private:
void show_clicked ();
void
ContentPanel::set_film (shared_ptr<Film> film)
{
+ _audio_panel->set_film (film);
+
_film = film;
film_changed (Film::CONTENT);
class TimelineDialog;
class FilmEditor;
class ContentSubPanel;
+class AudioPanel;
class Film;
class FilmViewer;
wxButton* _later;
wxButton* _timeline;
ContentSubPanel* _video_panel;
- ContentSubPanel* _audio_panel;
+ AudioPanel* _audio_panel;
ContentSubPanel* _subtitle_panel;
ContentSubPanel* _timing_panel;
std::list<ContentSubPanel *> _panels;
void
DCPPanel::set_film (shared_ptr<Film> film)
{
+ /* We are changing film, so destroy any audio dialog for the old one */
+ if (_audio_dialog) {
+ _audio_dialog->Destroy ();
+ _audio_dialog = 0;
+ }
+
_film = film;
film_changed (Film::NAME);