swaroop: move previous button.
[dcpomatic.git] / src / wx / swaroop_controls.cc
index 6e3d052eb40a92ac4ec1e824b3f3ec8f2deb40bf..f38fd33432a2ca1a8a4047242bca98eae6ac273e 100644 (file)
@@ -48,11 +48,11 @@ SwaroopControls::SwaroopControls (wxWindow* parent, shared_ptr<FilmViewer> viewe
        , _current_disable_timeline (false)
        , _current_disable_next_previous (false)
 {
+       _button_sizer->Add (_previous_button, 0, wxEXPAND);
        _button_sizer->Add (_play_button, 0, wxEXPAND);
        _button_sizer->Add (_pause_button, 0, wxEXPAND);
        _button_sizer->Add (_stop_button, 0, wxEXPAND);
        _button_sizer->Add (_next_button, 0, wxEXPAND);
-       _button_sizer->Add (_previous_button, 0, wxEXPAND);
 
        _spl_view = new wxListCtrl (this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLC_REPORT | wxLC_NO_HEADER);
        _spl_view->AppendColumn (wxT(""), wxLIST_FORMAT_LEFT, 740);
@@ -335,6 +335,7 @@ SwaroopControls::spl_selection_changed ()
        _selected_playlist = selected;
        _selected_playlist_position = 0;
        reset_film ();
+       update_current_content ();
 }
 
 void
@@ -370,15 +371,17 @@ SwaroopControls::update_current_content ()
 {
        DCPOMATIC_ASSERT (_selected_playlist);
 
-       _viewer->stop ();
+       bool const was_playing = _viewer->stop ();
 
        SPLEntry const & e = _playlists[*_selected_playlist].get()[_selected_playlist_position];
        _current_disable_timeline = e.disable_timeline;
-       _current_disable_next_previous = e.skippable;
+       _current_disable_next_previous = !e.skippable;
 
        setup_sensitivity ();
        reset_film ();
-       _viewer->start ();
+       if (was_playing) {
+               _viewer->start ();
+       }
 }
 
 void