X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=src%2Ftools%2Fdcpomatic_playlist.cc;h=04950028af6dcfaec08a5ed663ebe4fb4f1391eb;hb=6d27b49a7a767a9c8b31dc0f799da940ddb7232f;hp=7751fc1b31ff671df783a9bf90efd025bb4e72e0;hpb=54af50c3b8e9082f9751e809d63540c51197a4a1;p=dcpomatic.git diff --git a/src/tools/dcpomatic_playlist.cc b/src/tools/dcpomatic_playlist.cc index 7751fc1b3..04950028a 100644 --- a/src/tools/dcpomatic_playlist.cc +++ b/src/tools/dcpomatic_playlist.cc @@ -23,7 +23,7 @@ #include "../wx/content_view.h" #include "../wx/dcpomatic_button.h" #include "../wx/about_dialog.h" -#include "../wx/player_config_dialog.h" +#include "../wx/playlist_editor_config_dialog.h" #include "../lib/util.h" #include "../lib/config.h" #include "../lib/cross.h" @@ -134,19 +134,19 @@ public: return _sizer; } - shared_ptr first_playlist () const + shared_ptr first_playlist () const { if (_playlists.empty()) { - return shared_ptr(); + return shared_ptr(); } return _playlists.front (); } - boost::signals2::signal)> Edit; + boost::signals2::signal)> Edit; private: - void add_playlist_to_view (shared_ptr playlist) + void add_playlist_to_view (shared_ptr playlist) { wxListItem item; item.SetId (_list->GetItemCount()); @@ -154,21 +154,21 @@ private: _list->SetItem (N, 0, std_to_wx(playlist->name())); } - void add_playlist_to_model (shared_ptr playlist) + void add_playlist_to_model (shared_ptr playlist) { _playlists.push_back (playlist); - playlist->NameChanged.connect (bind(&PlaylistList::name_changed, this, weak_ptr(playlist))); + playlist->NameChanged.connect (bind(&PlaylistList::name_changed, this, weak_ptr(playlist))); } - void name_changed (weak_ptr wp) + void name_changed (weak_ptr wp) { - shared_ptr playlist = wp.lock (); + shared_ptr playlist = wp.lock (); if (!playlist) { return; } int N = 0; - BOOST_FOREACH (shared_ptr i, _playlists) { + BOOST_FOREACH (shared_ptr i, _playlists) { if (i == playlist) { _list->SetItem (N, 0, std_to_wx(i->name())); } @@ -186,21 +186,21 @@ private: _list->DeleteAllItems (); _playlists.clear (); for (boost::filesystem::directory_iterator i(*path); i != boost::filesystem::directory_iterator(); ++i) { - shared_ptr spl(new SPL); + shared_ptr spl(new SignalSPL); try { spl->read (*i, _content_store); add_playlist_to_model (spl); } catch (...) {} } - BOOST_FOREACH (shared_ptr i, _playlists) { + BOOST_FOREACH (shared_ptr i, _playlists) { add_playlist_to_view (i); } } void new_playlist () { - shared_ptr spl (new SPL(wx_to_std(_("New Playlist")))); + shared_ptr spl (new SignalSPL(wx_to_std(_("New Playlist")))); add_playlist_to_model (spl); add_playlist_to_view (spl); _list->SetItemState (_list->GetItemCount() - 1, wxLIST_STATE_SELECTED, wxLIST_STATE_SELECTED); @@ -222,14 +222,14 @@ private: _list->DeleteItem (selected); _playlists.erase (_playlists.begin() + selected); - Edit (shared_ptr()); + Edit (shared_ptr()); } void selection_changed () { long int selected = _list->GetNextItem (-1, wxLIST_NEXT_ALL, wxLIST_STATE_SELECTED); if (selected < 0 || selected >= int(_playlists.size())) { - Edit (shared_ptr()); + Edit (shared_ptr()); } else { Edit (_playlists[selected]); } @@ -239,7 +239,7 @@ private: wxListCtrl* _list; wxButton* _new; wxButton* _delete; - vector > _playlists; + vector > _playlists; ContentStore* _content_store; }; @@ -278,9 +278,9 @@ public: no_tick_icon.LoadFile ("no_tick.png", wxBITMAP_TYPE_PNG_RESOURCE); #else boost::filesystem::path tick_path = shared_path() / "tick.png"; - tick_icon.LoadFile (std_to_wx(tick_path.string())); + tick_icon.LoadFile (std_to_wx(tick_path.string()), wxBITMAP_TYPE_PNG); boost::filesystem::path no_tick_path = shared_path() / "no_tick.png"; - no_tick_icon.LoadFile (std_to_wx(no_tick_path.string())); + no_tick_icon.LoadFile (std_to_wx(no_tick_path.string()), wxBITMAP_TYPE_PNG); #endif images->Add (tick_icon); images->Add (no_tick_icon); @@ -317,7 +317,7 @@ public: return _sizer; } - void set (shared_ptr playlist) + void set (shared_ptr playlist) { _playlist = playlist; _list->DeleteAllItems (); @@ -332,7 +332,7 @@ public: setup_sensitivity (); } - shared_ptr playlist () const + shared_ptr playlist () const { return _playlist; } @@ -443,7 +443,7 @@ private: wxButton* _down; wxButton* _add; wxButton* _remove; - shared_ptr _playlist; + shared_ptr _playlist; }; @@ -453,6 +453,7 @@ public: explicit DOMFrame (wxString const & title) : wxFrame (0, -1, title) , _content_dialog (new ContentDialog(this)) + , _config_dialog (0) { wxMenuBar* bar = new wxMenuBar; setup_menu (bar); @@ -499,21 +500,21 @@ private: void edit_preferences () { if (!_config_dialog) { - _config_dialog = create_player_config_dialog (); + _config_dialog = create_playlist_editor_config_dialog (); } _config_dialog->Show (this); } - void change_playlist (shared_ptr playlist) + void change_playlist (shared_ptr playlist) { - shared_ptr old = _playlist_content->playlist (); + shared_ptr old = _playlist_content->playlist (); if (old) { save_playlist (old); } _playlist_content->set (playlist); } - void save_playlist (shared_ptr playlist) + void save_playlist (shared_ptr playlist) { optional dir = Config::instance()->player_playlist_directory(); if (!dir) { @@ -573,7 +574,8 @@ private: bool OnInit () try { - SetAppName (_("DCP-o-matic KDM Creator")); + wxInitAllImageHandlers (); + SetAppName (_("DCP-o-matic Playlist Editor")); if (!wxApp::OnInit()) { return false;