: wxPanel (parent)
, _generally_sensitive (true)
, _audio_dialog (0)
+ , _timeline_dialog (0)
{
wxBoxSizer* s = new wxBoxSizer (wxVERTICAL);
_notebook = new wxNotebook (this, wxID_ANY);
void
FilmEditor::timeline_clicked (wxCommandEvent &)
{
- TimelineDialog* d = new TimelineDialog (this, _film->playlist ());
- d->ShowModal ();
- d->Destroy ();
+ if (_timeline_dialog) {
+ _timeline_dialog->Destroy ();
+ _timeline_dialog = 0;
+ }
+
+ _timeline_dialog = new TimelineDialog (this, _film->playlist ());
+ _timeline_dialog->Show ();
}
class Film;
class AudioDialog;
class AudioMappingView;
+class TimelineDialog;
/** @class FilmEditor
* @brief A wx widget to edit a film's metadata, and perform various functions.
bool _generally_sensitive;
AudioDialog* _audio_dialog;
+ TimelineDialog* _timeline_dialog;
};
using std::cout;
using std::max;
using boost::shared_ptr;
+using boost::bind;
int const Timeline::_track_height = 64;
} else {
SetMinSize (wxSize (640, _track_height * (max (1UL, pl->audio().size()) + 1) + 96));
}
+
+ pl->Changed.connect (bind (&Timeline::playlist_changed, this));
+ pl->ContentChanged.connect (bind (&Timeline::playlist_changed, this));
}
template <class T>
delete gc;
}
+void
+Timeline::playlist_changed ()
+{
+ Refresh ();
+}
private:
void paint (wxPaintEvent &);
+ void playlist_changed ();
static int const _track_height;