diff options
| author | Carl Hetherington <cth@carlh.net> | 2013-06-30 23:27:19 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2013-06-30 23:27:19 +0100 |
| commit | e6dd32ca6a32f364dafd99b0fe4bbb6119afb9d7 (patch) | |
| tree | 59ac988625476d038554166967a867ffe8330743 /src | |
| parent | 288154d38df73021dd4a65327ab588c8a6590960 (diff) | |
| parent | f8cf5bfe56cc3522f281555c4b04d77b15cf1a2d (diff) | |
Merg..
Diffstat (limited to 'src')
| -rw-r--r-- | src/lib/cross.cc | 31 | ||||
| -rw-r--r-- | src/lib/cross.h | 3 | ||||
| -rw-r--r-- | src/lib/film.cc | 16 | ||||
| -rw-r--r-- | src/wx/film_editor.cc | 2 | ||||
| -rw-r--r-- | src/wx/new_film_dialog.cc | 10 | ||||
| -rw-r--r-- | src/wx/new_film_dialog.h | 9 | ||||
| -rw-r--r-- | src/wx/wscript | 2 |
7 files changed, 63 insertions, 10 deletions
diff --git a/src/lib/cross.cc b/src/lib/cross.cc index ff0d9f7d1..86b657432 100644 --- a/src/lib/cross.cc +++ b/src/lib/cross.cc @@ -22,8 +22,9 @@ #include "cross.h" #include "compose.hpp" #include "log.h" -#ifdef DVDOMATIC_POSIX +#ifdef DVDOMATIC_LINUX #include <unistd.h> +#include <mntent.h> #endif #ifdef DVDOMATIC_WINDOWS #include <windows.h> @@ -35,8 +36,10 @@ #endif using std::pair; +using std::list; using std::ifstream; using std::string; +using std::make_pair; using boost::shared_ptr; void @@ -156,3 +159,29 @@ run_ffprobe (boost::filesystem::path content, boost::filesystem::path out, share system (ffprobe.c_str ()); #endif } + +list<pair<string, string> > +mount_info () +{ + list<pair<string, string> > m; + +#ifdef DVDOMATIC_LINUX + FILE* f = setmntent ("/etc/mtab", "r"); + if (!f) { + return m; + } + + while (1) { + struct mntent* mnt = getmntent (f); + if (!mnt) { + break; + } + + m.push_back (make_pair (mnt->mnt_dir, mnt->mnt_type)); + } + + endmntent (f); +#endif + + return m; +} diff --git a/src/lib/cross.h b/src/lib/cross.h index 1a7a8cb4d..d9cc2d12f 100644 --- a/src/lib/cross.h +++ b/src/lib/cross.h @@ -26,6 +26,7 @@ class Log; #define WEXITSTATUS(w) (w) #endif -void dvdomatic_sleep (int); +extern void dvdomatic_sleep (int); extern std::pair<std::string, int> cpu_info (); extern void run_ffprobe (boost::filesystem::path, boost::filesystem::path, boost::shared_ptr<Log>); +extern std::list<std::pair<std::string, std::string> > mount_info (); diff --git a/src/lib/film.cc b/src/lib/film.cc index 827c62082..217673a7f 100644 --- a/src/lib/film.cc +++ b/src/lib/film.cc @@ -68,6 +68,7 @@ using std::setfill; using std::min; using std::make_pair; using std::endl; +using std::list; using boost::shared_ptr; using boost::lexical_cast; using boost::to_upper_copy; @@ -142,13 +143,13 @@ Film::Film (string d, bool must_exist) _sndfile_stream = SndfileStream::create (); + _log.reset (new FileLog (file ("log"))); + if (must_exist) { read_metadata (); } else { write_metadata (); } - - _log.reset (new FileLog (file ("log"))); } Film::Film (Film const & o) @@ -317,6 +318,11 @@ Film::make_dcp () log()->log (String::compose ("Content at %1 fps, DCP at %2 fps", source_frame_rate(), dcp_frame_rate())); log()->log (String::compose ("%1 threads", Config::instance()->num_local_encoding_threads())); log()->log (String::compose ("J2K bandwidth %1", j2k_bandwidth())); + if (use_content_audio()) { + log()->log ("Using content's audio"); + } else { + log()->log (String::compose ("Using external audio (%1 files)", external_audio().size())); + } #ifdef DVDOMATIC_DEBUG log()->log ("DVD-o-matic built in debug mode."); #else @@ -329,6 +335,10 @@ Film::make_dcp () #endif pair<string, int> const c = cpu_info (); log()->log (String::compose ("CPU: %1, %2 processors", c.first, c.second)); + list<pair<string, string> > const m = mount_info (); + for (list<pair<string, string> >::const_iterator i = m.begin(); i != m.end(); ++i) { + log()->log (String::compose ("Mount: %1 %2", i->first, i->second)); + } if (format() == 0) { throw MissingSettingError (_("format")); @@ -684,6 +694,8 @@ Film::read_metadata () } _dirty = false; + + _log->log (String::compose ("Loaded film with use_content_audio = %1", use_content_audio ())); } libdcp::Size diff --git a/src/wx/film_editor.cc b/src/wx/film_editor.cc index 6456ae247..dd952e22a 100644 --- a/src/wx/film_editor.cc +++ b/src/wx/film_editor.cc @@ -37,6 +37,7 @@ #include "lib/filter.h" #include "lib/config.h" #include "lib/ffmpeg_decoder.h" +#include "lib/log.h" #include "filter_dialog.h" #include "wx_util.h" #include "film_editor.h" @@ -765,6 +766,7 @@ FilmEditor::film_changed (Film::Property p) setup_frame_rate_description (); break; case Film::USE_CONTENT_AUDIO: + _film->log()->log (String::compose ("Film::USE_CONTENT_AUDIO changed; setting GUI using %1", _film->use_content_audio ())); checked_set (_use_content_audio, _film->use_content_audio()); checked_set (_use_external_audio, !_film->use_content_audio()); setup_dcp_name (); diff --git a/src/wx/new_film_dialog.cc b/src/wx/new_film_dialog.cc index 191482a7c..91caa4963 100644 --- a/src/wx/new_film_dialog.cc +++ b/src/wx/new_film_dialog.cc @@ -21,7 +21,7 @@ #include <wx/stdpaths.h> #include "lib/config.h" #include "new_film_dialog.h" -#ifdef __WXMSW__ +#if defined(__WXMSW__) || (GTK_MAJOR_VERSION == 2 && GTK_MINOR_VERSION == 24 && GTK_MICRO_VERSION == 17) #include "dir_picker_ctrl.h" #endif #include "wx_util.h" @@ -46,8 +46,12 @@ NewFilmDialog::NewFilmDialog (wxWindow* parent) table->Add (_name, 1, wxEXPAND); add_label_to_sizer (table, this, _("Create in folder")); -#ifdef __WXMSW__ - _folder = new DirPickerCtrl (this); + + /* GTK 2.24.17 has a buggy GtkFileChooserButton and it was put in Ubuntu 13.04. + Use our own dir picker as this is the least bad option I can think of. + */ +#if defined(__WXMSW__) || (GTK_MAJOR_VERSION == 2 && GTK_MINOR_VERSION == 24 && GTK_MICRO_VERSION == 17) + _folder = new DirPickerCtrl (this); #else _folder = new wxDirPickerCtrl (this, wxDD_DIR_MUST_EXIST); #endif diff --git a/src/wx/new_film_dialog.h b/src/wx/new_film_dialog.h index bfcbd423c..70bb7945b 100644 --- a/src/wx/new_film_dialog.h +++ b/src/wx/new_film_dialog.h @@ -19,6 +19,9 @@ #include <wx/wx.h> #include <wx/filepicker.h> +#ifdef __WXGTK__ +#include <gtk/gtk.h> +#endif class DirPickerCtrl; @@ -32,10 +35,10 @@ public: private: wxTextCtrl* _name; -#ifdef __WXMSW__ +#if defined(__WXMSW__) || (GTK_MAJOR_VERSION == 2 && GTK_MINOR_VERSION == 24 && GTK_MICRO_VERSION == 17) DirPickerCtrl* _folder; -#else +#else wxDirPickerCtrl* _folder; -#endif +#endif static boost::optional<std::string> _directory; }; diff --git a/src/wx/wscript b/src/wx/wscript index 9213d7220..4bc79d6bb 100644 --- a/src/wx/wscript +++ b/src/wx/wscript @@ -52,6 +52,8 @@ def build(bld): obj.includes = [ '..' ] obj.export_includes = ['.'] obj.uselib = 'WXWIDGETS' + if bld.env.TARGET_LINUX: + obj.uselib += ' GTK' obj.use = 'libdvdomatic' obj.source = sources obj.target = 'dvdomatic-wx' |
