diff options
| author | Carl Hetherington <cth@carlh.net> | 2013-06-02 23:03:08 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2013-06-02 23:03:08 +0100 |
| commit | a0856e3fbef17f24073b01cb96be6bbcb229ecbc (patch) | |
| tree | 13fd6191f2c4d82943cbcfa1f34688552cfc1f8e /src/wx | |
| parent | e6d086fff404d9fe5ac080f9e75334eeb315c1da (diff) | |
| parent | 42866530db49e0faf367ad28a55c658be60951bf (diff) | |
Merge master.
Diffstat (limited to 'src/wx')
| -rw-r--r-- | src/wx/audio_plot.cc | 2 | ||||
| -rw-r--r-- | src/wx/config_dialog.cc | 6 | ||||
| -rw-r--r-- | src/wx/film_viewer.cc | 14 | ||||
| -rw-r--r-- | src/wx/new_film_dialog.cc | 9 | ||||
| -rw-r--r-- | src/wx/new_film_dialog.h | 4 |
5 files changed, 24 insertions, 11 deletions
diff --git a/src/wx/audio_plot.cc b/src/wx/audio_plot.cc index 46c64c9bf..fb02fea7b 100644 --- a/src/wx/audio_plot.cc +++ b/src/wx/audio_plot.cc @@ -43,7 +43,9 @@ AudioPlot::AudioPlot (wxWindow* parent) , _gain (0) , _smoothing (max_smoothing / 2) { +#ifndef __WXOSX__ SetDoubleBuffered (true); +#endif for (int i = 0; i < MAX_AUDIO_CHANNELS; ++i) { _channel_visible[i] = false; diff --git a/src/wx/config_dialog.cc b/src/wx/config_dialog.cc index 3efd7857a..0b13b9c88 100644 --- a/src/wx/config_dialog.cc +++ b/src/wx/config_dialog.cc @@ -18,7 +18,7 @@ */ /** @file src/config_dialog.cc - * @brief A dialogue to edit DCP-o-matic configuration. + * @brief A dialogue to edit DVD-o-matic configuration. */ #include <iostream> @@ -43,7 +43,7 @@ using namespace std; using boost::bind; ConfigDialog::ConfigDialog (wxWindow* parent) - : wxDialog (parent, wxID_ANY, _("DCP-o-matic Preferences"), wxDefaultPosition, wxDefaultSize, wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER) + : wxDialog (parent, wxID_ANY, _("DVD-o-matic Preferences"), wxDefaultPosition, wxDefaultSize, wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER) { wxBoxSizer* s = new wxBoxSizer (wxVERTICAL); _notebook = new wxNotebook (this, wxID_ANY); @@ -95,7 +95,7 @@ ConfigDialog::make_misc_panel () table->Add (_language, 1, wxEXPAND); table->AddSpacer (0); - wxStaticText* restart = add_label_to_sizer (table, _misc_panel, _("(restart DCP-o-matic to see language changes)")); + wxStaticText* restart = add_label_to_sizer (table, _misc_panel, _("(restart DVD-o-matic to see language changes)")); wxFont font = restart->GetFont(); font.SetStyle (wxFONTSTYLE_ITALIC); font.SetPointSize (font.GetPointSize() - 1); diff --git a/src/wx/film_viewer.cc b/src/wx/film_viewer.cc index 26f99db11..e1471d94e 100644 --- a/src/wx/film_viewer.cc +++ b/src/wx/film_viewer.cc @@ -1,5 +1,3 @@ -/* -*- c-basic-offset: 8; default-tab-width: 8; -*- */ - /* Copyright (C) 2012 Carl Hetherington <cth@carlh.net> @@ -65,7 +63,10 @@ FilmViewer::FilmViewer (shared_ptr<Film> f, wxWindow* p) , _display_frame_x (0) , _got_frame (false) { +#ifndef __WXOSX__ _panel->SetDoubleBuffered (true); +#endif + #if wxMAJOR_VERSION == 2 && wxMINOR_VERSION >= 9 _panel->SetBackgroundStyle (wxBG_STYLE_PAINT); #endif @@ -196,9 +197,6 @@ FilmViewer::timer (wxTimerEvent &) return; } - _panel->Refresh (); - _panel->Update (); - get_frame (); if (_film->length()) { @@ -207,6 +205,9 @@ FilmViewer::timer (wxTimerEvent &) _slider->SetValue (new_slider_position); } } + + _panel->Refresh (); + _panel->Update (); } @@ -365,7 +366,8 @@ FilmViewer::process_video (shared_ptr<const Image> image, bool, Time t) _got_frame = true; double const fps = _film->dcp_video_frame_rate (); - _frame->SetLabel (wxString::Format (wxT("%d"), int (rint (t * fps / TIME_HZ)))); + /* Count frame number from 1 ... not sure if this is the best idea */ + _frame->SetLabel (wxString::Format (wxT("%d"), int (rint (t * fps / TIME_HZ)) + 1)); double w = static_cast<double>(t) / TIME_HZ; int const h = (w / 3600); diff --git a/src/wx/new_film_dialog.cc b/src/wx/new_film_dialog.cc index 90c2d727e..737b07fbb 100644 --- a/src/wx/new_film_dialog.cc +++ b/src/wx/new_film_dialog.cc @@ -29,6 +29,8 @@ using namespace std; using namespace boost; +string NewFilmDialog::_directory = Config::instance()->default_directory_or (wx_to_std (wxStandardPaths::Get().GetDocumentsDir())); + NewFilmDialog::NewFilmDialog (wxWindow* parent) : wxDialog (parent, wxID_ANY, _("New Film")) { @@ -49,7 +51,7 @@ NewFilmDialog::NewFilmDialog (wxWindow* parent) #else _folder = new wxDirPickerCtrl (this, wxDD_DIR_MUST_EXIST); #endif - _folder->SetPath (std_to_wx (Config::instance()->default_directory_or (wx_to_std (wxStandardPaths::Get().GetDocumentsDir())))); + _folder->SetPath (std_to_wx (_directory)); table->Add (_folder, 1, wxEXPAND); wxSizer* buttons = CreateSeparatedButtonSizer (wxOK | wxCANCEL); @@ -61,6 +63,11 @@ NewFilmDialog::NewFilmDialog (wxWindow* parent) overall_sizer->SetSizeHints (this); } +NewFilmDialog::~NewFilmDialog () +{ + _directory = wx_to_std (_folder->GetPath ()); +} + string NewFilmDialog::get_path () const { diff --git a/src/wx/new_film_dialog.h b/src/wx/new_film_dialog.h index 3d1253ecc..715f71f51 100644 --- a/src/wx/new_film_dialog.h +++ b/src/wx/new_film_dialog.h @@ -26,6 +26,7 @@ class NewFilmDialog : public wxDialog { public: NewFilmDialog (wxWindow *); + ~NewFilmDialog (); std::string get_path () const; @@ -35,5 +36,6 @@ private: DirPickerCtrl* _folder; #else wxDirPickerCtrl* _folder; -#endif +#endif + static std::string _directory; }; |
