From 57202d20733638d979fcc7976ed725ded23c5515 Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Fri, 25 Jan 2013 17:20:05 +0000 Subject: Remove film-specifity of dci name dialog and rename its source file. --- src/wx/wscript | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/wx/wscript') diff --git a/src/wx/wscript b/src/wx/wscript index 4dbb04eea..47272f697 100644 --- a/src/wx/wscript +++ b/src/wx/wscript @@ -14,7 +14,7 @@ def build(bld): obj.use = 'libdvdomatic' obj.source = """ config_dialog.cc - dci_name_dialog.cc + dci_metadata_dialog.cc dir_picker_ctrl.cc film_editor.cc film_viewer.cc -- cgit v1.2.3 From 7deb94e3cb9048891664f74d9c8a534ca6a24748 Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Thu, 7 Feb 2013 00:00:41 +0000 Subject: Remove x264 dependency; add options to help building on mageia. --- src/wx/wscript | 2 +- wscript | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) (limited to 'src/wx/wscript') diff --git a/src/wx/wscript b/src/wx/wscript index 47272f697..d844b1f1b 100644 --- a/src/wx/wscript +++ b/src/wx/wscript @@ -1,5 +1,5 @@ def configure(conf): - conf.check_cfg(package = '', path = 'wx-config', args = '--cppflags --cxxflags --libs', uselib_store = 'WXWIDGETS', mandatory = True) + conf.check_cfg(package = '', path = conf.options.wx_config, args = '--cppflags --cxxflags --libs', uselib_store = 'WXWIDGETS', mandatory = True) def build(bld): if bld.env.STATIC: diff --git a/wscript b/wscript index bf5cf1daa..43ac63548 100644 --- a/wscript +++ b/wscript @@ -13,6 +13,8 @@ def options(opt): opt.add_option('--disable-gui', action='store_true', default = False, help = 'disable building of GUI tools') opt.add_option('--target-windows', action='store_true', default = False, help = 'set up to do a cross-compile to Windows') opt.add_option('--static', action='store_true', default = False, help = 'build statically, and link statically to libdcp and FFmpeg') + opt.add_option('--magickpp-config', action='store', default='Magick++-config', help = 'path to Magick++-config') + opt.add_option('--wx-config', action='store', default='wx-config', help = 'path to wx-config') def configure(conf): conf.load('compiler_cxx') @@ -73,7 +75,7 @@ def configure(conf): conf.env.STLIB_AVFILTER = ['avfilter', 'swresample'] conf.env.HAVE_AVCODEC = 1 conf.env.STLIB_AVCODEC = ['avcodec'] - conf.env.LIB_AVCODEC = ['x264', 'z'] + conf.env.LIB_AVCODEC = ['z'] conf.env.HAVE_AVUTIL = 1 conf.env.STLIB_AVUTIL = ['avutil'] conf.env.HAVE_SWSCALE = 1 @@ -90,7 +92,7 @@ def configure(conf): conf.check_cfg(package = 'sndfile', args = '--cflags --libs', uselib_store = 'SNDFILE', mandatory = True) conf.check_cfg(package = 'glib-2.0', args = '--cflags --libs', uselib_store = 'GLIB', mandatory = True) conf.check_cfg(package = 'liblzma', args = '--cflags --libs', uselib_store = 'LZMA', mandatory = True) - conf.check_cfg(package = '', path = 'Magick++-config', args = '--cppflags --cxxflags --libs', uselib_store = 'MAGICK', mandatory = True) + conf.check_cfg(package = '', path = conf.options.magickpp_config, args = '--cppflags --cxxflags --libs', uselib_store = 'MAGICK', mandatory = True) if conf.options.static: conf.check_cc(fragment = """ -- cgit v1.2.3 From fa6c885de512cdde0590c2bbe9ea424030a12c6b Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Sun, 17 Feb 2013 00:25:23 +0000 Subject: i18n hacks. --- src/lib/film.cc | 2 +- src/lib/transcode_job.cc | 6 ++- src/lib/wscript | 110 ++++++++++++++++++++++++++--------------------- src/wscript | 4 ++ src/wx/wscript | 48 +++++++++++++-------- wscript | 3 ++ 6 files changed, 103 insertions(+), 70 deletions(-) (limited to 'src/wx/wscript') diff --git a/src/lib/film.cc b/src/lib/film.cc index 289a8c348..77f61cbac 100644 --- a/src/lib/film.cc +++ b/src/lib/film.cc @@ -246,7 +246,7 @@ Film::make_dcp (bool transcode) set_dci_date_today (); if (dcp_name().find ("/") != string::npos) { - throw BadSettingError ("name", "cannot contain slashes"); + throw BadSettingError ("name", _("cannot contain slashes")); } log()->log (String::compose ("DVD-o-matic %1 git %2 using %3", dvdomatic_version, dvdomatic_git_commit, dependency_version_summary())); diff --git a/src/lib/transcode_job.cc b/src/lib/transcode_job.cc index 87e9a47c4..a4279ef8b 100644 --- a/src/lib/transcode_job.cc +++ b/src/lib/transcode_job.cc @@ -30,6 +30,8 @@ #include "log.h" #include "encoder.h" +#include "i18n.h" + using std::string; using std::stringstream; using std::fixed; @@ -49,7 +51,7 @@ TranscodeJob::TranscodeJob (shared_ptr f, DecodeOptions o) string TranscodeJob::name () const { - return String::compose ("Transcode %1", _film->name()); + return String::compose (_("Transcode %1"), _film->name()); } void @@ -98,7 +100,7 @@ TranscodeJob::status () const s << Job::status (); if (!finished ()) { - s << "; " << fixed << setprecision (1) << fps << " frames per second"; + s << "; " << fixed << setprecision (1) << fps << " " << _("frames per second"); } return s.str (); diff --git a/src/lib/wscript b/src/lib/wscript index eee04190c..ee89ad085 100644 --- a/src/lib/wscript +++ b/src/lib/wscript @@ -1,3 +1,54 @@ +import os + +sources = """ + ab_transcode_job.cc + ab_transcoder.cc + audio_decoder.cc + audio_source.cc + config.cc + combiner.cc + cross.cc + dci_metadata.cc + dcp_content_type.cc + dcp_video_frame.cc + decoder.cc + decoder_factory.cc + delay_line.cc + dolby_cp750.cc + encoder.cc + examine_content_job.cc + external_audio_decoder.cc + filter_graph.cc + ffmpeg_compatibility.cc + ffmpeg_decoder.cc + film.cc + filter.cc + format.cc + gain.cc + image.cc + imagemagick_decoder.cc + job.cc + job_manager.cc + log.cc + lut.cc + matcher.cc + scp_dcp_job.cc + scaler.cc + server.cc + sound_processor.cc + stream.cc + subtitle.cc + timer.cc + transcode_job.cc + transcoder.cc + ui_signaller.cc + util.cc + version.cc + video_decoder.cc + video_source.cc + writer.cc + """ + def build(bld): if bld.env.STATIC: obj = bld(features = 'cxx cxxstlib') @@ -13,53 +64,14 @@ def build(bld): """ if bld.env.TARGET_WINDOWS: obj.uselib += ' WINSOCK2' - obj.source = """ - ab_transcode_job.cc - ab_transcoder.cc - audio_decoder.cc - audio_source.cc - config.cc - combiner.cc - cross.cc - dci_metadata.cc - dcp_content_type.cc - dcp_video_frame.cc - decoder.cc - decoder_factory.cc - delay_line.cc - dolby_cp750.cc - encoder.cc - examine_content_job.cc - external_audio_decoder.cc - filter_graph.cc - ffmpeg_compatibility.cc - ffmpeg_decoder.cc - film.cc - filter.cc - format.cc - gain.cc - image.cc - imagemagick_decoder.cc - job.cc - job_manager.cc - log.cc - lut.cc - matcher.cc - scp_dcp_job.cc - scaler.cc - server.cc - sound_processor.cc - stream.cc - subtitle.cc - timer.cc - transcode_job.cc - transcoder.cc - ui_signaller.cc - util.cc - version.cc - video_decoder.cc - video_source.cc - writer.cc - """ - + obj.source = sources obj.target = 'dvdomatic' + +def pot(bld): + s = "" + for f in sources.split('\n'): + t = f.strip() + if len(t) > 0: + s += (os.path.join('src', 'lib', t)) + " " + + os.system('xgettext -d libdvdomatic -s --keyword=_ -p build/src/lib -o libdvdomatic.pot %s' % s) diff --git a/src/wscript b/src/wscript index 3f17b3e6c..ed497ff0c 100644 --- a/src/wscript +++ b/src/wscript @@ -7,3 +7,7 @@ def build(bld): bld.recurse('tools') if not bld.env.DISABLE_GUI: bld.recurse('wx') + +def pot(bld): + bld.recurse('lib') + bld.recurse('wx') diff --git a/src/wx/wscript b/src/wx/wscript index d844b1f1b..ef1d1c083 100644 --- a/src/wx/wscript +++ b/src/wx/wscript @@ -1,3 +1,23 @@ +import os + +sources = """ + config_dialog.cc + dci_metadata_dialog.cc + dir_picker_ctrl.cc + film_editor.cc + film_viewer.cc + filter_dialog.cc + filter_view.cc + gain_calculator_dialog.cc + job_manager_view.cc + job_wrapper.cc + new_film_dialog.cc + properties_dialog.cc + server_dialog.cc + wx_util.cc + wx_ui_signaller.cc + """ + def configure(conf): conf.check_cfg(package = '', path = conf.options.wx_config, args = '--cppflags --cxxflags --libs', uselib_store = 'WXWIDGETS', mandatory = True) @@ -12,22 +32,14 @@ def build(bld): obj.export_includes = ['.'] obj.uselib = 'WXWIDGETS' obj.use = 'libdvdomatic' - obj.source = """ - config_dialog.cc - dci_metadata_dialog.cc - dir_picker_ctrl.cc - film_editor.cc - film_viewer.cc - filter_dialog.cc - filter_view.cc - gain_calculator_dialog.cc - job_manager_view.cc - job_wrapper.cc - new_film_dialog.cc - properties_dialog.cc - server_dialog.cc - wx_util.cc - wx_ui_signaller.cc - """ - + obj.source = sources obj.target = 'dvdomatic-wx' + +def pot(bld): + s = "" + for f in sources.split('\n'): + t = f.strip() + if len(t) > 0: + s += (os.path.join('src', 'wx', t)) + " " + + os.system('xgettext -d libdvdomatic -s --keyword=_ -p build/src/wx -o libdvdomatic-wx.pot %s' % s) diff --git a/wscript b/wscript index 06c193c4f..1a8238d1c 100644 --- a/wscript +++ b/wscript @@ -253,3 +253,6 @@ def create_version_cc(version): def post(ctx): if ctx.cmd == 'install': ctx.exec_command('/sbin/ldconfig') + +def pot(bld): + bld.recurse('src') -- cgit v1.2.3 From bc5df5cc9c2b11524938281f1b2043b185373020 Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Fri, 22 Feb 2013 23:36:32 +0000 Subject: Some i18n stuff. --- TRANSLATORS | 13 +++++++++ i18n.py | 16 +++++++++++ src/lib/film.cc | 2 ++ src/tools/dvdomatic.cc | 75 +++++++++++++++++++++++++++++++++++--------------- src/tools/wscript | 12 ++++++++ src/wscript | 5 ++++ src/wx/wscript | 9 +++++- wscript | 12 ++++++++ 8 files changed, 121 insertions(+), 23 deletions(-) create mode 100644 TRANSLATORS create mode 100644 i18n.py (limited to 'src/wx/wscript') diff --git a/TRANSLATORS b/TRANSLATORS new file mode 100644 index 000000000..cbfc875d4 --- /dev/null +++ b/TRANSLATORS @@ -0,0 +1,13 @@ +Translating DVD-o-matic +----------------------- + +1. Run ./waf po + +This will generate build/src/lib/dvdomatic.pot and build/src/wx/libdvdomatic-wx.pot. + +For each file: + +2. Open poEdit, "New catalogue from POT file", do translations, save as .po file. + +3. Send to me. + diff --git a/i18n.py b/i18n.py new file mode 100644 index 000000000..d5531834b --- /dev/null +++ b/i18n.py @@ -0,0 +1,16 @@ +import glob +import os +from waflib import Logs + +def po_to_mo(dir, name): + for f in glob.glob(os.path.join(dir, 'po', '*.po')): + + lang = os.path.basename(f).replace('.po', '') + out = os.path.join('build', dir, 'mo', lang, '%s.mo' % name) + try: + os.makedirs(os.path.dirname(out)) + except: + pass + + os.system('msgfmt %s -o %s' % (f, out)) + Logs.info('%s -> %s' % (f, out)) diff --git a/src/lib/film.cc b/src/lib/film.cc index 600cdfa02..addaa0852 100644 --- a/src/lib/film.cc +++ b/src/lib/film.cc @@ -52,6 +52,8 @@ #include "audio_decoder.h" #include "external_audio_decoder.h" +#include "i18n.h" + using std::string; using std::stringstream; using std::multimap; diff --git a/src/tools/dvdomatic.cc b/src/tools/dvdomatic.cc index 1b76132f6..be61bf433 100644 --- a/src/tools/dvdomatic.cc +++ b/src/tools/dvdomatic.cc @@ -60,6 +60,7 @@ static shared_ptr film; static std::string log_level; static std::string film_to_load; static wxMenu* jobs_menu = 0; +static wxLocale* locale = 0; static void set_menu_sensitivity (); @@ -68,9 +69,12 @@ class FilmChangedDialog public: FilmChangedDialog () { - stringstream s; - s << "Save changes to film \"" << film->name() << "\" before closing?"; - _dialog = new wxMessageDialog (0, std_to_wx (s.str()), _("Film changed"), wxYES_NO | wxYES_DEFAULT | wxICON_QUESTION); + _dialog = new wxMessageDialog ( + 0, + std_to_wx (String::compose ("Save changes to film \"%1\" before closing?", film->name())), + _("Film changed"), + wxYES_NO | wxYES_DEFAULT | wxICON_QUESTION + ); } ~FilmChangedDialog () @@ -117,9 +121,9 @@ enum Sensitivity { map menu_items; void -add_item (wxMenu* menu, std::string text, int id, Sensitivity sens) +add_item (wxMenu* menu, wxString text, int id, Sensitivity sens) { - wxMenuItem* item = menu->Append (id, std_to_wx (text)); + wxMenuItem* item = menu->Append (id, text); menu_items.insert (make_pair (item, sens)); } @@ -153,32 +157,32 @@ void setup_menu (wxMenuBar* m) { wxMenu* file = new wxMenu; - add_item (file, "New...", ID_file_new, ALWAYS); - add_item (file, "&Open...", ID_file_open, ALWAYS); + add_item (file, _("New..."), ID_file_new, ALWAYS); + add_item (file, _("&Open..."), ID_file_open, ALWAYS); file->AppendSeparator (); - add_item (file, "&Save", ID_file_save, NEEDS_FILM); + add_item (file, _("&Save"), ID_file_save, NEEDS_FILM); file->AppendSeparator (); - add_item (file, "&Properties...", ID_file_properties, NEEDS_FILM); + add_item (file, _("&Properties..."), ID_file_properties, NEEDS_FILM); file->AppendSeparator (); - add_item (file, "&Quit", ID_file_quit, ALWAYS); + add_item (file, _("&Quit"), ID_file_quit, ALWAYS); wxMenu* edit = new wxMenu; - add_item (edit, "&Preferences...", ID_edit_preferences, ALWAYS); + add_item (edit, _("&Preferences..."), ID_edit_preferences, ALWAYS); jobs_menu = new wxMenu; - add_item (jobs_menu, "&Make DCP", ID_jobs_make_dcp, NEEDS_FILM); - add_item (jobs_menu, "&Send DCP to TMS", ID_jobs_send_dcp_to_tms, NEEDS_FILM); - add_item (jobs_menu, "S&how DCP", ID_jobs_show_dcp, NEEDS_FILM); + add_item (jobs_menu, _("&Make DCP"), ID_jobs_make_dcp, NEEDS_FILM); + add_item (jobs_menu, _("&Send DCP to TMS"), ID_jobs_send_dcp_to_tms, NEEDS_FILM); + add_item (jobs_menu, _("S&how DCP"), ID_jobs_show_dcp, NEEDS_FILM); jobs_menu->AppendSeparator (); - add_item (jobs_menu, "&Examine content", ID_jobs_examine_content, NEEDS_FILM); + add_item (jobs_menu, _("&Examine content"), ID_jobs_examine_content, NEEDS_FILM); wxMenu* help = new wxMenu; - add_item (help, "About", ID_help_about, ALWAYS); + add_item (help, _("About"), ID_help_about, ALWAYS); - m->Append (file, _("&File")); - m->Append (edit, _("&Edit")); - m->Append (jobs_menu, _("&Jobs")); - m->Append (help, _("&Help")); + m->Append (file, _(_("&File"))); + m->Append (edit, _(_("&Edit"))); + m->Append (jobs_menu, _(_("&Jobs"))); + m->Append (help, _(_("&Help"))); } bool @@ -280,7 +284,7 @@ private: void file_changed (string f) { stringstream s; - s << "DVD-o-matic"; + s << _("DVD-o-matic"); if (!f.empty ()) { s << " - " << f; } @@ -430,6 +434,32 @@ static const wxCmdLineEntryDesc command_line_description[] = { }; #endif +void +setup_i18n () +{ + int language = wxLANGUAGE_DEFAULT; + + if (wxLocale::IsAvailable (language)) { + locale = new wxLocale (language, wxLOCALE_LOAD_DEFAULT); + +#ifdef __WXGTK__ + locale->AddCatalogLookupPathPrefix (wxT ("/usr")); + locale->AddCatalogLookupPathPrefix (wxT ("/usr/local")); + locale->AddCatalogLookupPathPrefix (wxT ("build/src/wx/mo")); + locale->AddCatalogLookupPathPrefix (wxT ("build/src/tools/mo")); + wxStandardPaths* paths = (wxStandardPaths*) &wxStandardPaths::Get(); + wxString prefix = paths->GetInstallPrefix(); + locale->AddCatalogLookupPathPrefix (prefix); +#endif + + if (!locale->IsOk()) { + delete locale; + locale = new wxLocale (wxLANGUAGE_ENGLISH); + language = wxLANGUAGE_ENGLISH; + } + } +} + class App : public wxApp { bool OnInit () @@ -443,6 +473,7 @@ class App : public wxApp #endif wxInitAllImageHandlers (); + setup_i18n (); dvdomatic_setup (); @@ -451,7 +482,7 @@ class App : public wxApp film.reset (new Film (film_to_load)); film->log()->set_level (log_level); } catch (exception& e) { - error_dialog (0, std_to_wx (String::compose ("Could not load film %1 (%2)", film_to_load, e.what()))); + error_dialog (0, std_to_wx (String::compose (wx_to_std (_("Could not load film %1 (%2)")), film_to_load, e.what()))); } } diff --git a/src/tools/wscript b/src/tools/wscript index c843c61d8..8af3d06a5 100644 --- a/src/tools/wscript +++ b/src/tools/wscript @@ -1,3 +1,8 @@ +import os +import glob +from waflib import Logs +import i18n + def build(bld): for t in ['makedcp', 'servomatic_cli', 'servomatictest']: obj = bld(features = 'cxx cxxprogram') @@ -17,3 +22,10 @@ def build(bld): if bld.env.TARGET_WINDOWS: obj.source += ' ../../windows/dvdomatic.rc' obj.target = t + +def pot(bld): + os.system('xgettext -d dvdomatic -s --keyword=_ -p build/src/tools -o dvdomatic.pot %s' % os.path.join('src', 'tools', 'dvdomatic.cc')) + +def mo(bld): + i18n.po_to_mo(os.path.join('src', 'tools'), 'dvdomatic') + diff --git a/src/wscript b/src/wscript index ed497ff0c..abe39894d 100644 --- a/src/wscript +++ b/src/wscript @@ -11,3 +11,8 @@ def build(bld): def pot(bld): bld.recurse('lib') bld.recurse('wx') + bld.recurse('tools') + +def mo(bld): + bld.recurse('wx') + bld.recurse('tools') diff --git a/src/wx/wscript b/src/wx/wscript index ef1d1c083..95cdbc8f0 100644 --- a/src/wx/wscript +++ b/src/wx/wscript @@ -1,4 +1,7 @@ import os +import glob +from waflib import Logs +import i18n sources = """ config_dialog.cc @@ -42,4 +45,8 @@ def pot(bld): if len(t) > 0: s += (os.path.join('src', 'wx', t)) + " " - os.system('xgettext -d libdvdomatic -s --keyword=_ -p build/src/wx -o libdvdomatic-wx.pot %s' % s) + os.system('xgettext -d libdvdomatic-wx -s --keyword=_ -p build/src/wx -o libdvdomatic-wx.pot %s' % s) + +def mo(bld): + i18n.po_to_mo(os.path.join('src', 'wx'), 'libdvdomatic-wx') + diff --git a/wscript b/wscript index cce8c240e..2a5c54951 100644 --- a/wscript +++ b/wscript @@ -198,6 +198,15 @@ def configure(conf): define_name = 'HAVE_BUFFERSRC_H', mandatory = False) + conf.find_program('msgfmt', var='MSGFMT') + + datadir = conf.env.DATADIR + if not datadir: + datadir = os.path.join(conf.env.PREFIX, 'share') + + conf.define('LOCALEDIR', os.path.join(datadir, 'locale')) + conf.define('DATADIR', datadir) + conf.recurse('src') conf.recurse('test') @@ -256,3 +265,6 @@ def post(ctx): def pot(bld): bld.recurse('src') + +def mo(bld): + bld.recurse('src') -- cgit v1.2.3 From 7913cba90bccb9501b63a0518c58abbd5a6b330d Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Sat, 23 Feb 2013 00:12:11 +0000 Subject: Try to centralise .pot building. --- i18n.py | 11 +++++++++++ src/lib/wscript | 9 ++------- src/tools/wscript | 2 +- src/wx/wscript | 8 +------- 4 files changed, 15 insertions(+), 15 deletions(-) (limited to 'src/wx/wscript') diff --git a/i18n.py b/i18n.py index d5531834b..10eaa38e9 100644 --- a/i18n.py +++ b/i18n.py @@ -2,6 +2,17 @@ import glob import os from waflib import Logs +def pot(dir, sources, name): + s = "" + for f in sources.split('\n'): + t = f.strip() + if len(t) > 0: + s += (os.path.join(dir, t)) + " " + + Logs.info('Making %s.pot' % os.path.join('build', dir, name)) + os.system('xgettext -d %s -s --keyword=_ -p %s -o %s.pot %s' % (name, os.path.join('build', dir), name, s)) + + def po_to_mo(dir, name): for f in glob.glob(os.path.join(dir, 'po', '*.po')): diff --git a/src/lib/wscript b/src/lib/wscript index ee89ad085..59047c70d 100644 --- a/src/lib/wscript +++ b/src/lib/wscript @@ -1,4 +1,5 @@ import os +import i18n sources = """ ab_transcode_job.cc @@ -68,10 +69,4 @@ def build(bld): obj.target = 'dvdomatic' def pot(bld): - s = "" - for f in sources.split('\n'): - t = f.strip() - if len(t) > 0: - s += (os.path.join('src', 'lib', t)) + " " - - os.system('xgettext -d libdvdomatic -s --keyword=_ -p build/src/lib -o libdvdomatic.pot %s' % s) + i18n.pot(os.path.join('src', 'lib'), sources, 'libdvdomatic') diff --git a/src/tools/wscript b/src/tools/wscript index 8af3d06a5..de130ce17 100644 --- a/src/tools/wscript +++ b/src/tools/wscript @@ -24,7 +24,7 @@ def build(bld): obj.target = t def pot(bld): - os.system('xgettext -d dvdomatic -s --keyword=_ -p build/src/tools -o dvdomatic.pot %s' % os.path.join('src', 'tools', 'dvdomatic.cc')) + i18n.pot(os.path.join('src', 'tools'), 'dvdomatic.cc', 'dvdomatic') def mo(bld): i18n.po_to_mo(os.path.join('src', 'tools'), 'dvdomatic') diff --git a/src/wx/wscript b/src/wx/wscript index 95cdbc8f0..a0a4bbe8b 100644 --- a/src/wx/wscript +++ b/src/wx/wscript @@ -39,13 +39,7 @@ def build(bld): obj.target = 'dvdomatic-wx' def pot(bld): - s = "" - for f in sources.split('\n'): - t = f.strip() - if len(t) > 0: - s += (os.path.join('src', 'wx', t)) + " " - - os.system('xgettext -d libdvdomatic-wx -s --keyword=_ -p build/src/wx -o libdvdomatic-wx.pot %s' % s) + i18n.pot(os.path.join('src', 'wx'), sources, 'libdvdomatic-wx') def mo(bld): i18n.po_to_mo(os.path.join('src', 'wx'), 'libdvdomatic-wx') -- cgit v1.2.3 From cf1e212c30ec7419b96388e4f78b44cb55bf34c5 Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Sun, 24 Feb 2013 22:15:50 +0000 Subject: Basic stuff to analyse audio (job). --- src/lib/analyse_audio_job.cc | 108 +++++++++++++++++++++++++++++++++++++++++++ src/lib/analyse_audio_job.h | 45 ++++++++++++++++++ src/lib/audio_analysis.cc | 69 +++++++++++++++++++++++++++ src/lib/audio_analysis.h | 59 +++++++++++++++++++++++ src/lib/ffmpeg_decoder.cc | 12 +++-- src/lib/film.cc | 29 ++++++++++++ src/lib/film.h | 6 +++ src/lib/options.h | 6 ++- src/lib/wscript | 2 + src/tools/dvdomatic.cc | 12 ++--- src/wx/film_editor.cc | 14 ++++++ src/wx/film_editor.h | 2 + src/wx/wscript | 2 + 13 files changed, 353 insertions(+), 13 deletions(-) create mode 100644 src/lib/analyse_audio_job.cc create mode 100644 src/lib/analyse_audio_job.h create mode 100644 src/lib/audio_analysis.cc create mode 100644 src/lib/audio_analysis.h (limited to 'src/wx/wscript') diff --git a/src/lib/analyse_audio_job.cc b/src/lib/analyse_audio_job.cc new file mode 100644 index 000000000..5623fdfcc --- /dev/null +++ b/src/lib/analyse_audio_job.cc @@ -0,0 +1,108 @@ +/* + Copyright (C) 2012 Carl Hetherington + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + +*/ + +#include "audio_analysis.h" +#include "analyse_audio_job.h" +#include "compose.hpp" +#include "film.h" +#include "options.h" +#include "decoder_factory.h" +#include "audio_decoder.h" + +using std::string; +using std::max; +using boost::shared_ptr; + +int const AnalyseAudioJob::_num_points = 1024; + +AnalyseAudioJob::AnalyseAudioJob (shared_ptr f) + : Job (f) + , _done_for_this_point (0) + , _done (0) + , _samples_per_point (1) +{ + +} + +string +AnalyseAudioJob::name () const +{ + return String::compose ("Analyse audio of %1", _film->name()); +} + +void +AnalyseAudioJob::run () +{ + if (!_film->audio_stream () || !_film->length()) { + set_progress (1); + set_state (FINISHED_ERROR); + return; + } + + DecodeOptions options; + options.decode_video = false; + + Decoders decoders = decoder_factory (_film, options); + assert (decoders.audio); + + decoders.audio->set_audio_stream (_film->audio_stream ()); + decoders.audio->Audio.connect (bind (&AnalyseAudioJob::audio, this, _1)); + + int64_t total_audio_frames = video_frames_to_audio_frames (_film->length().get(), _film->audio_stream()->sample_rate(), _film->frames_per_second()); + _samples_per_point = total_audio_frames / _num_points; + + _current.resize (_film->audio_stream()->channels ()); + _analysis.reset (new AudioAnalysis (_film->audio_stream()->channels())); + + while (!decoders.audio->pass()) { + set_progress (float (_done) / total_audio_frames); + } + + _analysis->write (_film->audio_analysis_path ()); + + set_progress (1); + set_state (FINISHED_OK); +} + +void +AnalyseAudioJob::audio (shared_ptr b) +{ + for (int i = 0; i < b->frames(); ++i) { + for (int j = 0; j < b->channels(); ++j) { + float const s = b->data(j)[i]; + _current[j][AudioPoint::RMS] += pow (s, 2); + _current[j][AudioPoint::PEAK] = max (_current[j][AudioPoint::PEAK], fabsf (s)); + + if (_done_for_this_point == _samples_per_point) { + _current[j][AudioPoint::RMS] = 20 * log10 (sqrt (_current[j][AudioPoint::RMS] / _samples_per_point)); + _current[j][AudioPoint::PEAK] = 20 * log10 (_current[j][AudioPoint::PEAK]); + + _analysis->add_point (j, _current[j]); + + _done_for_this_point = 0; + _current[j] = AudioPoint (); + } + } + + ++_done_for_this_point; + } + + _done += b->frames (); +} + diff --git a/src/lib/analyse_audio_job.h b/src/lib/analyse_audio_job.h new file mode 100644 index 000000000..1e7229ce6 --- /dev/null +++ b/src/lib/analyse_audio_job.h @@ -0,0 +1,45 @@ +/* + Copyright (C) 2012 Carl Hetherington + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + +*/ + +#include "job.h" +#include "audio_analysis.h" + +class AudioBuffers; + +class AnalyseAudioJob : public Job +{ +public: + AnalyseAudioJob (boost::shared_ptr f); + + std::string name () const; + void run (); + +private: + void audio (boost::shared_ptr); + + int64_t _done_for_this_point; + int64_t _done; + int64_t _samples_per_point; + std::vector _current; + + boost::shared_ptr _analysis; + + static const int _num_points; +}; + diff --git a/src/lib/audio_analysis.cc b/src/lib/audio_analysis.cc new file mode 100644 index 000000000..4a710f4c1 --- /dev/null +++ b/src/lib/audio_analysis.cc @@ -0,0 +1,69 @@ +/* + Copyright (C) 2012 Carl Hetherington + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + +*/ + +#include +#include +#include +#include "audio_analysis.h" + +using std::ostream; +using std::string; +using std::ofstream; +using std::vector; + +AudioPoint::AudioPoint () +{ + for (int i = 0; i < COUNT; ++i) { + _data[i] = 0; + } +} + +void +AudioPoint::write (ostream& s) const +{ + for (int i = 0; i < COUNT; ++i) { + s << _data[i] << "\n"; + } +} + + +AudioAnalysis::AudioAnalysis (int channels) +{ + _data.resize (channels); +} + +void +AudioAnalysis::add_point (int c, AudioPoint const & p) +{ + assert (c < int (_data.size ())); + _data[c].push_back (p); +} + +void +AudioAnalysis::write (string filename) +{ + ofstream f (filename.c_str ()); + f << _data.size() << "\n"; + for (vector >::iterator i = _data.begin(); i != _data.end(); ++i) { + f << i->size () << "\n"; + for (vector::iterator j = i->begin(); j != i->end(); ++j) { + j->write (f); + } + } +} diff --git a/src/lib/audio_analysis.h b/src/lib/audio_analysis.h new file mode 100644 index 000000000..1c668b9c2 --- /dev/null +++ b/src/lib/audio_analysis.h @@ -0,0 +1,59 @@ +/* + Copyright (C) 2012 Carl Hetherington + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + +*/ + +#ifndef DVDOMATIC_AUDIO_ANALYSIS_H +#define DVDOMATIC_AUDIO_ANALYSIS_H + +#include +#include + +class AudioPoint +{ +public: + enum Type { + PEAK, + RMS, + COUNT + }; + + AudioPoint (); + + void write (std::ostream &) const; + + float& operator[] (Type t) { + return _data[t]; + } + +private: + float _data[COUNT]; +}; + +class AudioAnalysis +{ +public: + AudioAnalysis (int c); + + void add_point (int c, AudioPoint const & p); + void write (std::string); + +private: + std::vector > _data; +}; + +#endif diff --git a/src/lib/ffmpeg_decoder.cc b/src/lib/ffmpeg_decoder.cc index d4ed76e37..58c7317ac 100644 --- a/src/lib/ffmpeg_decoder.cc +++ b/src/lib/ffmpeg_decoder.cc @@ -236,8 +236,10 @@ FFmpegDecoder::pass () int frame_finished; - while (avcodec_decode_video2 (_video_codec_context, _frame, &frame_finished, &_packet) >= 0 && frame_finished) { - filter_and_emit_video (_frame); + if (_opt.decode_video) { + while (avcodec_decode_video2 (_video_codec_context, _frame, &frame_finished, &_packet) >= 0 && frame_finished) { + filter_and_emit_video (_frame); + } } if (_audio_stream && _opt.decode_audio) { @@ -258,7 +260,7 @@ FFmpegDecoder::pass () shared_ptr ffa = dynamic_pointer_cast (_audio_stream); - if (_packet.stream_index == _video_stream) { + if (_packet.stream_index == _video_stream && _opt.decode_video) { int frame_finished; int const r = avcodec_decode_video2 (_video_codec_context, _frame, &frame_finished, &_packet); @@ -288,9 +290,9 @@ FFmpegDecoder::pass () was before this packet. Until then audio is thrown away. */ - if (_first_video && _first_video.get() <= source_pts_seconds) { + if ((_first_video && _first_video.get() <= source_pts_seconds) || !_opt.decode_video) { - if (!_first_audio) { + if (!_first_audio && _opt.decode_video) { _first_audio = source_pts_seconds; /* This is our first audio frame, and if we've arrived here we must have had our diff --git a/src/lib/film.cc b/src/lib/film.cc index 1cf161259..fb3fb4cde 100644 --- a/src/lib/film.cc +++ b/src/lib/film.cc @@ -51,6 +51,7 @@ #include "video_decoder.h" #include "audio_decoder.h" #include "external_audio_decoder.h" +#include "analyse_audio_job.h" using std::string; using std::stringstream; @@ -237,6 +238,15 @@ Film::video_mxf_filename () const return video_state_identifier() + ".mxf"; } +string +Film::audio_analysis_path () const +{ + boost::filesystem::path p; + p /= "analysis"; + p /= content_digest(); + return file (p.string ()); +} + /** Add suitable Jobs to the JobManager to create a DCP for this Film */ void Film::make_dcp () @@ -303,6 +313,19 @@ Film::make_dcp () } } +/** Start a job to analyse the audio of our content file */ +void +Film::analyse_audio () +{ + if (_analyse_audio_job) { + return; + } + + _analyse_audio_job.reset (new AnalyseAudioJob (shared_from_this())); + _analyse_audio_job->Finished.connect (bind (&Film::analyse_audio_finished, this)); + JobManager::instance()->add (_analyse_audio_job); +} + /** Start a job to examine our content file */ void Film::examine_content () @@ -316,6 +339,12 @@ Film::examine_content () JobManager::instance()->add (_examine_content_job); } +void +Film::analyse_audio_finished () +{ + _analyse_audio_job.reset (); +} + void Film::examine_content_finished () { diff --git a/src/lib/film.h b/src/lib/film.h index 04a483998..c268d3eac 100644 --- a/src/lib/film.h +++ b/src/lib/film.h @@ -45,6 +45,7 @@ class Job; class Filter; class Log; class ExamineContentJob; +class AnalyseAudioJob; class ExternalAudioStream; /** @class Film @@ -65,8 +66,10 @@ public: std::string info_path (int f) const; std::string video_mxf_dir () const; std::string video_mxf_filename () const; + std::string audio_analysis_path () const; void examine_content (); + void analyse_audio (); void send_dcp_to_tms (); void make_dcp (); @@ -374,9 +377,12 @@ private: /** Any running ExamineContentJob, or 0 */ boost::shared_ptr _examine_content_job; + /** Any running AnalyseAudioJob, or 0 */ + boost::shared_ptr _analyse_audio_job; void signal_changed (Property); void examine_content_finished (); + void analyse_audio_finished (); std::string video_state_identifier () const; /** Complete path to directory containing the film metadata; diff --git a/src/lib/options.h b/src/lib/options.h index 2cd7dffde..0d2c07fd5 100644 --- a/src/lib/options.h +++ b/src/lib/options.h @@ -28,11 +28,13 @@ class DecodeOptions { public: DecodeOptions () - : decode_audio (true) + : decode_video (true) + , decode_audio (true) , decode_subtitles (false) , video_sync (true) {} - + + bool decode_video; bool decode_audio; bool decode_subtitles; bool video_sync; diff --git a/src/lib/wscript b/src/lib/wscript index eee04190c..c2b46112c 100644 --- a/src/lib/wscript +++ b/src/lib/wscript @@ -16,6 +16,8 @@ def build(bld): obj.source = """ ab_transcode_job.cc ab_transcoder.cc + analyse_audio_job.cc + audio_analysis.cc audio_decoder.cc audio_source.cc config.cc diff --git a/src/tools/dvdomatic.cc b/src/tools/dvdomatic.cc index 1b76132f6..4f380b5ad 100644 --- a/src/tools/dvdomatic.cc +++ b/src/tools/dvdomatic.cc @@ -145,7 +145,7 @@ enum { ID_jobs_make_dcp, ID_jobs_send_dcp_to_tms, ID_jobs_show_dcp, - ID_jobs_examine_content, + ID_jobs_analyse_audio, ID_help_about }; @@ -170,7 +170,7 @@ setup_menu (wxMenuBar* m) add_item (jobs_menu, "&Send DCP to TMS", ID_jobs_send_dcp_to_tms, NEEDS_FILM); add_item (jobs_menu, "S&how DCP", ID_jobs_show_dcp, NEEDS_FILM); jobs_menu->AppendSeparator (); - add_item (jobs_menu, "&Examine content", ID_jobs_examine_content, NEEDS_FILM); + add_item (jobs_menu, "&Analyse audio", ID_jobs_analyse_audio, NEEDS_FILM); wxMenu* help = new wxMenu; add_item (help, "About", ID_help_about, ALWAYS); @@ -207,7 +207,7 @@ public: Connect (ID_jobs_make_dcp, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler (Frame::jobs_make_dcp)); Connect (ID_jobs_send_dcp_to_tms, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler (Frame::jobs_send_dcp_to_tms)); Connect (ID_jobs_show_dcp, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler (Frame::jobs_show_dcp)); - Connect (ID_jobs_examine_content, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler (Frame::jobs_examine_content)); + Connect (ID_jobs_analyse_audio, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler (Frame::jobs_analyse_audio)); Connect (ID_help_about, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler (Frame::help_about)); Connect (wxID_ANY, wxEVT_MENU_OPEN, wxMenuEventHandler (Frame::menu_opened)); @@ -386,10 +386,10 @@ private: } #endif } - - void jobs_examine_content (wxCommandEvent &) + + void jobs_analyse_audio (wxCommandEvent &) { - film->examine_content (); + film->analyse_audio (); } void help_about (wxCommandEvent &) diff --git a/src/wx/film_editor.cc b/src/wx/film_editor.cc index 68291a812..4a67624db 100644 --- a/src/wx/film_editor.cc +++ b/src/wx/film_editor.cc @@ -45,6 +45,7 @@ #include "sound_processor.h" #include "dci_metadata_dialog.h" #include "scaler.h" +#include "audio_dialog.h" using std::string; using std::cout; @@ -204,6 +205,7 @@ FilmEditor::connect_to_widgets () _audio_gain_calculate_button->Connect ( wxID_ANY, wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler (FilmEditor::audio_gain_calculate_button_clicked), 0, this ); + _show_audio->Connect (wxID_ANY, wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler (FilmEditor::show_audio_clicked), 0, this); _audio_delay->Connect (wxID_ANY, wxEVT_COMMAND_SPINCTRL_UPDATED, wxCommandEventHandler (FilmEditor::audio_delay_changed), 0, this); _use_content_audio->Connect (wxID_ANY, wxEVT_COMMAND_RADIOBUTTON_SELECTED, wxCommandEventHandler (FilmEditor::use_audio_changed), 0, this); _use_external_audio->Connect (wxID_ANY, wxEVT_COMMAND_RADIOBUTTON_SELECTED, wxCommandEventHandler (FilmEditor::use_audio_changed), 0, this); @@ -315,6 +317,10 @@ FilmEditor::make_audio_panel () grid->Add (s); } + _show_audio = new wxButton (_audio_panel, wxID_ANY, _("Show Audio...")); + grid->AddSpacer (0); + grid->Add (_show_audio); + { video_control (add_label_to_sizer (grid, _audio_panel, _("Audio Delay"))); wxBoxSizer* s = new wxBoxSizer (wxHORIZONTAL); @@ -1175,3 +1181,11 @@ FilmEditor::setup_dcp_name () _dcp_name->SetLabel (std_to_wx (s)); } } + +void +FilmEditor::show_audio_clicked (wxCommandEvent &) +{ + AudioDialog* d = new AudioDialog (this, _film); + d->ShowModal (); + d->Destroy (); +} diff --git a/src/wx/film_editor.h b/src/wx/film_editor.h index 8cb90b481..bd0300aed 100644 --- a/src/wx/film_editor.h +++ b/src/wx/film_editor.h @@ -70,6 +70,7 @@ private: void scaler_changed (wxCommandEvent &); void audio_gain_changed (wxCommandEvent &); void audio_gain_calculate_button_clicked (wxCommandEvent &); + void show_audio_clicked (wxCommandEvent &); void audio_delay_changed (wxCommandEvent &); void with_subtitles_toggled (wxCommandEvent &); void subtitle_offset_changed (wxCommandEvent &); @@ -145,6 +146,7 @@ private: wxSpinCtrl* _audio_gain; /** A button to open the gain calculation dialogue */ wxButton* _audio_gain_calculate_button; + wxButton* _show_audio; /** The Film's audio delay */ wxSpinCtrl* _audio_delay; wxCheckBox* _with_subtitles; diff --git a/src/wx/wscript b/src/wx/wscript index d844b1f1b..3fa40f55a 100644 --- a/src/wx/wscript +++ b/src/wx/wscript @@ -13,6 +13,8 @@ def build(bld): obj.uselib = 'WXWIDGETS' obj.use = 'libdvdomatic' obj.source = """ + audio_dialog.cc + audio_plot.cc config_dialog.cc dci_metadata_dialog.cc dir_picker_ctrl.cc -- cgit v1.2.3 From 3940c9ceea90f99d18792bb9ea6074ca65d7fed9 Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Thu, 28 Feb 2013 23:16:13 +0000 Subject: Build and install mo files from po. --- i18n.py | 16 ++++++---------- src/lib/wscript | 2 ++ src/tools/wscript | 6 ++---- src/wscript | 4 ---- src/wx/wscript | 6 ++---- wscript | 5 +---- 6 files changed, 13 insertions(+), 26 deletions(-) (limited to 'src/wx/wscript') diff --git a/i18n.py b/i18n.py index c22cbdb95..ab7f6843b 100644 --- a/i18n.py +++ b/i18n.py @@ -17,15 +17,11 @@ def pot(dir, sources, name, all = False): os.system('xgettext -d %s -s --keyword=_ --add-comments=/ -p %s -o %s.pot %s' % (name, os.path.join('build', dir), name, s)) -def po_to_mo(dir, name): - for f in glob.glob(os.path.join(dir, 'po', '*.po')): - +def po_to_mo(dir, name, bld): + for f in glob.glob(os.path.join(os.getcwd(), dir, 'po', '*.po')): lang = os.path.basename(f).replace('.po', '') - out = os.path.join('build', dir, 'mo', lang, '%s.mo' % name) - try: - os.makedirs(os.path.dirname(out)) - except: - pass + po = os.path.join('po', '%s.po' % lang) + mo = os.path.join('mo', lang, '%s.mo' % name) - os.system('msgfmt %s -o %s' % (f, out)) - Logs.info('%s -> %s' % (f, out)) + bld(rule = 'msgfmt ${SRC} -o ${TGT}', source = bld.path.make_node(po), target = bld.path.get_bld().make_node(mo)) + bld.install_files(os.path.join('${PREFIX}', 'share', 'locale', lang, 'LC_MESSAGES'), mo) diff --git a/src/lib/wscript b/src/lib/wscript index 59047c70d..6ddb94851 100644 --- a/src/lib/wscript +++ b/src/lib/wscript @@ -68,5 +68,7 @@ def build(bld): obj.source = sources obj.target = 'dvdomatic' + i18n.po_to_mo(os.path.join('src', 'lib'), 'libdvdomatic', bld) + def pot(bld): i18n.pot(os.path.join('src', 'lib'), sources, 'libdvdomatic') diff --git a/src/tools/wscript b/src/tools/wscript index de130ce17..64d5efe56 100644 --- a/src/tools/wscript +++ b/src/tools/wscript @@ -23,9 +23,7 @@ def build(bld): obj.source += ' ../../windows/dvdomatic.rc' obj.target = t + i18n.po_to_mo(os.path.join('src', 'tools'), 'dvdomatic', bld) + def pot(bld): i18n.pot(os.path.join('src', 'tools'), 'dvdomatic.cc', 'dvdomatic') - -def mo(bld): - i18n.po_to_mo(os.path.join('src', 'tools'), 'dvdomatic') - diff --git a/src/wscript b/src/wscript index abe39894d..f7f888acd 100644 --- a/src/wscript +++ b/src/wscript @@ -12,7 +12,3 @@ def pot(bld): bld.recurse('lib') bld.recurse('wx') bld.recurse('tools') - -def mo(bld): - bld.recurse('wx') - bld.recurse('tools') diff --git a/src/wx/wscript b/src/wx/wscript index a0a4bbe8b..92ff440cd 100644 --- a/src/wx/wscript +++ b/src/wx/wscript @@ -38,9 +38,7 @@ def build(bld): obj.source = sources obj.target = 'dvdomatic-wx' + i18n.po_to_mo(os.path.join('src', 'wx'), 'libdvdomatic-wx', bld) + def pot(bld): i18n.pot(os.path.join('src', 'wx'), sources, 'libdvdomatic-wx') - -def mo(bld): - i18n.po_to_mo(os.path.join('src', 'wx'), 'libdvdomatic-wx') - diff --git a/wscript b/wscript index 16ef91f3b..f3df9cfed 100644 --- a/wscript +++ b/wscript @@ -23,7 +23,7 @@ def configure(conf): conf.env.append_value('CXXFLAGS', ['-D__STDC_CONSTANT_MACROS', '-msse', '-mfpmath=sse', '-ffast-math', '-fno-strict-aliasing', '-Wall', '-Wno-attributes', '-Wextra', - '-DLOCALE_DIR="%s/share/locale"' % conf.env.prefix]) + '-DLOCALE_DIR="%s/share/locale"' % conf.env['PREFIX']]) if conf.options.target_windows: conf.env.append_value('CXXFLAGS', ['-DDVDOMATIC_WINDOWS', '-DWIN32_LEAN_AND_MEAN', '-DBOOST_USE_WINDOWS_H', '-DUNICODE']) @@ -267,6 +267,3 @@ def post(ctx): def pot(bld): bld.recurse('src') - -def mo(bld): - bld.recurse('src') -- cgit v1.2.3 From bacdb2fee1a921060ad40e2db14c4e787ae188a9 Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Wed, 20 Mar 2013 10:41:25 +0000 Subject: Target pot_merge to merge new .pot files with existing .po; update translations accordingly. --- ChangeLog | 4 ++ i18n.py | 11 ++++- src/lib/po/fr_FR.po | 102 ++++++++++++++++++++++++------------------ src/lib/po/it_IT.po | 42 +++++++++++++++--- src/lib/wscript | 3 ++ src/tools/po/fr_FR.po | 16 +++---- src/tools/po/it_IT.po | 8 ++-- src/tools/wscript | 3 ++ src/wscript | 5 +++ src/wx/po/fr_FR.po | 120 +++++++++++++++++++++++--------------------------- src/wx/po/it_IT.po | 110 ++++++++++++++++++++++----------------------- src/wx/wscript | 3 ++ wscript | 3 ++ 13 files changed, 247 insertions(+), 183 deletions(-) (limited to 'src/wx/wscript') diff --git a/ChangeLog b/ChangeLog index e9872734d..955a6104c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2013-03-20 Carl Hetherington + + * Make exception strings translatable (#81). + 2013-03-19 Carl Hetherington * Version 0.78beta2 released. diff --git a/i18n.py b/i18n.py index 8e2fd6404..ce28d25e9 100644 --- a/i18n.py +++ b/i18n.py @@ -2,6 +2,10 @@ import glob import os from waflib import Logs +def command(c): + print c + os.system(c) + def pot(dir, sources, name): s = "" for f in sources.split('\n'): @@ -16,8 +20,11 @@ def pot(dir, sources, name): except: pass - os.system('xgettext -d %s -s --keyword=_ --add-comments=/ -p %s -o %s.pot %s' % (name, d, name, s)) - + command('xgettext -d %s -s --keyword=_ --add-comments=/ -p %s -o %s.pot %s' % (name, d, name, s)) + +def pot_merge(dir, name): + for f in glob.glob(os.path.join(os.getcwd(), dir, 'po', '*.po')): + command('msgmerge %s %s.pot -o %s' % (f, os.path.join('build', dir, name), f)) def po_to_mo(dir, name, bld): for f in glob.glob(os.path.join(os.getcwd(), dir, 'po', '*.po')): diff --git a/src/lib/po/fr_FR.po b/src/lib/po/fr_FR.po index 887c79862..56bd03fac 100644 --- a/src/lib/po/fr_FR.po +++ b/src/lib/po/fr_FR.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: DVD-o-matic FRENCH\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2013-03-05 13:49+0000\n" +"POT-Creation-Date: 2013-03-20 10:29+0000\n" "PO-Revision-Date: 2013-03-20 00:39+0100\n" "Last-Translator: FreeDCP.net \n" "Language-Team: \n" @@ -16,7 +16,7 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -#: src/lib/transcode_job.cc:90 +#: src/lib/transcode_job.cc:87 msgid "0%" msgstr "0%" @@ -72,7 +72,7 @@ msgstr "Advertisement" msgid "An error occurred whilst handling the file %1." msgstr "Une erreur s'est produite lors du traitement du fichier %1." -#: src/lib/analyse_audio_job.cc:48 +#: src/lib/analyse_audio_job.cc:49 msgid "Analyse audio of %1" msgstr "Analyse du son de %1" @@ -88,6 +88,10 @@ msgstr "Bicubique" msgid "Bilinear" msgstr "Bilin??aire" +#: src/lib/exceptions.cc:60 +msgid "Cannot handle pixel format %1 during %2" +msgstr "" + #: src/lib/encoder.cc:101 msgid "Cannot resample audio as libswresample is not present" msgstr "R??-??chantillonnage du son impossible : libswresample est absent" @@ -132,24 +136,14 @@ msgstr "La cadence du DCP sera %1%% par rapport ?? la source" msgid "DCP will use every other frame of the source.\n" msgstr "Le DCP utilisera une image sur deux de la source.\n" -#: src/lib/filter.cc:68 -#: src/lib/filter.cc:69 -#: src/lib/filter.cc:70 -#: src/lib/filter.cc:71 -#: src/lib/filter.cc:72 -#: src/lib/filter.cc:73 +#: src/lib/filter.cc:68 src/lib/filter.cc:69 src/lib/filter.cc:70 +#: src/lib/filter.cc:71 src/lib/filter.cc:72 src/lib/filter.cc:73 msgid "De-blocking" msgstr "De-bloc" -#: src/lib/filter.cc:75 -#: src/lib/filter.cc:76 -#: src/lib/filter.cc:77 -#: src/lib/filter.cc:78 -#: src/lib/filter.cc:79 -#: src/lib/filter.cc:80 -#: src/lib/filter.cc:81 -#: src/lib/filter.cc:82 -#: src/lib/filter.cc:83 +#: src/lib/filter.cc:75 src/lib/filter.cc:76 src/lib/filter.cc:77 +#: src/lib/filter.cc:78 src/lib/filter.cc:79 src/lib/filter.cc:80 +#: src/lib/filter.cc:81 src/lib/filter.cc:82 src/lib/filter.cc:83 msgid "De-interlacing" msgstr "D??sentrelacement" @@ -237,10 +231,13 @@ msgstr "Filtre d??bloc horizontal" msgid "Horizontal deblocking filter A" msgstr "Filtre d??-bloc horizontal" -#: src/lib/job.cc:87 -#: src/lib/job.cc:96 -msgid "It is not known what caused this error. The best idea is to report the problem to the DVD-o-matic mailing list (dvdomatic@carlh.net)" -msgstr "Erreur ind??termin??e. Merci de rapporter le probl??me ?? la liste DVD-o-matic (dvdomatic@carlh.net)" +#: src/lib/job.cc:87 src/lib/job.cc:96 +msgid "" +"It is not known what caused this error. The best idea is to report the " +"problem to the DVD-o-matic mailing list (dvdomatic@carlh.net)" +msgstr "" +"Erreur ind??termin??e. Merci de rapporter le probl??me ?? la liste DVD-o-" +"matic (dvdomatic@carlh.net)" #: src/lib/filter.cc:82 msgid "Kernel deinterlacer" @@ -262,11 +259,8 @@ msgstr "D??sentrelaceur lin??aire interpol??" msgid "Median deinterlacer" msgstr "D??sentrelaceur m??dian" -#: src/lib/filter.cc:74 -#: src/lib/filter.cc:85 -#: src/lib/filter.cc:86 -#: src/lib/filter.cc:87 -#: src/lib/filter.cc:90 +#: src/lib/filter.cc:74 src/lib/filter.cc:85 src/lib/filter.cc:86 +#: src/lib/filter.cc:87 src/lib/filter.cc:90 msgid "Misc" msgstr "Divers" @@ -274,9 +268,7 @@ msgstr "Divers" msgid "Motion compensating deinterlacer" msgstr "D??sentrelaceur par compensation de mouvement" -#: src/lib/filter.cc:84 -#: src/lib/filter.cc:88 -#: src/lib/filter.cc:89 +#: src/lib/filter.cc:84 src/lib/filter.cc:88 src/lib/filter.cc:89 #: src/lib/filter.cc:91 msgid "Noise reduction" msgstr "R??duction de bruit" @@ -398,8 +390,12 @@ msgid "Test" msgstr "Test" #: src/lib/job.cc:76 -msgid "The drive that the film is stored on is low in disc space. Free some more space and try again." -msgstr "Le disque contenant le film est plein. Lib??rez de l'espace et essayez ?? nouveau." +msgid "" +"The drive that the film is stored on is low in disc space. Free some more " +"space and try again." +msgstr "" +"Le disque contenant le film est plein. Lib??rez de l'espace et essayez ?? " +"nouveau." #: src/lib/dcp_content_type.cc:46 msgid "Trailer" @@ -473,6 +469,11 @@ msgstr "type de contenu" msgid "copying %1" msgstr "copie de %1" +#: src/lib/exceptions.cc:36 +#, fuzzy +msgid "could not create file %1" +msgstr "??criture vers fichier distant (%1) impossible" + #: src/lib/ffmpeg_decoder.cc:191 msgid "could not find audio decoder" msgstr "d??codeur audio introuvable" @@ -489,16 +490,25 @@ msgstr "d??codeur de sous-titre introuvable" msgid "could not find video decoder" msgstr "d??codeur vid??o introuvable" -#: src/lib/external_audio_decoder.cc:72 +#: src/lib/sndfile_decoder.cc:72 msgid "could not open external audio file for reading" msgstr "lecture du fichier audio externe impossible" +#: src/lib/exceptions.cc:29 +#, fuzzy +msgid "could not open file %1" +msgstr "lecture du fichier impossible" + #: src/lib/dcp_video_frame.cc:388 msgid "could not open file for reading" msgstr "lecture du fichier impossible" -#: src/lib/encoder.cc:137 -#: src/lib/encoder.cc:314 +#: src/lib/exceptions.cc:44 +#, fuzzy +msgid "could not read from file %1 (%2)" +msgstr "Cr??ation du dossier distant %1 (%2) impossible" + +#: src/lib/encoder.cc:137 src/lib/encoder.cc:314 msgid "could not run sample-rate converter" msgstr "conversion de la fr??quence d'??chantillonnage impossible" @@ -510,6 +520,11 @@ msgstr "d??marrage de session SCP (%1) impossible" msgid "could not start SSH session" msgstr "d??marrage de session SSH impossible" +#: src/lib/exceptions.cc:50 +#, fuzzy +msgid "could not write to file %1 (%2)" +msgstr "??criture vers fichier distant (%1) impossible" + #: src/lib/encoder.cc:247 msgid "decoder sleeps with queue of %1" msgstr "d??codeur en veille avec %1 en file d'attente" @@ -518,11 +533,11 @@ msgstr "d??codeur en veille avec %1 en file d'attente" msgid "decoder wakes with queue of %1" msgstr "reprise du d??codage avec %1 en file d'attente" -#: src/lib/external_audio_decoder.cc:94 +#: src/lib/sndfile_decoder.cc:94 msgid "external audio files have differing lengths" msgstr "Les fichiers audio externes ont des dur??es diff??rentes" -#: src/lib/external_audio_decoder.cc:76 +#: src/lib/sndfile_decoder.cc:76 msgid "external audio files must be mono" msgstr "les fichiers audio externes doivent ??tre en mono" @@ -530,7 +545,7 @@ msgstr "les fichiers audio externes doivent ??tre en mono" msgid "format" msgstr "format" -#: src/lib/transcode_job.cc:103 +#: src/lib/transcode_job.cc:100 msgid "frames per second" msgstr "images par seconde" @@ -538,8 +553,7 @@ msgstr "images par seconde" msgid "hour" msgstr "heure" -#: src/lib/util.cc:112 -#: src/lib/util.cc:117 +#: src/lib/util.cc:112 src/lib/util.cc:117 msgid "hours" msgstr "heures" @@ -555,12 +569,15 @@ msgstr "minutes" msgid "missing key %1 in key-value set" msgstr "cl?? %1 non s??lectionn??e" +#: src/lib/exceptions.cc:54 +msgid "missing required setting %1" +msgstr "" + #: src/lib/subtitle.cc:52 msgid "multi-part subtitles not yet supported" msgstr "sous-titres en plusieurs parties non support??s" -#: src/lib/film.cc:263 -#: src/lib/film.cc:308 +#: src/lib/film.cc:263 src/lib/film.cc:308 msgid "name" msgstr "nom" @@ -593,4 +610,3 @@ msgstr "fixe" #: src/lib/film.cc:274 msgid "video" msgstr "vid??o" - diff --git a/src/lib/po/it_IT.po b/src/lib/po/it_IT.po index 46e533450..a5a868ca0 100644 --- a/src/lib/po/it_IT.po +++ b/src/lib/po/it_IT.po @@ -7,15 +7,15 @@ msgid "" msgstr "" "Project-Id-Version: IT VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2013-03-15 08:39+0000\n" +"POT-Creation-Date: 2013-03-20 10:29+0000\n" "PO-Revision-Date: 2013-03-18 16:46+0100\n" "Last-Translator: Maci \n" "Language-Team: \n" +"Language: Italiano\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "X-Generator: Poedit 1.5.5\n" -"Language: Italiano\n" #: src/lib/transcode_job.cc:87 msgid "0%" @@ -89,6 +89,10 @@ msgstr "Bicubica" msgid "Bilinear" msgstr "Bilineare" +#: src/lib/exceptions.cc:60 +msgid "Cannot handle pixel format %1 during %2" +msgstr "" + #: src/lib/encoder.cc:101 msgid "Cannot resample audio as libswresample is not present" msgstr "Non posso ricampionare l'audio perchè libswresample non è presente" @@ -233,8 +237,8 @@ msgid "" "It is not known what caused this error. The best idea is to report the " "problem to the DVD-o-matic mailing list (dvdomatic@carlh.net)" msgstr "" -"Non sappiamo cosa ha causato questo errore. La cosa migliore è di inviare un " -"report del problema alla mailing list di DVD-o-matic (dvdomatic@carlh.net)" +"Non sappiamo cosa ha causato questo errore. La cosa migliore è di inviare " +"un report del problema alla mailing list di DVD-o-matic (dvdomatic@carlh.net)" #: src/lib/filter.cc:82 msgid "Kernel deinterlacer" @@ -466,6 +470,11 @@ msgstr "tipo di contenuto" msgid "copying %1" msgstr "copia %1" +#: src/lib/exceptions.cc:36 +#, fuzzy +msgid "could not create file %1" +msgstr "Non posso scrivere il file remoto (%1)" + #: src/lib/ffmpeg_decoder.cc:191 msgid "could not find audio decoder" msgstr "non riesco a trovare il decoder audio" @@ -482,14 +491,24 @@ msgstr "non riesco a trovare il decoder dei sottotitoli" msgid "could not find video decoder" msgstr "non riesco a trovare il decoder video" -#: src/lib/external_audio_decoder.cc:72 +#: src/lib/sndfile_decoder.cc:72 msgid "could not open external audio file for reading" msgstr "non riesco ad aprire il file dell'audio esterno per leggerlo" +#: src/lib/exceptions.cc:29 +#, fuzzy +msgid "could not open file %1" +msgstr "non riesco ad aprire il file per leggerlo" + #: src/lib/dcp_video_frame.cc:388 msgid "could not open file for reading" msgstr "non riesco ad aprire il file per leggerlo" +#: src/lib/exceptions.cc:44 +#, fuzzy +msgid "could not read from file %1 (%2)" +msgstr "Non posso creare la directory remota %1 (%2)" + #: src/lib/encoder.cc:137 src/lib/encoder.cc:314 msgid "could not run sample-rate converter" msgstr "non riesco a lanciare il convertitore della frequenza di campionamento" @@ -502,6 +521,11 @@ msgstr "non posso avviare la sessione SCP (%1)" msgid "could not start SSH session" msgstr "non posso avviare la sessione SSH" +#: src/lib/exceptions.cc:50 +#, fuzzy +msgid "could not write to file %1 (%2)" +msgstr "Non posso scrivere il file remoto (%1)" + #: src/lib/encoder.cc:247 msgid "decoder sleeps with queue of %1" msgstr "il decoder è in pausa con la coda di %1" @@ -510,11 +534,11 @@ msgstr "il decoder è in pausa con la coda di %1" msgid "decoder wakes with queue of %1" msgstr "il decoder riparte con la coda di %1" -#: src/lib/external_audio_decoder.cc:94 +#: src/lib/sndfile_decoder.cc:94 msgid "external audio files have differing lengths" msgstr "i files dell'audio esterno hanno durata diversa" -#: src/lib/external_audio_decoder.cc:76 +#: src/lib/sndfile_decoder.cc:76 msgid "external audio files must be mono" msgstr "i files dell'audio esterno devono essere mono" @@ -546,6 +570,10 @@ msgstr "minuti" msgid "missing key %1 in key-value set" msgstr "persa la chiave %1 tra i valori chiave" +#: src/lib/exceptions.cc:54 +msgid "missing required setting %1" +msgstr "" + #: src/lib/subtitle.cc:52 msgid "multi-part subtitles not yet supported" msgstr "sottotitoli multi-part non ancora supportati" diff --git a/src/lib/wscript b/src/lib/wscript index 8b49e5933..5d9f5626a 100644 --- a/src/lib/wscript +++ b/src/lib/wscript @@ -75,3 +75,6 @@ def build(bld): def pot(bld): i18n.pot(os.path.join('src', 'lib'), sources, 'libdvdomatic') + +def pot_merge(bld): + i18n.pot_merge(os.path.join('src', 'lib'), 'libdvdomatic') diff --git a/src/tools/po/fr_FR.po b/src/tools/po/fr_FR.po index f38f07d6e..273c1fc32 100644 --- a/src/tools/po/fr_FR.po +++ b/src/tools/po/fr_FR.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: DVD-o-matic FRENCH\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2013-03-05 13:49+0000\n" +"POT-Creation-Date: 2013-03-20 10:29+0000\n" "PO-Revision-Date: 2013-03-13 22:33+0100\n" "Last-Translator: \n" "Language-Team: \n" @@ -65,14 +65,16 @@ msgid "&Send DCP to TMS" msgstr "&Envoyer le DCP dans le TMS" #: src/tools/dvdomatic.cc:409 -msgid "(C) 2012-2013 Carl Hetherington, Terrence Meiczinger, Paul Davis, Ole Laursen" -msgstr "(C) 2012-2013 Carl Hetherington, Terrence Meiczinger, Paul Davis, Ole Laursen" +msgid "" +"(C) 2012-2013 Carl Hetherington, Terrence Meiczinger, Paul Davis, Ole Laursen" +msgstr "" +"(C) 2012-2013 Carl Hetherington, Terrence Meiczinger, Paul Davis, Ole Laursen" #: src/tools/dvdomatic.cc:180 msgid "About" msgstr "A Propos" -#: src/tools/dvdomatic.cc:482 +#: src/tools/dvdomatic.cc:500 msgid "Could not load film %1 (%2)" msgstr "Impossible de charger le film %1 (%2)" @@ -81,9 +83,8 @@ msgstr "Impossible de charger le film %1 (%2)" msgid "Could not open film at %s (%s)" msgstr "Impossible d'ouvrir le film ?? %s (%s)" -#: src/tools/dvdomatic.cc:287 -#: src/tools/dvdomatic.cc:402 -#: src/tools/dvdomatic.cc:486 +#: src/tools/dvdomatic.cc:287 src/tools/dvdomatic.cc:402 +#: src/tools/dvdomatic.cc:504 msgid "DVD-o-matic" msgstr "DVD-o-matic" @@ -111,4 +112,3 @@ msgstr "S??lectionner le film ?? ouvrir" #, c-format msgid "The directory %s already exists." msgstr "Le dossier %s existe d??j??." - diff --git a/src/tools/po/it_IT.po b/src/tools/po/it_IT.po index 0886f3cb3..c22a536fe 100644 --- a/src/tools/po/it_IT.po +++ b/src/tools/po/it_IT.po @@ -7,15 +7,15 @@ msgid "" msgstr "" "Project-Id-Version: IT VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2013-03-15 08:39+0000\n" +"POT-Creation-Date: 2013-03-20 10:29+0000\n" "PO-Revision-Date: 2013-03-18 15:20+0100\n" "Last-Translator: Maci \n" "Language-Team: \n" +"Language: Italiano\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "X-Generator: Poedit 1.5.5\n" -"Language: Italiano\n" #: src/tools/dvdomatic.cc:177 msgid "&Analyse audio" @@ -75,7 +75,7 @@ msgstr "" msgid "About" msgstr "Informazioni" -#: src/tools/dvdomatic.cc:497 +#: src/tools/dvdomatic.cc:500 msgid "Could not load film %1 (%2)" msgstr "Non posso caricare il film %1 (%2)" @@ -85,7 +85,7 @@ msgid "Could not open film at %s (%s)" msgstr "Non posso aprire il film a %s (%s)" #: src/tools/dvdomatic.cc:287 src/tools/dvdomatic.cc:402 -#: src/tools/dvdomatic.cc:501 +#: src/tools/dvdomatic.cc:504 msgid "DVD-o-matic" msgstr "DVD-o-matic" diff --git a/src/tools/wscript b/src/tools/wscript index 64d5efe56..9f0f52152 100644 --- a/src/tools/wscript +++ b/src/tools/wscript @@ -27,3 +27,6 @@ def build(bld): def pot(bld): i18n.pot(os.path.join('src', 'tools'), 'dvdomatic.cc', 'dvdomatic') + +def pot_merge(bld): + i18n.pot_merge(os.path.join('src', 'tools'), 'dvdomatic') diff --git a/src/wscript b/src/wscript index f7f888acd..a4cf349f9 100644 --- a/src/wscript +++ b/src/wscript @@ -12,3 +12,8 @@ def pot(bld): bld.recurse('lib') bld.recurse('wx') bld.recurse('tools') + +def pot_merge(bld): + bld.recurse('lib') + bld.recurse('wx') + bld.recurse('tools') diff --git a/src/wx/po/fr_FR.po b/src/wx/po/fr_FR.po index 55732911c..f91279213 100644 --- a/src/wx/po/fr_FR.po +++ b/src/wx/po/fr_FR.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: DVD-o-matic FRENCH\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2013-03-05 13:49+0000\n" +"POT-Creation-Date: 2013-03-20 10:29+0000\n" "PO-Revision-Date: 2013-03-20 00:34+0100\n" "Last-Translator: FreeDCP.net \n" "Language-Team: \n" @@ -16,15 +16,15 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -#: src/wx/film_editor.cc:441 +#: src/wx/film_editor.cc:440 msgid "%" msgstr "%" -#: src/wx/film_editor.cc:1226 +#: src/wx/film_editor.cc:1229 msgid "1 channel" msgstr "1 canal" -#: src/wx/film_editor.cc:185 +#: src/wx/film_editor.cc:184 msgid "A/B" msgstr "A/B" @@ -32,16 +32,15 @@ msgstr "A/B" msgid "Add" msgstr "Ajouter" -#: src/wx/audio_dialog.cc:32 -#: src/wx/film_editor.cc:78 +#: src/wx/audio_dialog.cc:32 src/wx/film_editor.cc:77 msgid "Audio" msgstr "Audio" -#: src/wx/film_editor.cc:382 +#: src/wx/film_editor.cc:381 msgid "Audio Delay" msgstr "D??lai audio" -#: src/wx/film_editor.cc:370 +#: src/wx/film_editor.cc:369 msgid "Audio Gain" msgstr "Gain audio" @@ -54,7 +53,7 @@ msgstr "Langue audio (ex. FR)" msgid "Bad setting for %s (%s)" msgstr "Mauvais param??tre pour %s (%s)" -#: src/wx/film_editor.cc:297 +#: src/wx/film_editor.cc:296 msgid "Bottom crop" msgstr "D??coupe bas" @@ -66,7 +65,7 @@ msgstr "Parcourir..." msgid "But I have to use fader" msgstr "Je souhaite utiliser ce volume" -#: src/wx/film_editor.cc:375 +#: src/wx/film_editor.cc:374 msgid "Calculate..." msgstr "Calcul..." @@ -74,15 +73,15 @@ msgstr "Calcul..." msgid "Channels" msgstr "Canaux" -#: src/wx/film_editor.cc:326 +#: src/wx/film_editor.cc:325 msgid "Colour look-up table" msgstr "Espace colorim??trique" -#: src/wx/film_editor.cc:121 +#: src/wx/film_editor.cc:120 msgid "Content" msgstr "Contenu" -#: src/wx/film_editor.cc:131 +#: src/wx/film_editor.cc:130 msgid "Content Type" msgstr "Type de Contenu" @@ -101,7 +100,7 @@ msgstr "Impossible de cr??er le DCP : %s" msgid "Could not open content file (%s)" msgstr "Ouverture du contenu impossible (%s)" -#: src/wx/film_editor.cc:505 +#: src/wx/film_editor.cc:504 #, c-format msgid "Could not set content: %s" msgstr "S??lectionner du contenu impossible : %s" @@ -114,11 +113,11 @@ msgstr "Cr??er dans le dossier" msgid "DCI name" msgstr "Nom DCI" -#: src/wx/film_editor.cc:142 +#: src/wx/film_editor.cc:141 msgid "DCP Frame Rate" msgstr "Cadence image du DCP" -#: src/wx/film_editor.cc:110 +#: src/wx/film_editor.cc:109 msgid "DCP Name" msgstr "Nom du DCP" @@ -142,8 +141,7 @@ msgstr "D??tails du nom DCI par d??faut" msgid "Default directory for new films" msgstr "Dossier par d??faut des nouveaux films" -#: src/wx/film_editor.cc:117 -#: src/wx/job_manager_view.cc:88 +#: src/wx/film_editor.cc:116 src/wx/job_manager_view.cc:88 msgid "Details..." msgstr "D??tails..." @@ -151,7 +149,7 @@ msgstr "D??tails..." msgid "Disk space required" msgstr "Espace disque requis" -#: src/wx/film_editor.cc:192 +#: src/wx/film_editor.cc:191 msgid "Duration" msgstr "Dur??e" @@ -159,9 +157,8 @@ msgstr "Dur??e" msgid "Edit" msgstr "??dition" -#: src/wx/config_dialog.cc:84 -#: src/wx/config_dialog.cc:103 -#: src/wx/film_editor.cc:309 +#: src/wx/config_dialog.cc:84 src/wx/config_dialog.cc:103 +#: src/wx/film_editor.cc:308 msgid "Edit..." msgstr "??diter..." @@ -169,7 +166,7 @@ msgstr "??diter..." msgid "Encoding Servers" msgstr "Serveurs d'encodage" -#: src/wx/film_editor.cc:177 +#: src/wx/film_editor.cc:176 msgid "End" msgstr "Fin" @@ -177,7 +174,7 @@ msgstr "Fin" msgid "Facility (e.g. DLA)" msgstr "Laboratoire (ex. DLA)" -#: src/wx/film_editor.cc:74 +#: src/wx/film_editor.cc:73 msgid "Film" msgstr "Film" @@ -189,12 +186,11 @@ msgstr "Propri??t??s du film" msgid "Film name" msgstr "Nom du Film" -#: src/wx/film_editor.cc:304 -#: src/wx/filter_dialog.cc:32 +#: src/wx/film_editor.cc:303 src/wx/filter_dialog.cc:32 msgid "Filters" msgstr "Filtres" -#: src/wx/film_editor.cc:269 +#: src/wx/film_editor.cc:268 msgid "Format" msgstr "Format" @@ -218,7 +214,7 @@ msgstr "Gb" msgid "Host name or IP address" msgstr "Nom de l'h??te ou adresse IP" -#: src/wx/film_editor.cc:1230 +#: src/wx/film_editor.cc:1233 msgid "Hz" msgstr "Hz" @@ -230,19 +226,19 @@ msgstr "Je veux le jouer ?? ce volume" msgid "IP address" msgstr "Adresse IP" -#: src/wx/film_editor.cc:336 +#: src/wx/film_editor.cc:335 msgid "JPEG2000 bandwidth" msgstr "Qualit?? JPEG2000" -#: src/wx/film_editor.cc:282 +#: src/wx/film_editor.cc:281 msgid "Left crop" msgstr "D??coupe gauche" -#: src/wx/film_editor.cc:165 +#: src/wx/film_editor.cc:164 msgid "Length" msgstr "Longueur" -#: src/wx/film_editor.cc:340 +#: src/wx/film_editor.cc:339 msgid "MBps" msgstr "MBps" @@ -250,7 +246,7 @@ msgstr "MBps" msgid "My Documents" msgstr "Mes Documents" -#: src/wx/film_editor.cc:105 +#: src/wx/film_editor.cc:104 msgid "Name" msgstr "Nom" @@ -258,16 +254,15 @@ msgstr "Nom" msgid "New Film" msgstr "Nouveau Film" -#: src/wx/film_editor.cc:306 -#: src/wx/film_editor.cc:663 +#: src/wx/film_editor.cc:305 src/wx/film_editor.cc:664 msgid "None" msgstr "Aucun" -#: src/wx/film_editor.cc:136 +#: src/wx/film_editor.cc:135 msgid "Original Frame Rate" msgstr "Cadence d'images originale" -#: src/wx/film_editor.cc:160 +#: src/wx/film_editor.cc:159 msgid "Original Size" msgstr "Taille Originale" @@ -307,7 +302,7 @@ msgstr "??chelle de r??f??rence pour A7B" msgid "Remove" msgstr "Supprimer" -#: src/wx/film_editor.cc:287 +#: src/wx/film_editor.cc:286 msgid "Right crop" msgstr "D??coupe droite" @@ -315,15 +310,15 @@ msgstr "D??coupe droite" msgid "Running" msgstr "Progression" -#: src/wx/film_editor.cc:316 +#: src/wx/film_editor.cc:315 msgid "Scaler" msgstr "Mise ?? l'??chelle" -#: src/wx/film_editor.cc:408 +#: src/wx/film_editor.cc:407 msgid "Select Audio File" msgstr "S??lectionner le fichier son" -#: src/wx/film_editor.cc:122 +#: src/wx/film_editor.cc:121 msgid "Select Content File" msgstr "S??lectionner le fichier vid??o" @@ -331,7 +326,7 @@ msgstr "S??lectionner le fichier vid??o" msgid "Server" msgstr "Serveur" -#: src/wx/film_editor.cc:365 +#: src/wx/film_editor.cc:364 msgid "Show Audio..." msgstr "Montrer le son..." @@ -339,7 +334,7 @@ msgstr "Montrer le son..." msgid "Smoothing" msgstr "Lissage" -#: src/wx/film_editor.cc:174 +#: src/wx/film_editor.cc:173 msgid "Start" msgstr "D??but" @@ -351,15 +346,15 @@ msgstr "Studio (ex. TCF)" msgid "Subtitle Language (e.g. FR)" msgstr "Langue de sous-titres (ex. FR)" -#: src/wx/film_editor.cc:432 +#: src/wx/film_editor.cc:431 msgid "Subtitle Offset" msgstr "D??calage du sous-titre" -#: src/wx/film_editor.cc:437 +#: src/wx/film_editor.cc:436 msgid "Subtitle Scale" msgstr "Taille du sous-titre" -#: src/wx/film_editor.cc:80 +#: src/wx/film_editor.cc:79 msgid "Subtitles" msgstr "Sous-titres" @@ -399,15 +394,15 @@ msgstr "Nombre de processus ?? utiliser sur cet h??te" msgid "Time" msgstr "Dur??e" -#: src/wx/film_editor.cc:292 +#: src/wx/film_editor.cc:291 msgid "Top crop" msgstr "D??coupe haut" -#: src/wx/film_editor.cc:172 +#: src/wx/film_editor.cc:171 msgid "Trim frames" msgstr "Images coup??es" -#: src/wx/film_editor.cc:126 +#: src/wx/film_editor.cc:125 msgid "Trust content's header" msgstr "Faire confiance ?? l'en-t??te" @@ -415,31 +410,31 @@ msgstr "Faire confiance ?? l'en-t??te" msgid "Type" msgstr "Type" -#: src/wx/film_editor.cc:115 +#: src/wx/film_editor.cc:114 msgid "Use DCI name" msgstr "Utiliser le nom DCI" -#: src/wx/film_editor.cc:146 +#: src/wx/film_editor.cc:145 msgid "Use best" msgstr "Automatique" -#: src/wx/film_editor.cc:392 +#: src/wx/film_editor.cc:391 msgid "Use content's audio" msgstr "Utiliser le son int??gr??" -#: src/wx/film_editor.cc:402 +#: src/wx/film_editor.cc:401 msgid "Use external audio" msgstr "Utiliser une source audio externe" -#: src/wx/film_editor.cc:76 +#: src/wx/film_editor.cc:75 msgid "Video" msgstr "Vid??o" -#: src/wx/film_editor.cc:425 +#: src/wx/film_editor.cc:424 msgid "With Subtitles" msgstr "Avec sous-titres" -#: src/wx/film_editor.cc:1228 +#: src/wx/film_editor.cc:1231 msgid "channels" msgstr "canaux" @@ -447,27 +442,24 @@ msgstr "canaux" msgid "counting..." msgstr "calcul..." -#: src/wx/film_editor.cc:374 +#: src/wx/film_editor.cc:373 msgid "dB" msgstr "dB" -#: src/wx/film_editor.cc:689 -#: src/wx/film_editor.cc:691 +#: src/wx/film_editor.cc:690 src/wx/film_editor.cc:692 msgid "frames" msgstr "images" #. / TRANSLATORS: this is an abbreviation for milliseconds, the unit of time -#: src/wx/film_editor.cc:387 +#: src/wx/film_editor.cc:386 msgid "ms" msgstr "ms" #. / TRANSLATORS: `s' here is an abbreviation for seconds, the unit of time -#: src/wx/film_editor.cc:198 +#: src/wx/film_editor.cc:197 msgid "s" msgstr "s" -#: src/wx/properties_dialog.cc:62 -#: src/wx/properties_dialog.cc:63 +#: src/wx/properties_dialog.cc:62 src/wx/properties_dialog.cc:63 msgid "unknown" msgstr "inconnu" - diff --git a/src/wx/po/it_IT.po b/src/wx/po/it_IT.po index c8fa5815a..7a9e22634 100644 --- a/src/wx/po/it_IT.po +++ b/src/wx/po/it_IT.po @@ -7,25 +7,25 @@ msgid "" msgstr "" "Project-Id-Version: IT VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2013-03-15 08:39+0000\n" +"POT-Creation-Date: 2013-03-20 10:29+0000\n" "PO-Revision-Date: 2013-03-18 17:51+0100\n" "Last-Translator: Maci \n" "Language-Team: \n" +"Language: Italiano\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "X-Generator: Poedit 1.5.5\n" -"Language: Italiano\n" -#: src/wx/film_editor.cc:441 +#: src/wx/film_editor.cc:440 msgid "%" msgstr "%" -#: src/wx/film_editor.cc:1230 +#: src/wx/film_editor.cc:1229 msgid "1 channel" msgstr "Canale 1" -#: src/wx/film_editor.cc:185 +#: src/wx/film_editor.cc:184 msgid "A/B" msgstr "A/B" @@ -33,15 +33,15 @@ msgstr "A/B" msgid "Add" msgstr "Aggiungi" -#: src/wx/audio_dialog.cc:32 src/wx/film_editor.cc:78 +#: src/wx/audio_dialog.cc:32 src/wx/film_editor.cc:77 msgid "Audio" msgstr "Audio" -#: src/wx/film_editor.cc:382 +#: src/wx/film_editor.cc:381 msgid "Audio Delay" msgstr "Ritardo dell'audio" -#: src/wx/film_editor.cc:370 +#: src/wx/film_editor.cc:369 msgid "Audio Gain" msgstr "Guadagno dell'audio" @@ -54,7 +54,7 @@ msgstr "Lingua dell'audio (es. EN)" msgid "Bad setting for %s (%s)" msgstr "Valore sbagliato per %s (%s)" -#: src/wx/film_editor.cc:297 +#: src/wx/film_editor.cc:296 msgid "Bottom crop" msgstr "Taglio inferiore" @@ -66,7 +66,7 @@ msgstr "Sfoglia..." msgid "But I have to use fader" msgstr "Ma devo usare il fader" -#: src/wx/film_editor.cc:375 +#: src/wx/film_editor.cc:374 msgid "Calculate..." msgstr "Calcola..." @@ -74,15 +74,15 @@ msgstr "Calcola..." msgid "Channels" msgstr "Canali" -#: src/wx/film_editor.cc:326 +#: src/wx/film_editor.cc:325 msgid "Colour look-up table" msgstr "Tabella per ricerca del colore" -#: src/wx/film_editor.cc:121 +#: src/wx/film_editor.cc:120 msgid "Content" msgstr "Contenuto" -#: src/wx/film_editor.cc:131 +#: src/wx/film_editor.cc:130 msgid "Content Type" msgstr "Tipo di contenuto" @@ -101,7 +101,7 @@ msgstr "Non posso creare il DCP: %s" msgid "Could not open content file (%s)" msgstr "Non posso aprire il file del contenuto (%s)" -#: src/wx/film_editor.cc:505 +#: src/wx/film_editor.cc:504 #, c-format msgid "Could not set content: %s" msgstr "Non posso regolare il contenuto: %s" @@ -114,11 +114,11 @@ msgstr "Crea nella cartella" msgid "DCI name" msgstr "Nome del DCP" -#: src/wx/film_editor.cc:142 +#: src/wx/film_editor.cc:141 msgid "DCP Frame Rate" msgstr "Frequenza fotogrammi del DCP" -#: src/wx/film_editor.cc:110 +#: src/wx/film_editor.cc:109 msgid "DCP Name" msgstr "Nome del DCP" @@ -142,7 +142,7 @@ msgstr "Dettagli del nome di default DCI" msgid "Default directory for new films" msgstr "Directory di default per i nuovi films" -#: src/wx/film_editor.cc:117 src/wx/job_manager_view.cc:88 +#: src/wx/film_editor.cc:116 src/wx/job_manager_view.cc:88 msgid "Details..." msgstr "Dettagli" @@ -150,7 +150,7 @@ msgstr "Dettagli" msgid "Disk space required" msgstr "Spazio su disco rischiesto" -#: src/wx/film_editor.cc:192 +#: src/wx/film_editor.cc:191 msgid "Duration" msgstr "Durata" @@ -159,7 +159,7 @@ msgid "Edit" msgstr "Modifica" #: src/wx/config_dialog.cc:84 src/wx/config_dialog.cc:103 -#: src/wx/film_editor.cc:309 +#: src/wx/film_editor.cc:308 msgid "Edit..." msgstr "Modifica..." @@ -167,7 +167,7 @@ msgstr "Modifica..." msgid "Encoding Servers" msgstr "Servers di codifica" -#: src/wx/film_editor.cc:177 +#: src/wx/film_editor.cc:176 msgid "End" msgstr "Fine" @@ -175,7 +175,7 @@ msgstr "Fine" msgid "Facility (e.g. DLA)" msgstr "Facility (es. DLA)" -#: src/wx/film_editor.cc:74 +#: src/wx/film_editor.cc:73 msgid "Film" msgstr "Film" @@ -187,11 +187,11 @@ msgstr "Proprietà del film" msgid "Film name" msgstr "Nome del film" -#: src/wx/film_editor.cc:304 src/wx/filter_dialog.cc:32 +#: src/wx/film_editor.cc:303 src/wx/filter_dialog.cc:32 msgid "Filters" msgstr "Filtri" -#: src/wx/film_editor.cc:269 +#: src/wx/film_editor.cc:268 msgid "Format" msgstr "Formato" @@ -215,7 +215,7 @@ msgstr "Gb" msgid "Host name or IP address" msgstr "Nome dell'Host o indirizzo IP" -#: src/wx/film_editor.cc:1234 +#: src/wx/film_editor.cc:1233 msgid "Hz" msgstr "Hz" @@ -227,19 +227,19 @@ msgstr "Voglio riprodurrlo back at fader" msgid "IP address" msgstr "Indirizzo IP" -#: src/wx/film_editor.cc:336 +#: src/wx/film_editor.cc:335 msgid "JPEG2000 bandwidth" msgstr "Banda passante JPEG2000" -#: src/wx/film_editor.cc:282 +#: src/wx/film_editor.cc:281 msgid "Left crop" msgstr "Taglio sinistro" -#: src/wx/film_editor.cc:165 +#: src/wx/film_editor.cc:164 msgid "Length" msgstr "Lunghezza" -#: src/wx/film_editor.cc:340 +#: src/wx/film_editor.cc:339 msgid "MBps" msgstr "MBps" @@ -247,7 +247,7 @@ msgstr "MBps" msgid "My Documents" msgstr "Documenti" -#: src/wx/film_editor.cc:105 +#: src/wx/film_editor.cc:104 msgid "Name" msgstr "Nome" @@ -255,15 +255,15 @@ msgstr "Nome" msgid "New Film" msgstr "Nuovo Film" -#: src/wx/film_editor.cc:306 src/wx/film_editor.cc:665 +#: src/wx/film_editor.cc:305 src/wx/film_editor.cc:664 msgid "None" msgstr "Nessuno" -#: src/wx/film_editor.cc:136 +#: src/wx/film_editor.cc:135 msgid "Original Frame Rate" msgstr "Frequenza Fotogrammi Originale" -#: src/wx/film_editor.cc:160 +#: src/wx/film_editor.cc:159 msgid "Original Size" msgstr "Dimensione Originale" @@ -303,7 +303,7 @@ msgstr "Scalatura di riferimento per A/B" msgid "Remove" msgstr "Rimuovi" -#: src/wx/film_editor.cc:287 +#: src/wx/film_editor.cc:286 msgid "Right crop" msgstr "Taglio destro" @@ -311,15 +311,15 @@ msgstr "Taglio destro" msgid "Running" msgstr "In corso" -#: src/wx/film_editor.cc:316 +#: src/wx/film_editor.cc:315 msgid "Scaler" msgstr "Scaler" -#: src/wx/film_editor.cc:408 +#: src/wx/film_editor.cc:407 msgid "Select Audio File" msgstr "Seleziona File Audio" -#: src/wx/film_editor.cc:122 +#: src/wx/film_editor.cc:121 msgid "Select Content File" msgstr "Seleziona FIle del Contenuto" @@ -327,7 +327,7 @@ msgstr "Seleziona FIle del Contenuto" msgid "Server" msgstr "Server" -#: src/wx/film_editor.cc:365 +#: src/wx/film_editor.cc:364 msgid "Show Audio..." msgstr "Mostra Audio..." @@ -335,7 +335,7 @@ msgstr "Mostra Audio..." msgid "Smoothing" msgstr "Levigatura" -#: src/wx/film_editor.cc:174 +#: src/wx/film_editor.cc:173 msgid "Start" msgstr "Avvio" @@ -347,15 +347,15 @@ msgstr "Studio (es. TCF)" msgid "Subtitle Language (e.g. FR)" msgstr "Lingua dei Sottotitoli (es. FR)" -#: src/wx/film_editor.cc:432 +#: src/wx/film_editor.cc:431 msgid "Subtitle Offset" msgstr "Sfalsamento dei Sottotitoli" -#: src/wx/film_editor.cc:437 +#: src/wx/film_editor.cc:436 msgid "Subtitle Scale" msgstr "Scala dei Sottotitoli" -#: src/wx/film_editor.cc:80 +#: src/wx/film_editor.cc:79 msgid "Subtitles" msgstr "Sottotitoli" @@ -395,15 +395,15 @@ msgstr "Threads da usare per codificare su questo host" msgid "Time" msgstr "Tempo" -#: src/wx/film_editor.cc:292 +#: src/wx/film_editor.cc:291 msgid "Top crop" msgstr "Taglio superiore" -#: src/wx/film_editor.cc:172 +#: src/wx/film_editor.cc:171 msgid "Trim frames" msgstr "Taglia fotogrammi" -#: src/wx/film_editor.cc:126 +#: src/wx/film_editor.cc:125 msgid "Trust content's header" msgstr "Conferma l'intestazione del contenuto" @@ -411,31 +411,31 @@ msgstr "Conferma l'intestazione del contenuto" msgid "Type" msgstr "Tipo" -#: src/wx/film_editor.cc:115 +#: src/wx/film_editor.cc:114 msgid "Use DCI name" msgstr "Usa nome DCI" -#: src/wx/film_editor.cc:146 +#: src/wx/film_editor.cc:145 msgid "Use best" msgstr "Usa il migliore" -#: src/wx/film_editor.cc:392 +#: src/wx/film_editor.cc:391 msgid "Use content's audio" msgstr "Usa l'audio del contenuto" -#: src/wx/film_editor.cc:402 +#: src/wx/film_editor.cc:401 msgid "Use external audio" msgstr "Usa l'audio esterno" -#: src/wx/film_editor.cc:76 +#: src/wx/film_editor.cc:75 msgid "Video" msgstr "Video" -#: src/wx/film_editor.cc:425 +#: src/wx/film_editor.cc:424 msgid "With Subtitles" msgstr "Con Sottotitoli" -#: src/wx/film_editor.cc:1232 +#: src/wx/film_editor.cc:1231 msgid "channels" msgstr "canali" @@ -443,21 +443,21 @@ msgstr "canali" msgid "counting..." msgstr "conteggio..." -#: src/wx/film_editor.cc:374 +#: src/wx/film_editor.cc:373 msgid "dB" msgstr "dB" -#: src/wx/film_editor.cc:691 src/wx/film_editor.cc:693 +#: src/wx/film_editor.cc:690 src/wx/film_editor.cc:692 msgid "frames" msgstr "fotogrammi" #. / TRANSLATORS: this is an abbreviation for milliseconds, the unit of time -#: src/wx/film_editor.cc:387 +#: src/wx/film_editor.cc:386 msgid "ms" msgstr "ms" #. / TRANSLATORS: `s' here is an abbreviation for seconds, the unit of time -#: src/wx/film_editor.cc:198 +#: src/wx/film_editor.cc:197 msgid "s" msgstr "s" diff --git a/src/wx/wscript b/src/wx/wscript index cc303f5e8..42bb8ca88 100644 --- a/src/wx/wscript +++ b/src/wx/wscript @@ -44,3 +44,6 @@ def build(bld): def pot(bld): i18n.pot(os.path.join('src', 'wx'), sources, 'libdvdomatic-wx') + +def pot_merge(bld): + i18n.pot_merge(os.path.join('src', 'wx'), 'libdvdomatic-wx') diff --git a/wscript b/wscript index b61b3b4cb..2b03c89cb 100644 --- a/wscript +++ b/wscript @@ -267,3 +267,6 @@ def post(ctx): def pot(bld): bld.recurse('src') + +def pot_merge(bld): + bld.recurse('src') -- cgit v1.2.3 From 8750efb9e072cf3b42e6c3c29521c7031c0b5dfd Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Sat, 6 Apr 2013 14:42:08 +0100 Subject: Basics of content dialogs. --- src/lib/audio_content.cc | 4 ++ src/lib/audio_content.h | 8 +++ src/lib/audio_mapping.cc | 103 +++++++++++++++++++++++++++++++++++ src/lib/audio_mapping.h | 53 ++++++++++++++++++ src/lib/encoder.cc | 3 +- src/lib/sndfile_content.cc | 84 +++++++++++++++++----------- src/lib/sndfile_content.h | 32 +++++++++-- src/lib/sndfile_decoder.cc | 65 +++++++++++----------- src/lib/sndfile_decoder.h | 8 +++ src/lib/util.cc | 52 ------------------ src/lib/util.h | 13 ----- src/lib/writer.cc | 3 +- src/lib/wscript | 1 + src/wx/audio_dialog.cc | 7 ++- src/wx/film_editor.cc | 79 +++++++++++---------------- src/wx/film_editor.h | 5 +- src/wx/imagemagick_content_dialog.cc | 62 +++++++++++++++++++++ src/wx/imagemagick_content_dialog.h | 34 ++++++++++++ src/wx/sndfile_content_dialog.cc | 67 +++++++++++++++++++++++ src/wx/sndfile_content_dialog.h | 36 ++++++++++++ src/wx/wscript | 2 + 21 files changed, 536 insertions(+), 185 deletions(-) create mode 100644 src/lib/audio_mapping.cc create mode 100644 src/lib/audio_mapping.h create mode 100644 src/wx/imagemagick_content_dialog.cc create mode 100644 src/wx/imagemagick_content_dialog.h create mode 100644 src/wx/sndfile_content_dialog.cc create mode 100644 src/wx/sndfile_content_dialog.h (limited to 'src/wx/wscript') diff --git a/src/lib/audio_content.cc b/src/lib/audio_content.cc index 8ca1e83c9..9968f4725 100644 --- a/src/lib/audio_content.cc +++ b/src/lib/audio_content.cc @@ -22,6 +22,10 @@ using boost::shared_ptr; +int const AudioContentProperty::AUDIO_CHANNELS = 200; +int const AudioContentProperty::AUDIO_LENGTH = 201; +int const AudioContentProperty::AUDIO_FRAME_RATE = 202; + AudioContent::AudioContent (boost::filesystem::path f) : Content (f) { diff --git a/src/lib/audio_content.h b/src/lib/audio_content.h index 2bfc20656..d5dbf266b 100644 --- a/src/lib/audio_content.h +++ b/src/lib/audio_content.h @@ -27,6 +27,14 @@ namespace cxml { class Node; } +class AudioContentProperty +{ +public: + static int const AUDIO_CHANNELS; + static int const AUDIO_LENGTH; + static int const AUDIO_FRAME_RATE; +}; + class AudioContent : public virtual Content { public: diff --git a/src/lib/audio_mapping.cc b/src/lib/audio_mapping.cc new file mode 100644 index 000000000..3fc423e10 --- /dev/null +++ b/src/lib/audio_mapping.cc @@ -0,0 +1,103 @@ +/* + Copyright (C) 2013 Carl Hetherington + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + +*/ + +#include "audio_mapping.h" + +using std::map; +using boost::optional; + +AutomaticAudioMapping::AutomaticAudioMapping (int c) + : _source_channels (c) +{ + +} + +optional +AutomaticAudioMapping::source_to_dcp (int c) const +{ + if (c >= _source_channels) { + return optional (); + } + + if (_source_channels == 1) { + /* mono sources to centre */ + return libdcp::CENTRE; + } + + return static_cast (c); +} + +optional +AutomaticAudioMapping::dcp_to_source (libdcp::Channel c) const +{ + if (_source_channels == 1) { + if (c == libdcp::CENTRE) { + return 0; + } else { + return optional (); + } + } + + if (static_cast (c) >= _source_channels) { + return optional (); + } + + return static_cast (c); +} + +int +AutomaticAudioMapping::dcp_channels () const +{ + if (_source_channels == 1) { + /* The source is mono, so to put the mono channel into + the centre we need to generate a 5.1 soundtrack. + */ + return 6; + } + + return _source_channels; +} + +optional +ConfiguredAudioMapping::dcp_to_source (libdcp::Channel c) const +{ + map::const_iterator i = _source_to_dcp.begin (); + while (i != _source_to_dcp.end() && i->second != c) { + ++i; + } + + if (i == _source_to_dcp.end ()) { + return boost::none; + } + + return i->first; +} + +optional +ConfiguredAudioMapping::source_to_dcp (int c) const +{ + map::const_iterator i = _source_to_dcp.find (c); + if (i == _source_to_dcp.end ()) { + return boost::none; + } + + return i->second; +} + + diff --git a/src/lib/audio_mapping.h b/src/lib/audio_mapping.h new file mode 100644 index 000000000..8804bde06 --- /dev/null +++ b/src/lib/audio_mapping.h @@ -0,0 +1,53 @@ +/* + Copyright (C) 2013 Carl Hetherington + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + +*/ + +#include +#include +#include +#include + +class AudioMapping +{ +public: + virtual boost::optional source_to_dcp (int c) const = 0; + virtual boost::optional dcp_to_source (libdcp::Channel c) const = 0; +}; + +class AutomaticAudioMapping : public AudioMapping +{ +public: + AutomaticAudioMapping (int); + + boost::optional source_to_dcp (int c) const; + boost::optional dcp_to_source (libdcp::Channel c) const; + int dcp_channels () const; + +private: + int _source_channels; +}; + +class ConfiguredAudioMapping : public AudioMapping +{ +public: + boost::optional source_to_dcp (int c) const; + boost::optional dcp_to_source (libdcp::Channel c) const; + +private: + std::map _source_to_dcp; +}; diff --git a/src/lib/encoder.cc b/src/lib/encoder.cc index 568307462..a0b88e33e 100644 --- a/src/lib/encoder.cc +++ b/src/lib/encoder.cc @@ -38,6 +38,7 @@ #include "cross.h" #include "writer.h" #include "player.h" +#include "audio_mapping.h" #include "i18n.h" @@ -426,7 +427,7 @@ Encoder::encoder_thread (ServerDescription* server) void Encoder::write_audio (shared_ptr data) { - AudioMapping m (_film->audio_channels ()); + AutomaticAudioMapping m (_film->audio_channels ()); if (m.dcp_channels() != _film->audio_channels()) { /* Remap (currently just for mono -> 5.1) */ diff --git a/src/lib/sndfile_content.cc b/src/lib/sndfile_content.cc index 684405efb..ee4f21eef 100644 --- a/src/lib/sndfile_content.cc +++ b/src/lib/sndfile_content.cc @@ -17,13 +17,18 @@ */ +#include #include "sndfile_content.h" +#include "sndfile_decoder.h" #include "compose.hpp" +#include "job.h" #include "i18n.h" using std::string; +using std::stringstream; using boost::shared_ptr; +using boost::lexical_cast; SndfileContent::SndfileContent (boost::filesystem::path f) : Content (f) @@ -35,9 +40,10 @@ SndfileContent::SndfileContent (boost::filesystem::path f) SndfileContent::SndfileContent (shared_ptr node) : Content (node) , AudioContent (node) - { - + _audio_channels = node->number_child ("AudioChannels"); + _audio_length = node->number_child ("AudioLength"); + _audio_frame_rate = node->number_child ("AudioFrameRate"); } string @@ -49,37 +55,21 @@ SndfileContent::summary () const string SndfileContent::information () const { - return ""; -} - -int -SndfileContent::audio_channels () const -{ - /* XXX */ - return 0; -} - -ContentAudioFrame -SndfileContent::audio_length () const -{ - /* XXX */ - return 0; -} - -int -SndfileContent::audio_frame_rate () const -{ - /* XXX */ - return 0; -} - -int64_t -SndfileContent::audio_channel_layout () const -{ - /* XXX */ - return 0; -} + if (_audio_frame_rate == 0) { + return ""; + } + + stringstream s; + + s << String::compose ( + _("%1 channels, %2kHz, %3 samples"), + audio_channels(), + audio_frame_rate() / 1000.0, + audio_length() + ); + return s.str (); +} bool SndfileContent::valid_file (boost::filesystem::path f) @@ -95,3 +85,33 @@ SndfileContent::clone () const { return shared_ptr (new SndfileContent (*this)); } + +void +SndfileContent::examine (shared_ptr film, shared_ptr job, bool quick) +{ + job->set_progress_unknown (); + Content::examine (film, job, quick); + + SndfileDecoder dec (film, shared_from_this()); + + { + boost::mutex::scoped_lock lm (_mutex); + _audio_channels = dec.audio_channels (); + _audio_length = dec.audio_length (); + _audio_frame_rate = dec.audio_frame_rate (); + } + + signal_changed (AudioContentProperty::AUDIO_CHANNELS); + signal_changed (AudioContentProperty::AUDIO_LENGTH); + signal_changed (AudioContentProperty::AUDIO_FRAME_RATE); +} + +void +SndfileContent::as_xml (xmlpp::Node* node) const +{ + node->add_child("Type")->add_child_text ("Sndfile"); + Content::as_xml (node); + node->add_child("AudioChannels")->add_child_text (lexical_cast (_audio_channels)); + node->add_child("AudioLength")->add_child_text (lexical_cast (_audio_length)); + node->add_child("AudioFrameRate")->add_child_text (lexical_cast (_audio_frame_rate)); +} diff --git a/src/lib/sndfile_content.h b/src/lib/sndfile_content.h index b696b57a5..27c5f3615 100644 --- a/src/lib/sndfile_content.h +++ b/src/lib/sndfile_content.h @@ -17,6 +17,9 @@ */ +extern "C" { +#include +} #include "audio_content.h" namespace cxml { @@ -33,15 +36,36 @@ public: return boost::dynamic_pointer_cast (Content::shared_from_this ()); } + void examine (boost::shared_ptr, boost::shared_ptr, bool); std::string summary () const; std::string information () const; + void as_xml (xmlpp::Node *) const; boost::shared_ptr clone () const; /* AudioContent */ - int audio_channels () const; - ContentAudioFrame audio_length () const; - int audio_frame_rate () const; - int64_t audio_channel_layout () const; + int audio_channels () const { + boost::mutex::scoped_lock lm (_mutex); + return _audio_channels; + } + + ContentAudioFrame audio_length () const { + boost::mutex::scoped_lock lm (_mutex); + return _audio_length; + } + + int audio_frame_rate () const { + boost::mutex::scoped_lock lm (_mutex); + return _audio_frame_rate; + } + + int64_t audio_channel_layout () const { + return av_get_default_channel_layout (audio_channels ()); + } static bool valid_file (boost::filesystem::path); + +private: + int _audio_channels; + ContentAudioFrame _audio_length; + int _audio_frame_rate; }; diff --git a/src/lib/sndfile_decoder.cc b/src/lib/sndfile_decoder.cc index 1f97e5c41..c7311112a 100644 --- a/src/lib/sndfile_decoder.cc +++ b/src/lib/sndfile_decoder.cc @@ -28,59 +28,62 @@ using std::vector; using std::string; -using std::stringstream; using std::min; using std::cout; using boost::shared_ptr; -using boost::optional; - -/* XXX */ SndfileDecoder::SndfileDecoder (shared_ptr f, shared_ptr c) : Decoder (f) , AudioDecoder (f) + , _sndfile_content (c) { - sf_count_t frames; - SNDFILE* sf = open_file (frames); - sf_close (sf); + _sndfile = sf_open (_sndfile_content->file().string().c_str(), SFM_READ, &_info); + if (!_sndfile) { + throw DecodeError (_("could not open audio file for reading")); + } + + _remaining = _info.frames; } -SNDFILE* -SndfileDecoder::open_file (sf_count_t & frames) +SndfileDecoder::~SndfileDecoder () { - frames = 0; - - SF_INFO info; - SNDFILE* s = sf_open (_sndfile_content->file().string().c_str(), SFM_READ, &info); - if (!s) { - throw DecodeError (_("could not open external audio file for reading")); + if (_sndfile) { + sf_close (_sndfile); } - - frames = info.frames; - return s; } bool SndfileDecoder::pass () { - sf_count_t frames; - SNDFILE* sndfile = open_file (frames); - /* Do things in half second blocks as I think there may be limits to what FFmpeg (and in particular the resampler) can cope with. */ sf_count_t const block = _sndfile_content->audio_frame_rate() / 2; + sf_count_t const this_time = min (block, _remaining); + + shared_ptr audio (new AudioBuffers (_sndfile_content->audio_channels(), this_time)); + sf_read_float (_sndfile, audio->data(0), this_time); + audio->set_frames (this_time); + Audio (audio); + _remaining -= this_time; - shared_ptr audio (new AudioBuffers (_sndfile_content->audio_channels(), block)); - while (frames > 0) { - sf_count_t const this_time = min (block, frames); - sf_read_float (sndfile, audio->data(0), this_time); - audio->set_frames (this_time); - Audio (audio); - frames -= this_time; - } + return (_remaining == 0); +} - sf_close (sndfile); +int +SndfileDecoder::audio_channels () const +{ + return _info.channels; +} - return true; +ContentAudioFrame +SndfileDecoder::audio_length () const +{ + return _info.frames; +} + +int +SndfileDecoder::audio_frame_rate () const +{ + return _info.samplerate; } diff --git a/src/lib/sndfile_decoder.h b/src/lib/sndfile_decoder.h index 56fc3a9f0..2900afea0 100644 --- a/src/lib/sndfile_decoder.h +++ b/src/lib/sndfile_decoder.h @@ -27,12 +27,20 @@ class SndfileDecoder : public AudioDecoder { public: SndfileDecoder (boost::shared_ptr, boost::shared_ptr); + ~SndfileDecoder (); bool pass (); + int audio_channels () const; + ContentAudioFrame audio_length () const; + int audio_frame_rate () const; + private: SNDFILE* open_file (sf_count_t &); void close_file (SNDFILE*); boost::shared_ptr _sndfile_content; + SNDFILE* _sndfile; + SF_INFO _info; + ContentAudioFrame _remaining; }; diff --git a/src/lib/util.cc b/src/lib/util.cc index e0de82c64..1e60b43fc 100644 --- a/src/lib/util.cc +++ b/src/lib/util.cc @@ -914,58 +914,6 @@ audio_channel_name (int c) return channels[c]; } -AudioMapping::AudioMapping (int c) - : _source_channels (c) -{ - -} - -optional -AudioMapping::source_to_dcp (int c) const -{ - if (c >= _source_channels) { - return optional (); - } - - if (_source_channels == 1) { - /* mono sources to centre */ - return libdcp::CENTRE; - } - - return static_cast (c); -} - -optional -AudioMapping::dcp_to_source (libdcp::Channel c) const -{ - if (_source_channels == 1) { - if (c == libdcp::CENTRE) { - return 0; - } else { - return optional (); - } - } - - if (static_cast (c) >= _source_channels) { - return optional (); - } - - return static_cast (c); -} - -int -AudioMapping::dcp_channels () const -{ - if (_source_channels == 1) { - /* The source is mono, so to put the mono channel into - the centre we need to generate a 5.1 soundtrack. - */ - return 6; - } - - return _source_channels; -} - FrameRateConversion::FrameRateConversion (float source, int dcp) : skip (false) , repeat (false) diff --git a/src/lib/util.h b/src/lib/util.h index 23ebd52bc..1fe6212e4 100644 --- a/src/lib/util.h +++ b/src/lib/util.h @@ -194,19 +194,6 @@ private: float** _data; }; -class AudioMapping -{ -public: - AudioMapping (int); - - boost::optional source_to_dcp (int c) const; - boost::optional dcp_to_source (libdcp::Channel c) const; - int dcp_channels () const; - -private: - int _source_channels; -}; - extern int64_t video_frames_to_audio_frames (ContentVideoFrame v, float audio_sample_rate, float frames_per_second); extern std::pair cpu_info (); diff --git a/src/lib/writer.cc b/src/lib/writer.cc index 5d38860e7..6df1a1f21 100644 --- a/src/lib/writer.cc +++ b/src/lib/writer.cc @@ -31,6 +31,7 @@ #include "dcp_video_frame.h" #include "dcp_content_type.h" #include "player.h" +#include "audio_mapping.h" #include "i18n.h" @@ -77,7 +78,7 @@ Writer::Writer (shared_ptr f) _picture_asset_writer = _picture_asset->start_write (_first_nonexistant_frame > 0); - AudioMapping m (_film->audio_channels ()); + AutomaticAudioMapping m (_film->audio_channels ()); if (m.dcp_channels() > 0) { _sound_asset.reset ( diff --git a/src/lib/wscript b/src/lib/wscript index 32a2cde23..896598a0e 100644 --- a/src/lib/wscript +++ b/src/lib/wscript @@ -8,6 +8,7 @@ sources = """ audio_analysis.cc audio_content.cc audio_decoder.cc + audio_mapping.cc audio_source.cc config.cc combiner.cc diff --git a/src/wx/audio_dialog.cc b/src/wx/audio_dialog.cc index 1241c2e76..f53ea7c19 100644 --- a/src/wx/audio_dialog.cc +++ b/src/wx/audio_dialog.cc @@ -20,6 +20,7 @@ #include #include "lib/audio_analysis.h" #include "lib/film.h" +#include "lib/audio_mapping.h" #include "audio_dialog.h" #include "audio_plot.h" #include "wx_util.h" @@ -108,7 +109,7 @@ AudioDialog::setup_channels () return; } - AudioMapping m (_film->audio_channels ()); + AutomaticAudioMapping m (_film->audio_channels ()); for (int i = 0; i < MAX_AUDIO_CHANNELS; ++i) { if (m.dcp_to_source(static_cast(i))) { @@ -134,7 +135,7 @@ AudioDialog::try_to_load_analysis () _plot->set_analysis (a); - AudioMapping m (_film->audio_channels ()); + AutomaticAudioMapping m (_film->audio_channels ()); optional c = m.source_to_dcp (0); if (c) { _channel_checkbox[c.get()]->SetValue (true); @@ -157,7 +158,7 @@ AudioDialog::channel_clicked (wxCommandEvent& ev) assert (c < MAX_AUDIO_CHANNELS); - AudioMapping m (_film->audio_channels ()); + AutomaticAudioMapping m (_film->audio_channels ()); optional s = m.dcp_to_source (static_cast (c)); if (s) { _plot->set_channel_visible (s.get(), _channel_checkbox[c]->GetValue ()); diff --git a/src/wx/film_editor.cc b/src/wx/film_editor.cc index 58fc077a3..6c42359fb 100644 --- a/src/wx/film_editor.cc +++ b/src/wx/film_editor.cc @@ -49,6 +49,8 @@ #include "dci_metadata_dialog.h" #include "scaler.h" #include "audio_dialog.h" +#include "imagemagick_content_dialog.h" +#include "sndfile_content_dialog.h" using std::string; using std::cout; @@ -198,9 +200,9 @@ FilmEditor::connect_to_widgets () _content->Connect (wxID_ANY, wxEVT_COMMAND_LIST_ITEM_SELECTED, wxListEventHandler (FilmEditor::content_item_selected), 0, this); _content_add->Connect (wxID_ANY, wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler (FilmEditor::content_add_clicked), 0, this); _content_remove->Connect (wxID_ANY, wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler (FilmEditor::content_remove_clicked), 0, this); + _content_edit->Connect (wxID_ANY, wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler (FilmEditor::content_edit_clicked), 0, this); _content_earlier->Connect (wxID_ANY, wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler (FilmEditor::content_earlier_clicked), 0, this); _content_later->Connect (wxID_ANY, wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler (FilmEditor::content_later_clicked), 0, this); - _imagemagick_video_length->Connect (wxID_ANY, wxEVT_COMMAND_SPINCTRL_UPDATED, wxCommandEventHandler (FilmEditor::imagemagick_video_length_changed), 0, this); _left_crop->Connect (wxID_ANY, wxEVT_COMMAND_SPINCTRL_UPDATED, wxCommandEventHandler (FilmEditor::left_crop_changed), 0, this); _right_crop->Connect (wxID_ANY, wxEVT_COMMAND_SPINCTRL_UPDATED, wxCommandEventHandler (FilmEditor::right_crop_changed), 0, this); _top_crop->Connect (wxID_ANY, wxEVT_COMMAND_SPINCTRL_UPDATED, wxCommandEventHandler (FilmEditor::top_crop_changed), 0, this); @@ -343,6 +345,8 @@ FilmEditor::make_content_panel () b->Add (_content_add); _content_remove = new wxButton (_content_panel, wxID_ANY, _("Remove")); b->Add (_content_remove); + _content_edit = new wxButton (_content_panel, wxID_ANY, _("Edit...")); + b->Add (_content_edit); _content_earlier = new wxButton (_content_panel, wxID_ANY, _("Earlier")); b->Add (_content_earlier); _content_later = new wxButton (_content_panel, wxID_ANY, _("Later")); @@ -355,21 +359,6 @@ FilmEditor::make_content_panel () _content_information = new wxTextCtrl (_content_panel, wxID_ANY, wxT ("\n\n\n\n"), wxDefaultPosition, wxDefaultSize, wxTE_READONLY | wxTE_MULTILINE); _content_sizer->Add (_content_information, 1, wxEXPAND | wxALL, 6); - - wxFlexGridSizer* grid = new wxFlexGridSizer (2, 4, 4); - _content_sizer->Add (grid, 0, wxEXPAND | wxALL, 6); - - { - add_label_to_sizer (grid, _content_panel, (_("Duration"))); - wxBoxSizer* s = new wxBoxSizer (wxHORIZONTAL); - _imagemagick_video_length = new wxSpinCtrl (_content_panel); - s->Add (_imagemagick_video_length); - /// TRANSLATORS: this is an abbreviation for seconds, the unit of time - add_label_to_sizer (s, _content_panel, _("s")); - grid->Add (s); - } - - _imagemagick_video_length->SetRange (1, 3600); } void @@ -723,14 +712,9 @@ FilmEditor::film_content_changed (weak_ptr content, int property) setup_show_audio_sensitivity (); } else if (property == VideoContentProperty::VIDEO_LENGTH) { setup_length (); - boost::shared_ptr c = content.lock (); if (c && c == selected_content()) { setup_content_information (); - shared_ptr im = dynamic_pointer_cast (c); - if (im) { - checked_set (_imagemagick_video_length, im->video_length() / 24); - } } } else if (property == FFmpegContentProperty::AUDIO_STREAM) { if (_film->ffmpeg_audio_stream()) { @@ -1258,6 +1242,33 @@ FilmEditor::content_remove_clicked (wxCommandEvent &) } } +void +FilmEditor::content_edit_clicked (wxCommandEvent &) +{ + shared_ptr c = selected_content (); + if (!c) { + return; + } + + shared_ptr im = dynamic_pointer_cast (c); + if (im) { + ImageMagickContentDialog* d = new ImageMagickContentDialog (this, im); + int const r = d->ShowModal (); + d->Destroy (); + + if (r == wxID_OK) { + im->set_video_length (d->video_length() * 24); + } + } + + shared_ptr sf = dynamic_pointer_cast (c); + if (sf) { + SndfileContentDialog* d = new SndfileContentDialog (this, sf); + d->ShowModal (); + d->Destroy (); + } +} + void FilmEditor::content_earlier_clicked (wxCommandEvent &) { @@ -1281,15 +1292,6 @@ FilmEditor::content_item_selected (wxListEvent &) { setup_content_button_sensitivity (); setup_content_information (); - - shared_ptr c = selected_content (); - if (c) { - shared_ptr im = dynamic_pointer_cast (c); - _imagemagick_video_length->Enable (im); - if (im) { - checked_set (_imagemagick_video_length, im->video_length() / 24); - } - } } void @@ -1310,27 +1312,12 @@ FilmEditor::setup_content_button_sensitivity () _content_add->Enable (_generally_sensitive); bool const have_selection = _content->GetNextItem (-1, wxLIST_NEXT_ALL, wxLIST_STATE_SELECTED) != -1; + _content_edit->Enable (have_selection && _generally_sensitive); _content_remove->Enable (have_selection && _generally_sensitive); _content_earlier->Enable (have_selection && _generally_sensitive); _content_later->Enable (have_selection && _generally_sensitive); } -void -FilmEditor::imagemagick_video_length_changed (wxCommandEvent &) -{ - shared_ptr c = selected_content (); - if (!c) { - return; - } - - shared_ptr im = dynamic_pointer_cast (c); - if (!im) { - return; - } - - im->set_video_length (_imagemagick_video_length->GetValue() * 24); -} - shared_ptr FilmEditor::selected_content () { diff --git a/src/wx/film_editor.h b/src/wx/film_editor.h index 2870714f9..b6f6a24ee 100644 --- a/src/wx/film_editor.h +++ b/src/wx/film_editor.h @@ -16,7 +16,7 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ - + /** @file src/film_editor.h * @brief A wx widget to edit a film's metadata, and perform various functions. */ @@ -66,6 +66,7 @@ private: void content_item_selected (wxListEvent &); void content_add_clicked (wxCommandEvent &); void content_remove_clicked (wxCommandEvent &); + void content_edit_clicked (wxCommandEvent &); void content_earlier_clicked (wxCommandEvent &); void content_later_clicked (wxCommandEvent &); void imagemagick_video_length_changed (wxCommandEvent &); @@ -131,10 +132,10 @@ private: wxListCtrl* _content; wxButton* _content_add; wxButton* _content_remove; + wxButton* _content_edit; wxButton* _content_earlier; wxButton* _content_later; wxTextCtrl* _content_information; - wxSpinCtrl* _imagemagick_video_length; wxButton* _edit_dci_button; wxChoice* _format; wxStaticText* _format_description; diff --git a/src/wx/imagemagick_content_dialog.cc b/src/wx/imagemagick_content_dialog.cc new file mode 100644 index 000000000..726e4b8e2 --- /dev/null +++ b/src/wx/imagemagick_content_dialog.cc @@ -0,0 +1,62 @@ +/* + Copyright (C) 2013 Carl Hetherington + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + +*/ + +#include +#include "lib/imagemagick_content.h" +#include "imagemagick_content_dialog.h" +#include "wx_util.h" + +using boost::shared_ptr; + +ImageMagickContentDialog::ImageMagickContentDialog (wxWindow* parent, shared_ptr content) + : wxDialog (parent, wxID_ANY, _("Image")) +{ + wxFlexGridSizer* grid = new wxFlexGridSizer (3, 6, 6); + grid->AddGrowableCol (1, 1); + + { + add_label_to_sizer (grid, this, (_("Duration"))); + wxBoxSizer* s = new wxBoxSizer (wxHORIZONTAL); + _video_length = new wxSpinCtrl (this); + s->Add (_video_length); + /// TRANSLATORS: this is an abbreviation for seconds, the unit of time + add_label_to_sizer (s, this, _("s")); + grid->Add (s); + } + + wxBoxSizer* overall_sizer = new wxBoxSizer (wxVERTICAL); + overall_sizer->Add (grid, 1, wxEXPAND | wxALL, 6); + + wxSizer* buttons = CreateSeparatedButtonSizer (wxOK); + if (buttons) { + overall_sizer->Add (buttons, wxSizerFlags().Expand().DoubleBorder()); + } + + SetSizer (overall_sizer); + overall_sizer->Layout (); + overall_sizer->SetSizeHints (this); + + checked_set (_video_length, content->video_length () / 24); +} + +int +ImageMagickContentDialog::video_length () const +{ + return _video_length->GetValue (); +} diff --git a/src/wx/imagemagick_content_dialog.h b/src/wx/imagemagick_content_dialog.h new file mode 100644 index 000000000..2fa955929 --- /dev/null +++ b/src/wx/imagemagick_content_dialog.h @@ -0,0 +1,34 @@ +/* + Copyright (C) 2013 Carl Hetherington + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + +*/ + +#include + +class wxSpinCtrl; +class ImageMagickContent; + +class ImageMagickContentDialog : public wxDialog +{ +public: + ImageMagickContentDialog (wxWindow *, boost::shared_ptr); + + int video_length () const; + +private: + wxSpinCtrl* _video_length; +}; diff --git a/src/wx/sndfile_content_dialog.cc b/src/wx/sndfile_content_dialog.cc new file mode 100644 index 000000000..f305b158c --- /dev/null +++ b/src/wx/sndfile_content_dialog.cc @@ -0,0 +1,67 @@ +/* + Copyright (C) 2013 Carl Hetherington + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + +*/ + +#include "lib/util.h" +#include "lib/sndfile_content.h" +#include "sndfile_content_dialog.h" +#include "wx_util.h" + +using boost::shared_ptr; + +SndfileContentDialog::SndfileContentDialog (wxWindow* parent, shared_ptr content) + : wxDialog (parent, wxID_ANY, _("Sound file")) +{ + wxFlexGridSizer* grid = new wxFlexGridSizer (7, 6, 0); + + add_label_to_sizer (grid, this, wxT ("")); + add_label_to_sizer (grid, this, _("L")); + add_label_to_sizer (grid, this, _("R")); + add_label_to_sizer (grid, this, _("C")); + add_label_to_sizer (grid, this, _("Lfe")); + add_label_to_sizer (grid, this, _("Ls")); + add_label_to_sizer (grid, this, _("Rs")); + + _buttons.resize (content->audio_channels ()); + for (int i = 0; i < content->audio_channels(); ++i) { + + if (content->audio_channels() == 1) { + add_label_to_sizer (grid, this, _("Source")); + } else { + add_label_to_sizer (grid, this, wxString::Format (_("Source %d"), i + 1)); + } + + for (int j = 0; j < MAX_AUDIO_CHANNELS; ++j) { + wxRadioButton* b = new wxRadioButton (this, wxID_ANY, wxT (""), wxDefaultPosition, wxDefaultSize, j ? 0 : wxRB_GROUP); + _buttons[i].push_back (b); + grid->Add (b, wxSHRINK); + } + } + + wxBoxSizer* overall_sizer = new wxBoxSizer (wxVERTICAL); + overall_sizer->Add (grid, 1, wxEXPAND | wxALL, 6); + + wxSizer* buttons = CreateSeparatedButtonSizer (wxOK); + if (buttons) { + overall_sizer->Add (buttons, wxSizerFlags().Expand().DoubleBorder()); + } + + SetSizer (overall_sizer); + overall_sizer->Layout (); + overall_sizer->SetSizeHints (this); +} diff --git a/src/wx/sndfile_content_dialog.h b/src/wx/sndfile_content_dialog.h new file mode 100644 index 000000000..5a328892a --- /dev/null +++ b/src/wx/sndfile_content_dialog.h @@ -0,0 +1,36 @@ +/* + Copyright (C) 2013 Carl Hetherington + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + +*/ + +#include +#include +#include +#include "lib/audio_mapping.h" + +class SndfileContent; + +class SndfileContentDialog : public wxDialog +{ +public: + SndfileContentDialog (wxWindow *, boost::shared_ptr); + + ConfiguredAudioMapping audio_mapping () const; + +private: + std::vector > _buttons; +}; diff --git a/src/wx/wscript b/src/wx/wscript index 42bb8ca88..bd21af6ce 100644 --- a/src/wx/wscript +++ b/src/wx/wscript @@ -14,11 +14,13 @@ sources = """ filter_dialog.cc filter_view.cc gain_calculator_dialog.cc + imagemagick_content_dialog.cc job_manager_view.cc job_wrapper.cc new_film_dialog.cc properties_dialog.cc server_dialog.cc + sndfile_content_dialog.cc wx_util.cc wx_ui_signaller.cc """ -- cgit v1.2.3 From c921cfe23b593d7c367ad76094308c5f08037374 Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Sat, 6 Apr 2013 23:57:46 +0100 Subject: Various work on audio channel mapping. --- src/lib/analyse_audio_job.cc | 4 +- src/lib/audio_mapping.cc | 100 ++++++++++++------------- src/lib/audio_mapping.h | 52 +++++++------ src/lib/encoder.cc | 3 + src/lib/ffmpeg_content.cc | 3 +- src/lib/film.cc | 16 +++- src/lib/film.h | 12 ++- src/lib/imagemagick_content.cc | 2 +- src/lib/playlist.cc | 45 +++++++++++ src/lib/playlist.h | 3 + src/lib/sndfile_content.cc | 7 +- src/lib/writer.cc | 6 +- src/wx/audio_dialog.cc | 36 +-------- src/wx/audio_dialog.h | 1 - src/wx/audio_mapping_view.cc | 156 +++++++++++++++++++++++++++++++++++++++ src/wx/audio_mapping_view.h | 35 +++++++++ src/wx/film_editor.cc | 55 +++++++++----- src/wx/film_editor.h | 6 +- src/wx/sndfile_content_dialog.cc | 67 ----------------- src/wx/sndfile_content_dialog.h | 36 --------- src/wx/wscript | 2 +- 21 files changed, 401 insertions(+), 246 deletions(-) create mode 100644 src/wx/audio_mapping_view.cc create mode 100644 src/wx/audio_mapping_view.h delete mode 100644 src/wx/sndfile_content_dialog.cc delete mode 100644 src/wx/sndfile_content_dialog.h (limited to 'src/wx/wscript') diff --git a/src/lib/analyse_audio_job.cc b/src/lib/analyse_audio_job.cc index 5ef6515dd..50096d7c1 100644 --- a/src/lib/analyse_audio_job.cc +++ b/src/lib/analyse_audio_job.cc @@ -57,8 +57,8 @@ AnalyseAudioJob::run () _samples_per_point = max (int64_t (1), _film->audio_length() / _num_points); - _current.resize (_film->audio_channels ()); - _analysis.reset (new AudioAnalysis (_film->audio_channels())); + _current.resize (MAX_AUDIO_CHANNELS); + _analysis.reset (new AudioAnalysis (MAX_AUDIO_CHANNELS)); while (!player->pass()) { set_progress (float (_done) / _film->audio_length ()); diff --git a/src/lib/audio_mapping.cc b/src/lib/audio_mapping.cc index 3fc423e10..48cc23307 100644 --- a/src/lib/audio_mapping.cc +++ b/src/lib/audio_mapping.cc @@ -19,85 +19,77 @@ #include "audio_mapping.h" -using std::map; -using boost::optional; - -AutomaticAudioMapping::AutomaticAudioMapping (int c) - : _source_channels (c) +using std::list; +using std::cout; +using std::make_pair; +using std::pair; +using boost::shared_ptr; + +void +AudioMapping::add (Channel c, libdcp::Channel d) { - + _content_to_dcp.push_back (make_pair (c, d)); } -optional -AutomaticAudioMapping::source_to_dcp (int c) const +/* XXX: this is grotty */ +int +AudioMapping::dcp_channels () const { - if (c >= _source_channels) { - return optional (); + for (list >::const_iterator i = _content_to_dcp.begin(); i != _content_to_dcp.end(); ++i) { + if (((int) i->second) > 2) { + return 6; + } } - if (_source_channels == 1) { - /* mono sources to centre */ - return libdcp::CENTRE; - } - - return static_cast (c); + return 2; } -optional -AutomaticAudioMapping::dcp_to_source (libdcp::Channel c) const +list +AudioMapping::dcp_to_content (libdcp::Channel d) const { - if (_source_channels == 1) { - if (c == libdcp::CENTRE) { - return 0; - } else { - return optional (); + list c; + for (list >::const_iterator i = _content_to_dcp.begin(); i != _content_to_dcp.end(); ++i) { + if (i->second == d) { + c.push_back (i->first); } } - if (static_cast (c) >= _source_channels) { - return optional (); - } - - return static_cast (c); + return c; } -int -AutomaticAudioMapping::dcp_channels () const +list +AudioMapping::content_channels () const { - if (_source_channels == 1) { - /* The source is mono, so to put the mono channel into - the centre we need to generate a 5.1 soundtrack. - */ - return 6; + list c; + for (list >::const_iterator i = _content_to_dcp.begin(); i != _content_to_dcp.end(); ++i) { + if (find (c.begin(), c.end(), i->first) == c.end ()) { + c.push_back (i->first); + } } - return _source_channels; + return c; } -optional -ConfiguredAudioMapping::dcp_to_source (libdcp::Channel c) const +list +AudioMapping::content_to_dcp (Channel c) const { - map::const_iterator i = _source_to_dcp.begin (); - while (i != _source_to_dcp.end() && i->second != c) { - ++i; - } - - if (i == _source_to_dcp.end ()) { - return boost::none; + list d; + for (list >::const_iterator i = _content_to_dcp.begin(); i != _content_to_dcp.end(); ++i) { + if (i->first == c) { + d.push_back (i->second); + } } - return i->first; + return d; } -optional -ConfiguredAudioMapping::source_to_dcp (int c) const +bool +operator== (AudioMapping::Channel const & a, AudioMapping::Channel const & b) { - map::const_iterator i = _source_to_dcp.find (c); - if (i == _source_to_dcp.end ()) { - return boost::none; - } - - return i->second; + shared_ptr sa = a.content.lock (); + shared_ptr sb = b.content.lock (); + return sa == sb && a.index == b.index; } + diff --git a/src/lib/audio_mapping.h b/src/lib/audio_mapping.h index 8804bde06..10ac20b48 100644 --- a/src/lib/audio_mapping.h +++ b/src/lib/audio_mapping.h @@ -17,37 +17,43 @@ */ -#include -#include -#include +#ifndef DVDOMATIC_AUDIO_MAPPING_H +#define DVDOMATIC_AUDIO_MAPPING_H + +#include +#include #include +#include +#include "audio_content.h" class AudioMapping { public: - virtual boost::optional source_to_dcp (int c) const = 0; - virtual boost::optional dcp_to_source (libdcp::Channel c) const = 0; -}; - -class AutomaticAudioMapping : public AudioMapping -{ -public: - AutomaticAudioMapping (int); + struct Channel { + Channel (boost::weak_ptr c, int i) + : content (c) + , index (i) + {} + + boost::weak_ptr content; + int index; + }; + + void add (Channel, libdcp::Channel); - boost::optional source_to_dcp (int c) const; - boost::optional dcp_to_source (libdcp::Channel c) const; int dcp_channels () const; - -private: - int _source_channels; -}; + std::list dcp_to_content (libdcp::Channel) const; + std::list > content_to_dcp () const { + return _content_to_dcp; + } -class ConfiguredAudioMapping : public AudioMapping -{ -public: - boost::optional source_to_dcp (int c) const; - boost::optional dcp_to_source (libdcp::Channel c) const; + std::list content_channels () const; + std::list content_to_dcp (Channel) const; private: - std::map _source_to_dcp; + std::list > _content_to_dcp; }; + +extern bool operator== (AudioMapping::Channel const &, AudioMapping::Channel const &); + +#endif diff --git a/src/lib/encoder.cc b/src/lib/encoder.cc index a0b88e33e..0542587a0 100644 --- a/src/lib/encoder.cc +++ b/src/lib/encoder.cc @@ -427,6 +427,8 @@ Encoder::encoder_thread (ServerDescription* server) void Encoder::write_audio (shared_ptr data) { +#if 0 + XXX AutomaticAudioMapping m (_film->audio_channels ()); if (m.dcp_channels() != _film->audio_channels()) { @@ -444,6 +446,7 @@ Encoder::write_audio (shared_ptr data) data = b; } +#endif _writer->write (data); } diff --git a/src/lib/ffmpeg_content.cc b/src/lib/ffmpeg_content.cc index cc95105e5..d36abe2c3 100644 --- a/src/lib/ffmpeg_content.cc +++ b/src/lib/ffmpeg_content.cc @@ -152,12 +152,13 @@ FFmpegContent::examine (shared_ptr film, shared_ptr job, bool quick) signal_changed (FFmpegContentProperty::SUBTITLE_STREAM); signal_changed (FFmpegContentProperty::AUDIO_STREAMS); signal_changed (FFmpegContentProperty::AUDIO_STREAM); + signal_changed (AudioContentProperty::AUDIO_CHANNELS); } string FFmpegContent::summary () const { - return String::compose (_("Movie: %1"), file().filename ()); + return String::compose (_("Movie: %1"), file().filename().string()); } string diff --git a/src/lib/film.cc b/src/lib/film.cc index 69d2a28e2..b1f740ec2 100644 --- a/src/lib/film.cc +++ b/src/lib/film.cc @@ -960,6 +960,7 @@ Film::signal_changed (Property p) case Film::CONTENT: _playlist->setup (content ()); set_dcp_frame_rate (best_dcp_frame_rate (video_frame_rate ())); + set_audio_mapping (_playlist->default_audio_mapping ()); break; default: break; @@ -1235,12 +1236,25 @@ Film::set_ffmpeg_audio_stream (FFmpegAudioStream s) } } +void +Film::set_audio_mapping (AudioMapping m) +{ + { + boost::mutex::scoped_lock lm (_state_mutex); + _audio_mapping = m; + } + + signal_changed (AUDIO_MAPPING); +} + void Film::content_changed (boost::weak_ptr c, int p) { if (p == VideoContentProperty::VIDEO_FRAME_RATE) { set_dcp_frame_rate (best_dcp_frame_rate (video_frame_rate ())); - } + } else if (p == AudioContentProperty::AUDIO_CHANNELS) { + set_audio_mapping (_playlist->default_audio_mapping ()); + } if (ui_signaller) { ui_signaller->emit (boost::bind (boost::ref (ContentChanged), c, p)); diff --git a/src/lib/film.h b/src/lib/film.h index 9c5f561e6..532d32bdc 100644 --- a/src/lib/film.h +++ b/src/lib/film.h @@ -36,6 +36,7 @@ #include "dci_metadata.h" #include "types.h" #include "ffmpeg_content.h" +#include "audio_mapping.h" class DCPContentType; class Format; @@ -146,7 +147,8 @@ public: COLOUR_LUT, J2K_BANDWIDTH, DCI_METADATA, - DCP_FRAME_RATE + DCP_FRAME_RATE, + AUDIO_MAPPING }; @@ -262,6 +264,11 @@ public: return _dcp_frame_rate; } + AudioMapping audio_mapping () const { + boost::mutex::scoped_lock lm (_state_mutex); + return _audio_mapping; + } + /* SET */ void set_directory (std::string); @@ -294,6 +301,7 @@ public: void set_dci_metadata (DCIMetadata); void set_dcp_frame_rate (int); void set_dci_date_today (); + void set_audio_mapping (AudioMapping); /** Emitted when some property has of the Film has changed */ mutable boost::signals2::signal Changed; @@ -314,6 +322,7 @@ private: void read_metadata (); void content_changed (boost::weak_ptr, int); boost::shared_ptr ffmpeg () const; + void setup_default_audio_mapping (); /** Log to write to */ boost::shared_ptr _log; @@ -378,6 +387,7 @@ private: int _dcp_frame_rate; /** The date that we should use in a DCI name */ boost::gregorian::date _dci_date; + AudioMapping _audio_mapping; /** true if our state has changed since we last saved it */ mutable bool _dirty; diff --git a/src/lib/imagemagick_content.cc b/src/lib/imagemagick_content.cc index 912c180a8..59fde40bb 100644 --- a/src/lib/imagemagick_content.cc +++ b/src/lib/imagemagick_content.cc @@ -45,7 +45,7 @@ ImageMagickContent::ImageMagickContent (shared_ptr node) string ImageMagickContent::summary () const { - return String::compose (_("Image: %1"), file().filename ()); + return String::compose (_("Image: %1"), file().filename().string()); } bool diff --git a/src/lib/playlist.cc b/src/lib/playlist.cc index e0220ef6f..3f7905fa9 100644 --- a/src/lib/playlist.cc +++ b/src/lib/playlist.cc @@ -30,6 +30,7 @@ using std::list; using std::cout; using std::vector; +using std::min; using boost::shared_ptr; using boost::weak_ptr; using boost::dynamic_pointer_cast; @@ -224,3 +225,47 @@ Playlist::content_changed (weak_ptr c, int p) { ContentChanged (c, p); } + +AudioMapping +Playlist::default_audio_mapping () const +{ + AudioMapping m; + + switch (_audio_from) { + case AUDIO_NONE: + break; + case AUDIO_FFMPEG: + if (_ffmpeg->audio_channels() == 1) { + /* Map mono sources to centre */ + m.add (AudioMapping::Channel (_ffmpeg, 0), libdcp::CENTRE); + } else { + int const N = min (_ffmpeg->audio_channels (), MAX_AUDIO_CHANNELS); + /* Otherwise just start with a 1:1 mapping */ + for (int i = 0; i < N; ++i) { + m.add (AudioMapping::Channel (_ffmpeg, i), (libdcp::Channel) i); + } + } + break; + + case AUDIO_SNDFILE: + { + int n = 0; + for (list >::const_iterator i = _sndfile.begin(); i != _sndfile.end(); ++i) { + cout << "sndfile " << (*i)->audio_channels() << "\n"; + for (int j = 0; j < (*i)->audio_channels(); ++j) { + m.add (AudioMapping::Channel (*i, j), (libdcp::Channel) n); + ++n; + if (n >= MAX_AUDIO_CHANNELS) { + break; + } + } + if (n >= MAX_AUDIO_CHANNELS) { + break; + } + } + break; + } + } + + return m; +} diff --git a/src/lib/playlist.h b/src/lib/playlist.h index 1a24a0227..1d189cb07 100644 --- a/src/lib/playlist.h +++ b/src/lib/playlist.h @@ -25,6 +25,7 @@ #include "video_sink.h" #include "audio_sink.h" #include "ffmpeg_content.h" +#include "audio_mapping.h" class Content; class FFmpegContent; @@ -53,6 +54,8 @@ public: libdcp::Size video_size () const; ContentVideoFrame video_length () const; + AudioMapping default_audio_mapping () const; + enum VideoFrom { VIDEO_NONE, VIDEO_FFMPEG, diff --git a/src/lib/sndfile_content.cc b/src/lib/sndfile_content.cc index ee4f21eef..539b0dfb5 100644 --- a/src/lib/sndfile_content.cc +++ b/src/lib/sndfile_content.cc @@ -27,12 +27,16 @@ using std::string; using std::stringstream; +using std::cout; using boost::shared_ptr; using boost::lexical_cast; SndfileContent::SndfileContent (boost::filesystem::path f) : Content (f) , AudioContent (f) + , _audio_channels (0) + , _audio_length (0) + , _audio_frame_rate (0) { } @@ -49,7 +53,7 @@ SndfileContent::SndfileContent (shared_ptr node) string SndfileContent::summary () const { - return String::compose (_("Sound file: %1"), file().filename ()); + return String::compose (_("Sound file: %1"), file().filename().string()); } string @@ -115,3 +119,4 @@ SndfileContent::as_xml (xmlpp::Node* node) const node->add_child("AudioLength")->add_child_text (lexical_cast (_audio_length)); node->add_child("AudioFrameRate")->add_child_text (lexical_cast (_audio_frame_rate)); } + diff --git a/src/lib/writer.cc b/src/lib/writer.cc index 6df1a1f21..7258826ba 100644 --- a/src/lib/writer.cc +++ b/src/lib/writer.cc @@ -78,15 +78,13 @@ Writer::Writer (shared_ptr f) _picture_asset_writer = _picture_asset->start_write (_first_nonexistant_frame > 0); - AutomaticAudioMapping m (_film->audio_channels ()); - - if (m.dcp_channels() > 0) { + if (_film->audio_channels() > 0) { _sound_asset.reset ( new libdcp::SoundAsset ( _film->dir (_film->dcp_name()), N_("audio.mxf"), _film->dcp_frame_rate (), - m.dcp_channels (), + _film->audio_mapping().dcp_channels (), dcp_audio_sample_rate (_film->audio_frame_rate()) ) ); diff --git a/src/wx/audio_dialog.cc b/src/wx/audio_dialog.cc index f53ea7c19..4c50260fa 100644 --- a/src/wx/audio_dialog.cc +++ b/src/wx/audio_dialog.cc @@ -20,7 +20,6 @@ #include #include "lib/audio_analysis.h" #include "lib/film.h" -#include "lib/audio_mapping.h" #include "audio_dialog.h" #include "audio_plot.h" #include "wx_util.h" @@ -93,7 +92,6 @@ AudioDialog::set_film (shared_ptr f) _film = f; try_to_load_analysis (); - setup_channels (); _plot->set_gain (_film->audio_gain ()); _film_changed_connection = _film->Changed.connect (bind (&AudioDialog::film_changed, this, _1)); @@ -102,23 +100,6 @@ AudioDialog::set_film (shared_ptr f) SetTitle (wxString::Format (_("DVD-o-matic audio - %s"), std_to_wx(_film->name()).data())); } -void -AudioDialog::setup_channels () -{ - if (!_film->has_audio()) { - return; - } - - AutomaticAudioMapping m (_film->audio_channels ()); - - for (int i = 0; i < MAX_AUDIO_CHANNELS; ++i) { - if (m.dcp_to_source(static_cast(i))) { - _channel_checkbox[i]->Show (); - } else { - _channel_checkbox[i]->Hide (); - } - } -} void AudioDialog::try_to_load_analysis () @@ -135,12 +116,8 @@ AudioDialog::try_to_load_analysis () _plot->set_analysis (a); - AutomaticAudioMapping m (_film->audio_channels ()); - optional c = m.source_to_dcp (0); - if (c) { - _channel_checkbox[c.get()]->SetValue (true); - _plot->set_channel_visible (0, true); - } + _channel_checkbox[0]->SetValue (true); + _plot->set_channel_visible (0, true); for (int i = 0; i < AudioPoint::COUNT; ++i) { _type_checkbox[i]->SetValue (true); @@ -158,11 +135,7 @@ AudioDialog::channel_clicked (wxCommandEvent& ev) assert (c < MAX_AUDIO_CHANNELS); - AutomaticAudioMapping m (_film->audio_channels ()); - optional s = m.dcp_to_source (static_cast (c)); - if (s) { - _plot->set_channel_visible (s.get(), _channel_checkbox[c]->GetValue ()); - } + _plot->set_channel_visible (c, _channel_checkbox[c]->GetValue ()); } void @@ -172,9 +145,6 @@ AudioDialog::film_changed (Film::Property p) case Film::AUDIO_GAIN: _plot->set_gain (_film->audio_gain ()); break; - case Film::CONTENT: - setup_channels (); - break; default: break; } diff --git a/src/wx/audio_dialog.h b/src/wx/audio_dialog.h index 514faeea0..db1d74f30 100644 --- a/src/wx/audio_dialog.h +++ b/src/wx/audio_dialog.h @@ -39,7 +39,6 @@ private: void type_clicked (wxCommandEvent &); void smoothing_changed (wxScrollEvent &); void try_to_load_analysis (); - void setup_channels (); boost::shared_ptr _film; AudioPlot* _plot; diff --git a/src/wx/audio_mapping_view.cc b/src/wx/audio_mapping_view.cc new file mode 100644 index 000000000..d62609d22 --- /dev/null +++ b/src/wx/audio_mapping_view.cc @@ -0,0 +1,156 @@ +/* + Copyright (C) 2013 Carl Hetherington + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + +*/ + +#include +#include +#include +#include +#include "lib/audio_mapping.h" +#include "audio_mapping_view.h" +#include "wx_util.h" + +using std::cout; +using std::list; +using boost::shared_ptr; + +/* This could go away with wxWidgets 2.9, which has an API call + to find these values. +*/ + +#ifdef __WXMSW__ +#define CHECKBOX_WIDTH 16 +#define CHECKBOX_HEIGHT 16 +#endif + +#ifdef __WXGTK__ +#define CHECKBOX_WIDTH 20 +#define CHECKBOX_HEIGHT 20 +#endif + + +class NoSelectionStringRenderer : public wxGridCellStringRenderer +{ +public: + void Draw (wxGrid& grid, wxGridCellAttr& attr, wxDC& dc, const wxRect& rect, int row, int col, bool) + { + wxGridCellStringRenderer::Draw (grid, attr, dc, rect, row, col, false); + } +}; + +class CheckBoxRenderer : public wxGridCellRenderer +{ +public: + + void Draw (wxGrid& grid, wxGridCellAttr &, wxDC& dc, const wxRect& rect, int row, int col, bool) + { + wxRendererNative::Get().DrawCheckBox ( + &grid, + dc, rect, + grid.GetCellValue (row, col) == "1" ? static_cast(wxCONTROL_CHECKED) : 0 + ); + } + + wxSize GetBestSize (wxGrid &, wxGridCellAttr &, wxDC &, int, int) + { + return wxSize (CHECKBOX_WIDTH + 4, CHECKBOX_HEIGHT + 4); + } + + wxGridCellRenderer* Clone () const + { + return new CheckBoxRenderer; + } +}; + + +AudioMappingView::AudioMappingView (wxWindow* parent) + : wxPanel (parent, wxID_ANY) +{ + _grid = new wxGrid (this, wxID_ANY); + + _grid->CreateGrid (0, 7); + _grid->HideRowLabels (); + _grid->DisableDragRowSize (); + _grid->DisableDragColSize (); + _grid->EnableEditing (false); + _grid->SetCellHighlightPenWidth (0); + _grid->SetDefaultRenderer (new NoSelectionStringRenderer); + + _grid->SetColLabelValue (0, _("Content channel")); + _grid->SetColLabelValue (1, _("L")); + _grid->SetColLabelValue (2, _("R")); + _grid->SetColLabelValue (3, _("C")); + _grid->SetColLabelValue (4, _("Lfe")); + _grid->SetColLabelValue (5, _("Ls")); + _grid->SetColLabelValue (6, _("Rs")); + + _grid->AutoSize (); + + wxBoxSizer* s = new wxBoxSizer (wxVERTICAL); + s->Add (_grid, 1, wxEXPAND); + SetSizerAndFit (s); + + Connect (wxID_ANY, wxEVT_GRID_CELL_LEFT_CLICK, wxGridEventHandler (AudioMappingView::left_click), 0, this); +} + +void +AudioMappingView::left_click (wxGridEvent& ev) +{ + if (ev.GetCol() == 0) { + return; + } + + if (_grid->GetCellValue (ev.GetRow(), ev.GetCol()) == "1") { + _grid->SetCellValue (ev.GetRow(), ev.GetCol(), "0"); + } else { + _grid->SetCellValue (ev.GetRow(), ev.GetCol(), "1"); + } +} + +void +AudioMappingView::set_mapping (AudioMapping map) +{ + if (_grid->GetNumberRows ()) { + _grid->DeleteRows (0, _grid->GetNumberRows ()); + } + + list content_channels = map.content_channels (); + _grid->InsertRows (0, content_channels.size ()); + + for (size_t r = 0; r < content_channels.size(); ++r) { + for (int c = 1; c < 7; ++c) { + _grid->SetCellRenderer (r, c, new CheckBoxRenderer); + } + } + + int n = 0; + for (list::iterator i = content_channels.begin(); i != content_channels.end(); ++i) { + shared_ptr ac = i->content.lock (); + assert (ac); + _grid->SetCellValue (n, 0, wxString::Format ("%s %d", std_to_wx (ac->file().filename().string()), i->index + 1)); + + list const d = map.content_to_dcp (*i); + for (list::const_iterator j = d.begin(); j != d.end(); ++j) { + _grid->SetCellValue (n, static_cast (*j) + 1, "1"); + } + ++n; + } + + _grid->AutoSize (); +} + diff --git a/src/wx/audio_mapping_view.h b/src/wx/audio_mapping_view.h new file mode 100644 index 000000000..36429412f --- /dev/null +++ b/src/wx/audio_mapping_view.h @@ -0,0 +1,35 @@ +/* + Copyright (C) 2013 Carl Hetherington + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + +*/ + +#include +#include +#include + +class AudioMappingView : public wxPanel +{ +public: + AudioMappingView (wxWindow *); + + void set_mapping (AudioMapping); + +private: + void left_click (wxGridEvent &); + + wxGrid* _grid; +}; diff --git a/src/wx/film_editor.cc b/src/wx/film_editor.cc index 6c42359fb..6f08b6567 100644 --- a/src/wx/film_editor.cc +++ b/src/wx/film_editor.cc @@ -50,7 +50,7 @@ #include "scaler.h" #include "audio_dialog.h" #include "imagemagick_content_dialog.h" -#include "sndfile_content_dialog.h" +#include "audio_mapping_view.h" using std::string; using std::cout; @@ -197,7 +197,9 @@ FilmEditor::connect_to_widgets () _edit_dci_button->Connect (wxID_ANY, wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler (FilmEditor::edit_dci_button_clicked), 0, this); _format->Connect (wxID_ANY, wxEVT_COMMAND_CHOICE_SELECTED, wxCommandEventHandler (FilmEditor::format_changed), 0, this); _trust_content_headers->Connect (wxID_ANY, wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler (FilmEditor::trust_content_headers_changed), 0, this); - _content->Connect (wxID_ANY, wxEVT_COMMAND_LIST_ITEM_SELECTED, wxListEventHandler (FilmEditor::content_item_selected), 0, this); + _content->Connect (wxID_ANY, wxEVT_COMMAND_LIST_ITEM_SELECTED, wxListEventHandler (FilmEditor::content_selection_changed), 0, this); + _content->Connect (wxID_ANY, wxEVT_COMMAND_LIST_ITEM_DESELECTED, wxListEventHandler (FilmEditor::content_selection_changed), 0, this); + _content->Connect (wxID_ANY, wxEVT_COMMAND_LIST_ITEM_ACTIVATED, wxListEventHandler (FilmEditor::content_activated), 0, this); _content_add->Connect (wxID_ANY, wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler (FilmEditor::content_add_clicked), 0, this); _content_remove->Connect (wxID_ANY, wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler (FilmEditor::content_remove_clicked), 0, this); _content_edit->Connect (wxID_ANY, wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler (FilmEditor::content_edit_clicked), 0, this); @@ -406,6 +408,9 @@ FilmEditor::make_audio_panel () grid->Add (s, 1, wxEXPAND); } + _audio_mapping = new AudioMappingView (_audio_panel); + _audio_sizer->Add (_audio_mapping, 1, wxEXPAND | wxALL, 6); + _audio_gain->SetRange (-60, 60); _audio_delay->SetRange (-1000, 1000); } @@ -691,6 +696,10 @@ FilmEditor::film_changed (Film::Property p) _frame_rate_description->SetLabel (wxT ("")); _best_dcp_frame_rate->Disable (); } + break; + case Film::AUDIO_MAPPING: + _audio_mapping->set_mapping (_film->audio_mapping ()); + break; } } @@ -849,6 +858,7 @@ FilmEditor::set_film (shared_ptr f) film_changed (Film::J2K_BANDWIDTH); film_changed (Film::DCI_METADATA); film_changed (Film::DCP_FRAME_RATE); + film_changed (Film::AUDIO_MAPPING); film_content_changed (boost::shared_ptr (), FFmpegContentProperty::SUBTITLE_STREAMS); film_content_changed (boost::shared_ptr (), FFmpegContentProperty::SUBTITLE_STREAM); @@ -1242,6 +1252,15 @@ FilmEditor::content_remove_clicked (wxCommandEvent &) } } +void +FilmEditor::content_activated (wxListEvent& ev) +{ + ContentList c = _film->content (); + assert (ev.GetIndex() >= 0 && size_t (ev.GetIndex()) < c.size ()); + + edit_content (c[ev.GetIndex()]); +} + void FilmEditor::content_edit_clicked (wxCommandEvent &) { @@ -1250,22 +1269,19 @@ FilmEditor::content_edit_clicked (wxCommandEvent &) return; } + edit_content (c); +} + +void +FilmEditor::edit_content (shared_ptr c) +{ shared_ptr im = dynamic_pointer_cast (c); if (im) { ImageMagickContentDialog* d = new ImageMagickContentDialog (this, im); - int const r = d->ShowModal (); - d->Destroy (); - - if (r == wxID_OK) { - im->set_video_length (d->video_length() * 24); - } - } - - shared_ptr sf = dynamic_pointer_cast (c); - if (sf) { - SndfileContentDialog* d = new SndfileContentDialog (this, sf); d->ShowModal (); d->Destroy (); + + im->set_video_length (d->video_length() * 24); } } @@ -1288,7 +1304,7 @@ FilmEditor::content_later_clicked (wxCommandEvent &) } void -FilmEditor::content_item_selected (wxListEvent &) +FilmEditor::content_selection_changed (wxListEvent &) { setup_content_button_sensitivity (); setup_content_information (); @@ -1311,11 +1327,12 @@ FilmEditor::setup_content_button_sensitivity () { _content_add->Enable (_generally_sensitive); - bool const have_selection = _content->GetNextItem (-1, wxLIST_NEXT_ALL, wxLIST_STATE_SELECTED) != -1; - _content_edit->Enable (have_selection && _generally_sensitive); - _content_remove->Enable (have_selection && _generally_sensitive); - _content_earlier->Enable (have_selection && _generally_sensitive); - _content_later->Enable (have_selection && _generally_sensitive); + shared_ptr selection = selected_content (); + + _content_edit->Enable (selection && _generally_sensitive && dynamic_pointer_cast (selection)); + _content_remove->Enable (selection && _generally_sensitive); + _content_earlier->Enable (selection && _generally_sensitive); + _content_later->Enable (selection && _generally_sensitive); } shared_ptr diff --git a/src/wx/film_editor.h b/src/wx/film_editor.h index b6f6a24ee..bc6b045c4 100644 --- a/src/wx/film_editor.h +++ b/src/wx/film_editor.h @@ -33,6 +33,7 @@ class wxListCtrl; class wxListEvent; class Film; class AudioDialog; +class AudioMappingView; /** @class FilmEditor * @brief A wx widget to edit a film's metadata, and perform various functions. @@ -63,7 +64,8 @@ private: void top_crop_changed (wxCommandEvent &); void bottom_crop_changed (wxCommandEvent &); void trust_content_headers_changed (wxCommandEvent &); - void content_item_selected (wxListEvent &); + void content_selection_changed (wxListEvent &); + void content_activated (wxListEvent &); void content_add_clicked (wxCommandEvent &); void content_remove_clicked (wxCommandEvent &); void content_edit_clicked (wxCommandEvent &); @@ -110,6 +112,7 @@ private: void active_jobs_changed (bool); boost::shared_ptr selected_content (); + void edit_content (boost::shared_ptr); wxNotebook* _notebook; wxPanel* _film_panel; @@ -152,6 +155,7 @@ private: wxButton* _show_audio; wxSpinCtrl* _audio_delay; wxChoice* _ffmpeg_audio_stream; + AudioMappingView* _audio_mapping; wxCheckBox* _with_subtitles; wxChoice* _ffmpeg_subtitle_stream; wxSpinCtrl* _subtitle_offset; diff --git a/src/wx/sndfile_content_dialog.cc b/src/wx/sndfile_content_dialog.cc deleted file mode 100644 index f305b158c..000000000 --- a/src/wx/sndfile_content_dialog.cc +++ /dev/null @@ -1,67 +0,0 @@ -/* - Copyright (C) 2013 Carl Hetherington - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - -*/ - -#include "lib/util.h" -#include "lib/sndfile_content.h" -#include "sndfile_content_dialog.h" -#include "wx_util.h" - -using boost::shared_ptr; - -SndfileContentDialog::SndfileContentDialog (wxWindow* parent, shared_ptr content) - : wxDialog (parent, wxID_ANY, _("Sound file")) -{ - wxFlexGridSizer* grid = new wxFlexGridSizer (7, 6, 0); - - add_label_to_sizer (grid, this, wxT ("")); - add_label_to_sizer (grid, this, _("L")); - add_label_to_sizer (grid, this, _("R")); - add_label_to_sizer (grid, this, _("C")); - add_label_to_sizer (grid, this, _("Lfe")); - add_label_to_sizer (grid, this, _("Ls")); - add_label_to_sizer (grid, this, _("Rs")); - - _buttons.resize (content->audio_channels ()); - for (int i = 0; i < content->audio_channels(); ++i) { - - if (content->audio_channels() == 1) { - add_label_to_sizer (grid, this, _("Source")); - } else { - add_label_to_sizer (grid, this, wxString::Format (_("Source %d"), i + 1)); - } - - for (int j = 0; j < MAX_AUDIO_CHANNELS; ++j) { - wxRadioButton* b = new wxRadioButton (this, wxID_ANY, wxT (""), wxDefaultPosition, wxDefaultSize, j ? 0 : wxRB_GROUP); - _buttons[i].push_back (b); - grid->Add (b, wxSHRINK); - } - } - - wxBoxSizer* overall_sizer = new wxBoxSizer (wxVERTICAL); - overall_sizer->Add (grid, 1, wxEXPAND | wxALL, 6); - - wxSizer* buttons = CreateSeparatedButtonSizer (wxOK); - if (buttons) { - overall_sizer->Add (buttons, wxSizerFlags().Expand().DoubleBorder()); - } - - SetSizer (overall_sizer); - overall_sizer->Layout (); - overall_sizer->SetSizeHints (this); -} diff --git a/src/wx/sndfile_content_dialog.h b/src/wx/sndfile_content_dialog.h deleted file mode 100644 index 5a328892a..000000000 --- a/src/wx/sndfile_content_dialog.h +++ /dev/null @@ -1,36 +0,0 @@ -/* - Copyright (C) 2013 Carl Hetherington - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - -*/ - -#include -#include -#include -#include "lib/audio_mapping.h" - -class SndfileContent; - -class SndfileContentDialog : public wxDialog -{ -public: - SndfileContentDialog (wxWindow *, boost::shared_ptr); - - ConfiguredAudioMapping audio_mapping () const; - -private: - std::vector > _buttons; -}; diff --git a/src/wx/wscript b/src/wx/wscript index bd21af6ce..7f9cde9ac 100644 --- a/src/wx/wscript +++ b/src/wx/wscript @@ -5,6 +5,7 @@ import i18n sources = """ audio_dialog.cc + audio_mapping_view.cc audio_plot.cc config_dialog.cc dci_metadata_dialog.cc @@ -20,7 +21,6 @@ sources = """ new_film_dialog.cc properties_dialog.cc server_dialog.cc - sndfile_content_dialog.cc wx_util.cc wx_ui_signaller.cc """ -- cgit v1.2.3 From 7ee21d16c01b90c22192cd10f118419881fe504e Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Sat, 13 Apr 2013 12:53:40 +0100 Subject: DVD-o-matic -> DCP-o-matic. --- Doxyfile | 2 +- README | 13 +- TODO | 137 ------ builds/control-12.04-32 | 8 +- builds/control-12.04-64 | 8 +- builds/control-12.10-32 | 8 +- builds/control-12.10-64 | 8 +- cscript | 14 +- cscript.py | 8 - debian/changelog | 136 +++--- debian/copyright | 4 +- debian/files | 2 +- debian/rules | 2 +- doc/mainpage.txt | 20 +- doc/manual/Makefile | 22 +- doc/manual/dvdomatic-html.xsl | 12 - doc/manual/dvdomatic-pdf.xsl | 17 - doc/manual/dvdomatic.css | 19 - doc/manual/dvdomatic.sty | 68 --- doc/manual/dvdomatic.xml | 932 ------------------------------------- dvdomatic.desktop.in | 10 - hacks/python-playback/config.py | 2 - hacks/python-playback/dvdomatic | 209 --------- hacks/python-playback/film.py | 188 -------- hacks/python-playback/film_view.py | 212 --------- hacks/python-playback/player.py | 112 ----- hacks/python-playback/ratio.py | 56 --- hacks/python-playback/screens | 62 --- hacks/python-playback/screens.py | 85 ---- hacks/python-playback/thumbs.py | 76 --- hacks/python-playback/util.py | 7 - hacks/python-playback/xrandr-notes | 17 - icons/128x128/dvdomatic.png | Bin 18365 -> 0 bytes icons/16x16/dvdomatic.png | Bin 211 -> 0 bytes icons/22x22/dvdomatic.png | Bin 994 -> 0 bytes icons/32x32/dvdomatic.png | Bin 1747 -> 0 bytes icons/48x48/dvdomatic.png | Bin 3407 -> 0 bytes icons/64x64/dvdomatic.png | Bin 5421 -> 0 bytes run/dvdomatic | 15 - src/lib/audio_analysis.h | 4 +- src/lib/audio_content.h | 4 +- src/lib/audio_decoder.h | 4 +- src/lib/audio_mapping.h | 4 +- src/lib/audio_sink.h | 4 +- src/lib/audio_source.h | 4 +- src/lib/config.cc | 4 +- src/lib/config.h | 4 +- src/lib/content.h | 4 +- src/lib/cross.cc | 10 +- src/lib/cross.h | 4 +- src/lib/dci_metadata.h | 4 +- src/lib/dcp_content_type.h | 4 +- src/lib/dcp_video_frame.cc | 2 +- src/lib/decoder.h | 4 +- src/lib/encoder.cc | 2 +- src/lib/encoder.h | 4 +- src/lib/exceptions.h | 4 +- src/lib/ffmpeg_content.h | 4 +- src/lib/film.cc | 10 +- src/lib/film.h | 6 +- src/lib/filter.h | 4 +- src/lib/filter_graph.h | 4 +- src/lib/i18n.h | 2 +- src/lib/image.h | 4 +- src/lib/job.cc | 4 +- src/lib/job.h | 4 +- src/lib/job_manager.cc | 2 +- src/lib/log.h | 4 +- src/lib/player.h | 4 +- src/lib/po/es_ES.po | 6 +- src/lib/po/fr_FR.po | 8 +- src/lib/po/it_IT.po | 4 +- src/lib/po/sv_SE.po | 6 +- src/lib/processor.h | 4 +- src/lib/scaler.h | 4 +- src/lib/sound_processor.h | 4 +- src/lib/timer.h | 4 +- src/lib/types.h | 4 +- src/lib/ui_signaller.h | 4 +- src/lib/util.cc | 28 +- src/lib/util.h | 14 +- src/lib/version.h | 4 +- src/lib/video_content.h | 4 +- src/lib/video_decoder.h | 4 +- src/lib/video_sink.h | 4 +- src/lib/video_source.h | 4 +- src/lib/wscript | 10 +- src/tools/dvdomatic.cc | 578 ----------------------- src/tools/makedcp.cc | 12 +- src/tools/po/es_ES.po | 58 +-- src/tools/po/fr_FR.po | 58 +-- src/tools/po/it_IT.po | 56 +-- src/tools/po/sv_SE.po | 58 +-- src/tools/servomatic_cli.cc | 4 +- src/tools/servomatic_gui.cc | 6 +- src/tools/servomatictest.cc | 2 +- src/tools/wscript | 14 +- src/wx/audio_dialog.cc | 2 +- src/wx/config_dialog.cc | 6 +- src/wx/config_dialog.h | 4 +- src/wx/po/es_ES.po | 16 +- src/wx/po/fr_FR.po | 16 +- src/wx/po/it_IT.po | 16 +- src/wx/po/sv_SE.po | 18 +- src/wx/wscript | 12 +- src/wx/wx_util.cc | 2 +- test/test.cc | 14 +- test/wscript | 2 +- windows/dvdomatic.bmp | Bin 343254 -> 0 bytes windows/dvdomatic.ico | Bin 9662 -> 0 bytes windows/dvdomatic.rc | 3 - windows/dvdomatic_taskbar.ico | Bin 1150 -> 0 bytes windows/installer.nsi.32.in | 70 +-- windows/installer.nsi.64.in | 72 +-- wscript | 24 +- 115 files changed, 515 insertions(+), 3345 deletions(-) delete mode 100644 TODO delete mode 100644 cscript.py delete mode 100644 doc/manual/dvdomatic-html.xsl delete mode 100644 doc/manual/dvdomatic-pdf.xsl delete mode 100644 doc/manual/dvdomatic.css delete mode 100644 doc/manual/dvdomatic.sty delete mode 100644 doc/manual/dvdomatic.xml delete mode 100644 dvdomatic.desktop.in delete mode 100644 hacks/python-playback/config.py delete mode 100755 hacks/python-playback/dvdomatic delete mode 100644 hacks/python-playback/film.py delete mode 100644 hacks/python-playback/film_view.py delete mode 100644 hacks/python-playback/player.py delete mode 100644 hacks/python-playback/ratio.py delete mode 100644 hacks/python-playback/screens delete mode 100644 hacks/python-playback/screens.py delete mode 100644 hacks/python-playback/thumbs.py delete mode 100644 hacks/python-playback/util.py delete mode 100644 hacks/python-playback/xrandr-notes delete mode 100644 icons/128x128/dvdomatic.png delete mode 100644 icons/16x16/dvdomatic.png delete mode 100644 icons/22x22/dvdomatic.png delete mode 100644 icons/32x32/dvdomatic.png delete mode 100644 icons/48x48/dvdomatic.png delete mode 100644 icons/64x64/dvdomatic.png delete mode 100755 run/dvdomatic delete mode 100644 src/tools/dvdomatic.cc delete mode 100644 windows/dvdomatic.bmp delete mode 100644 windows/dvdomatic.ico delete mode 100644 windows/dvdomatic.rc delete mode 100644 windows/dvdomatic_taskbar.ico (limited to 'src/wx/wscript') diff --git a/Doxyfile b/Doxyfile index 56f7e1d3c..4ed65e4f1 100644 --- a/Doxyfile +++ b/Doxyfile @@ -26,7 +26,7 @@ DOXYFILE_ENCODING = UTF-8 # identify the project. Note that if you do not use Doxywizard you need # to put quotes around the project name if it contains spaces. -PROJECT_NAME = DVD-o-matic +PROJECT_NAME = DCP-o-matic # The PROJECT_NUMBER tag can be used to enter a project or revision number. # This could be handy for archiving the generated documentation or diff --git a/README b/README index fd3983c29..c218ed1a5 100644 --- a/README +++ b/README @@ -1,4 +1,4 @@ -dvd-o-matic +DCP-o-matic ----------- Hello! @@ -33,27 +33,22 @@ You will need these libraries: libsndfile libssh -and also the command line tool: - - vobcopy (if you want to rip DVDs straight into DVD-o-matic) - Documentation ------------- -There is a manual available at http://carlh.net/software/dvdomatic +There is a manual available at http://carlh.net/software/dcpomatic The DocBook source for this is in doc/manual. In a nutshell ------------- -The `dvdomatic' program is a GTK front-end which is probably easiest +The `dcpomatic' program is a GTK front-end which is probably easiest to use. It will create a directory for a particular project, and write its data to that directory. The basic approach is: "File->New"; specify a directory. -Choose "Jobs->Copy from DVD" to read a DVD from your drive, if you have one. Fill in the fields in the window (most importantly the `content' field: specify your video, and the `Name' field: give your project [and hence DCP] a name.) @@ -76,7 +71,7 @@ Server/client ------------- Running the `servomatic' program on a remote machine will make it -listen on port 6192 (by default) and process requests from a dvdomatic +listen on port 6192 (by default) and process requests from a dcpomatic instance. This has been written with no thought to security, so don't do it over the public internet! The connection will probably need to be 1 Gb/s to make it worthwhile. diff --git a/TODO b/TODO deleted file mode 100644 index 17f02e429..000000000 --- a/TODO +++ /dev/null @@ -1,137 +0,0 @@ -Make a DCP with subs using subtitle edit. - -Look at http://liblqr.wikidot.com/en:manual - -EC2 - -Small instance $0.085 ph -Sintel Trailer 1080p @ 200000 Mbps -1247 frames @ 24fps ie 51.96s -Took 1h20 to encode - -High-CPU medium $0.186 ph -Sintel Trailer 1080p @ 200000 Mbps -1247 frames @ 24fps ie 51.96s -Took 23m to encode - -High-CPU extra-large $0.744 ph -Sintel Trailer 1080p @ 200000 Mbps -1247 frames @ 24fps ie 51.96s - - -Transfer in free -Transfer out $0.120 per GB - - -Port DVD rip - -Write still j2ks straight to a MXF. -md5_data to use openssl -Write all j2ks straight to a MXF? Possible? - -Standardise j2c/j2k -Format name in ~/.dvdomatic screws up with spaces; use ID or something -Thumbnails are poorly named -x-thread signaller -Restartable jobs somehow -More logging -Nice error when trying to thumbnail with no content. -Destroy _buffer_src_context / _buffer_sink_context -Don't start later jobs when one breaks. -Compute time remaining based on more recent information. -Use lexical_cast more -Do deps better - -options summary - -1: L -2: R -3: C -4: Lfe -5: Ls -6: Rs - -City Screen - -Screen 1: "1.37" masking preset, projector only has DCI 133 preset. - -With 1480x1080 alignment in DCI 133: bottom you see purple, yellow; top purple; left and right no lines -With 1480x1080 alignment in DCI Flat: outside masks, but you see bottom purple, yellow; left/right all; top purple - - -Screen 2: no real masking preset, projector has DCI 133 and DCI 137 - -1480x1080, DCI 133 -L yellow purple -R none -B purple -T none -1480x1080, DCI 137 -L all -R all but blue -T purple -B purple - - -Screen 3: projector has DCI 1.38 - -1480x1080 -L, R, T none -B purple + yellow - - -films-0.6: Dolby Countdown looks as though it's 3D. THX Terminator 2 fucked -(these on default settings) -fq/gradfun --- no obvious effect -hqdn3d --- pretty good denoising -ow --- no obvious effect -tn --- interesting; much noise reduction, bad artefacts on movement, colour tint even in black -unsharp --- worse - -Benchmark SWS options: lanczos ? -hqdn3d=0:0:6 ? (turn off chroma/luma blurring) - -Lanczos; no visible effect on Ghostbusters. - - -THX_Monster with master Intel Core 2 Duo E4600 (2.4GHz), slave Intel Core i3 M350 (2.27GHz) -1920 x 1080 original -> DCI Flat -240 frames - -[Gbit: gigabit ethernet rather than 100Mbit] -[im-mod: after modification to memcpy RGB data then to RGB -> XYZ in the encode thread -[hack1]: after modification to pass YUV and to swscale in the encode thread (includes im-mod) -[hack2]: modified hack1 - Time Seconds FPS Speedup relative to 1 local -1 local: 20m57 1257 0.19 x 1 -2 local: 11m24 684 0.35 x 1.84 -2 local [im-mod]: 13m13 -2 local + 1 slave: 6m34 394 0.61 x 3.19 -2 local + 2 slave: 5m13 313 0.77 x 4.02 -2 local + 4 slave: 5m05 303 0.79 x 4.15 -2 local + 4 slave [Gbit]: 2m50 170 1.41 x 7.39 -2 local + 4 slave [Gbit,im-mod]:2m33 -2 local + 4 slave [Gbit,hack1]: 3m20 -2 local + 4 slave [Gbit,hack2]: 2m22 -1 local + 8 slave [Gbit]: 2m28 148 1.62 x 8.49 -2 local + 8 slave [Gbit]: 2m41 161 1.49 x 7.81 -2 local + 8 slave [Gbit,im-mod]:2m35 - - - -Just encode 52s -Encode + Image create 1m27 -Encode + Image create (memcpy, not convert) 53s. - -THX_Monster with master Intel Core i3 M350 (2.27GHz), slave Intel Core 2 Duo E4600 (2.4GHz) -1920 x 1080 original -> DCI Flat -240 frames - - -4 local: 2m45 -4 local [im-mod]: 2m53 -4 local + 2 slave [Gbit]: 2m22 -4 local + 4 slave [Gbit]: 2m21 -4 local + 4 slave [Gbit,in-mod]:2m21 - - diff --git a/builds/control-12.04-32 b/builds/control-12.04-32 index 8cb5aceb3..d31a5e384 100644 --- a/builds/control-12.04-32 +++ b/builds/control-12.04-32 @@ -1,15 +1,15 @@ -Source: dvdomatic +Source: dcpomatic Section: video Priority: extra Maintainer: Carl Hetherington Build-Depends: debhelper (>= 8.0.0), python (>= 2.7.3), g++ (>= 4:4.6.3), pkg-config (>= 0.26), libwxgtk2.8-dev (>= 2.8.12.1), libssh-dev (>= 0.5.2), libboost-filesystem-dev (>= 1.46.0), libboost-thread-dev (>= 1.46.0), libsndfile1-dev (>= 1.0.25), libmagick++-dev (>= 8:6.6.9.7) Standards-Version: 3.9.3 -Homepage: http://carlh.net/software/dvdomatic +Homepage: http://carlh.net/software/dcpomatic -Package: dvdomatic +Package: dcpomatic Architecture: i386 Depends: libc6 (>= 2.15), libwxgtk2.8-0 (>= 2.8.12.1), libssh-4 (>= 0.5.2), libboost-filesystem1.46.1 (>= 1.46.1), libboost-thread1.46.1 (>= 1.46.1), libsndfile1 (>= 1.0.25), libmagick++4 (>= 8:6.6.9.7), libxml++2.6-2 (>= 2.34.1) Description: Generator of Digital Cinema Packages (DCPs) - DVD-o-matic generates Digital Cinema Packages (DCPs) from video and audio + DCP-o-matic generates Digital Cinema Packages (DCPs) from video and audio files (such as those from DVDs or Blu-Rays) for presentation on DCI-compliant digital projectors. diff --git a/builds/control-12.04-64 b/builds/control-12.04-64 index cdb15a87b..5d41558b6 100644 --- a/builds/control-12.04-64 +++ b/builds/control-12.04-64 @@ -1,15 +1,15 @@ -Source: dvdomatic +Source: dcpomatic Section: video Priority: extra Maintainer: Carl Hetherington Build-Depends: debhelper (>= 8.0.0), python (>= 2.7.3), g++ (>= 4:4.6.3), pkg-config (>= 0.26), libwxgtk2.8-dev (>= 2.8.12.1), libssh-dev (>= 0.5.2), libboost-filesystem-dev (>= 1.46.0), libboost-thread-dev (>= 1.46.0), libsndfile1-dev (>= 1.0.25), libmagick++-dev (>= 8:6.6.9.7) Standards-Version: 3.9.3 -Homepage: http://carlh.net/software/dvdomatic +Homepage: http://carlh.net/software/dcpomatic -Package: dvdomatic +Package: dcpomatic Architecture: amd64 Depends: libc6 (>= 2.15), libwxgtk2.8-0 (>= 2.8.12.1), libssh-4 (>= 0.5.2), libboost-filesystem1.46.1 (>= 1.46.1), libboost-thread1.46.1 (>= 1.46.1), libsndfile1 (>= 1.0.25), libmagick++4 (>= 8:6.6.9.7), libxml++2.6-2 (>= 2.34.1) Description: Generator of Digital Cinema Packages (DCPs) - DVD-o-matic generates Digital Cinema Packages (DCPs) from video and audio + DCP-o-matic generates Digital Cinema Packages (DCPs) from video and audio files (such as those from DVDs or Blu-Rays) for presentation on DCI-compliant digital projectors. diff --git a/builds/control-12.10-32 b/builds/control-12.10-32 index 1dc91b701..67933f2ed 100644 --- a/builds/control-12.10-32 +++ b/builds/control-12.10-32 @@ -1,15 +1,15 @@ -Source: dvdomatic +Source: dcpomatic Section: video Priority: extra Maintainer: Carl Hetherington Build-Depends: debhelper (>= 8.0.0), python (>= 2.7.3), g++ (>= 4:4.6.3), pkg-config (>= 0.26), libwxgtk2.8-dev (>= 2.8.12.1), libssh-dev (>= 0.5.2), libboost-filesystem-dev (>= 1.46.0), libboost-thread-dev (>= 1.46.0), libsndfile1-dev (>= 1.0.25), libmagick++-dev (>= 8:6.6.9.7) Standards-Version: 3.9.3 -Homepage: http://carlh.net/software/dvdomatic +Homepage: http://carlh.net/software/dcpomatic -Package: dvdomatic +Package: dcpomatic Architecture: i386 Depends: libc6 (>= 2.15), libwxgtk2.8-0 (>= 2.8.12.1), libssh-4 (>= 0.5.2), libboost-filesystem1.49.0 (>= 1.49.0), libboost-thread1.49.0 (>= 1.49.0), libsndfile1 (>= 1.0.25), libmagick++5 (>= 8:6.7.7.10), libxml++2.6-2 (>= 2.34.2) Description: Generator of Digital Cinema Packages (DCPs) - DVD-o-matic generates Digital Cinema Packages (DCPs) from video and audio + DCP-o-matic generates Digital Cinema Packages (DCPs) from video and audio files (such as those from DVDs or Blu-Rays) for presentation on DCI-compliant digital projectors. diff --git a/builds/control-12.10-64 b/builds/control-12.10-64 index ed0b36b2e..cddf80007 100644 --- a/builds/control-12.10-64 +++ b/builds/control-12.10-64 @@ -1,15 +1,15 @@ -Source: dvdomatic +Source: dcpomatic Section: video Priority: extra Maintainer: Carl Hetherington Build-Depends: debhelper (>= 8.0.0), python (>= 2.7.3), g++ (>= 4:4.6.3), pkg-config (>= 0.26), libwxgtk2.8-dev (>= 2.8.12.1), libssh-dev (>= 0.5.2), libboost-filesystem-dev (>= 1.46.0), libboost-thread-dev (>= 1.46.0), libsndfile1-dev (>= 1.0.25), libmagick++-dev (>= 8:6.6.9.7) Standards-Version: 3.9.3 -Homepage: http://carlh.net/software/dvdomatic +Homepage: http://carlh.net/software/dcpomatic -Package: dvdomatic +Package: dcpomatic Architecture: amd64 Depends: libc6 (>= 2.15), libwxgtk2.8-0 (>= 2.8.12.1), libssh-4 (>= 0.5.2), libboost-filesystem1.49.0 (>= 1.49.0), libboost-thread1.49.0 (>= 1.49.0), libsndfile1 (>= 1.0.25), libmagick++5 (>= 8:6.7.7.10), libxml++2.6-2 (>= 2.34.2) Description: Generator of Digital Cinema Packages (DCPs) - DVD-o-matic generates Digital Cinema Packages (DCPs) from video and audio + DCP-o-matic generates Digital Cinema Packages (DCPs) from video and audio files (such as those from DVDs or Blu-Rays) for presentation on DCI-compliant digital projectors. diff --git a/cscript b/cscript index 4873df654..07840c109 100644 --- a/cscript +++ b/cscript @@ -25,13 +25,13 @@ def build(environment, variant, version): shutil.copyfile(os.path.join('builds', 'control-%s' % variant), os.path.join('debian', 'control')) command('./waf dist') f = open(os.path.join('debian', 'files'), 'w') - print >>f,'dvdomatic_%s-1_%s.deb video extra' % (version, cpu) + print >>f,'dcpomatic_%s-1_%s.deb video extra' % (version, cpu) shutil.rmtree('build/deb', ignore_errors=True) os.makedirs('build/deb') os.chdir('build/deb') - shutil.move('../../dvdomatic-%s.tar.bz2' % version, 'dvdomatic_%s.orig.tar.bz2' % version) - command('tar xjf dvdomatic_%s.orig.tar.bz2' % version) - os.chdir('dvdomatic-%s' % version) + shutil.move('../../dcpomatic-%s.tar.bz2' % version, 'dcpomatic_%s.orig.tar.bz2' % version) + command('tar xjf dcpomatic_%s.orig.tar.bz2' % version) + os.chdir('dcpomatic-%s' % version) command('dch -b -v %s-1 "New upstream release."' % version) command('dpkg-source -b .') command('dpkg-buildpackage') @@ -39,9 +39,9 @@ def build(environment, variant, version): def make_pot(): command('./waf pot') - return [os.path.abspath('build/src/lib/libdvdomatic.pot'), - os.path.abspath('build/src/wx/libdvdomatic-wx.pot'), - os.path.abspath('build/src/tools/dvdomatic.pot')] + return [os.path.abspath('build/src/lib/libdcpomatic.pot'), + os.path.abspath('build/src/wx/libdcpomatic-wx.pot'), + os.path.abspath('build/src/tools/dcpomatic.pot')] def make_manual(): os.chdir('doc/manual') diff --git a/cscript.py b/cscript.py deleted file mode 100644 index 9b8fa46c0..000000000 --- a/cscript.py +++ /dev/null @@ -1,8 +0,0 @@ -import cdist - -def builds(): - return ['source'] - -def build_source(): - cdist.build_source_waf() - diff --git a/debian/changelog b/debian/changelog index d1cea437d..0a53eff15 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,298 +1,298 @@ -dvdomatic (0.83-1) UNRELEASED; urgency=low +dcpomatic (0.83-1) UNRELEASED; urgency=low * New upstream release. -- Carl Hetherington Wed, 10 Apr 2013 12:48:25 +0100 -dvdomatic (0.82-1) UNRELEASED; urgency=low +dcpomatic (0.82-1) UNRELEASED; urgency=low * New upstream release. -- Carl Hetherington Tue, 09 Apr 2013 23:43:35 +0100 -dvdomatic (0.82beta1-1) UNRELEASED; urgency=low +dcpomatic (0.82beta1-1) UNRELEASED; urgency=low * New upstream release. -- Carl Hetherington Tue, 09 Apr 2013 21:48:56 +0100 -dvdomatic (0.81-1) UNRELEASED; urgency=low +dcpomatic (0.81-1) UNRELEASED; urgency=low * New upstream release. -- Carl Hetherington Tue, 09 Apr 2013 19:48:04 +0100 -dvdomatic (0.81beta1-1) UNRELEASED; urgency=low +dcpomatic (0.81beta1-1) UNRELEASED; urgency=low * New upstream release. -- Carl Hetherington Tue, 09 Apr 2013 15:37:32 +0100 -dvdomatic (0.80-1) UNRELEASED; urgency=low +dcpomatic (0.80-1) UNRELEASED; urgency=low * New upstream release. -- Carl Hetherington Sun, 07 Apr 2013 23:48:12 +0100 -dvdomatic (0.80beta4-1) UNRELEASED; urgency=low +dcpomatic (0.80beta4-1) UNRELEASED; urgency=low * New upstream release. -- Carl Hetherington Sun, 07 Apr 2013 23:08:49 +0100 -dvdomatic (0.80beta3-1) UNRELEASED; urgency=low +dcpomatic (0.80beta3-1) UNRELEASED; urgency=low * New upstream release. -- Carl Hetherington Sun, 07 Apr 2013 22:44:29 +0100 -dvdomatic (0.80beta2-1) UNRELEASED; urgency=low +dcpomatic (0.80beta2-1) UNRELEASED; urgency=low * New upstream release. -- Carl Hetherington Sun, 07 Apr 2013 22:19:34 +0100 -dvdomatic (0.80beta1-1) UNRELEASED; urgency=low +dcpomatic (0.80beta1-1) UNRELEASED; urgency=low * New upstream release. -- Carl Hetherington Sun, 07 Apr 2013 18:21:33 +0100 -dvdomatic (0.79-1) UNRELEASED; urgency=low +dcpomatic (0.79-1) UNRELEASED; urgency=low * New upstream release. -- Carl Hetherington Mon, 01 Apr 2013 22:37:03 +0100 -dvdomatic (0.78-1) UNRELEASED; urgency=low +dcpomatic (0.78-1) UNRELEASED; urgency=low * New upstream release. -- Carl Hetherington Sun, 31 Mar 2013 02:43:03 +0100 -dvdomatic (0.78beta16-1) UNRELEASED; urgency=low +dcpomatic (0.78beta16-1) UNRELEASED; urgency=low * New upstream release. -- Carl Hetherington Thu, 28 Mar 2013 16:28:05 +0000 -dvdomatic (0.78beta15-1) UNRELEASED; urgency=low +dcpomatic (0.78beta15-1) UNRELEASED; urgency=low * New upstream release. -- Carl Hetherington Thu, 28 Mar 2013 14:25:56 +0000 -dvdomatic (0.78beta14-1) UNRELEASED; urgency=low +dcpomatic (0.78beta14-1) UNRELEASED; urgency=low * New upstream release. -- Carl Hetherington Thu, 28 Mar 2013 10:38:07 +0000 -dvdomatic (0.78beta13-1) UNRELEASED; urgency=low +dcpomatic (0.78beta13-1) UNRELEASED; urgency=low * New upstream release. -- Carl Hetherington Wed, 27 Mar 2013 12:26:55 +0000 -dvdomatic (0.78beta12-1) UNRELEASED; urgency=low +dcpomatic (0.78beta12-1) UNRELEASED; urgency=low * New upstream release. -- Carl Hetherington Tue, 26 Mar 2013 21:13:54 +0000 -dvdomatic (0.78beta11-1) UNRELEASED; urgency=low +dcpomatic (0.78beta11-1) UNRELEASED; urgency=low * New upstream release. -- Carl Hetherington Tue, 26 Mar 2013 17:34:49 +0000 -dvdomatic (0.78beta10-1) UNRELEASED; urgency=low +dcpomatic (0.78beta10-1) UNRELEASED; urgency=low * New upstream release. -- Carl Hetherington Tue, 26 Mar 2013 11:35:15 +0000 -dvdomatic (0.78beta9-1) UNRELEASED; urgency=low +dcpomatic (0.78beta9-1) UNRELEASED; urgency=low * New upstream release. -- Carl Hetherington Tue, 26 Mar 2013 10:36:05 +0000 -dvdomatic (0.78beta8-1) UNRELEASED; urgency=low +dcpomatic (0.78beta8-1) UNRELEASED; urgency=low * New upstream release. -- Carl Hetherington Tue, 26 Mar 2013 00:59:36 +0000 -dvdomatic (0.78beta7-1) UNRELEASED; urgency=low +dcpomatic (0.78beta7-1) UNRELEASED; urgency=low * New upstream release. -- Carl Hetherington Tue, 26 Mar 2013 00:19:21 +0000 -dvdomatic (0.78beta6-1) UNRELEASED; urgency=low +dcpomatic (0.78beta6-1) UNRELEASED; urgency=low * New upstream release. -- Carl Hetherington Mon, 25 Mar 2013 00:08:10 +0000 -dvdomatic (0.78beta5-1) UNRELEASED; urgency=low +dcpomatic (0.78beta5-1) UNRELEASED; urgency=low * New upstream release. -- Carl Hetherington Thu, 21 Mar 2013 16:32:21 +0000 -dvdomatic (0.78beta4-1) UNRELEASED; urgency=low +dcpomatic (0.78beta4-1) UNRELEASED; urgency=low * New upstream release. -- Carl Hetherington Wed, 20 Mar 2013 15:01:10 +0000 -dvdomatic (0.78beta3-1) UNRELEASED; urgency=low +dcpomatic (0.78beta3-1) UNRELEASED; urgency=low * New upstream release. -- Carl Hetherington Wed, 20 Mar 2013 10:49:17 +0000 -dvdomatic (0.78beta2-1) UNRELEASED; urgency=low +dcpomatic (0.78beta2-1) UNRELEASED; urgency=low * New upstream release. -- Carl Hetherington Tue, 19 Mar 2013 21:35:50 +0000 -dvdomatic (0.78beta1-1) UNRELEASED; urgency=low +dcpomatic (0.78beta1-1) UNRELEASED; urgency=low * New upstream release. -- Carl Hetherington Tue, 19 Mar 2013 20:50:54 +0000 -dvdomatic (0.77-1) UNRELEASED; urgency=low +dcpomatic (0.77-1) UNRELEASED; urgency=low * New upstream release. -- Carl Hetherington Thu, 14 Mar 2013 17:12:03 +0000 -dvdomatic (0.77beta2-1) UNRELEASED; urgency=low +dcpomatic (0.77beta2-1) UNRELEASED; urgency=low * New upstream release. -- Carl Hetherington Thu, 14 Mar 2013 15:50:43 +0000 -dvdomatic (0.77beta1-1) UNRELEASED; urgency=low +dcpomatic (0.77beta1-1) UNRELEASED; urgency=low * New upstream release. -- Carl Hetherington Thu, 14 Mar 2013 15:14:01 +0000 -dvdomatic (0.76-1) UNRELEASED; urgency=low +dcpomatic (0.76-1) UNRELEASED; urgency=low * New upstream release. -- Carl Hetherington Tue, 05 Mar 2013 13:30:28 +0000 -dvdomatic (0.76beta3-1) UNRELEASED; urgency=low +dcpomatic (0.76beta3-1) UNRELEASED; urgency=low * New upstream release. -- Carl Hetherington Tue, 05 Mar 2013 12:47:20 +0000 -dvdomatic (0.76beta2-1) UNRELEASED; urgency=low +dcpomatic (0.76beta2-1) UNRELEASED; urgency=low * New upstream release. -- Carl Hetherington Fri, 01 Mar 2013 18:32:16 +0000 -dvdomatic (0.76beta1-1) UNRELEASED; urgency=low +dcpomatic (0.76beta1-1) UNRELEASED; urgency=low * New upstream release. -- Carl Hetherington Fri, 01 Mar 2013 17:36:55 +0000 -dvdomatic (0.75-1) UNRELEASED; urgency=low +dcpomatic (0.75-1) UNRELEASED; urgency=low * New upstream release. -- Carl Hetherington Wed, 27 Feb 2013 11:03:07 +0000 -dvdomatic (0.75beta1-1) UNRELEASED; urgency=low +dcpomatic (0.75beta1-1) UNRELEASED; urgency=low * New upstream release. -- Carl Hetherington Wed, 27 Feb 2013 08:20:42 +0000 -dvdomatic (0.74-1) UNRELEASED; urgency=low +dcpomatic (0.74-1) UNRELEASED; urgency=low * New upstream release. -- Carl Hetherington Sat, 23 Feb 2013 22:57:20 +0000 -dvdomatic (0.74beta1-1) UNRELEASED; urgency=low +dcpomatic (0.74beta1-1) UNRELEASED; urgency=low * New upstream release. -- Carl Hetherington Sat, 23 Feb 2013 21:44:22 +0000 -dvdomatic (0.73-1) UNRELEASED; urgency=low +dcpomatic (0.73-1) UNRELEASED; urgency=low * New upstream release. -- Carl Hetherington Thu, 21 Feb 2013 00:43:40 +0000 -dvdomatic (0.73beta9-1) UNRELEASED; urgency=low +dcpomatic (0.73beta9-1) UNRELEASED; urgency=low * New upstream release. -- Carl Hetherington Wed, 20 Feb 2013 23:40:24 +0000 -dvdomatic (0.73beta8-1) UNRELEASED; urgency=low +dcpomatic (0.73beta8-1) UNRELEASED; urgency=low * New upstream release. -- Carl Hetherington Mon, 18 Feb 2013 22:35:51 +0000 -dvdomatic (0.73beta7-1) UNRELEASED; urgency=low +dcpomatic (0.73beta7-1) UNRELEASED; urgency=low * New upstream release. -- Carl Hetherington Mon, 18 Feb 2013 20:38:51 +0000 -dvdomatic (0.73beta6-1) UNRELEASED; urgency=low +dcpomatic (0.73beta6-1) UNRELEASED; urgency=low * New upstream release. -- Carl Hetherington Sun, 17 Feb 2013 23:05:56 +0000 -dvdomatic (0.73beta3-1) UNRELEASED; urgency=low +dcpomatic (0.73beta3-1) UNRELEASED; urgency=low * New upstream release. -- Carl Hetherington Sun, 17 Feb 2013 23:05:05 +0000 -dvdomatic (0.73beta2-1) UNRELEASED; urgency=low +dcpomatic (0.73beta2-1) UNRELEASED; urgency=low * New upstream release. -- Carl Hetherington Sat, 16 Feb 2013 22:42:32 +0000 -dvdomatic (0.73beta1-1) UNRELEASED; urgency=low +dcpomatic (0.73beta1-1) UNRELEASED; urgency=low * New upstream release. -- Carl Hetherington Sat, 16 Feb 2013 21:19:24 +0000 -dvdomatic (0.72-1) UNRELEASED; urgency=low +dcpomatic (0.72-1) UNRELEASED; urgency=low * New upstream release. -- Carl Hetherington Thu, 24 Jan 2013 15:31:57 +0000 -dvdomatic (0.71-1) UNRELEASED; urgency=low +dcpomatic (0.71-1) UNRELEASED; urgency=low * New upstream release. -- Carl Hetherington Thu, 24 Jan 2013 11:36:04 +0000 -dvdomatic (0.70-1) UNRELEASED; urgency=low +dcpomatic (0.70-1) UNRELEASED; urgency=low * New upstream release. * New upstream release. @@ -300,7 +300,7 @@ dvdomatic (0.70-1) UNRELEASED; urgency=low -- Carl Hetherington Sat, 12 Jan 2013 23:07:15 +0000 -dvdomatic (0.70beta3-1) UNRELEASED; urgency=low +dcpomatic (0.70beta3-1) UNRELEASED; urgency=low * New upstream release. * New upstream release. @@ -309,13 +309,13 @@ dvdomatic (0.70beta3-1) UNRELEASED; urgency=low -- Carl Hetherington Sun, 06 Jan 2013 23:44:24 +0000 -dvdomatic (0.68-1) UNRELEASED; urgency=low +dcpomatic (0.68-1) UNRELEASED; urgency=low * New upstream release. -- Carl Hetherington Sun, 23 Dec 2012 01:43:44 +0000 -dvdomatic (0.68beta10-1) UNRELEASED; urgency=low +dcpomatic (0.68beta10-1) UNRELEASED; urgency=low * New upstream release. * New upstream release. @@ -325,91 +325,91 @@ dvdomatic (0.68beta10-1) UNRELEASED; urgency=low -- Carl Hetherington Sat, 22 Dec 2012 13:27:27 +0000 -dvdomatic (0.68beta5-1) unstable; urgency=low +dcpomatic (0.68beta5-1) unstable; urgency=low * New upstream release. -- Carl Hetherington Thu, 20 Dec 2012 07:53:46 +0000 -dvdomatic (0.68beta4-1) unstable; urgency=low +dcpomatic (0.68beta4-1) unstable; urgency=low * New upstream release. -- Carl Hetherington Thu, 20 Dec 2012 07:48:45 +0000 -dvdomatic (0.68beta3-1) unstable; urgency=low +dcpomatic (0.68beta3-1) unstable; urgency=low * New upstream release. -- Carl Hetherington Thu, 20 Dec 2012 00:35:45 +0000 -dvdomatic (0.68beta2-1) unstable; urgency=low +dcpomatic (0.68beta2-1) unstable; urgency=low * New upstream release. -- Carl Hetherington Wed, 19 Dec 2012 11:22:58 +0000 -dvdomatic (0.68beta1-1) unstable; urgency=low +dcpomatic (0.68beta1-1) unstable; urgency=low * New upstream release. -- Carl Hetherington Wed, 19 Dec 2012 10:11:13 +0000 -dvdomatic (0.67-1) unstable; urgency=low +dcpomatic (0.67-1) unstable; urgency=low * New upstream release. -- Carl Hetherington Tue, 18 Dec 2012 23:49:27 +0000 -dvdomatic (0.66-1) unstable; urgency=low +dcpomatic (0.66-1) unstable; urgency=low * New upstream release. -- Carl Hetherington Tue, 18 Dec 2012 11:29:04 +0000 -dvdomatic (0.65-1) unstable; urgency=low +dcpomatic (0.65-1) unstable; urgency=low * New upstream release. -- Carl Hetherington Tue, 18 Dec 2012 09:24:56 +0000 -dvdomatic (0.64-1) unstable; urgency=low +dcpomatic (0.64-1) unstable; urgency=low * New upstream release. -- Carl Hetherington Thu, 13 Dec 2012 21:52:09 +0000 -dvdomatic (0.63pre-1) unstable; urgency=low +dcpomatic (0.63pre-1) unstable; urgency=low * New upstream release. -- Carl Hetherington Tue, 11 Dec 2012 23:15:52 +0000 -dvdomatic (0.60-1) unstable; urgency=low +dcpomatic (0.60-1) unstable; urgency=low * New upstream release. -- Carl Hetherington Tue, 11 Dec 2012 22:46:04 +0000 -dvdomatic (0.59-1) unstable; urgency=low +dcpomatic (0.59-1) unstable; urgency=low * New upstream release. -- Carl Hetherington Mon, 10 Dec 2012 20:58:19 +0000 -dvdomatic (0.59beta5-1) unstable; urgency=low +dcpomatic (0.59beta5-1) unstable; urgency=low * New upstream release. -- Carl Hetherington Sun, 09 Dec 2012 23:51:55 +0000 -dvdomatic (0.59beta4-1) unstable; urgency=low +dcpomatic (0.59beta4-1) unstable; urgency=low * New upstream release. -- Carl Hetherington Sun, 09 Dec 2012 21:38:00 +0000 -dvdomatic (0.59beta1-1) unstable; urgency=low +dcpomatic (0.59beta1-1) unstable; urgency=low * Initial release. diff --git a/debian/copyright b/debian/copyright index 2579947e4..0cf23aacd 100644 --- a/debian/copyright +++ b/debian/copyright @@ -1,6 +1,6 @@ Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ -Upstream-Name: dvdomatic -Source: +Upstream-Name: dcpomatic +Source: Files: * Copyright: 2012 Carl Hetherington diff --git a/debian/files b/debian/files index 7639f05ac..ca46cf438 100644 --- a/debian/files +++ b/debian/files @@ -1 +1 @@ -dvdomatic_0.59beta1-1_i386.deb video extra +dcpomatic_0.59beta1-1_i386.deb video extra diff --git a/debian/rules b/debian/rules index 3320087a5..ba42e5291 100755 --- a/debian/rules +++ b/debian/rules @@ -19,5 +19,5 @@ override_dh_auto_build: ./waf --nocache build override_dh_auto_install: - ./waf --nocache install --destdir=debian/dvdomatic + ./waf --nocache install --destdir=debian/dcpomatic diff --git a/doc/mainpage.txt b/doc/mainpage.txt index 59c578899..649c9c609 100644 --- a/doc/mainpage.txt +++ b/doc/mainpage.txt @@ -1,37 +1,37 @@ -/** @mainpage DVD-o-matic +/** @mainpage DCP-o-matic * - * DVD-o-matic is a tool to create digital cinema packages (DCPs) from + * DCP-o-matic is a tool to create digital cinema packages (DCPs) from * video files, or from sets of TIFF image files. It is written in C++ * and distributed under the GPL. * * Video files are decoded using FFmpeg (http://ffmpeg.org), so any video - * supported by FFmpeg should be usable with DVD-o-matic. DVD-o-matic's output has been + * supported by FFmpeg should be usable with DCP-o-matic. DCP-o-matic's output has been * tested on numerous digital projectors. * - * DVD-o-matic allows you to crop black borders from movies, scale them to the correct + * DCP-o-matic allows you to crop black borders from movies, scale them to the correct * aspect ratio and apply FFmpeg filters. The time-consuming encoding of JPEG2000 files * can be parallelised amongst any number of processors on the local host and any number * of servers over a network. * - * DVD-o-matic can also make DCPs from still images, for advertisements and such-like. + * DCP-o-matic can also make DCPs from still images, for advertisements and such-like. * - * Parts of DVD-o-matic are based on OpenDCP (http://code.google.com/p/opendcp), + * Parts of DCP-o-matic are based on OpenDCP (http://code.google.com/p/opendcp), * written by Terrence Meiczinger. * - * DVD-o-matic uses libopenjpeg (http://code.google.com/p/openjpeg/) for JPEG2000 encoding + * DCP-o-matic uses libopenjpeg (http://code.google.com/p/openjpeg/) for JPEG2000 encoding * and libsndfile (http://www.mega-nerd.com/libsndfile/) for WAV file manipulation. It * also makes heavy use of the boost libraries (http://www.boost.org/). ImageMagick * (http://www.imagemagick.org/) is used for still-image encoding and decoding, and the GUI is * built using wxWidgets (http://wxwidgets.org/). It also uses libmhash (http://mhash.sourceforge.net/) * for debugging purposes. * - * Thanks are due to the authors and communities of all DVD-o-matic's dependencies. + * Thanks are due to the authors and communities of all DCP-o-matic's dependencies. * - * DVD-o-matic is distributed in the hope that there are still cinemas with projectionists + * DCP-o-matic is distributed in the hope that there are still cinemas with projectionists * who might want to use it. As Mark Kermode says, "if it doesn't have a projectionist * it's not a cinema - it's a sweetshop with a video-screen." * * Email correspondance is welcome to cth@carlh.net * - * More details can be found at http://carlh.net/software/dvdomatic + * More details can be found at http://carlh.net/software/dcpomatic */ diff --git a/doc/manual/Makefile b/doc/manual/Makefile index 94abc8516..115d7c3c8 100644 --- a/doc/manual/Makefile +++ b/doc/manual/Makefile @@ -1,4 +1,4 @@ -# DVD-o-matic manual makefile +# DCP-o-matic manual makefile all: html pdf @@ -8,7 +8,7 @@ SCREENSHOTS := file-new.png video-new-film.png still-new-film.png click-content- still-select-content-file.png examine-thumbs.png \ calculate-audio-gain.png prefs.png making-dcp.png filters.png film-tab.png video-tab.png audio-tab.png subtitles-tab.png -XML := dvdomatic.xml +XML := dcpomatic.xml GRAPHICS := @@ -70,7 +70,7 @@ diagrams/%.pdf: diagrams/%.svg # HTML # -html: $(XML) dvdomatic-html.xsl extensions-html.ent dvdomatic.css \ +html: $(XML) dcpomatic-html.xsl extensions-html.ent dcpomatic.css \ $(addprefix html/screenshots/,$(SCREENSHOTS)) \ $(subst .svg,.png,$(addprefix diagrams/,$(DIAGRAMS))) \ $(subst .svg,.png,$(addprefix graphics/,$(GRAPHICS))) \ @@ -80,19 +80,19 @@ html: $(XML) dvdomatic-html.xsl extensions-html.ent dvdomatic.css \ cp extensions-html.ent extensions.ent # DocBoox -> html - xmlto html -m dvdomatic-html.xsl dvdomatic.xml --skip-validation -o html + xmlto html -m dcpomatic-html.xsl dcpomatic.xml --skip-validation -o html # Copy graphics and CSS in # mkdir -p html/diagrams html/graphics # cp diagrams/*.png html/diagrams # cp graphics/*.png html/graphics - cp dvdomatic.css html + cp dcpomatic.css html # # PDF # -pdf: $(XML) dvdomatic-pdf.xsl extensions-pdf.ent screenshots/*.png $(subst .svg,.pdf,$(addprefix diagrams/,$(DIAGRAMS))) +pdf: $(XML) dcpomatic-pdf.xsl extensions-pdf.ent screenshots/*.png $(subst .svg,.pdf,$(addprefix diagrams/,$(DIAGRAMS))) # The DocBook needs to know what file extensions to look for # for screenshots and diagrams; use the correct file to tell it. @@ -100,14 +100,14 @@ pdf: $(XML) dvdomatic-pdf.xsl extensions-pdf.ent screenshots/*.png $(subst .svg, mkdir -p pdf - dblatex -p dvdomatic-pdf.xsl -s dvdomatic.sty -r pptex.py -T native dvdomatic.xml -t pdf -o pdf/dvdomatic.pdf + dblatex -p dcpomatic-pdf.xsl -s dcpomatic.sty -r pptex.py -T native dcpomatic.xml -t pdf -o pdf/dcpomatic.pdf # # LaTeX (handy for debugging) # -tex: $(XML) dvdomatic-pdf.xsl extensions-pdf.ent +tex: $(XML) dcpomatic-pdf.xsl extensions-pdf.ent # The DocBook needs to know what file extensions to look for # for screenshots and diagrams; use the correct file to tell it. @@ -116,8 +116,8 @@ tex: $(XML) dvdomatic-pdf.xsl extensions-pdf.ent mkdir -p tex # -P removes the revhistory table - dblatex -P doc.collab.show=0 -P latex.output.revhistory=0 -p dvdomatic-pdf.xsl -s dvdomatic.sty -r pptex.py -T native dvdomatic.xml -t tex -o tex/dvdomatic.tex + dblatex -P doc.collab.show=0 -P latex.output.revhistory=0 -p dcpomatic-pdf.xsl -s dcpomatic.sty -r pptex.py -T native dcpomatic.xml -t tex -o tex/dcpomatic.tex -clean:; rm -rf html pdf diagrams/*.pdf diagrams/*.png graphics/*.png *.aux dvdomatic.cb dvdomatic.cb2 dvdomatic.glo dvdomatic.idx dvdomatic.ilg - rm -rf dvdomatic.ind dvdomatic.lof dvdomatic.log dvdomatic.tex dvdomatic.toc extensions.ent dvdomatic.out +clean:; rm -rf html pdf diagrams/*.pdf diagrams/*.png graphics/*.png *.aux dcpomatic.cb dcpomatic.cb2 dcpomatic.glo dcpomatic.idx dcpomatic.ilg + rm -rf dcpomatic.ind dcpomatic.lof dcpomatic.log dcpomatic.tex dcpomatic.toc extensions.ent dcpomatic.out diff --git a/doc/manual/dvdomatic-html.xsl b/doc/manual/dvdomatic-html.xsl deleted file mode 100644 index 059d7ead7..000000000 --- a/doc/manual/dvdomatic-html.xsl +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - - - - diff --git a/doc/manual/dvdomatic-pdf.xsl b/doc/manual/dvdomatic-pdf.xsl deleted file mode 100644 index 414fb64b8..000000000 --- a/doc/manual/dvdomatic-pdf.xsl +++ /dev/null @@ -1,17 +0,0 @@ - - - - -colorlinks,linkcolor=black,urlcolor=black - - -0 -0 - - -scale=0.6 - - -3 - - diff --git a/doc/manual/dvdomatic.css b/doc/manual/dvdomatic.css deleted file mode 100644 index 0e4982f20..000000000 --- a/doc/manual/dvdomatic.css +++ /dev/null @@ -1,19 +0,0 @@ -body { - font-family: luxi sans, sans-serif; - margin-left: 4em; - margin-right: 4em; - margin-top: 1em; - margin-bottom: 1em; - background-color: #E2E8EE; -} - -div.sidebar { - margin-left: 1em; - margin-right: 1em; - padding-left: 1em; - padding-right: 1em; - border-color: #000000; - border-width: 2px; - border-style: solid; - background-color: #E2E8EE; -} diff --git a/doc/manual/dvdomatic.sty b/doc/manual/dvdomatic.sty deleted file mode 100644 index 834e581fc..000000000 --- a/doc/manual/dvdomatic.sty +++ /dev/null @@ -1,68 +0,0 @@ -%% -%% This style is derivated from the docbook one -%% -\NeedsTeXFormat{LaTeX2e} -\ProvidesPackage{ardour}[2007/04/04 My DocBook Style] - -%% Just use the original package and pass the options -\RequirePackageWithOptions{docbook} - -% Use a nice font -\usepackage{lmodern} - -% Define \dbend as the dangerous bend sign -\font\manual=manfnt -\def\dbend{{\manual\char127}} - -% Redefine sidebar environment to use the dangerous bend style -% Danger, Will Robinson! -\def\sidebar{\begin{trivlist}\item[]\noindent% -\begingroup\hangindent=2pc\hangafter=-2%\clubpenalty=10000% -\def\par{\endgraf\endgroup}% -\hbox to0pt{\hskip-\hangindent\dbend\hfill}\ignorespaces} -\def\endsidebar{\par\end{trivlist}} - - -% Futz with the title page; basically a copy of -% /usr/share/texmf/tex/latex/dblatex/style/dbk_title.sty -% with authors added. - -\def\DBKcover{ -\ifthenelse{\equal{\DBKedition}{}}{\def\edhead{}}{\def\edhead{Ed. \DBKedition}} - -\pagestyle{empty} - -% interligne double -\setlength{\oldbaselineskip}{\baselineskip} -\setlength{\baselineskip}{2\oldbaselineskip} -\textsf{ -\vfill -\vspace{2.5cm} -\begin{center} - \huge{\textbf{\DBKtitle}}\\ % - \ \\ % - \ \\ % - \Large{\DBKauthor}\\ % - \ifx\DBKsubtitle\relax\else% - \underline{\ \ \ \ \ \ \ \ \ \ \ }\\ % - \ \\ % - \huge{\textbf{\DBKsubtitle}}\\ % - \fi -\end{center} -\vfill -\setlength{\baselineskip}{\oldbaselineskip} -\hspace{1cm} -\vspace{1cm} -\begin{center} -\begin{tabular}{p{7cm} p{7cm}} -\Large{\DBKreference{} \edhead} & \\ -\end{tabular} -\end{center} -} - -% Format for the other pages -\newpage -\setlength{\baselineskip}{\oldbaselineskip} -%\chead[]{\DBKcheadfront} -\lfoot[]{} -} diff --git a/doc/manual/dvdomatic.xml b/doc/manual/dvdomatic.xml deleted file mode 100644 index 58315eca6..000000000 --- a/doc/manual/dvdomatic.xml +++ /dev/null @@ -1,932 +0,0 @@ - - - - -%dbcent; - -%extensions; -]> - - - -DVD-o-matic -CarlHetherington - - - -Introduction - - -Hello, and welcome to DVD-o-matic! - - -
-What is DVD-o-matic? - - -DVD-o-matic is a program to generate Digital -Cinema Packages (DCPs) from DVDs, Blu-Rays, video files such as MP4 -and AVI, or still images. The resulting DCPs will play on modern digital -cinema projectors. - - - -You might find it useful to make DVDs easier to present, to encode -independently-shot feature films, or to generate local advertising for -your cinema. - - -
- -
-Licence - - -DVD-o-matic is licensed under the GNU GPL. - - -
- -
- - -Installation - -
-Windows - - -To install DVD-o-matic on Windows, simply download the installer from -http://carlh.net -and double-click it. Click through the installer wizard, and -DVD-o-matic will be installed onto your machine. - - - -If you are using a 32-bit version of Windows, you will need the 32-bit -installer. For 64-bit Windows, either installer will work, but I -suggest you used the 64-bit version as it will allow DVD-o-matic to -use more memory. You may find that DVD-o-matic crashes if you run -many parallel encoding threads (more than 4) on the 32-bit -version. - - -
- -
-Ubuntu Linux - - -You can install DVD-o-matic on Ubuntu 12.04 (‘Precise -Pangolin’) or 12.10 (‘Quantal Quetzal’) using -.deb packages: download the appropriate package from -http://carlh.net and -double-click it. Ubuntu will install the necessary bits and pieces -and set DVD-o-matic up for you. - - -
- -
-Other Linux distributions - - -Installation on non-Ubuntu Linux is currently a little involved, as -there are no packages available (yet); you will have to compile it -from source. If you are using a non-Ubuntu distribution, do let me -know via the mailing -list and I will see about building some packages. - - - -The following dependencies are required: - -FFmpeg -libsndfile -OpenSSL -libopenjpeg -ImageMagick -Boost -libssh -GTK -wxWidgets -libdcp - - - - -Once you have installed the development packages for the dependencies, -download the source code from http://carlh.net, -unpack it and run the following commands from inside the source -directory: - - - -./waf configure -./waf build -sudo ./waf install - - - -With any luck, this will build and install DVD-o-matic on your system. To run it, enter: - - - -dvdomatic - - - -in a shell. - - -
-
- - -Creating a video DCP - - -In this chapter we will see how to create a video DCP using -DVD-o-matic. We will gloss over some of the finer details, which are -explained in later chapters. - - -
-Creating a new film - - -Let's make a very simple DCP to see how DVD-o-matic works. First, we -need some content. Download the low-resolution trailer for the open -movie Sintel from their -website. Generally, of course, one would want to use the -highest-resolution material available, but for this test we will use -the low-resolution version to save everyone's bandwidth bills. - - - -Now, start DVD-o-matic and its window will open. First, we will -create a new ‘film’. A ‘film’ is how DVD-o-matic refers to -a piece of content, along with some settings, which we will make into -a DCP. DVD-o-matic stores its data in a folder on your disk while it -creates the DCP. You can create a new film by selecting -New from the File menu, as -shown in . - - -
- Creating a new film - - - - - -
- - -This will open a dialogue box for the new film, as shown in . - - -
- Dialogue box for creating a new film - - - - - -
- - -In this dialogue box you can choose a name for the film. This will be -used to name the folder to store its data in, and also as the initial -name for the DCP itself. You can also choose whereabouts you want to create -the film. In the example from the figure, DVD-o-matic will create a -folder called ‘DCP Test’ inside my home folder (carl) into which it -will write its working files. - - - -If you always create your DCPs in a particular folder, you can use -DVD-o-matic's Preferences to make life a little -easier by setting the default folder that DVD-o-matic will offer in this dialogue. -See . - - -
- -
-Selecting content - - -The next step is to set the content that you want to use. Click the -content selector, as shown in , and a file chooser will -open for you to select the content file to use, as shown in . - - -
- Opening the content selector - - - - - -
- -
- Selecting a video content file - - - - - -
- - -Select your content file and click Open. In this -case we are using the Sintel trailer that we downloaded earlier. - - - -When you do this, DVD-o-matic will take a look at your file. After a -short while (when the progress bar at the bottom right of the window -has finished), you can look through your content using the slider to -the right of the window, as shown in . - - -
- Examining the content - - - - - -
- - -Dragging the slider will move through your video. You can also click -the Play button to play the content back. Note -that there will be no sound, and playback might not be entirely -accurate (it may be slightly slower or faster than it should be, for -example). This player is really only intended for brief inspection of -content; if you need to check it more thoroughly, use another player -such as Totem, mplayer or VLC. - - -
- -
-Setting up - - -Now there are a few things to set up to describe how the DCP should be -created. The settings are divided into four tabs: film, video, audio and subtitles. - - -
-Film tab - - -The ‘film’ tab contains settings that pertain to the whole film, as shown in . - - -
- Film settings tab - - - - - -
- - -The first thing here is the name. This is generally set to the title -of the film that is being encoded. If Use DCI -name is not ticked, the name that you specify will be used -as-is for the name of the DCP. If Use DCI name -is ticked, the name that you enter will be used as part of a -DCI-compliant name. - - - -Underneath the name field is a preview of the name that the DCP will -get. To use a DCI-compliant name, tick the Use DCI -name checkbox. The DCI name will be composed using details -of your content's soundtrack, the current date and other things that -can be specified in the DCI name details dialogue box, which you can -open by clicking on the Details button. - - - -If the DCP name is long, it may not all be visible. You can see the -full name by hovering the mouse pointer over the partial name. - - - -The Trust content's header button starts off -checked, and this means that DVD-o-matic will use the content's header -information to determine its length. If, for some reason, this header -length is wrong, uncheck the Trust content's -header button and DVD-o-matic will run through the content -to find its exact length. This may take a while for large pieces of content. - - - -Next up is the content type. This can be -‘feature’, ‘trailer’ or whatever; select the -required type from the drop-down list. - - - -The trim frames settings allow you to trim frames -from the beginning and end of the content; any trimmed frames will not -be included in the DCP. - - -
- -
-Video tab - - -This tab contains settings related to the picture in your DCP, as shown in . - - -
- Video settings tab - - - - - -
- - -The first option on this tab is the format. This will govern the -shape that DVD-o-matic will make your image into. Select the aspect -ratio that your content should be presented in. The ‘4:3 within -Flat’ and ‘16:9 within Flat’ settings will put the -image at the specified ratio within a Flat (1.85:1) frame, so that you -can project the DCP using your projector's Flat preset. - - - -The remaining options can often be left alone, but may sometimes be -useful. The ‘crop’ settings can be used to crop your -content, which can be used to remove black borders from round the -edges of DVD images, for example. The specified number of pixels will -be trimmed from each edge, and the content image in the right of the -window will be updated to show the effect of the crop. - - - -The ‘filters’ settings allow you to apply various video -filters to the image. These may be useful to try to improve -poor-quality sources like DVDs. We will discuss filtering later in the manual. - - - - -The ‘scaler’ is the method that will be used to scale up -your content to the required size for the DCP, if required. We will -discuss the options in more detail later; Bicubic is a fine choice in -most situations. - - - - -The ‘colour look-up table’ specifies the colour space that -your input content will be expected to be in. If in doubt, leave it -set to ‘sRGB’. - - - -Finally, the ‘JPEG2000 bandwidth’ setting changes how big the final -image files used within the DCP will be. Larger numbers will give -better quality, but correspondingly larger DCPs. The bandwidth can be -between 50 and 250 megabits per second (MBps). - - -
- -
-Audio tab - - -This tab contains settings related to the sound in your DCP, as shown in . - - -
- Audio settings tab - - - - - -
- - - -‘Audio Gain’ is used to alter the volume of the -soundtrack. The specified gain (in dB) will be applied to each sound -channel before it is written to the DCP. - - - -If you use a sound processor that DVD-o-matic knows about, it can help -you calculate changes in gain that you should apply. Say, for -example, that you make a test DCP and find that you have to run it at -volume 5 instead of volume 7 to get a good sound level in the screen. -If this is the case, click the Calculate... -button next to the audio gain entry, and the dialogue box in will open. - - -
- Calculating audio gain - - - - - -
- - -For our example, put 5 in the first box and 7 in the second and click -OK. DVD-o-matic will calculate the audio gain -that it should apply to make this happen. Then you can re-make the -DCP (this will be reasonably fast, as the video data will already have -been done) and it should play back at the correct volume with 7 on -your sound-rack fader. - - - -Current versions of DVD-o-matic only know about the Dolby CP750. If -you use a different sound processor, and know the gain curve of its -volume control, get in -touch. - - - -‘Audio Delay’ is used to adjust the synchronisation -between audio and video. A positive delay will move the audio later -with respect to the video, and a negative delay will move it earlier. - - - -By default the Use content‘s audio button -will be selected. This means that the DCP will use one of the -soundtracks from your content file; you can select the soundtrack that -you wish to use from the drop-down box. - - - -Note that if your content's audio is mono, DVD-o-matic will place it -in the centre channel in the DCP. - - - -Alternatively, you can supply different sound files by clicking the -Use external audio button and choosing a WAV file -for any channels that you want to appear in the DCP. These files can -be any bit depth and sampling rate, and will be re-sampled and -bit-depth converted if required. - - -
-
-Subtitles tab - - -This tab contains settings related to subtitles in your DCP, as shown in . - - -
- Subtitle settings tab - - - - - -
- - -DVD-o-matic will extract subtitles from the content, if present, and -they can be ‘burnt into’ the DCP (that is, they are -included in the image and not overlaid by the projector). Note that -DVD and Blu-Ray subtitles are stored as bitmaps, so it is not possible -(automatically) to use non-burnt-in subtitles with these sources. -Select the With Subtitles checkbox to enable -subtitles. The offset control moves the -subtitles up and down the image, and the scale -control changes their size. - - - -Future versions of DVD-o-matic will hopefully include the option to -use text subtitles (as is the norm with most professionally-mastered -DCPs). - - -
-
- -
-Making the DCP - - -Now that we have set everything up, choose Make -DCP from the Jobs menu. DVD-o-matic -will encode your DCP. This may take some time (many hours in some -cases). While the job is in progress, DVD-o-matic will update you on -how it is getting on with the progress bar in the bottom of its window, as shown in . - - -
- Making the DCP - - - - - -
- - -When it has finished, the DCP will end up on your disk inside the -film's directory. You can then copy this to a projector via a USB -stick, hard-drive or network connection. - - - -Alternatively, if you have a projector or TMS that is accessible via -SCP across your network, you can upload the content directly from -DVD-o-matic. See . - - -
-
- - - -Creating a still-image DCP - - -DVD-o-matic can also be used to create DCPs of a still image, perhaps -for an advertisement or an on-screen announcement. This chapter shows you -how to do it. - - - -As with video DCPs, the first step is to create a new -‘Film’; select New from the -File menu and the new film dialogue will open as -shown in . - - -
- Dialogue box for creating a new film - - - - - -
- - -Enter a name and click OK. Then we set up the -content; click the content selector as before, and this time we will -choose an image file, as shown in . - - -
- Selecting a still content file - - - - - -
- - -Setting up for a still image DCP is somewhat simpler than for a video; -the tabs are all the same, but many options are removed and a few are added. - - - -As with video, you can select a content type and the format (ratio) -that your image should be presented in. It will be scaled and padded -to fit the selected ratio, but in such a way that the pixel aspect -ratio is preserved. In other words, the image will not be stretched, -merely scaled; if you want to stretch your image, you will need to do -so in a separate program before importing it into DVD-o-matic. You -can also crop your image, if you so choose, and then set a duration -(in seconds) that the image should appear on screen. - - - -Still-image DCPs can include sound; this can be added from the -Audio tab. If your specified duration is shorter -than the audio, the audio will be cut off at the duration; if it is -longer, silence will be added after your audio. - - - -Finally, as with video, you can choose Make DCP -from the Jobs menu to create your DCP. This will -be much quicker than creating a video DCP, as DVD-o-matic only needs -to encode a single frame which it can then repeat. - - -
- - - -Preferences - - -DVD-o-matic provides a few preferences which can be used to modify its -behaviour. This chapter explains those options. - - -
-The preferences dialogue - - -The preferences dialogue is opened by choosing -Preferences... from the Edit -menu. The dialogue is shown in . - - -
- Preferences - - - - - -
- -
-TMS setup - - -The first part of the dialogue gives some options for specifying -details about your TMS. If you do this, and your TMS accepts SSH -connections, you can upload DCPs directly from DVD-o-matic to the TMS. -This is discussed in . - - - -TMS IP address should be set to the IP address of -your TMS, TMS target path to the place that DCPs -should be uploaded to (which will be relative to the home directory of -the SSH user). Finally, the user name and password are the -credentials required to log into the TMS via SSH. - -
- -
-Threads - - -When DVD-o-matic is encoding DCPs it can use multiple parallel threads -to speed things up. Set this value to the number of threads -DVD-o-matic should use. This would typically be set to the number of -processors (or processor cores) in your machine. - - -
- -
-Default directory for new films - - -This is the directory which DVD-o-matic will suggest initially as a place to put new films. - - -
- -
-A/B options - - -These options are for DVD-o-matic's special mode of making A/B -comparison DCPs for checking the performance of video filters. Their -use is described in . - - -
- -
-Encoding servers - - -If you have spare machines sitting around on your network not doing -much, they can be pressed into service to speed up DCP encodes. This -is done by running a small server program on the machine, which will -encode video sent to it by the ‘master’ DVD-o-matic. This -option is described in more detail in . -Use these preferences to specify the encoding servers that should be -used. - - -
- -
-
- - -Advanced topics - -This chapter describes some parts of DVD-o-matic that are -probably not essential, but which you might find useful in some -circumstances. - - -
-Filtering - - -DVD-o-matic offers a variety of filters that can be applied to your -video content. You can set up the filters by clicking the -Edit button next to the filters entry in the -setup area of the DVD-o-matic window; this opens the filters selector -as shown in . - - -
- Filters selector - - - - - -
- - -After changing the filters setup, you will need to regenerate the DCP -to see the effect on the cinema screen. The preview in DVD-o-matic -will update itself whenever filters are changed, though of course this -image is much smaller and of lower resolution than a projected image! - - -
- -
-Scaling - - -If your source material is not of the DCI-specified size, or if it -uses non-square pixels, DVD-o-matic will need to scale it. The -algorithm used to scale is set up by the Scaler -entry in the film setup area. We think ‘Bicubic’ is the -best all-round option, but tests are ongoing. - - -
- -
-TMS upload - - -If you have configured details of a TMS in the preferences dialogue -() you can upload a completed DCP -straight to your TMS buy choosing Send DCP to TMS -from the Jobs menu. - - -
- - -
-A/B comparison - - -When evaluating the effects of different filters or scalers on the -image quality, A/B mode might be useful. In this mode, DVD-o-matic -will generate a DCP where the left half of the image uses some -‘reference’ filtering and scaling, and the right half of -the image uses a different set of filters and a different scaler. -This DCP can then be played back on a projector and the image quality -evaluated. - - - -To enable A/B mode, click the A/B checkbox in the setup area of the -DVD-o-matic window. When you generate your DCP, the left half of the -screen will use the filters and scaler specified in the preferences dialogue, and the right -half will use the filters and scaler specified in the film setup. - - -
- -
-Encoding servers - - -One way to increase the speed of DCP encoding is to use more -than one machine at the same time. An instance of DVD-o-matic can -offload some of the time-consuming JPEG2000 encoding to any number of -other machines on a network. To do this, one ‘master’ -machine runs DVD-o-matic, and the ‘server’ machines run -a small program called ‘servomatic’. - - -
-Running the servers - - -There are two options for the encoding server; -servomatic_cli, which runs on the command line, and -servomatic_gui, which has a simple GUI. The command line -version is well-suited to headless servers, especially on Linux, and -the GUI version works best on Windows where it will put an icon in the -system tray. - - - -To run the command line version, simply enter: - - - -servomatic_cli - - - -at a command prompt. If you are running the program on a machine with -a multi-core processor, you can run multiple parallel encoding threads -by doing something like: - - - -servomatic_cli -t 4 - - - -to run 4 threads in parallel. - - - -To run the GUI version on windows, run the ‘DVD-o-matic encode -server’ from the start menu. An icon will appear in the system -tray; right-click it to open a menu from whence you can quit the -server or open a window to show its status. - - -
-
-Setting up DVD-o-matic - - -Once your servers are running, you need to tell your master -DVD-o-matic instance about them. Start DVD-o-matic and open the -Preferences dialog from the -Edit menu. At the bottom of this dialog is a -section where you can add, edit and remove encoding servers. For each -encoding server you need only specify its IP address and the number of -threads that it is running, so that DVD-o-matic knows how many -parallel encode jobs to send to the server. - - - -Once this is done, any encodes that you start will split the workload -up between the master machine and the servers. - - -
-
-Some notes about encode servers - - -DVD-o-matic does not mind if servers come and go; if a server -disappears, DVD-o-matic will stop sending work to it, and will check -it every minute or so in case it has come back online. - - - -You will probably find that using a 1Gb/s or faster network will -provide a significant speed-up compared to a 100Mb/s network. - - - -Making changes to the server configuration in the master DVD-o-matic -will have no effect while an encode is running; the changes will only -be noticed when a new encode is started. - - -
-
- -
- - -
diff --git a/dvdomatic.desktop.in b/dvdomatic.desktop.in deleted file mode 100644 index 65067eb3b..000000000 --- a/dvdomatic.desktop.in +++ /dev/null @@ -1,10 +0,0 @@ -[Desktop Entry] -Encoding=UTF-8 -Version=1.0 -Type=Application -Terminal=false -Exec=@PREFIX@/bin/dvdomatic -Name=DVD-o-matic -Icon=dvdomatic -Comment=DCP generator -Categories=AudioVideo;Video diff --git a/hacks/python-playback/config.py b/hacks/python-playback/config.py deleted file mode 100644 index fecf261f5..000000000 --- a/hacks/python-playback/config.py +++ /dev/null @@ -1,2 +0,0 @@ - -LEFT_SCREEN_WIDTH = 1366 diff --git a/hacks/python-playback/dvdomatic b/hacks/python-playback/dvdomatic deleted file mode 100755 index ce405f37e..000000000 --- a/hacks/python-playback/dvdomatic +++ /dev/null @@ -1,209 +0,0 @@ -#!/usr/bin/python - -import os -import operator -import traceback -import pygtk -pygtk.require('2.0') -import gtk -import glib -import gobject -import film -import film_view -import player -import screens -import thumbs -import ratio -import util - -FILM_DIRECTORY = '/home/carl/DVD' - -current_player = None -films = [] -inhibit_selection_update = False - -def find_films(): - global films - films = [] - for root, dirs, files in os.walk(FILM_DIRECTORY): - for name in files: - if os.path.basename(name) == 'info': - films.append(film.Film(os.path.join(root, os.path.dirname(name)))) - - films.sort(key = operator.attrgetter('name')) - -def update_film_store(): - global film_store - global films - global inhibit_selection_update - inhibit_selection_update = True - film_store.clear() - for f in films: - film_store.append([f.name]) - inhibit_selection_update = False - -def update_screen_store(screen_store, screens): - screen_store.clear() - for s in screens.screens: - screen_store.append([s.name]) - -def create_film_tree_view(film_store): - view = gtk.TreeView(film_store) - column = gtk.TreeViewColumn() - view.append_column(column) - cell = gtk.CellRendererText() - column.pack_start(cell) - column.add_attribute(cell, 'text', 0) - view.get_selection().set_mode(gtk.SELECTION_SINGLE) - return view - -def create_screen_view(screen_store): - view = gtk.TreeView(screen_store) - column = gtk.TreeViewColumn() - view.append_column(column) - cell = gtk.CellRendererText() - column.pack_start(cell) - column.add_attribute(cell, 'text', 0) - view.get_selection().set_mode(gtk.SELECTION_SINGLE) - return view - -def get_selected_film(): - (model, iter) = film_tree_view.get_selection().get_selected() - - for f in films: - if f.name == model.get(iter, 0)[0]: - return f - - return None - -# @return Selected screen name -def get_selected_screen(): - (model, iter) = screen_view.get_selection().get_selected() - return model.get(iter, 0)[0] - -def film_selected(selection): - if inhibit_selection_update: - return - - film_view.set(get_selected_film()) - check_for_playability() - -def screen_selected(selection): - check_for_playability() - -def check_for_playability(): - f = get_selected_film() - if screens.get_format(get_selected_screen(), f.ratio) is not None: - play_button.set_label("Play") - play_button.set_sensitive(True) - else: - play_button.set_label("Cannot play: no setting for %s on screen %s" % (ratio.find(f.ratio).name(), get_selected_screen())) - play_button.set_sensitive(False) - -def update_status(s): - global current_player - if current_player is None: - s.set_text("Not playing") - return True - - position = current_player.time_pos - if position is None: - return True - position_hms = util.s_to_hms(position) - - length = current_player.length - if length is None: - return True - - remaining = length - position - remaining_hms = util.s_to_hms(remaining) - s.set_text("Playing: %d:%02d:%02d, %d:%02d:%02d remaining" % (position_hms[0], position_hms[1], position_hms[2], remaining_hms[0], remaining_hms[1], remaining_hms[2])) - return True - -def play_clicked(b): - global current_player - f = get_selected_film() - current_player = player.get_player(f, screens.get_format(get_selected_screen(), f.ratio)) - print current_player.args - -def stop_clicked(b): - global current_player - if current_player is not None: - current_player.stop() - current_player = None - -def add_film_clicked(b): - global films - c = gtk.FileChooserDialog("New Film", main_window, gtk.FILE_CHOOSER_ACTION_CREATE_FOLDER, (("Add", gtk.RESPONSE_OK))) - c.set_current_folder(FILM_DIRECTORY) - if c.run() == gtk.RESPONSE_OK: - f = film.Film() - f.data = c.get_filename() - f.name = os.path.basename(c.get_filename()) - f.write() - find_films() - update_film_store() - c.hide() - - for i in range(0, len(films)): - if films[i].name == f.name: - film_tree_view.get_selection().select_path((i, )) - -main_window = gtk.Window(gtk.WINDOW_TOPLEVEL) -main_window.set_title("DVD-o-matic") -main_window.maximize() - -main_hbox = gtk.HBox() -main_hbox.set_spacing(12) -main_hbox.set_border_width(12) -main_window.add(main_hbox) - -find_films() -film_view = film_view.FilmView(main_window) -screens = screens.Screens("screens") - -left_vbox = gtk.VBox() -left_vbox.set_spacing(12) -main_hbox.pack_start(left_vbox, False, False) -right_vbox = gtk.VBox() -right_vbox.set_spacing(12) -main_hbox.pack_start(right_vbox) - -film_store = gtk.ListStore(gobject.TYPE_STRING) -update_film_store() - -film_tree_view = create_film_tree_view(film_store) -left_vbox.pack_start(film_tree_view, True, True) -film_tree_view.get_selection().select_path((0, )) -film_tree_view.get_selection().connect("changed", film_selected) - -add_film_button = gtk.Button(stock = gtk.STOCK_ADD) -left_vbox.pack_start(add_film_button, False, False) -add_film_button.connect("clicked", add_film_clicked) - -screen_store = gtk.ListStore(gobject.TYPE_STRING) -update_screen_store(screen_store, screens) - -screen_view = create_screen_view(screen_store) -left_vbox.pack_start(screen_view, False, False) -screen_view.get_selection().select_path((0, )) -screen_view.get_selection().connect("changed", screen_selected) - -right_vbox.pack_start(film_view, False, False) -film_view.set(films[0]) - -play_button = gtk.Button("Play") -right_vbox.pack_start(play_button) -play_button.connect("clicked", play_clicked) - -stop_button = gtk.Button("Stop") -right_vbox.pack_start(stop_button) -stop_button.connect("clicked", stop_clicked) - -status = gtk.Label() -right_vbox.pack_start(status, False, False) -glib.timeout_add_seconds(1, update_status, status) - -check_for_playability() -main_window.show_all() -gtk.main() diff --git a/hacks/python-playback/film.py b/hacks/python-playback/film.py deleted file mode 100644 index 3ad128027..000000000 --- a/hacks/python-playback/film.py +++ /dev/null @@ -1,188 +0,0 @@ -import os -import subprocess -import shlex -import shutil -import player - -class Film: - def __init__(self, data = None): - # File or directory containing content - self.content = None - # True if content is in DVD format - self.dvd = False - # DVD title number - self.dvd_title = 1 - # Directory containing metadata - self.data = None - # Film name - self.name = None - # Number of pixels by which to crop the content from each edge - self.left_crop = 0 - self.top_crop = 0 - self.right_crop = 0 - self.bottom_crop = 0 - # Use deinterlacing filter - self.deinterlace = False - # Target ratio - self.ratio = 1.85 - # Audio stream ID to play - self.aid = None - - self.width = None - self.height = None - self.fps = None - self.length = None - - if data is not None: - self.data = data - f = open(os.path.join(self.data, 'info'), 'r') - while 1: - l = f.readline() - if l == '': - break - - d = l.strip() - - s = d.find(' ') - if s != -1: - key = d[:s] - value = d[s+1:] - - if key == 'name': - self.name = value - elif key == 'content': - self.content = value - elif key == 'dvd': - self.dvd = int(value) == 1 - elif key == 'dvd_title': - self.dvd_title = int(value) - elif key == 'left_crop': - self.left_crop = int(value) - elif key == 'top_crop': - self.top_crop = int(value) - elif key == 'right_crop': - self.right_crop = int(value) - elif key == 'bottom_crop': - self.bottom_crop = int(value) - elif key == 'deinterlace': - self.deinterlace = int(value) == 1 - elif key == 'ratio': - self.ratio = float(value) - elif key == 'aid': - self.aid = int(value) - elif key == 'width': - self.width = int(value) - elif key == 'height': - self.height = int(value) - elif key == 'fps': - self.fps = float(value) - elif key == 'length': - self.length = float(value) - - if self.width is None or self.height is None or self.fps is None or self.length is None: - self.update_content_metadata() - - def write(self): - try: - os.mkdir(self.data) - except OSError: - pass - - f = open(os.path.join(self.data, 'info'), 'w') - self.write_datum(f, 'name', self.name) - self.write_datum(f, 'content', self.content) - self.write_datum(f, 'dvd', int(self.dvd)) - self.write_datum(f, 'dvd_title', self.dvd_title) - self.write_datum(f, 'left_crop', self.left_crop) - self.write_datum(f, 'top_crop', self.top_crop) - self.write_datum(f, 'right_crop', self.right_crop) - self.write_datum(f, 'bottom_crop', self.bottom_crop) - self.write_datum(f, 'deinterlace', int(self.deinterlace)) - self.write_datum(f, 'ratio', self.ratio) - self.write_datum(f, 'aid', self.aid) - self.write_datum(f, 'width', self.width) - self.write_datum(f, 'height', self.height) - self.write_datum(f, 'fps', self.fps) - self.write_datum(f, 'length', self.length) - - def write_datum(self, f, key, value): - if value is not None: - print >>f,'%s %s' % (key, str(value)) - - def thumbs_dir(self): - t = os.path.join(self.data, 'thumbs') - - try: - os.mkdir(t) - except OSError: - pass - - return t - - def thumb(self, n): - return os.path.join(self.thumbs_dir(), str('%08d.png' % (n + 1))) - - def thumbs(self): - return len(os.listdir(self.thumbs_dir())) - - def remove_thumbs(self): - shutil.rmtree(self.thumbs_dir()) - - def make_thumbs(self): - num_thumbs = 128 - cl = self.player_command_line() - if self.length is not None: - sstep = self.length / num_thumbs - else: - sstep = 100 - cl.extra = '-vo png -frames %d -sstep %d -nosound' % (num_thumbs, sstep) - os.chdir(self.thumbs_dir()) - os.system(cl.get(True)) - - def set_dvd(self, d): - self.dvd = d - self.remove_thumbs() - - def set_dvd_title(self, t): - self.dvd_title = t - self.remove_thumbs() - - def set_content(self, c): - if c == self.content: - return - - self.content = c - self.update_content_metadata() - - def player_command_line(self): - cl = player.CommandLine() - cl.dvd = self.dvd - cl.dvd_title = self.dvd_title - cl.content = self.content - return cl - - def update_content_metadata(self): - if self.content is None: - return - - self.width = None - self.height = None - self.fps = None - self.length = None - - cl = self.player_command_line() - cl.extra = '-identify -vo null -ao null -frames 0' - text = subprocess.check_output(shlex.split(cl.get(True))).decode('utf-8') - lines = text.split('\n') - for l in lines: - s = l.strip() - b = s.split('=') - if len(b) == 2: - if b[0] == 'ID_VIDEO_WIDTH': - self.width = int(b[1]) - elif b[0] == 'ID_VIDEO_HEIGHT': - self.height = int(b[1]) - elif b[0] == 'ID_VIDEO_FPS': - self.fps = float(b[1]) - elif b[0] == 'ID_LENGTH': - self.length = float(b[1]) diff --git a/hacks/python-playback/film_view.py b/hacks/python-playback/film_view.py deleted file mode 100644 index c11b2e657..000000000 --- a/hacks/python-playback/film_view.py +++ /dev/null @@ -1,212 +0,0 @@ -import os -import pygtk -pygtk.require('2.0') -import gtk -import ratio -import util -import thumbs - -class FilmView(gtk.HBox): - def __init__(self, parent): - gtk.HBox.__init__(self) - - self.parent_window = parent - - self.inhibit_save = True - - self.table = gtk.Table() - self.pack_start(self.table, True, True) - - self.table.set_row_spacings(4) - self.table.set_col_spacings(12) - self.film_name = gtk.Entry() - self.ratio = gtk.combo_box_new_text() - for r in ratio.ratios: - self.ratio.append_text(r.name()) - self.content_file_radio = gtk.RadioButton() - self.content_file_radio.set_label("File") - self.content_file_chooser = gtk.FileChooserDialog("Content", self.parent_window, gtk.FILE_CHOOSER_ACTION_OPEN, (("Select", gtk.RESPONSE_OK))) - self.content_file_button = gtk.FileChooserButton(self.content_file_chooser) - self.content_folder_radio = gtk.RadioButton() - self.content_folder_radio.set_label("Folder") - self.content_folder_radio.set_group(self.content_file_radio) - self.content_folder_chooser = gtk.FileChooserDialog("Content", self.parent_window, gtk.FILE_CHOOSER_ACTION_SELECT_FOLDER, (("Select", gtk.RESPONSE_OK))) - self.content_folder_button = gtk.FileChooserButton(self.content_folder_chooser) - self.dvd = gtk.CheckButton("DVD") - self.dvd_title = gtk.SpinButton() - self.dvd_title.set_range(0, 32) - self.dvd_title.set_increments(1, 4) - self.deinterlace = gtk.CheckButton("Deinterlace") - self.left_crop = self.crop_spinbutton() - self.right_crop = self.crop_spinbutton() - self.top_crop = self.crop_spinbutton() - self.bottom_crop = self.crop_spinbutton() - - # Information about the content (immutable) - self.source_size = self.label() - self.fps = self.label() - self.length = self.label() - - # Buttons - self.thumbs_button = gtk.Button("Show Thumbnails") - - self.film_name.connect("changed", self.changed, self) - self.ratio.connect("changed", self.changed, self) - self.deinterlace.connect("toggled", self.changed, self) - self.thumbs_button.connect("clicked", self.thumbs_clicked, self) - self.content_file_radio.connect("toggled", self.content_radio_toggled, self) - self.content_folder_radio.connect("toggled", self.content_radio_toggled, self) - self.content_file_button.connect("file-set", self.content_file_chooser_file_set, self) - self.content_folder_button.connect("file-set", self.content_folder_chooser_file_set, self) - self.dvd.connect("toggled", self.changed, self) - self.dvd_title.connect("value-changed", self.changed, self) - - n = 0 - self.table.attach(self.label("Film"), 0, 1, n, n + 1) - self.table.attach(self.film_name, 1, 2, n, n + 1) - n += 1 - self.table.attach(self.label("Ratio"), 0, 1, n, n + 1) - self.table.attach(self.ratio, 1, 2, n, n + 1) - n += 1 - self.table.attach(self.label("Content"), 0, 1, n, n + 1) - b = gtk.HBox() - b.set_spacing(4) - b.pack_start(self.content_file_radio, False, False) - b.pack_start(self.content_file_button, True, True) - b.pack_start(self.content_folder_radio, False, False) - b.pack_start(self.content_folder_button, True, True) - self.table.attach(b, 1, 2, n, n + 1) - n += 1 - self.table.attach(self.dvd, 0, 2, n, n + 1) - n += 1 - self.table.attach(self.label("DVD title"), 0, 1, n, n + 1) - self.table.attach(self.dvd_title, 1, 2, n, n + 1) - n += 1 - self.table.attach(self.deinterlace, 0, 2, n, n + 1) - n += 1 - self.table.attach(self.label("Left Crop"), 0, 1, n, n + 1) - self.table.attach(self.left_crop, 1, 2, n, n + 1) - n += 1 - self.table.attach(self.label("Right Crop"), 0, 1, n, n + 1) - self.table.attach(self.right_crop, 1, 2, n, n + 1) - n += 1 - self.table.attach(self.label("Top Crop"), 0, 1, n, n + 1) - self.table.attach(self.top_crop, 1, 2, n, n + 1) - n += 1 - self.table.attach(self.label("Bottom Crop"), 0, 1, n, n + 1) - self.table.attach(self.bottom_crop, 1, 2, n, n + 1) - n += 1 - self.table.attach(self.label("Source size"), 0, 1, n, n + 1) - self.table.attach(self.source_size, 1, 2, n, n + 1) - n += 1 - self.table.attach(self.label("Frames per second"), 0, 1, n, n + 1) - self.table.attach(self.fps, 1, 2, n, n + 1) - n += 1 - self.table.attach(self.label("Length"), 0, 1, n, n + 1) - self.table.attach(self.length, 1, 2, n, n + 1) - - self.right_vbox = gtk.VBox() - self.pack_start(self.right_vbox, False, False) - - self.right_vbox.pack_start(self.thumbs_button, False, False) - - self.inhibit_save = False - - def set(self, film): - self.inhibit_save = True - - self.film = film - self.film_name.set_text(film.name) - self.ratio.set_active(ratio.ratio_to_index(film.ratio)) - if film.content is not None: - if os.path.isfile(film.content): - self.set_content_is_file(True) - self.content_file_button.set_filename(film.content) - else: - self.set_content_is_file(False) - self.content_folder_button.set_filename(film.content) - self.dvd.set_active(film.dvd) - self.dvd_title.set_value(film.dvd_title) - self.dvd_title.set_sensitive(film.dvd) - self.deinterlace.set_active(film.deinterlace) - self.left_crop.set_value(film.left_crop) - self.right_crop.set_value(film.right_crop) - self.top_crop.set_value(film.top_crop) - self.bottom_crop.set_value(film.bottom_crop) - - # Content information - if film.width is not None and film.height is not None: - self.source_size.set_text("%dx%d" % (film.width, film.height)) - else: - self.source_size.set_text("Unknown") - if film.fps is not None: - self.fps.set_text(str(film.fps)) - if film.length is not None: - self.length.set_text("%d:%02d:%02d" % util.s_to_hms(film.length)) - - self.inhibit_save = False - - def set_content_is_file(self, f): - self.content_file_button.set_sensitive(f) - self.content_folder_button.set_sensitive(not f) - self.content_file_radio.set_active(f) - self.content_folder_radio.set_active(not f) - - def label(self, text = ""): - l = gtk.Label(text) - l.set_alignment(0, 0.5) - return l - - def changed(self, a, b): - self.dvd_title.set_sensitive(self.dvd.get_active()) - self.save_film() - - def crop_spinbutton(self): - s = gtk.SpinButton() - s.set_range(0, 1024) - s.set_increments(1, 16) - s.connect("value-changed", self.changed, self) - return s - - def save_film(self): - if self.inhibit_save: - return - - self.film.name = self.film_name.get_text() - self.film.ratio = ratio.index_to_ratio(self.ratio.get_active()).ratio - - if self.content_file_radio.get_active(): - self.film.set_content(self.content_file_button.get_filename()) - else: - self.film.set_content(self.content_folder_button.get_filename()) - self.film.set_dvd(self.dvd.get_active()) - self.film.set_dvd_title(self.dvd_title.get_value_as_int()) - self.film.deinterlace = self.deinterlace.get_active() - self.film.left_crop = self.left_crop.get_value_as_int() - self.film.right_crop = self.right_crop.get_value_as_int() - self.film.top_crop = self.top_crop.get_value_as_int() - self.film.bottom_crop = self.bottom_crop.get_value_as_int() - self.film.write() - - def thumbs_clicked(self, a, b): - if self.film.thumbs() == 0: - self.film.make_thumbs() - - t = thumbs.Thumbs(self.film) - t.run() - t.hide() - self.left_crop.set_value(t.left_crop()) - self.right_crop.set_value(t.right_crop()) - self.top_crop.set_value(t.top_crop()) - self.bottom_crop.set_value(t.bottom_crop()) - - def content_file_chooser_file_set(self, a, b): - self.changed(a, b) - - def content_folder_chooser_file_set(self, a, b): - self.changed(a, b) - - def content_radio_toggled(self, a, b): - self.set_content_is_file(self.content_file_radio.get_active()) - self.changed(a, b) - diff --git a/hacks/python-playback/player.py b/hacks/python-playback/player.py deleted file mode 100644 index 5cc8da711..000000000 --- a/hacks/python-playback/player.py +++ /dev/null @@ -1,112 +0,0 @@ -import os -import threading -import subprocess -import shlex -import select -import film -import config -import mplayer - -class CommandLine: - def __init__(self): - self.position_x = 0 - self.position_y = 0 - self.output_width = None - self.output_height = None - self.mov = False - self.delay = None - self.dvd = False - self.dvd_title = 1 - self.content = None - self.extra = '' - self.crop_x = None - self.crop_y = None - self.crop_w = None - self.crop_h = None - self.deinterlace = False - self.aid = None - - def get(self, with_binary): - # hqdn3d? - # nr, unsharp? - # -vo x11 appears to be necessary to prevent unwanted hardware scaling - # -noaspect stops mplayer rescaling to the movie's specified aspect ratio - args = '-vo x11 -noaspect -ao pulse -noborder -noautosub -nosub -sws 10 ' - args += '-geometry %d:%d ' % (self.position_x, self.position_y) - - # Video filters (passed to -vf) - - filters = [] - - if self.crop_x is not None or self.crop_y is not None or self.crop_w is not None or self.crop_h is not None: - crop = 'crop=' - if self.crop_w is not None and self.crop_h is not None: - crop += '%d:%d' % (self.crop_w, self.crop_h) - if self.crop_x is not None and self.crop_x is not None: - crop += ':%d:%d' % (self.crop_x, self.crop_y) - filters.append(crop) - - if self.output_width is not None or self.output_height is not None: - filters.append('scale=%d:%d' % (self.output_width, self.output_height)) - - # Post processing - pp = [] - if self.deinterlace: - pp.append('lb') - - # Deringing filter - pp.append('dr') - - if len(pp) > 0: - pp_string = 'pp=' - for i in range(0, len(pp)): - pp_string += pp[i] - if i < len(pp) - 1: - pp += ',' - - filters.append(pp_string) - - if len(filters) > 0: - args += '-vf ' - for i in range(0, len(filters)): - args += filters[i] - if i < len(filters) - 1: - args += ',' - args += ' ' - - if self.mov: - args += '-demuxer mov ' - if self.delay is not None: - args += '-delay %f ' % float(args.delay) - if self.aid is not None: - args += '-aid %s ' % self.aid - - args += self.extra - - if self.dvd: - data_specifier = 'dvd://%d -dvd-device \"%s\"' % (self.dvd_title, self.content) - else: - data_specifier = '\"%s\"' % self.content - - if with_binary: - return 'mplayer %s %s' % (args, data_specifier) - - return '%s %s' % (args, data_specifier) - -def get_player(film, format): - cl = CommandLine() - cl.dvd = film.dvd - cl.dvd_title = film.dvd_title - cl.content = film.content - cl.crop_w = film.width - film.left_crop - film.right_crop - cl.crop_h = film.height - film.top_crop - film.bottom_crop - cl.position_x = format.x - if format.external: - cl.position_x = format.x + config.LEFT_SCREEN_WIDTH - cl.position_y = format.y - cl.output_width = format.width - cl.output_height = format.height - cl.deinterlace = film.deinterlace - cl.aid = film.aid - return mplayer.Player(cl.get(False)) - diff --git a/hacks/python-playback/ratio.py b/hacks/python-playback/ratio.py deleted file mode 100644 index 62320dc8a..000000000 --- a/hacks/python-playback/ratio.py +++ /dev/null @@ -1,56 +0,0 @@ -# Class to describe a Ratio, and a collection of common -# (and not-so-common) film ratios collected from Wikipedia. - -class Ratio: - def __init__(self, ratio, nickname = None): - self.nickname = nickname - self.ratio = ratio - - # @return presentation name of this ratio - def name(self): - if self.nickname is not None: - return "%.2f (%s)" % (self.ratio, self.nickname) - - return "%.2f" % self.ratio - -ratios = [] -ratios.append(Ratio(1.33, '4:3')) -ratios.append(Ratio(1.37, 'Academy')) -ratios.append(Ratio(1.78, '16:9')) -ratios.append(Ratio(1.85, 'Flat / widescreen')) -ratios.append(Ratio(2.39, 'CinemaScope / Panavision')) -ratios.append(Ratio(1.15, 'Movietone')) -ratios.append(Ratio(1.43, 'IMAX')) -ratios.append(Ratio(1.5)) -ratios.append(Ratio(1.56, '14:9')) -ratios.append(Ratio(1.6, '16:10')) -ratios.append(Ratio(1.67)) -ratios.append(Ratio(2, 'SuperScope')) -ratios.append(Ratio(2.2, 'Todd-AO')) -ratios.append(Ratio(2.35, 'Early CinemaScope / Panavision')) -ratios.append(Ratio(2.37, '21:9')) -ratios.append(Ratio(2.55, 'CinemaScope 55')) -ratios.append(Ratio(2.59, 'Cinerama')) -ratios.append(Ratio(2.76, 'Ultra Panavision')) -ratios.append(Ratio(2.93, 'MGM Camera 65')) -ratios.append(Ratio(4, 'Polyvision')) - -# Find a Ratio object from a fractional ratio -def find(ratio): - for r in ratios: - if r.ratio == ratio: - return r - - return None - -# @return the ith ratio -def index_to_ratio(i): - return ratios[i] - -# @return the index within the ratios list of a given fractional ratio -def ratio_to_index(r): - for i in range(0, len(ratios)): - if ratios[i].ratio == r: - return i - - return None diff --git a/hacks/python-playback/screens b/hacks/python-playback/screens deleted file mode 100644 index f389cb1c4..000000000 --- a/hacks/python-playback/screens +++ /dev/null @@ -1,62 +0,0 @@ -# Screen 1 (untested) -screen 1 -ratio 1.85 -x 175 -y 100 -width 1550 -height 950 -external 1 -ratio 2.39 -x 0 -y 200 -width 2000 -height 860 -external 1 - -# Screen 2 -screen 2 -ratio 1.85 -x 175 -y 100 -width 1550 -height 950 -external 1 -ratio 2.39 -x 0 -y 200 -width 2000 -height 860 -external 1 - -# Screen 3 (untested) -screen 3 -ratio 1.85 -x 175 -y 100 -width 1550 -height 950 -external 1 -ratio 2.39 -x 0 -y 200 -width 2000 -height 860 -external 1 - -# Carl's Laptop -screen laptop -ratio 1.85 -x 0 -y 0 -width 1366 -height 738 -ratio 2.39 -x 0 -y 0 -width 1366 -height 572 -ratio 1.78 -x 0 -y 0 -width 1366 -height 767 diff --git a/hacks/python-playback/screens.py b/hacks/python-playback/screens.py deleted file mode 100644 index 4230a4cf8..000000000 --- a/hacks/python-playback/screens.py +++ /dev/null @@ -1,85 +0,0 @@ -#!/usr/bin/python - -class Screen: - def __init__(self): - self.name = None - self.formats = [] - -class Format: - def __init__(self): - self.ratio = None - self.x = None - self.y = None - self.width = None - self.height = None - self.external = False - -class Screens: - def __init__(self, file): - - self.screens = [] - - f = open(file, 'r') - current_screen = None - current_format = None - while 1: - l = f.readline() - if l == '': - break - if len(l) > 0 and l[0] == '#': - continue - - s = l.strip() - - if len(s) == 0: - continue - - b = s.split() - - if len(b) != 2: - print "WARNING: ignored line `%s' in screens file" % (s) - continue - - if b[0] == 'screen': - if current_format is not None: - current_screen.formats.append(current_format) - current_format = None - - if current_screen is not None: - self.screens.append(current_screen) - current_screen = None - - current_screen = Screen() - current_screen.name = b[1] - elif b[0] == 'ratio': - if current_format is not None: - current_screen.formats.append(current_format) - current_format = None - - current_format = Format() - current_format.ratio = float(b[1]) - elif b[0] == 'x': - current_format.x = int(b[1]) - elif b[0] == 'y': - current_format.y = int(b[1]) - elif b[0] == 'width': - current_format.width = int(b[1]) - elif b[0] == 'height': - current_format.height = int(b[1]) - elif b[0] == 'external': - current_format.external = int(b[1]) == 1 - - if current_format is not None: - current_screen.formats.append(current_format) - - if current_screen is not None: - self.screens.append(current_screen) - - def get_format(self, screen, ratio): - for s in self.screens: - if s.name == screen: - for f in s.formats: - if f.ratio == ratio: - return f - - return None diff --git a/hacks/python-playback/thumbs.py b/hacks/python-playback/thumbs.py deleted file mode 100644 index 921f82f5d..000000000 --- a/hacks/python-playback/thumbs.py +++ /dev/null @@ -1,76 +0,0 @@ -# GUI to display thumbnails and allow cropping -# to be set up - -import os -import sys -import pygtk -pygtk.require('2.0') -import gtk -import film -import player - -class Thumbs(gtk.Dialog): - def __init__(self, film): - gtk.Dialog.__init__(self) - self.film = film - self.controls = gtk.Table() - self.controls.set_col_spacings(4) - self.thumb_adj = gtk.Adjustment(0, 0, self.film.thumbs() - 1, 1, 10) - self.add_control("Thumbnail", self.thumb_adj, 0) - self.left_crop_adj = gtk.Adjustment(self.film.left_crop, 0, 1024, 1, 128) - self.add_control("Left crop", self.left_crop_adj, 1) - self.right_crop_adj = gtk.Adjustment(self.film.right_crop, 0, 1024, 1, 128) - self.add_control("Right crop", self.right_crop_adj, 2) - self.top_crop_adj = gtk.Adjustment(self.film.top_crop, 0, 1024, 1, 128) - self.add_control("Top crop", self.top_crop_adj, 3) - self.bottom_crop_adj = gtk.Adjustment(self.film.bottom_crop, 0, 1024, 1, 128) - self.add_control("Bottom crop", self.bottom_crop_adj, 4) - self.display_image = gtk.Image() - self.update_display() - window_box = gtk.HBox() - window_box.set_spacing(12) - - controls_vbox = gtk.VBox() - controls_vbox.set_spacing(4) - controls_vbox.pack_start(self.controls, False, False) - - window_box.pack_start(controls_vbox, True, True) - window_box.pack_start(self.display_image) - - self.set_title("%s Thumbnails" % film.name) - self.get_content_area().add(window_box) - self.add_button("Close", gtk.RESPONSE_ACCEPT) - self.show_all() - - for a in [self.thumb_adj, self.left_crop_adj, self.right_crop_adj, self.top_crop_adj, self.bottom_crop_adj]: - a.connect('value-changed', self.update_display, self) - - def add_control(self, name, adj, n): - l = gtk.Label(name) - l.set_alignment(1, 0.5) - self.controls.attach(l, 0, 1, n, n + 1) - s = gtk.SpinButton(adj) - self.controls.attach(s, 1, 2, n, n + 1) - - def update_display(self, a = None, b = None): - thumb_pixbuf = gtk.gdk.pixbuf_new_from_file(self.film.thumb(self.thumb_adj.get_value())) - self.width = thumb_pixbuf.get_width() - self.height = thumb_pixbuf.get_height() - left = self.left_crop() - right = self.right_crop() - top = self.top_crop() - bottom = self.bottom_crop() - pixbuf = thumb_pixbuf.subpixbuf(left, top, self.width - left - right, self.height - top - bottom) - self.display_image.set_from_pixbuf(pixbuf) - - def top_crop(self): - return int(self.top_crop_adj.get_value()) - - def bottom_crop(self): - return int(self.bottom_crop_adj.get_value()) - - def left_crop(self): - return int(self.left_crop_adj.get_value()) - - def right_crop(self): - return int(self.right_crop_adj.get_value()) diff --git a/hacks/python-playback/util.py b/hacks/python-playback/util.py deleted file mode 100644 index d78abdd00..000000000 --- a/hacks/python-playback/util.py +++ /dev/null @@ -1,7 +0,0 @@ - -def s_to_hms(s): - m = int(s / 60) - s -= (m * 60) - h = int(m / 60) - m -= (h * 60) - return (h, m, s) diff --git a/hacks/python-playback/xrandr-notes b/hacks/python-playback/xrandr-notes deleted file mode 100644 index eeabf1423..000000000 --- a/hacks/python-playback/xrandr-notes +++ /dev/null @@ -1,17 +0,0 @@ -Recommended 1680 x 1050, 60 fps -xrandr --output HDMI1 --mode 0xbc - -List modes -xrandr --verbose -q - -2048 x 1024, 24 fps -xrandr --output HDMI1 --mode 0xd1 - -cvt -to give modeline, then -xrandr --newmode modeline -then add -xrandr --verbose --addmode HDMI1 modename -then activate -xrandr --output HDMI1 --mode foo - diff --git a/icons/128x128/dvdomatic.png b/icons/128x128/dvdomatic.png deleted file mode 100644 index 9936b39af..000000000 Binary files a/icons/128x128/dvdomatic.png and /dev/null differ diff --git a/icons/16x16/dvdomatic.png b/icons/16x16/dvdomatic.png deleted file mode 100644 index 3c5a10f2d..000000000 Binary files a/icons/16x16/dvdomatic.png and /dev/null differ diff --git a/icons/22x22/dvdomatic.png b/icons/22x22/dvdomatic.png deleted file mode 100644 index dddb86298..000000000 Binary files a/icons/22x22/dvdomatic.png and /dev/null differ diff --git a/icons/32x32/dvdomatic.png b/icons/32x32/dvdomatic.png deleted file mode 100644 index 8cecf08f8..000000000 Binary files a/icons/32x32/dvdomatic.png and /dev/null differ diff --git a/icons/48x48/dvdomatic.png b/icons/48x48/dvdomatic.png deleted file mode 100644 index 07bf2d10b..000000000 Binary files a/icons/48x48/dvdomatic.png and /dev/null differ diff --git a/icons/64x64/dvdomatic.png b/icons/64x64/dvdomatic.png deleted file mode 100644 index 35564a8a2..000000000 Binary files a/icons/64x64/dvdomatic.png and /dev/null differ diff --git a/run/dvdomatic b/run/dvdomatic deleted file mode 100755 index dbc63d44a..000000000 --- a/run/dvdomatic +++ /dev/null @@ -1,15 +0,0 @@ -#!/bin/bash - -export LD_LIBRARY_PATH=build/src/lib:build/src/wx:build/src/asdcplib/src:$LD_LIBRARY_PATH -if [ "$1" == "--debug" ]; then - shift - gdb --args build/src/tools/dvdomatic $* -elif [ "$1" == "--valgrind" ]; then - shift - valgrind --tool="memcheck" build/src/tools/dvdomatic $* -elif [ "$1" == "--i18n" ]; then - shift - LANGUAGE=fr_FR.UTF8 LANG=fr_FR.UTF8 build/src/tools/dvdomatic "$*" -else - build/src/tools/dvdomatic $* -fi diff --git a/src/lib/audio_analysis.h b/src/lib/audio_analysis.h index 6e0e2b78a..ec6905105 100644 --- a/src/lib/audio_analysis.h +++ b/src/lib/audio_analysis.h @@ -17,8 +17,8 @@ */ -#ifndef DVDOMATIC_AUDIO_ANALYSIS_H -#define DVDOMATIC_AUDIO_ANALYSIS_H +#ifndef DCPOMATIC_AUDIO_ANALYSIS_H +#define DCPOMATIC_AUDIO_ANALYSIS_H #include #include diff --git a/src/lib/audio_content.h b/src/lib/audio_content.h index dbd55943d..2362786d9 100644 --- a/src/lib/audio_content.h +++ b/src/lib/audio_content.h @@ -17,8 +17,8 @@ */ -#ifndef DVDOMATIC_AUDIO_CONTENT_H -#define DVDOMATIC_AUDIO_CONTENT_H +#ifndef DCPOMATIC_AUDIO_CONTENT_H +#define DCPOMATIC_AUDIO_CONTENT_H #include "content.h" #include "util.h" diff --git a/src/lib/audio_decoder.h b/src/lib/audio_decoder.h index 24e2796ae..418fc6da2 100644 --- a/src/lib/audio_decoder.h +++ b/src/lib/audio_decoder.h @@ -21,8 +21,8 @@ * @brief Parent class for audio decoders. */ -#ifndef DVDOMATIC_AUDIO_DECODER_H -#define DVDOMATIC_AUDIO_DECODER_H +#ifndef DCPOMATIC_AUDIO_DECODER_H +#define DCPOMATIC_AUDIO_DECODER_H #include "audio_source.h" #include "decoder.h" diff --git a/src/lib/audio_mapping.h b/src/lib/audio_mapping.h index 4f2cdb7f8..248d2570e 100644 --- a/src/lib/audio_mapping.h +++ b/src/lib/audio_mapping.h @@ -17,8 +17,8 @@ */ -#ifndef DVDOMATIC_AUDIO_MAPPING_H -#define DVDOMATIC_AUDIO_MAPPING_H +#ifndef DCPOMATIC_AUDIO_MAPPING_H +#define DCPOMATIC_AUDIO_MAPPING_H #include #include diff --git a/src/lib/audio_sink.h b/src/lib/audio_sink.h index 11d578a60..085491657 100644 --- a/src/lib/audio_sink.h +++ b/src/lib/audio_sink.h @@ -17,8 +17,8 @@ */ -#ifndef DVDOMATIC_AUDIO_SINK_H -#define DVDOMATIC_AUDIO_SINK_H +#ifndef DCPOMATIC_AUDIO_SINK_H +#define DCPOMATIC_AUDIO_SINK_H class AudioSink { diff --git a/src/lib/audio_source.h b/src/lib/audio_source.h index 5a1510d3c..ee5c606dc 100644 --- a/src/lib/audio_source.h +++ b/src/lib/audio_source.h @@ -21,8 +21,8 @@ * @brief Parent class for classes which emit audio data. */ -#ifndef DVDOMATIC_AUDIO_SOURCE_H -#define DVDOMATIC_AUDIO_SOURCE_H +#ifndef DCPOMATIC_AUDIO_SOURCE_H +#define DCPOMATIC_AUDIO_SOURCE_H #include diff --git a/src/lib/config.cc b/src/lib/config.cc index 2defa0539..354940b1c 100644 --- a/src/lib/config.cc +++ b/src/lib/config.cc @@ -155,9 +155,9 @@ Config::file (bool old) const boost::filesystem::path p; p /= g_get_user_config_dir (); if (old) { - p /= ".dvdomatic"; + p /= ".dcpomatic"; } else { - p /= ".dvdomatic.xml"; + p /= ".dcpomatic.xml"; } return p.string (); } diff --git a/src/lib/config.h b/src/lib/config.h index 13d36d236..57f4fb8a9 100644 --- a/src/lib/config.h +++ b/src/lib/config.h @@ -21,8 +21,8 @@ * @brief Class holding configuration. */ -#ifndef DVDOMATIC_CONFIG_H -#define DVDOMATIC_CONFIG_H +#ifndef DCPOMATIC_CONFIG_H +#define DCPOMATIC_CONFIG_H #include #include diff --git a/src/lib/content.h b/src/lib/content.h index c8aa6b0e0..d39fc9e1a 100644 --- a/src/lib/content.h +++ b/src/lib/content.h @@ -17,8 +17,8 @@ */ -#ifndef DVDOMATIC_CONTENT_H -#define DVDOMATIC_CONTENT_H +#ifndef DCPOMATIC_CONTENT_H +#define DCPOMATIC_CONTENT_H #include #include diff --git a/src/lib/cross.cc b/src/lib/cross.cc index 2c66ab53a..f232f1779 100644 --- a/src/lib/cross.cc +++ b/src/lib/cross.cc @@ -18,20 +18,20 @@ */ #include "cross.h" -#ifdef DVDOMATIC_POSIX +#ifdef DCPOMATIC_POSIX #include #endif -#ifdef DVDOMATIC_WINDOWS +#ifdef DCPOMATIC_WINDOWS #include "windows.h" #endif void -dvdomatic_sleep (int s) +dcpomatic_sleep (int s) { -#ifdef DVDOMATIC_POSIX +#ifdef DCPOMATIC_POSIX sleep (s); #endif -#ifdef DVDOMATIC_WINDOWS +#ifdef DCPOMATIC_WINDOWS Sleep (s * 1000); #endif } diff --git a/src/lib/cross.h b/src/lib/cross.h index 110660b16..00457c968 100644 --- a/src/lib/cross.h +++ b/src/lib/cross.h @@ -17,8 +17,8 @@ */ -#ifdef DVDOMATIC_WINDOWS +#ifdef DCPOMATIC_WINDOWS #define WEXITSTATUS(w) (w) #endif -void dvdomatic_sleep (int); +void dcpomatic_sleep (int); diff --git a/src/lib/dci_metadata.h b/src/lib/dci_metadata.h index f61dae5a8..b87609ed0 100644 --- a/src/lib/dci_metadata.h +++ b/src/lib/dci_metadata.h @@ -17,8 +17,8 @@ */ -#ifndef DVDOMATIC_DCI_METADATA_H -#define DVDOMATIC_DCI_METADATA_H +#ifndef DCPOMATIC_DCI_METADATA_H +#define DCPOMATIC_DCI_METADATA_H #include #include diff --git a/src/lib/dcp_content_type.h b/src/lib/dcp_content_type.h index 960bb0129..14204bd72 100644 --- a/src/lib/dcp_content_type.h +++ b/src/lib/dcp_content_type.h @@ -17,8 +17,8 @@ */ -#ifndef DVDOMATIC_DCP_CONTENT_TYPE_H -#define DVDOMATIC_DCP_CONTENT_TYPE_H +#ifndef DCPOMATIC_DCP_CONTENT_TYPE_H +#define DCPOMATIC_DCP_CONTENT_TYPE_H /** @file src/content_type.h * @brief A description of the type of content for a DCP (e.g. feature, trailer etc.) diff --git a/src/lib/dcp_video_frame.cc b/src/lib/dcp_video_frame.cc index e9499871a..da51665d1 100644 --- a/src/lib/dcp_video_frame.cc +++ b/src/lib/dcp_video_frame.cc @@ -266,7 +266,7 @@ DCPVideoFrame::encode_locally () _parameters->tcp_numlayers++; _parameters->cp_disto_alloc = 1; _parameters->cp_rsiz = CINEMA2K; - _parameters->cp_comment = strdup (N_("DVD-o-matic")); + _parameters->cp_comment = strdup (N_("DCP-o-matic")); _parameters->cp_cinema = CINEMA2K_24; /* 3 components, so use MCT */ diff --git a/src/lib/decoder.h b/src/lib/decoder.h index 0fffef257..72b866ffe 100644 --- a/src/lib/decoder.h +++ b/src/lib/decoder.h @@ -21,8 +21,8 @@ * @brief Parent class for decoders of content. */ -#ifndef DVDOMATIC_DECODER_H -#define DVDOMATIC_DECODER_H +#ifndef DCPOMATIC_DECODER_H +#define DCPOMATIC_DECODER_H #include #include diff --git a/src/lib/encoder.cc b/src/lib/encoder.cc index b897c8a31..a8e3547a1 100644 --- a/src/lib/encoder.cc +++ b/src/lib/encoder.cc @@ -423,7 +423,7 @@ Encoder::encoder_thread (ServerDescription* server) } if (remote_backoff > 0) { - dvdomatic_sleep (remote_backoff); + dcpomatic_sleep (remote_backoff); } lock.lock (); diff --git a/src/lib/encoder.h b/src/lib/encoder.h index 70e6eea9a..56007fd48 100644 --- a/src/lib/encoder.h +++ b/src/lib/encoder.h @@ -17,8 +17,8 @@ */ -#ifndef DVDOMATIC_ENCODER_H -#define DVDOMATIC_ENCODER_H +#ifndef DCPOMATIC_ENCODER_H +#define DCPOMATIC_ENCODER_H /** @file src/encoder.h * @brief Encoder to J2K and WAV for DCP. diff --git a/src/lib/exceptions.h b/src/lib/exceptions.h index 6920556e5..6bad7c924 100644 --- a/src/lib/exceptions.h +++ b/src/lib/exceptions.h @@ -17,8 +17,8 @@ */ -#ifndef DVDOMATIC_EXCEPTIONS_H -#define DVDOMATIC_EXCEPTIONS_H +#ifndef DCPOMATIC_EXCEPTIONS_H +#define DCPOMATIC_EXCEPTIONS_H /** @file src/exceptions.h * @brief Our exceptions. diff --git a/src/lib/ffmpeg_content.h b/src/lib/ffmpeg_content.h index b49e5790e..8bf4d42a5 100644 --- a/src/lib/ffmpeg_content.h +++ b/src/lib/ffmpeg_content.h @@ -17,8 +17,8 @@ */ -#ifndef DVDOMATIC_FFMPEG_CONTENT_H -#define DVDOMATIC_FFMPEG_CONTENT_H +#ifndef DCPOMATIC_FFMPEG_CONTENT_H +#define DCPOMATIC_FFMPEG_CONTENT_H #include #include "video_content.h" diff --git a/src/lib/film.cc b/src/lib/film.cc index 6ab6551da..67605ffca 100644 --- a/src/lib/film.cc +++ b/src/lib/film.cc @@ -254,7 +254,7 @@ Film::make_dcp () throw BadSettingError (_("name"), _("cannot contain slashes")); } - log()->log (String::compose ("DVD-o-matic %1 git %2 using %3", dvdomatic_version, dvdomatic_git_commit, dependency_version_summary())); + log()->log (String::compose ("DCP-o-matic %1 git %2 using %3", dcpomatic_version, dcpomatic_git_commit, dependency_version_summary())); { char buffer[128]; @@ -270,10 +270,10 @@ 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())); -#ifdef DVDOMATIC_DEBUG - log()->log ("DVD-o-matic built in debug mode."); +#ifdef DCPOMATIC_DEBUG + log()->log ("DCP-o-matic built in debug mode."); #else - log()->log ("DVD-o-matic built in optimised mode."); + log()->log ("DCP-o-matic built in optimised mode."); #endif #ifdef LIBDCP_DEBUG log()->log ("libdcp built in debug mode."); @@ -432,7 +432,7 @@ Film::read_metadata () boost::mutex::scoped_lock lm (_state_mutex); if (boost::filesystem::exists (file ("metadata")) && !boost::filesystem::exists (file ("metadata.xml"))) { - throw StringError (_("This film was created with an older version of DVD-o-matic, and unfortunately it cannot be loaded into this version. You will need to create a new Film, re-add your content and set it up again. Sorry!")); + throw StringError (_("This film was created with an older version of DCP-o-matic, and unfortunately it cannot be loaded into this version. You will need to create a new Film, re-add your content and set it up again. Sorry!")); } cxml::File f (file ("metadata.xml"), "Metadata"); diff --git a/src/lib/film.h b/src/lib/film.h index 4d994996e..ffa5d0690 100644 --- a/src/lib/film.h +++ b/src/lib/film.h @@ -22,8 +22,8 @@ * how they should be presented in a DCP. */ -#ifndef DVDOMATIC_FILM_H -#define DVDOMATIC_FILM_H +#ifndef DCPOMATIC_FILM_H +#define DCPOMATIC_FILM_H #include #include @@ -336,7 +336,7 @@ private: /** Mutex for _directory */ mutable boost::mutex _directory_mutex; - /** Name for DVD-o-matic */ + /** Name for DCP-o-matic */ std::string _name; /** True if a auto-generated DCI-compliant name should be used for our DCP */ bool _use_dci_name; diff --git a/src/lib/filter.h b/src/lib/filter.h index 205d92482..7587312c2 100644 --- a/src/lib/filter.h +++ b/src/lib/filter.h @@ -21,8 +21,8 @@ * @brief A class to describe one of FFmpeg's video or post-processing filters. */ -#ifndef DVDOMATIC_FILTER_H -#define DVDOMATIC_FILTER_H +#ifndef DCPOMATIC_FILTER_H +#define DCPOMATIC_FILTER_H #include #include diff --git a/src/lib/filter_graph.h b/src/lib/filter_graph.h index db86a677d..1ff5527ab 100644 --- a/src/lib/filter_graph.h +++ b/src/lib/filter_graph.h @@ -21,8 +21,8 @@ * @brief A graph of FFmpeg filters. */ -#ifndef DVDOMATIC_FILTER_GRAPH_H -#define DVDOMATIC_FILTER_GRAPH_H +#ifndef DCPOMATIC_FILTER_GRAPH_H +#define DCPOMATIC_FILTER_GRAPH_H #include "util.h" #include "ffmpeg_compatibility.h" diff --git a/src/lib/i18n.h b/src/lib/i18n.h index 46bb1d565..890313bc6 100644 --- a/src/lib/i18n.h +++ b/src/lib/i18n.h @@ -19,5 +19,5 @@ #include -#define _(x) dgettext ("libdvdomatic", x) +#define _(x) dgettext ("libdcpomatic", x) #define N_(x) x diff --git a/src/lib/image.h b/src/lib/image.h index 6b9ade99e..1d7d75dfc 100644 --- a/src/lib/image.h +++ b/src/lib/image.h @@ -21,8 +21,8 @@ * @brief A set of classes to describe video images. */ -#ifndef DVDOMATIC_IMAGE_H -#define DVDOMATIC_IMAGE_H +#ifndef DCPOMATIC_IMAGE_H +#define DCPOMATIC_IMAGE_H #include #include diff --git a/src/lib/job.cc b/src/lib/job.cc index ff0332d6d..2a4986f0d 100644 --- a/src/lib/job.cc +++ b/src/lib/job.cc @@ -87,7 +87,7 @@ Job::run_wrapper () set_state (FINISHED_ERROR); set_error ( e.what (), - _("It is not known what caused this error. The best idea is to report the problem to the DVD-o-matic mailing list (dvdomatic@carlh.net)") + _("It is not known what caused this error. The best idea is to report the problem to the DCP-o-matic mailing list (dcpomatic@carlh.net)") ); } catch (...) { @@ -96,7 +96,7 @@ Job::run_wrapper () set_state (FINISHED_ERROR); set_error ( _("Unknown error"), - _("It is not known what caused this error. The best idea is to report the problem to the DVD-o-matic mailing list (dvdomatic@carlh.net)") + _("It is not known what caused this error. The best idea is to report the problem to the DCP-o-matic mailing list (dcpomatic@carlh.net)") ); } diff --git a/src/lib/job.h b/src/lib/job.h index f5175c525..2119db2f3 100644 --- a/src/lib/job.h +++ b/src/lib/job.h @@ -21,8 +21,8 @@ * @brief A parent class to represent long-running tasks which are run in their own thread. */ -#ifndef DVDOMATIC_JOB_H -#define DVDOMATIC_JOB_H +#ifndef DCPOMATIC_JOB_H +#define DCPOMATIC_JOB_H #include #include diff --git a/src/lib/job_manager.cc b/src/lib/job_manager.cc index 910597628..f96275467 100644 --- a/src/lib/job_manager.cc +++ b/src/lib/job_manager.cc @@ -126,7 +126,7 @@ JobManager::scheduler () } } - dvdomatic_sleep (1); + dcpomatic_sleep (1); } } diff --git a/src/lib/log.h b/src/lib/log.h index 3a2cfcbfd..3ad6516c1 100644 --- a/src/lib/log.h +++ b/src/lib/log.h @@ -17,8 +17,8 @@ */ -#ifndef DVDOMATIC_LOG_H -#define DVDOMATIC_LOG_H +#ifndef DCPOMATIC_LOG_H +#define DCPOMATIC_LOG_H /** @file src/log.h * @brief A very simple logging class. diff --git a/src/lib/player.h b/src/lib/player.h index 8a82ab298..dbfde09a6 100644 --- a/src/lib/player.h +++ b/src/lib/player.h @@ -17,8 +17,8 @@ */ -#ifndef DVDOMATIC_PLAYER_H -#define DVDOMATIC_PLAYER_H +#ifndef DCPOMATIC_PLAYER_H +#define DCPOMATIC_PLAYER_H #include #include diff --git a/src/lib/po/es_ES.po b/src/lib/po/es_ES.po index 17051bd98..5c8d642e3 100644 --- a/src/lib/po/es_ES.po +++ b/src/lib/po/es_ES.po @@ -5,7 +5,7 @@ # msgid "" msgstr "" -"Project-Id-Version: LIBDVDOMATIC\n" +"Project-Id-Version: LIBDCPOMATIC\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2013-04-09 11:14+0100\n" "PO-Revision-Date: 2013-04-02 19:10-0500\n" @@ -250,10 +250,10 @@ msgstr "Horizontal deblocking filter A" #: src/lib/job.cc:92 src/lib/job.cc:101 msgid "" "It is not known what caused this error. The best idea is to report the " -"problem to the DVD-o-matic mailing list (dvdomatic@carlh.net)" +"problem to the DCP-o-matic mailing list (dcpomatic@carlh.net)" msgstr "" "Error desconocido. La mejor idea es informar del problema a la lista de " -"correo de DVD-O-matic (dvdomatic@carlh.net)" +"correo de DCP-o-matic (dcpomatic@carlh.net)" #: src/lib/filter.cc:82 msgid "Kernel deinterlacer" diff --git a/src/lib/po/fr_FR.po b/src/lib/po/fr_FR.po index d9d945b52..af6890d97 100644 --- a/src/lib/po/fr_FR.po +++ b/src/lib/po/fr_FR.po @@ -5,7 +5,7 @@ # msgid "" msgstr "" -"Project-Id-Version: DVD-o-matic FRENCH\n" +"Project-Id-Version: DCP-o-matic FRENCH\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2013-04-09 11:14+0100\n" "PO-Revision-Date: 2013-03-20 00:39+0100\n" @@ -248,10 +248,10 @@ msgstr "Filtre dé-bloc horizontal" #: src/lib/job.cc:92 src/lib/job.cc:101 msgid "" "It is not known what caused this error. The best idea is to report the " -"problem to the DVD-o-matic mailing list (dvdomatic@carlh.net)" +"problem to the DCP-o-matic mailing list (dcpomatic@carlh.net)" msgstr "" -"Erreur indéterminée. Merci de rapporter le problème à la liste DVD-o-matic " -"(dvdomatic@carlh.net)" +"Erreur indéterminée. Merci de rapporter le problème à la liste DCP-o-matic " +"(dcpomatic@carlh.net)" #: src/lib/filter.cc:82 msgid "Kernel deinterlacer" diff --git a/src/lib/po/it_IT.po b/src/lib/po/it_IT.po index 992eda107..c1ca26ea3 100644 --- a/src/lib/po/it_IT.po +++ b/src/lib/po/it_IT.po @@ -248,10 +248,10 @@ msgstr "Filtro A sblocco orizzontale" #: src/lib/job.cc:92 src/lib/job.cc:101 msgid "" "It is not known what caused this error. The best idea is to report the " -"problem to the DVD-o-matic mailing list (dvdomatic@carlh.net)" +"problem to the DCP-o-matic mailing list (dcpomatic@carlh.net)" msgstr "" "Non sappiamo cosa ha causato questo errore. La cosa migliore è inviare un " -"report del problema alla mailing list di DVD-o-matic (dvdomatic@carlh.net)" +"report del problema alla mailing list di DCP-o-matic (dcpomatic@carlh.net)" #: src/lib/filter.cc:82 msgid "Kernel deinterlacer" diff --git a/src/lib/po/sv_SE.po b/src/lib/po/sv_SE.po index d574261c8..c8695ce4d 100644 --- a/src/lib/po/sv_SE.po +++ b/src/lib/po/sv_SE.po @@ -5,7 +5,7 @@ # msgid "" msgstr "" -"Project-Id-Version: DVD-o-matic\n" +"Project-Id-Version: DCP-o-matic\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2013-04-09 11:14+0100\n" "PO-Revision-Date: 2013-04-09 10:13+0100\n" @@ -249,10 +249,10 @@ msgstr "Filter för horisontal kantighetsutjämning A" #: src/lib/job.cc:92 src/lib/job.cc:101 msgid "" "It is not known what caused this error. The best idea is to report the " -"problem to the DVD-o-matic mailing list (dvdomatic@carlh.net)" +"problem to the DCP-o-matic mailing list (dcpomatic@carlh.net)" msgstr "" "Det är inte känt vad som orsakade detta fel. Bästa sättet att rapportera " -"problemet är till DVD-o-matics mejl-lista (dvdomatic@carlh.net)" +"problemet är till DCP-o-matics mejl-lista (dcpomatic@carlh.net)" #: src/lib/filter.cc:82 msgid "Kernel deinterlacer" diff --git a/src/lib/processor.h b/src/lib/processor.h index 1ba396f2f..5dbafab7f 100644 --- a/src/lib/processor.h +++ b/src/lib/processor.h @@ -21,8 +21,8 @@ * @brief Parent class for classes which accept and then emit video or audio data. */ -#ifndef DVDOMATIC_PROCESSOR_H -#define DVDOMATIC_PROCESSOR_H +#ifndef DCPOMATIC_PROCESSOR_H +#define DCPOMATIC_PROCESSOR_H #include "video_source.h" #include "video_sink.h" diff --git a/src/lib/scaler.h b/src/lib/scaler.h index c80f4b7db..a736e92de 100644 --- a/src/lib/scaler.h +++ b/src/lib/scaler.h @@ -21,8 +21,8 @@ * @brief A class to describe one of FFmpeg's software scalers. */ -#ifndef DVDOMATIC_SCALER_H -#define DVDOMATIC_SCALER_H +#ifndef DCPOMATIC_SCALER_H +#define DCPOMATIC_SCALER_H #include #include diff --git a/src/lib/sound_processor.h b/src/lib/sound_processor.h index 2edf38840..bdbe72ba2 100644 --- a/src/lib/sound_processor.h +++ b/src/lib/sound_processor.h @@ -21,8 +21,8 @@ * @brief A class to describe a sound processor. */ -#ifndef DVDOMATIC_SOUND_PROCESSOR_H -#define DVDOMATIC_SOUND_PROCESSOR_H +#ifndef DCPOMATIC_SOUND_PROCESSOR_H +#define DCPOMATIC_SOUND_PROCESSOR_H #include #include diff --git a/src/lib/timer.h b/src/lib/timer.h index f509a7492..173d0d961 100644 --- a/src/lib/timer.h +++ b/src/lib/timer.h @@ -22,8 +22,8 @@ * @brief Some timing classes for debugging and profiling. */ -#ifndef DVDOMATIC_TIMER_H -#define DVDOMATIC_TIMER_H +#ifndef DCPOMATIC_TIMER_H +#define DCPOMATIC_TIMER_H #include #include diff --git a/src/lib/types.h b/src/lib/types.h index f821a74ac..c2bb9d853 100644 --- a/src/lib/types.h +++ b/src/lib/types.h @@ -17,8 +17,8 @@ */ -#ifndef DVDOMATIC_TYPES_H -#define DVDOMATIC_TYPES_H +#ifndef DCPOMATIC_TYPES_H +#define DCPOMATIC_TYPES_H #include #include diff --git a/src/lib/ui_signaller.h b/src/lib/ui_signaller.h index 221bcbe95..428ab698f 100644 --- a/src/lib/ui_signaller.h +++ b/src/lib/ui_signaller.h @@ -17,8 +17,8 @@ */ -#ifndef DVDOMATIC_UI_SIGNALLER_H -#define DVDOMATIC_UI_SIGNALLER_H +#ifndef DCPOMATIC_UI_SIGNALLER_H +#define DCPOMATIC_UI_SIGNALLER_H #include #include diff --git a/src/lib/util.cc b/src/lib/util.cc index 06da94294..ad08c6ab4 100644 --- a/src/lib/util.cc +++ b/src/lib/util.cc @@ -27,7 +27,7 @@ #include #include #include -#ifdef DVDOMATIC_POSIX +#ifdef DCPOMATIC_POSIX #include #include #endif @@ -148,7 +148,7 @@ seconds_to_approximate_hms (int s) return ap.str (); } -#ifdef DVDOMATIC_POSIX +#ifdef DCPOMATIC_POSIX /** @param l Mangled C++ identifier. * @return Demangled version. */ @@ -247,11 +247,11 @@ seconds (struct timeval t) return t.tv_sec + (double (t.tv_usec) / 1e6); } -/** Call the required functions to set up DVD-o-matic's static arrays, etc. +/** Call the required functions to set up DCP-o-matic's static arrays, etc. * Must be called from the UI thread, if there is one. */ void -dvdomatic_setup () +dcpomatic_setup () { avfilter_register_all (); @@ -264,7 +264,7 @@ dvdomatic_setup () ui_thread = boost::this_thread::get_id (); } -#ifdef DVDOMATIC_WINDOWS +#ifdef DCPOMATIC_WINDOWS boost::filesystem::path mo_path () { @@ -279,9 +279,9 @@ mo_path () #endif void -dvdomatic_setup_i18n (string lang) +dcpomatic_setup_i18n (string lang) { -#ifdef DVDOMATIC_POSIX +#ifdef DCPOMATIC_POSIX lang += ".UTF8"; #endif @@ -297,15 +297,15 @@ dvdomatic_setup_i18n (string lang) } setlocale (LC_ALL, ""); - textdomain ("libdvdomatic"); + textdomain ("libdcpomatic"); -#ifdef DVDOMATIC_WINDOWS - bindtextdomain ("libdvdomatic", mo_path().string().c_str()); - bind_textdomain_codeset ("libdvdomatic", "UTF8"); +#ifdef DCPOMATIC_WINDOWS + bindtextdomain ("libdcpomatic", mo_path().string().c_str()); + bind_textdomain_codeset ("libdcpomatic", "UTF8"); #endif -#ifdef DVDOMATIC_POSIX - bindtextdomain ("libdvdomatic", POSIX_LOCALE_PREFIX); +#ifdef DCPOMATIC_POSIX + bindtextdomain ("libdcpomatic", POSIX_LOCALE_PREFIX); #endif } @@ -909,7 +909,7 @@ cpu_info () pair info; info.second = 0; -#ifdef DVDOMATIC_POSIX +#ifdef DCPOMATIC_POSIX ifstream f (N_("/proc/cpuinfo")); while (f.good ()) { string l; diff --git a/src/lib/util.h b/src/lib/util.h index f4af7c22b..065801a88 100644 --- a/src/lib/util.h +++ b/src/lib/util.h @@ -22,8 +22,8 @@ * @brief Some utility functions and classes. */ -#ifndef DVDOMATIC_UTIL_H -#define DVDOMATIC_UTIL_H +#ifndef DCPOMATIC_UTIL_H +#define DCPOMATIC_UTIL_H #include #include @@ -39,7 +39,7 @@ extern "C" { #include "compose.hpp" #include "types.h" -#ifdef DVDOMATIC_DEBUG +#ifdef DCPOMATIC_DEBUG #define TIMING(...) _film->log()->microsecond_log (String::compose (__VA_ARGS__), Log::TIMING); #else #define TIMING(...) @@ -55,14 +55,14 @@ extern std::string seconds_to_approximate_hms (int); extern void stacktrace (std::ostream &, int); extern std::string dependency_version_summary (); extern double seconds (struct timeval); -extern void dvdomatic_setup (); -extern void dvdomatic_setup_i18n (std::string); +extern void dcpomatic_setup (); +extern void dcpomatic_setup_i18n (std::string); extern std::vector split_at_spaces_considering_quotes (std::string); extern std::string md5_digest (boost::filesystem::path); extern std::string md5_digest (void const *, int); extern void ensure_ui_thread (); extern std::string audio_channel_name (int); -#ifdef DVDOMATIC_WINDOWS +#ifdef DCPOMATIC_WINDOWS extern boost::filesystem::path mo_path (); #endif @@ -117,7 +117,7 @@ extern std::string get_optional_string (std::multimap /** @class Socket * @brief A class to wrap a boost::asio::ip::tcp::socket with some things - * that are useful for DVD-o-matic. + * that are useful for DCP-o-matic. * * This class wraps some things that I could not work out how to do with boost; * most notably, sync read/write calls with timeouts. diff --git a/src/lib/version.h b/src/lib/version.h index 71639e3bc..518862fc4 100644 --- a/src/lib/version.h +++ b/src/lib/version.h @@ -1,3 +1,3 @@ -extern char const * dvdomatic_version; -extern char const * dvdomatic_git_commit; +extern char const * dcpomatic_version; +extern char const * dcpomatic_git_commit; diff --git a/src/lib/video_content.h b/src/lib/video_content.h index 3d2c4cab2..75e507d4d 100644 --- a/src/lib/video_content.h +++ b/src/lib/video_content.h @@ -17,8 +17,8 @@ */ -#ifndef DVDOMATIC_VIDEO_CONTENT_H -#define DVDOMATIC_VIDEO_CONTENT_H +#ifndef DCPOMATIC_VIDEO_CONTENT_H +#define DCPOMATIC_VIDEO_CONTENT_H #include "content.h" #include "util.h" diff --git a/src/lib/video_decoder.h b/src/lib/video_decoder.h index 05cf99a96..23817c055 100644 --- a/src/lib/video_decoder.h +++ b/src/lib/video_decoder.h @@ -17,8 +17,8 @@ */ -#ifndef DVDOMATIC_VIDEO_DECODER_H -#define DVDOMATIC_VIDEO_DECODER_H +#ifndef DCPOMATIC_VIDEO_DECODER_H +#define DCPOMATIC_VIDEO_DECODER_H #include "video_source.h" #include "decoder.h" diff --git a/src/lib/video_sink.h b/src/lib/video_sink.h index 7c128cf73..c68651005 100644 --- a/src/lib/video_sink.h +++ b/src/lib/video_sink.h @@ -17,8 +17,8 @@ */ -#ifndef DVDOMATIC_VIDEO_SINK_H -#define DVDOMATIC_VIDEO_SINK_H +#ifndef DCPOMATIC_VIDEO_SINK_H +#define DCPOMATIC_VIDEO_SINK_H #include #include "util.h" diff --git a/src/lib/video_source.h b/src/lib/video_source.h index e60e7dfd0..e7c9805ef 100644 --- a/src/lib/video_source.h +++ b/src/lib/video_source.h @@ -21,8 +21,8 @@ * @brief Parent class for classes which emit video data. */ -#ifndef DVDOMATIC_VIDEO_SOURCE_H -#define DVDOMATIC_VIDEO_SOURCE_H +#ifndef DCPOMATIC_VIDEO_SOURCE_H +#define DCPOMATIC_VIDEO_SOURCE_H #include #include diff --git a/src/lib/wscript b/src/lib/wscript index 2a26c2bfe..fddebe8e6 100644 --- a/src/lib/wscript +++ b/src/lib/wscript @@ -66,7 +66,7 @@ def build(bld): else: obj = bld(features = 'cxx cxxshlib') - obj.name = 'libdvdomatic' + obj.name = 'libdcpomatic' obj.export_includes = ['.'] obj.uselib = """ AVCODEC AVUTIL AVFORMAT AVFILTER SWSCALE SWRESAMPLE @@ -78,12 +78,12 @@ def build(bld): if bld.env.STATIC: obj.uselib += ' XML++' obj.source = sources + " version.cc" - obj.target = 'dvdomatic' + obj.target = 'dcpomatic' - i18n.po_to_mo(os.path.join('src', 'lib'), 'libdvdomatic', bld) + i18n.po_to_mo(os.path.join('src', 'lib'), 'libdcpomatic', bld) def pot(bld): - i18n.pot(os.path.join('src', 'lib'), sources, 'libdvdomatic') + i18n.pot(os.path.join('src', 'lib'), sources, 'libdcpomatic') def pot_merge(bld): - i18n.pot_merge(os.path.join('src', 'lib'), 'libdvdomatic') + i18n.pot_merge(os.path.join('src', 'lib'), 'libdcpomatic') diff --git a/src/tools/dvdomatic.cc b/src/tools/dvdomatic.cc deleted file mode 100644 index 768819abc..000000000 --- a/src/tools/dvdomatic.cc +++ /dev/null @@ -1,578 +0,0 @@ -/* - Copyright (C) 2012 Carl Hetherington - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - -*/ - -#include -#include -#ifdef __WXMSW__ -#include -#endif -#include -#include -#include -#include "wx/film_viewer.h" -#include "wx/film_editor.h" -#include "wx/job_manager_view.h" -#include "wx/config_dialog.h" -#include "wx/job_wrapper.h" -#include "wx/wx_util.h" -#include "wx/new_film_dialog.h" -#include "wx/properties_dialog.h" -#include "wx/wx_ui_signaller.h" -#include "lib/film.h" -#include "lib/format.h" -#include "lib/config.h" -#include "lib/filter.h" -#include "lib/util.h" -#include "lib/scaler.h" -#include "lib/exceptions.h" -#include "lib/version.h" -#include "lib/ui_signaller.h" -#include "lib/log.h" - -using std::cout; -using std::string; -using std::wstring; -using std::stringstream; -using std::map; -using std::make_pair; -using std::exception; -using boost::shared_ptr; - -static FilmEditor* film_editor = 0; -static FilmViewer* film_viewer = 0; -static shared_ptr film; -static std::string log_level; -static std::string film_to_load; -static std::string film_to_create; -static wxMenu* jobs_menu = 0; -static wxLocale* locale = 0; - -static void set_menu_sensitivity (); - -class FilmChangedDialog -{ -public: - FilmChangedDialog () - { - _dialog = new wxMessageDialog ( - 0, - wxString::Format (_("Save changes to film \"%s\" before closing?"), std_to_wx (film->name ()).data()), - _("Film changed"), - wxYES_NO | wxYES_DEFAULT | wxICON_QUESTION - ); - } - - ~FilmChangedDialog () - { - _dialog->Destroy (); - } - - int run () - { - return _dialog->ShowModal (); - } - -private: - wxMessageDialog* _dialog; -}; - - -void -maybe_save_then_delete_film () -{ - if (!film) { - return; - } - - if (film->dirty ()) { - FilmChangedDialog d; - switch (d.run ()) { - case wxID_NO: - break; - case wxID_YES: - film->write_metadata (); - break; - } - } - - film.reset (); -} - -enum Sensitivity { - ALWAYS, - NEEDS_FILM -}; - -map menu_items; - -void -add_item (wxMenu* menu, wxString text, int id, Sensitivity sens) -{ - wxMenuItem* item = menu->Append (id, text); - menu_items.insert (make_pair (item, sens)); -} - -void -set_menu_sensitivity () -{ - for (map::iterator i = menu_items.begin(); i != menu_items.end(); ++i) { - if (i->second == NEEDS_FILM) { - i->first->Enable (film != 0); - } else { - i->first->Enable (true); - } - } -} - -enum { - ID_file_new = 1, - ID_file_open, - ID_file_save, - ID_file_properties, - ID_file_quit, - ID_edit_preferences, - ID_jobs_make_dcp, - ID_jobs_send_dcp_to_tms, - ID_jobs_show_dcp, - ID_jobs_analyse_audio, - ID_help_about -}; - -void -setup_menu (wxMenuBar* m) -{ - wxMenu* file = new wxMenu; - add_item (file, _("New..."), ID_file_new, ALWAYS); - add_item (file, _("&Open..."), ID_file_open, ALWAYS); - file->AppendSeparator (); - add_item (file, _("&Save"), ID_file_save, NEEDS_FILM); - file->AppendSeparator (); - add_item (file, _("&Properties..."), ID_file_properties, NEEDS_FILM); - file->AppendSeparator (); - add_item (file, _("&Quit"), ID_file_quit, ALWAYS); - - wxMenu* edit = new wxMenu; - add_item (edit, _("&Preferences..."), ID_edit_preferences, ALWAYS); - - jobs_menu = new wxMenu; - add_item (jobs_menu, _("&Make DCP"), ID_jobs_make_dcp, NEEDS_FILM); - add_item (jobs_menu, _("&Send DCP to TMS"), ID_jobs_send_dcp_to_tms, NEEDS_FILM); - add_item (jobs_menu, _("S&how DCP"), ID_jobs_show_dcp, NEEDS_FILM); - jobs_menu->AppendSeparator (); - add_item (jobs_menu, _("&Analyse audio"), ID_jobs_analyse_audio, NEEDS_FILM); - - wxMenu* help = new wxMenu; - add_item (help, _("About"), ID_help_about, ALWAYS); - - m->Append (file, _("&File")); - m->Append (edit, _("&Edit")); - m->Append (jobs_menu, _("&Jobs")); - m->Append (help, _("&Help")); -} - -bool -window_closed (wxCommandEvent &) -{ - maybe_save_then_delete_film (); - return false; -} - -class Frame : public wxFrame -{ -public: - Frame (wxString const & title) - : wxFrame (NULL, -1, title) - { - wxMenuBar* bar = new wxMenuBar; - setup_menu (bar); - SetMenuBar (bar); - - Connect (ID_file_new, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler (Frame::file_new)); - Connect (ID_file_open, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler (Frame::file_open)); - Connect (ID_file_save, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler (Frame::file_save)); - Connect (ID_file_properties, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler (Frame::file_properties)); - Connect (ID_file_quit, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler (Frame::file_quit)); - Connect (ID_edit_preferences, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler (Frame::edit_preferences)); - Connect (ID_jobs_make_dcp, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler (Frame::jobs_make_dcp)); - Connect (ID_jobs_send_dcp_to_tms, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler (Frame::jobs_send_dcp_to_tms)); - Connect (ID_jobs_show_dcp, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler (Frame::jobs_show_dcp)); - Connect (ID_jobs_analyse_audio, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler (Frame::jobs_analyse_audio)); - Connect (ID_help_about, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler (Frame::help_about)); - - Connect (wxID_ANY, wxEVT_MENU_OPEN, wxMenuEventHandler (Frame::menu_opened)); - - wxPanel* panel = new wxPanel (this); - wxSizer* s = new wxBoxSizer (wxHORIZONTAL); - s->Add (panel, 1, wxEXPAND); - SetSizer (s); - - film_editor = new FilmEditor (film, panel); - film_viewer = new FilmViewer (film, panel); - JobManagerView* job_manager_view = new JobManagerView (panel); - - _top_sizer = new wxBoxSizer (wxHORIZONTAL); - _top_sizer->Add (film_editor, 0, wxALL, 6); - _top_sizer->Add (film_viewer, 1, wxEXPAND | wxALL, 6); - - wxBoxSizer* main_sizer = new wxBoxSizer (wxVERTICAL); - main_sizer->Add (_top_sizer, 2, wxEXPAND | wxALL, 6); - main_sizer->Add (job_manager_view, 1, wxEXPAND | wxALL, 6); - panel->SetSizer (main_sizer); - - set_menu_sensitivity (); - - film_editor->FileChanged.connect (bind (&Frame::file_changed, this, _1)); - if (film) { - file_changed (film->directory ()); - } else { - file_changed (""); - } - - set_film (); - - film_editor->Connect (wxID_ANY, wxEVT_SIZE, wxSizeEventHandler (Frame::film_editor_sized), 0, this); - } - -private: - - void film_editor_sized (wxSizeEvent &) - { - static bool in_layout = false; - if (!in_layout) { - in_layout = true; - _top_sizer->Layout (); - in_layout = false; - } - } - - void menu_opened (wxMenuEvent& ev) - { - if (ev.GetMenu() != jobs_menu) { - return; - } - - bool const have_dcp = film && film->have_dcp(); - jobs_menu->Enable (ID_jobs_send_dcp_to_tms, have_dcp); - jobs_menu->Enable (ID_jobs_show_dcp, have_dcp); - } - - void set_film () - { - film_viewer->set_film (film); - film_editor->set_film (film); - set_menu_sensitivity (); - } - - void file_changed (string f) - { - stringstream s; - s << wx_to_std (_("DVD-o-matic")); - if (!f.empty ()) { - s << " - " << f; - } - - SetTitle (std_to_wx (s.str())); - } - - void file_new (wxCommandEvent &) - { - NewFilmDialog* d = new NewFilmDialog (this); - int const r = d->ShowModal (); - - if (r == wxID_OK) { - - if (boost::filesystem::exists (d->get_path())) { - error_dialog (this, std_to_wx (String::compose (wx_to_std (_("The directory %1 already exists.")), d->get_path().c_str()))); - return; - } - - maybe_save_then_delete_film (); - film.reset (new Film (d->get_path (), false)); - film->log()->set_level (log_level); - film->set_name (boost::filesystem::path (d->get_path()).filename().generic_string()); - set_film (); - } - - d->Destroy (); - } - - void file_open (wxCommandEvent &) - { - wxDirDialog* c = new wxDirDialog (this, _("Select film to open"), wxStandardPaths::Get().GetDocumentsDir(), wxDEFAULT_DIALOG_STYLE | wxDD_DIR_MUST_EXIST); - int r; - while (1) { - r = c->ShowModal (); - if (r == wxID_OK && c->GetPath() == wxStandardPaths::Get().GetDocumentsDir()) { - error_dialog (this, _("You did not select a folder. Make sure that you select a folder before clicking Open.")); - } else { - break; - } - } - - if (r == wxID_OK) { - maybe_save_then_delete_film (); - try { - film.reset (new Film (wx_to_std (c->GetPath ()))); - film->log()->set_level (log_level); - set_film (); - } catch (std::exception& e) { - wxString p = c->GetPath (); - wxCharBuffer b = p.ToUTF8 (); - error_dialog (this, wxString::Format (_("Could not open film at %s (%s)"), p.data(), std_to_wx (e.what()).data())); - } - } - - c->Destroy (); - } - - void file_save (wxCommandEvent &) - { - film->write_metadata (); - } - - void file_properties (wxCommandEvent &) - { - PropertiesDialog* d = new PropertiesDialog (this, film); - d->ShowModal (); - d->Destroy (); - } - - void file_quit (wxCommandEvent &) - { - maybe_save_then_delete_film (); - Close (true); - } - - void edit_preferences (wxCommandEvent &) - { - ConfigDialog* d = new ConfigDialog (this); - d->ShowModal (); - d->Destroy (); - Config::instance()->write (); - } - - void jobs_make_dcp (wxCommandEvent &) - { - JobWrapper::make_dcp (this, film); - } - - void jobs_send_dcp_to_tms (wxCommandEvent &) - { - film->send_dcp_to_tms (); - } - - void jobs_show_dcp (wxCommandEvent &) - { -#ifdef __WXMSW__ - string d = film->directory(); - wstring w; - w.assign (d.begin(), d.end()); - ShellExecute (0, L"open", w.c_str(), 0, 0, SW_SHOWDEFAULT); -#else - int r = system ("which nautilus"); - if (WEXITSTATUS (r) == 0) { - system (string ("nautilus " + film->directory()).c_str ()); - } else { - int r = system ("which konqueror"); - if (WEXITSTATUS (r) == 0) { - system (string ("konqueror " + film->directory()).c_str ()); - } - } -#endif - } - - void jobs_analyse_audio (wxCommandEvent &) - { - film->analyse_audio (); - } - - void help_about (wxCommandEvent &) - { - wxAboutDialogInfo info; - info.SetName (_("DVD-o-matic")); - if (strcmp (dvdomatic_git_commit, "release") == 0) { - info.SetVersion (std_to_wx (String::compose ("version %1", dvdomatic_version))); - } else { - info.SetVersion (std_to_wx (String::compose ("version %1 git %2", dvdomatic_version, dvdomatic_git_commit))); - } - info.SetDescription (_("Free, open-source DCP generation from almost anything.")); - info.SetCopyright (_("(C) 2012-2013 Carl Hetherington, Terrence Meiczinger, Paul Davis, Ole Laursen")); - - wxArrayString authors; - authors.Add (wxT ("Carl Hetherington")); - authors.Add (wxT ("Terrence Meiczinger")); - authors.Add (wxT ("Paul Davis")); - authors.Add (wxT ("Ole Laursen")); - info.SetDevelopers (authors); - - wxArrayString translators; - translators.Add (wxT ("Olivier Perriere")); - translators.Add (wxT ("Lilian Lefranc")); - translators.Add (wxT ("Thierry Journet")); - translators.Add (wxT ("Massimiliano Broggi")); - translators.Add (wxT ("Manuel AC")); - translators.Add (wxT ("Adam Klotblixt")); - info.SetTranslators (translators); - - info.SetWebSite (wxT ("http://carlh.net/software/dvdomatic")); - wxAboutBox (info); - } - - wxSizer* _top_sizer; -}; - -#if wxMINOR_VERSION == 9 -static const wxCmdLineEntryDesc command_line_description[] = { - { wxCMD_LINE_OPTION, "l", "log", "set log level (silent, verbose or timing)", wxCMD_LINE_VAL_STRING, wxCMD_LINE_PARAM_OPTIONAL }, - { wxCMD_LINE_SWITCH, "n", "new", "create new film", wxCMD_LINE_VAL_NONE, wxCMD_LINE_PARAM_OPTIONAL }, - { wxCMD_LINE_PARAM, 0, 0, "film to load or create", wxCMD_LINE_VAL_STRING, wxCMD_LINE_PARAM_MULTIPLE | wxCMD_LINE_PARAM_OPTIONAL }, - { wxCMD_LINE_NONE, "", "", "", wxCmdLineParamType (0), 0 } -}; -#else -static const wxCmdLineEntryDesc command_line_description[] = { - { wxCMD_LINE_OPTION, wxT("l"), wxT("log"), wxT("set log level (silent, verbose or timing)"), wxCMD_LINE_VAL_STRING, wxCMD_LINE_PARAM_OPTIONAL }, - { wxCMD_LINE_SWITCH, wxT("n"), wxT("new"), wxT("create new film"), wxCMD_LINE_VAL_NONE, wxCMD_LINE_PARAM_OPTIONAL }, - { wxCMD_LINE_PARAM, 0, 0, wxT("film to load or create"), wxCMD_LINE_VAL_STRING, wxCMD_LINE_PARAM_MULTIPLE | wxCMD_LINE_PARAM_OPTIONAL }, - { wxCMD_LINE_NONE, wxT(""), wxT(""), wxT(""), wxCmdLineParamType (0), 0 } -}; -#endif - -void -setup_i18n () -{ - int language = wxLANGUAGE_DEFAULT; - - if (Config::instance()->language()) { - wxLanguageInfo const * li = wxLocale::FindLanguageInfo (std_to_wx (Config::instance()->language().get())); - if (li) { - language = li->Language; - } - } - - if (wxLocale::IsAvailable (language)) { - locale = new wxLocale (language, wxLOCALE_LOAD_DEFAULT); - -#ifdef DVDOMATIC_WINDOWS - locale->AddCatalogLookupPathPrefix (std_to_wx (mo_path().string())); -#endif - - locale->AddCatalog (wxT ("libdvdomatic-wx")); - locale->AddCatalog (wxT ("dvdomatic")); - - if (!locale->IsOk()) { - delete locale; - locale = new wxLocale (wxLANGUAGE_ENGLISH); - language = wxLANGUAGE_ENGLISH; - } - } - - if (locale) { - dvdomatic_setup_i18n (wx_to_std (locale->GetCanonicalName ())); - } -} - -class App : public wxApp -{ - bool OnInit () - { - if (!wxApp::OnInit()) { - return false; - } - -#ifdef DVDOMATIC_POSIX - unsetenv ("UBUNTU_MENUPROXY"); -#endif - - wxInitAllImageHandlers (); - - /* Enable i18n; this will create a Config object - to look for a force-configured language. This Config - object will be wrong, however, because dvdomatic_setup - hasn't yet been called and there aren't any scalers, filters etc. - set up yet. - */ - setup_i18n (); - - /* Set things up, including scalers / filters etc. - which will now be internationalised correctly. - */ - dvdomatic_setup (); - - /* Force the configuration to be re-loaded correctly next - time it is needed. - */ - Config::drop (); - - if (!film_to_load.empty() && boost::filesystem::is_directory (film_to_load)) { - try { - film.reset (new Film (film_to_load)); - film->log()->set_level (log_level); - } catch (exception& e) { - error_dialog (0, std_to_wx (String::compose (wx_to_std (_("Could not load film %1 (%2)")), film_to_load, e.what()))); - } - } - - if (!film_to_create.empty ()) { - film.reset (new Film (film_to_create, false)); - film->log()->set_level (log_level); - film->set_name (boost::filesystem::path (film_to_create).filename().generic_string ()); - } - - Frame* f = new Frame (_("DVD-o-matic")); - SetTopWindow (f); - f->Maximize (); - f->Show (); - - ui_signaller = new wxUISignaller (this); - this->Connect (-1, wxEVT_IDLE, wxIdleEventHandler (App::idle)); - - return true; - } - - void OnInitCmdLine (wxCmdLineParser& parser) - { - parser.SetDesc (command_line_description); - parser.SetSwitchChars (wxT ("-")); - } - - bool OnCmdLineParsed (wxCmdLineParser& parser) - { - if (parser.GetParamCount() > 0) { - if (parser.Found (wxT ("new"))) { - film_to_create = wx_to_std (parser.GetParam (0)); - } else { - film_to_load = wx_to_std (parser.GetParam(0)); - } - } - - wxString log; - if (parser.Found (wxT ("log"), &log)) { - log_level = wx_to_std (log); - } - - return true; - } - - void idle (wxIdleEvent &) - { - ui_signaller->ui_idle (); - } -}; - -IMPLEMENT_APP (App) diff --git a/src/tools/makedcp.cc b/src/tools/makedcp.cc index 85134b3c5..e2e1874c4 100644 --- a/src/tools/makedcp.cc +++ b/src/tools/makedcp.cc @@ -47,9 +47,9 @@ static void help (string n) { cerr << "Syntax: " << n << " [OPTION] \n" - << " -v, --version show DVD-o-matic version\n" + << " -v, --version show DCP-o-matic version\n" << " -h, --help show this help\n" - << " -d, --deps list DVD-o-matic dependency details and quit\n" + << " -d, --deps list DCP-o-matic dependency details and quit\n" << " -t, --test run in test mode (repeatable UUID generation, timestamps etc.)\n" << " -n, --no-progress do not print progress to stdout\n" << " -r, --no-remote do not use any remote servers\n" @@ -87,7 +87,7 @@ main (int argc, char* argv[]) switch (c) { case 'v': - cout << "dvdomatic version " << dvdomatic_version << " " << dvdomatic_git_commit << "\n"; + cout << "dcpomatic version " << dcpomatic_version << " " << dcpomatic_git_commit << "\n"; exit (EXIT_SUCCESS); case 'h': help (argv[0]); @@ -117,13 +117,13 @@ main (int argc, char* argv[]) film_dir = argv[optind]; - dvdomatic_setup (); + dcpomatic_setup (); if (no_remote) { Config::instance()->set_servers (vector ()); } - cout << "DVD-o-matic " << dvdomatic_version << " git " << dvdomatic_git_commit; + cout << "DCP-o-matic " << dcpomatic_version << " git " << dcpomatic_git_commit; char buf[256]; if (gethostname (buf, 256) == 0) { cout << " on " << buf; @@ -162,7 +162,7 @@ main (int argc, char* argv[]) bool error = false; while (!should_stop) { - dvdomatic_sleep (5); + dcpomatic_sleep (5); list > jobs = JobManager::instance()->get (); diff --git a/src/tools/po/es_ES.po b/src/tools/po/es_ES.po index abfbfef6d..d35f104c6 100644 --- a/src/tools/po/es_ES.po +++ b/src/tools/po/es_ES.po @@ -5,7 +5,7 @@ # msgid "" msgstr "" -"Project-Id-Version: DVDOMATIC\n" +"Project-Id-Version: DCPOMATIC\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2013-04-09 11:14+0100\n" "PO-Revision-Date: 2013-03-23 21:08-0500\n" @@ -17,111 +17,111 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" "X-Generator: Poedit 1.5.5\n" -#: src/tools/dvdomatic.cc:177 +#: src/tools/dcpomatic.cc:177 msgid "&Analyse audio" msgstr "&Analizar audio" -#: src/tools/dvdomatic.cc:183 +#: src/tools/dcpomatic.cc:183 msgid "&Edit" msgstr "&Editar" -#: src/tools/dvdomatic.cc:182 +#: src/tools/dcpomatic.cc:182 msgid "&File" msgstr "&Archivo" -#: src/tools/dvdomatic.cc:185 +#: src/tools/dcpomatic.cc:185 msgid "&Help" msgstr "&Ayuda" -#: src/tools/dvdomatic.cc:184 +#: src/tools/dcpomatic.cc:184 msgid "&Jobs" msgstr "&Tareas" -#: src/tools/dvdomatic.cc:173 +#: src/tools/dcpomatic.cc:173 msgid "&Make DCP" msgstr "&Crear DCP" -#: src/tools/dvdomatic.cc:161 +#: src/tools/dcpomatic.cc:161 msgid "&Open..." msgstr "&Abrir..." -#: src/tools/dvdomatic.cc:170 +#: src/tools/dcpomatic.cc:170 msgid "&Preferences..." msgstr "&Preferencias..." -#: src/tools/dvdomatic.cc:165 +#: src/tools/dcpomatic.cc:165 msgid "&Properties..." msgstr "&Propiedades..." -#: src/tools/dvdomatic.cc:167 +#: src/tools/dcpomatic.cc:167 msgid "&Quit" msgstr "&Salir" -#: src/tools/dvdomatic.cc:163 +#: src/tools/dcpomatic.cc:163 msgid "&Save" msgstr "&Guardar" -#: src/tools/dvdomatic.cc:174 +#: src/tools/dcpomatic.cc:174 msgid "&Send DCP to TMS" msgstr "&Enviar DCP al TMS" -#: src/tools/dvdomatic.cc:417 +#: src/tools/dcpomatic.cc:417 msgid "" "(C) 2012-2013 Carl Hetherington, Terrence Meiczinger, Paul Davis, Ole Laursen" msgstr "" "(C) 2012-2013 Carl Hetherington, Terrence Meiczinger, Paul Davis, Ole Laursen" -#: src/tools/dvdomatic.cc:180 +#: src/tools/dcpomatic.cc:180 msgid "About" msgstr "Acerca de" -#: src/tools/dvdomatic.cc:527 +#: src/tools/dcpomatic.cc:527 #, fuzzy msgid "Could not load film %1 (%2)" msgstr "No se pudo cargar la película %s (%s)" -#: src/tools/dvdomatic.cc:339 +#: src/tools/dcpomatic.cc:339 #, c-format msgid "Could not open film at %s (%s)" msgstr "No se pudo cargar la película en %s (%s)" -#: src/tools/dvdomatic.cc:287 src/tools/dvdomatic.cc:410 -#: src/tools/dvdomatic.cc:531 -msgid "DVD-o-matic" -msgstr "DVD-o-matic" +#: src/tools/dcpomatic.cc:287 src/tools/dcpomatic.cc:410 +#: src/tools/dcpomatic.cc:531 +msgid "DCP-o-matic" +msgstr "DCP-o-matic" -#: src/tools/dvdomatic.cc:75 +#: src/tools/dcpomatic.cc:75 msgid "Film changed" msgstr "Película cambiada" -#: src/tools/dvdomatic.cc:416 +#: src/tools/dcpomatic.cc:416 msgid "Free, open-source DCP generation from almost anything." msgstr "" "Generación de DCP a partir de casi cualquier fuente, libre y de código " "abierto." -#: src/tools/dvdomatic.cc:160 +#: src/tools/dcpomatic.cc:160 msgid "New..." msgstr "Nuevo..." -#: src/tools/dvdomatic.cc:175 +#: src/tools/dcpomatic.cc:175 msgid "S&how DCP" msgstr "&Mostrar DCP" -#: src/tools/dvdomatic.cc:74 +#: src/tools/dcpomatic.cc:74 msgid "Save changes to film \"%s\" before closing?" msgstr "" -#: src/tools/dvdomatic.cc:319 +#: src/tools/dcpomatic.cc:319 msgid "Select film to open" msgstr "Selecciona la película a abrir" -#: src/tools/dvdomatic.cc:303 +#: src/tools/dcpomatic.cc:303 #, fuzzy msgid "The directory %1 already exists." msgstr "La carpeta %s ya existe." -#: src/tools/dvdomatic.cc:324 +#: src/tools/dcpomatic.cc:324 msgid "" "You did not select a folder. Make sure that you select a folder before " "clicking Open." diff --git a/src/tools/po/fr_FR.po b/src/tools/po/fr_FR.po index b40c86877..ef2246992 100644 --- a/src/tools/po/fr_FR.po +++ b/src/tools/po/fr_FR.po @@ -5,7 +5,7 @@ # msgid "" msgstr "" -"Project-Id-Version: DVD-o-matic FRENCH\n" +"Project-Id-Version: DCP-o-matic FRENCH\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2013-04-09 11:14+0100\n" "PO-Revision-Date: 2013-03-13 22:33+0100\n" @@ -16,109 +16,109 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -#: src/tools/dvdomatic.cc:177 +#: src/tools/dcpomatic.cc:177 msgid "&Analyse audio" msgstr "&Analyser le son" -#: src/tools/dvdomatic.cc:183 +#: src/tools/dcpomatic.cc:183 msgid "&Edit" msgstr "&Edition" -#: src/tools/dvdomatic.cc:182 +#: src/tools/dcpomatic.cc:182 msgid "&File" msgstr "&Fichier" -#: src/tools/dvdomatic.cc:185 +#: src/tools/dcpomatic.cc:185 msgid "&Help" msgstr "&Aide" -#: src/tools/dvdomatic.cc:184 +#: src/tools/dcpomatic.cc:184 msgid "&Jobs" msgstr "&Travaux" -#: src/tools/dvdomatic.cc:173 +#: src/tools/dcpomatic.cc:173 msgid "&Make DCP" msgstr "&Créer le DCP" -#: src/tools/dvdomatic.cc:161 +#: src/tools/dcpomatic.cc:161 msgid "&Open..." msgstr "&Ouvrir..." -#: src/tools/dvdomatic.cc:170 +#: src/tools/dcpomatic.cc:170 msgid "&Preferences..." msgstr "&Préférences..." -#: src/tools/dvdomatic.cc:165 +#: src/tools/dcpomatic.cc:165 msgid "&Properties..." msgstr "&Propriétés..." -#: src/tools/dvdomatic.cc:167 +#: src/tools/dcpomatic.cc:167 msgid "&Quit" msgstr "&Quitter" -#: src/tools/dvdomatic.cc:163 +#: src/tools/dcpomatic.cc:163 msgid "&Save" msgstr "&Enregistrer" -#: src/tools/dvdomatic.cc:174 +#: src/tools/dcpomatic.cc:174 msgid "&Send DCP to TMS" msgstr "&Envoyer le DCP dans le TMS" -#: src/tools/dvdomatic.cc:417 +#: src/tools/dcpomatic.cc:417 msgid "" "(C) 2012-2013 Carl Hetherington, Terrence Meiczinger, Paul Davis, Ole Laursen" msgstr "" "(C) 2012-2013 Carl Hetherington, Terrence Meiczinger, Paul Davis, Ole Laursen" -#: src/tools/dvdomatic.cc:180 +#: src/tools/dcpomatic.cc:180 msgid "About" msgstr "A Propos" -#: src/tools/dvdomatic.cc:527 +#: src/tools/dcpomatic.cc:527 #, fuzzy msgid "Could not load film %1 (%2)" msgstr "Impossible de charger le film %s (%s)" -#: src/tools/dvdomatic.cc:339 +#: src/tools/dcpomatic.cc:339 #, c-format msgid "Could not open film at %s (%s)" msgstr "Impossible d'ouvrir le film à %s (%s)" -#: src/tools/dvdomatic.cc:287 src/tools/dvdomatic.cc:410 -#: src/tools/dvdomatic.cc:531 -msgid "DVD-o-matic" -msgstr "DVD-o-matic" +#: src/tools/dcpomatic.cc:287 src/tools/dcpomatic.cc:410 +#: src/tools/dcpomatic.cc:531 +msgid "DCP-o-matic" +msgstr "DCP-o-matic" -#: src/tools/dvdomatic.cc:75 +#: src/tools/dcpomatic.cc:75 msgid "Film changed" msgstr "Film changé" -#: src/tools/dvdomatic.cc:416 +#: src/tools/dcpomatic.cc:416 msgid "Free, open-source DCP generation from almost anything." msgstr "Création de DCP libre et open-source à partir de presque tout." -#: src/tools/dvdomatic.cc:160 +#: src/tools/dcpomatic.cc:160 msgid "New..." msgstr "Nouveau..." -#: src/tools/dvdomatic.cc:175 +#: src/tools/dcpomatic.cc:175 msgid "S&how DCP" msgstr "Voir le DCP" -#: src/tools/dvdomatic.cc:74 +#: src/tools/dcpomatic.cc:74 msgid "Save changes to film \"%s\" before closing?" msgstr "" -#: src/tools/dvdomatic.cc:319 +#: src/tools/dcpomatic.cc:319 msgid "Select film to open" msgstr "Sélectionner le film à ouvrir" -#: src/tools/dvdomatic.cc:303 +#: src/tools/dcpomatic.cc:303 #, fuzzy msgid "The directory %1 already exists." msgstr "Le dossier %s existe déjà." -#: src/tools/dvdomatic.cc:324 +#: src/tools/dcpomatic.cc:324 msgid "" "You did not select a folder. Make sure that you select a folder before " "clicking Open." diff --git a/src/tools/po/it_IT.po b/src/tools/po/it_IT.po index 38cbec157..998f70059 100644 --- a/src/tools/po/it_IT.po +++ b/src/tools/po/it_IT.po @@ -17,107 +17,107 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" "X-Generator: Poedit 1.5.5\n" -#: src/tools/dvdomatic.cc:177 +#: src/tools/dcpomatic.cc:177 msgid "&Analyse audio" msgstr "&Analizza audio" -#: src/tools/dvdomatic.cc:183 +#: src/tools/dcpomatic.cc:183 msgid "&Edit" msgstr "&Modifica" -#: src/tools/dvdomatic.cc:182 +#: src/tools/dcpomatic.cc:182 msgid "&File" msgstr "&File" -#: src/tools/dvdomatic.cc:185 +#: src/tools/dcpomatic.cc:185 msgid "&Help" msgstr "&Aiuto" -#: src/tools/dvdomatic.cc:184 +#: src/tools/dcpomatic.cc:184 msgid "&Jobs" msgstr "&Lavori" -#: src/tools/dvdomatic.cc:173 +#: src/tools/dcpomatic.cc:173 msgid "&Make DCP" msgstr "&Crea DCP" -#: src/tools/dvdomatic.cc:161 +#: src/tools/dcpomatic.cc:161 msgid "&Open..." msgstr "&Apri..." -#: src/tools/dvdomatic.cc:170 +#: src/tools/dcpomatic.cc:170 msgid "&Preferences..." msgstr "&Preferenze..." -#: src/tools/dvdomatic.cc:165 +#: src/tools/dcpomatic.cc:165 msgid "&Properties..." msgstr "&Proprieta'..." -#: src/tools/dvdomatic.cc:167 +#: src/tools/dcpomatic.cc:167 msgid "&Quit" msgstr "&Esci" -#: src/tools/dvdomatic.cc:163 +#: src/tools/dcpomatic.cc:163 msgid "&Save" msgstr "&Salva" -#: src/tools/dvdomatic.cc:174 +#: src/tools/dcpomatic.cc:174 msgid "&Send DCP to TMS" msgstr "&Invia DCP a TMS" -#: src/tools/dvdomatic.cc:417 +#: src/tools/dcpomatic.cc:417 msgid "" "(C) 2012-2013 Carl Hetherington, Terrence Meiczinger, Paul Davis, Ole Laursen" msgstr "" "(C) 2012-2013 Carl Hetherington, Terrence Meiczinger, Paul Davis, Ole Laursen" -#: src/tools/dvdomatic.cc:180 +#: src/tools/dcpomatic.cc:180 msgid "About" msgstr "Informazioni" -#: src/tools/dvdomatic.cc:527 +#: src/tools/dcpomatic.cc:527 msgid "Could not load film %1 (%2)" msgstr "Non posso caricare il film %s (%s)" -#: src/tools/dvdomatic.cc:339 +#: src/tools/dcpomatic.cc:339 #, c-format msgid "Could not open film at %s (%s)" msgstr "Non posso aprire il film in %s (%s)" -#: src/tools/dvdomatic.cc:287 src/tools/dvdomatic.cc:410 -#: src/tools/dvdomatic.cc:531 -msgid "DVD-o-matic" -msgstr "DVD-o-matic" +#: src/tools/dcpomatic.cc:287 src/tools/dcpomatic.cc:410 +#: src/tools/dcpomatic.cc:531 +msgid "DCP-o-matic" +msgstr "DCP-o-matic" -#: src/tools/dvdomatic.cc:75 +#: src/tools/dcpomatic.cc:75 msgid "Film changed" msgstr "Film modificato" -#: src/tools/dvdomatic.cc:416 +#: src/tools/dcpomatic.cc:416 msgid "Free, open-source DCP generation from almost anything." msgstr "Genera DCP da quasi tutto, free e open-source." -#: src/tools/dvdomatic.cc:160 +#: src/tools/dcpomatic.cc:160 msgid "New..." msgstr "Nuovo" -#: src/tools/dvdomatic.cc:175 +#: src/tools/dcpomatic.cc:175 msgid "S&how DCP" msgstr "&Mostra DCP" -#: src/tools/dvdomatic.cc:74 +#: src/tools/dcpomatic.cc:74 msgid "Save changes to film \"%s\" before closing?" msgstr "Salvare i cambiamenti del film \"%s\" prima di chiudere?" -#: src/tools/dvdomatic.cc:319 +#: src/tools/dcpomatic.cc:319 msgid "Select film to open" msgstr "Seleziona il film da aprire" -#: src/tools/dvdomatic.cc:303 +#: src/tools/dcpomatic.cc:303 msgid "The directory %1 already exists." msgstr "La directory %s esiste gia'." -#: src/tools/dvdomatic.cc:324 +#: src/tools/dcpomatic.cc:324 msgid "" "You did not select a folder. Make sure that you select a folder before " "clicking Open." diff --git a/src/tools/po/sv_SE.po b/src/tools/po/sv_SE.po index 57254770c..4765c2d98 100644 --- a/src/tools/po/sv_SE.po +++ b/src/tools/po/sv_SE.po @@ -5,7 +5,7 @@ # msgid "" msgstr "" -"Project-Id-Version: DVD-o-matic\n" +"Project-Id-Version: DCP-o-matic\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2013-04-09 11:14+0100\n" "PO-Revision-Date: 2013-04-09 10:12+0100\n" @@ -17,108 +17,108 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" "X-Generator: Poedit 1.5.5\n" -#: src/tools/dvdomatic.cc:177 +#: src/tools/dcpomatic.cc:177 msgid "&Analyse audio" msgstr "&Analysera audio" -#: src/tools/dvdomatic.cc:183 +#: src/tools/dcpomatic.cc:183 msgid "&Edit" msgstr "&Redigera" -#: src/tools/dvdomatic.cc:182 +#: src/tools/dcpomatic.cc:182 msgid "&File" msgstr "&Fil" -#: src/tools/dvdomatic.cc:185 +#: src/tools/dcpomatic.cc:185 msgid "&Help" msgstr "&Hjälp" -#: src/tools/dvdomatic.cc:184 +#: src/tools/dcpomatic.cc:184 msgid "&Jobs" msgstr "&Jobb" -#: src/tools/dvdomatic.cc:173 +#: src/tools/dcpomatic.cc:173 msgid "&Make DCP" msgstr "&Skapa DCP" -#: src/tools/dvdomatic.cc:161 +#: src/tools/dcpomatic.cc:161 msgid "&Open..." msgstr "&Öppna" -#: src/tools/dvdomatic.cc:170 +#: src/tools/dcpomatic.cc:170 msgid "&Preferences..." msgstr "&Inställningar" -#: src/tools/dvdomatic.cc:165 +#: src/tools/dcpomatic.cc:165 msgid "&Properties..." msgstr "&Egenskaper" -#: src/tools/dvdomatic.cc:167 +#: src/tools/dcpomatic.cc:167 msgid "&Quit" msgstr "&Avsluta" -#: src/tools/dvdomatic.cc:163 +#: src/tools/dcpomatic.cc:163 msgid "&Save" msgstr "&Spara" -#: src/tools/dvdomatic.cc:174 +#: src/tools/dcpomatic.cc:174 msgid "&Send DCP to TMS" msgstr "&Skicka DCP till TMS" -#: src/tools/dvdomatic.cc:417 +#: src/tools/dcpomatic.cc:417 msgid "" "(C) 2012-2013 Carl Hetherington, Terrence Meiczinger, Paul Davis, Ole Laursen" msgstr "" "(C) 2012-2013 Carl Hetherington, Terrence Meiczinger, Paul Davis, Ole Laursen" -#: src/tools/dvdomatic.cc:180 +#: src/tools/dcpomatic.cc:180 msgid "About" msgstr "Om" -#: src/tools/dvdomatic.cc:527 +#: src/tools/dcpomatic.cc:527 msgid "Could not load film %1 (%2)" msgstr "Kunde inte öppna filmen %1 (%2)" -#: src/tools/dvdomatic.cc:339 +#: src/tools/dcpomatic.cc:339 #, c-format msgid "Could not open film at %s (%s)" msgstr "Kunde inte öppna filmen vid %s (%s)" -#: src/tools/dvdomatic.cc:287 src/tools/dvdomatic.cc:410 -#: src/tools/dvdomatic.cc:531 -msgid "DVD-o-matic" -msgstr "DVD-o-matic" +#: src/tools/dcpomatic.cc:287 src/tools/dcpomatic.cc:410 +#: src/tools/dcpomatic.cc:531 +msgid "DCP-o-matic" +msgstr "DCP-o-matic" -#: src/tools/dvdomatic.cc:75 +#: src/tools/dcpomatic.cc:75 msgid "Film changed" msgstr "Film ändrad" -#: src/tools/dvdomatic.cc:416 +#: src/tools/dcpomatic.cc:416 msgid "Free, open-source DCP generation from almost anything." msgstr "" "Fri, öppen-källkodsprogramvara för DCP-generering från nästan vad som helst." -#: src/tools/dvdomatic.cc:160 +#: src/tools/dcpomatic.cc:160 msgid "New..." msgstr "Ny..." -#: src/tools/dvdomatic.cc:175 +#: src/tools/dcpomatic.cc:175 msgid "S&how DCP" msgstr "&Visa DCP" -#: src/tools/dvdomatic.cc:74 +#: src/tools/dcpomatic.cc:74 msgid "Save changes to film \"%s\" before closing?" msgstr "Spara ändringarna till filmen \"%s\" före avslut?" -#: src/tools/dvdomatic.cc:319 +#: src/tools/dcpomatic.cc:319 msgid "Select film to open" msgstr "Välj film att öppna" -#: src/tools/dvdomatic.cc:303 +#: src/tools/dcpomatic.cc:303 msgid "The directory %1 already exists." msgstr "Katalogen %1 finns redan." -#: src/tools/dvdomatic.cc:324 +#: src/tools/dcpomatic.cc:324 msgid "" "You did not select a folder. Make sure that you select a folder before " "clicking Open." diff --git a/src/tools/servomatic_cli.cc b/src/tools/servomatic_cli.cc index 6626d45b9..76d085034 100644 --- a/src/tools/servomatic_cli.cc +++ b/src/tools/servomatic_cli.cc @@ -51,7 +51,7 @@ static void help (string n) { cerr << "Syntax: " << n << " [OPTION]\n" - << " -v, --version show DVD-o-matic version\n" + << " -v, --version show DCP-o-matic version\n" << " -h, --help show this help\n" << " -t, --threads number of parallel encoding threads to use\n"; } @@ -78,7 +78,7 @@ main (int argc, char* argv[]) switch (c) { case 'v': - cout << "dvdomatic version " << dvdomatic_version << " " << dvdomatic_git_commit << "\n"; + cout << "dcpomatic version " << dcpomatic_version << " " << dcpomatic_git_commit << "\n"; exit (EXIT_SUCCESS); case 'h': help (argv[0]); diff --git a/src/tools/servomatic_gui.cc b/src/tools/servomatic_gui.cc index 5e36660eb..152e063c1 100644 --- a/src/tools/servomatic_gui.cc +++ b/src/tools/servomatic_gui.cc @@ -61,7 +61,7 @@ class StatusDialog : public wxDialog { public: StatusDialog () - : wxDialog (0, wxID_ANY, _("DVD-o-matic encode server"), wxDefaultPosition, wxSize (600, 80), wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER) + : wxDialog (0, wxID_ANY, _("DCP-o-matic encode server"), wxDefaultPosition, wxSize (600, 80), wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER) , _timer (this, ID_timer) { _sizer = new wxFlexGridSizer (1, 6, 6); @@ -103,7 +103,7 @@ public: wxIcon icon; icon.CopyFromBitmap (bitmap); #endif - SetIcon (icon, std_to_wx ("DVD-o-matic encode server")); + SetIcon (icon, std_to_wx ("DCP-o-matic encode server")); Connect (ID_status, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler (TaskBarIcon::status)); Connect (ID_quit, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler (TaskBarIcon::quit)); @@ -147,7 +147,7 @@ private: return false; } - dvdomatic_setup (); + dcpomatic_setup (); _icon = new TaskBarIcon; _thread = new thread (bind (&App::main_thread, this)); diff --git a/src/tools/servomatictest.cc b/src/tools/servomatictest.cc index d3222faa3..42cc76871 100644 --- a/src/tools/servomatictest.cc +++ b/src/tools/servomatictest.cc @@ -145,7 +145,7 @@ main (int argc, char* argv[]) exit (EXIT_FAILURE); } - dvdomatic_setup (); + dcpomatic_setup (); server = new ServerDescription (server_host, 1); shared_ptr film (new Film (film_dir, true)); diff --git a/src/tools/wscript b/src/tools/wscript index 9cc7e9d1b..f0ffb8e89 100644 --- a/src/tools/wscript +++ b/src/tools/wscript @@ -8,25 +8,25 @@ def build(bld): obj = bld(features = 'cxx cxxprogram') obj.uselib = 'BOOST_THREAD OPENJPEG DCP CXML AVFORMAT AVFILTER AVCODEC AVUTIL SWSCALE POSTPROC' obj.includes = ['..'] - obj.use = ['libdvdomatic'] + obj.use = ['libdcpomatic'] obj.source = '%s.cc' % t obj.target = t if not bld.env.DISABLE_GUI: - for t in ['dvdomatic', 'servomatic_gui']: + for t in ['dcpomatic', 'servomatic_gui']: obj = bld(features = 'cxx cxxprogram') obj.uselib = 'DCP CXML OPENJPEG AVFORMAT AVFILTER AVCODEC AVUTIL SWSCALE POSTPROC' obj.includes = ['..'] - obj.use = ['libdvdomatic', 'libdvdomatic-wx'] + obj.use = ['libdcpomatic', 'libdcpomatic-wx'] obj.source = '%s.cc' % t if bld.env.TARGET_WINDOWS: - obj.source += ' ../../windows/dvdomatic.rc' + obj.source += ' ../../windows/dcpomatic.rc' obj.target = t - i18n.po_to_mo(os.path.join('src', 'tools'), 'dvdomatic', bld) + i18n.po_to_mo(os.path.join('src', 'tools'), 'dcpomatic', bld) def pot(bld): - i18n.pot(os.path.join('src', 'tools'), 'dvdomatic.cc', 'dvdomatic') + i18n.pot(os.path.join('src', 'tools'), 'dcpomatic.cc', 'dcpomatic') def pot_merge(bld): - i18n.pot_merge(os.path.join('src', 'tools'), 'dvdomatic') + i18n.pot_merge(os.path.join('src', 'tools'), 'dcpomatic') diff --git a/src/wx/audio_dialog.cc b/src/wx/audio_dialog.cc index bed7aac6d..15d746839 100644 --- a/src/wx/audio_dialog.cc +++ b/src/wx/audio_dialog.cc @@ -100,7 +100,7 @@ AudioDialog::set_film (shared_ptr f) _film_changed_connection = _film->Changed.connect (bind (&AudioDialog::film_changed, this, _1)); _film_audio_analysis_succeeded_connection = _film->AudioAnalysisSucceeded.connect (bind (&AudioDialog::try_to_load_analysis, this)); - SetTitle (wxString::Format (_("DVD-o-matic audio - %s"), std_to_wx(_film->name()).data())); + SetTitle (wxString::Format (_("DCP-o-matic audio - %s"), std_to_wx(_film->name()).data())); } diff --git a/src/wx/config_dialog.cc b/src/wx/config_dialog.cc index 1d025f3fa..4ae8f1eb4 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 DVD-o-matic configuration. + * @brief A dialogue to edit DCP-o-matic configuration. */ #include @@ -41,7 +41,7 @@ using namespace std; using boost::bind; ConfigDialog::ConfigDialog (wxWindow* parent) - : wxDialog (parent, wxID_ANY, _("DVD-o-matic Preferences"), wxDefaultPosition, wxDefaultSize, wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER) + : wxDialog (parent, wxID_ANY, _("DCP-o-matic Preferences"), wxDefaultPosition, wxDefaultSize, wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER) { wxFlexGridSizer* table = new wxFlexGridSizer (3, 6, 6); table->AddGrowableCol (1, 1); @@ -58,7 +58,7 @@ ConfigDialog::ConfigDialog (wxWindow* parent) table->AddSpacer (0); table->AddSpacer (0); - wxStaticText* restart = add_label_to_sizer (table, this, _("(restart DVD-o-matic to see language changes)")); + wxStaticText* restart = add_label_to_sizer (table, this, _("(restart DCP-o-matic to see language changes)")); wxFont font = restart->GetFont(); font.SetStyle (wxFONTSTYLE_ITALIC); font.SetPointSize (font.GetPointSize() - 1); diff --git a/src/wx/config_dialog.h b/src/wx/config_dialog.h index f6f3b3707..a2fc1f4b1 100644 --- a/src/wx/config_dialog.h +++ b/src/wx/config_dialog.h @@ -18,7 +18,7 @@ */ /** @file src/config_dialog.h - * @brief A dialogue to edit DVD-o-matic configuration. + * @brief A dialogue to edit DCP-o-matic configuration. */ #include @@ -31,7 +31,7 @@ class DirPickerCtrl; class ServerDescription; /** @class ConfigDialog - * @brief A dialogue to edit DVD-o-matic configuration. + * @brief A dialogue to edit DCP-o-matic configuration. */ class ConfigDialog : public wxDialog { diff --git a/src/wx/po/es_ES.po b/src/wx/po/es_ES.po index 207708589..abb6b780f 100644 --- a/src/wx/po/es_ES.po +++ b/src/wx/po/es_ES.po @@ -5,7 +5,7 @@ # msgid "" msgstr "" -"Project-Id-Version: libdvdomatic-wx\n" +"Project-Id-Version: libdcpomatic-wx\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2013-04-09 11:14+0100\n" "PO-Revision-Date: 2013-04-02 19:08-0500\n" @@ -22,7 +22,7 @@ msgid "%" msgstr "%" #: src/wx/config_dialog.cc:61 -msgid "(restart DVD-o-matic to see language changes)" +msgid "(restart DCP-o-matic to see language changes)" msgstr "" #: src/wx/film_editor.cc:1269 @@ -141,17 +141,17 @@ msgid "DCP Name" msgstr "Nombre DCP" #: src/wx/wx_util.cc:61 -msgid "DVD-o-matic" -msgstr "DVD-o-matic" +msgid "DCP-o-matic" +msgstr "DCP-o-matic" #: src/wx/config_dialog.cc:44 -msgid "DVD-o-matic Preferences" -msgstr "Preferencias DVD-o-matic" +msgid "DCP-o-matic Preferences" +msgstr "Preferencias DCP-o-matic" #: src/wx/audio_dialog.cc:101 #, fuzzy, c-format -msgid "DVD-o-matic audio - %s" -msgstr "Audio DVD-o-matic - %1" +msgid "DCP-o-matic audio - %s" +msgstr "Audio DCP-o-matic - %1" #: src/wx/config_dialog.cc:102 msgid "Default DCI name details" diff --git a/src/wx/po/fr_FR.po b/src/wx/po/fr_FR.po index 80ee5dbfd..2aac7114c 100644 --- a/src/wx/po/fr_FR.po +++ b/src/wx/po/fr_FR.po @@ -5,7 +5,7 @@ # msgid "" msgstr "" -"Project-Id-Version: DVD-o-matic FRENCH\n" +"Project-Id-Version: DCP-o-matic FRENCH\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2013-04-09 11:14+0100\n" "PO-Revision-Date: 2013-03-20 00:34+0100\n" @@ -21,7 +21,7 @@ msgid "%" msgstr "%" #: src/wx/config_dialog.cc:61 -msgid "(restart DVD-o-matic to see language changes)" +msgid "(restart DCP-o-matic to see language changes)" msgstr "" #: src/wx/film_editor.cc:1269 @@ -140,17 +140,17 @@ msgid "DCP Name" msgstr "Nom du DCP" #: src/wx/wx_util.cc:61 -msgid "DVD-o-matic" -msgstr "DVD-o-matic" +msgid "DCP-o-matic" +msgstr "DCP-o-matic" #: src/wx/config_dialog.cc:44 -msgid "DVD-o-matic Preferences" -msgstr "Préférences DVD-o-matic" +msgid "DCP-o-matic Preferences" +msgstr "Préférences DCP-o-matic" #: src/wx/audio_dialog.cc:101 #, c-format -msgid "DVD-o-matic audio - %s" -msgstr "Son DVD-o-matic - %s" +msgid "DCP-o-matic audio - %s" +msgstr "Son DCP-o-matic - %s" #: src/wx/config_dialog.cc:102 msgid "Default DCI name details" diff --git a/src/wx/po/it_IT.po b/src/wx/po/it_IT.po index 78fd0dee9..7b06495e8 100644 --- a/src/wx/po/it_IT.po +++ b/src/wx/po/it_IT.po @@ -22,8 +22,8 @@ msgid "%" msgstr "%" #: src/wx/config_dialog.cc:61 -msgid "(restart DVD-o-matic to see language changes)" -msgstr "(riavviare DVD-o-matic per vedere i cambiamenti di lingua)" +msgid "(restart DCP-o-matic to see language changes)" +msgstr "(riavviare DCP-o-matic per vedere i cambiamenti di lingua)" #: src/wx/film_editor.cc:1269 msgid "1 channel" @@ -141,17 +141,17 @@ msgid "DCP Name" msgstr "Nome del DCP" #: src/wx/wx_util.cc:61 -msgid "DVD-o-matic" -msgstr "DVD-o-matic" +msgid "DCP-o-matic" +msgstr "DCP-o-matic" #: src/wx/config_dialog.cc:44 -msgid "DVD-o-matic Preferences" -msgstr "Preferenze DVD-o-matic" +msgid "DCP-o-matic Preferences" +msgstr "Preferenze DCP-o-matic" #: src/wx/audio_dialog.cc:101 #, c-format -msgid "DVD-o-matic audio - %s" -msgstr "Audio DVD-o-matic - %s" +msgid "DCP-o-matic audio - %s" +msgstr "Audio DCP-o-matic - %s" #: src/wx/config_dialog.cc:102 msgid "Default DCI name details" diff --git a/src/wx/po/sv_SE.po b/src/wx/po/sv_SE.po index e52589ff0..96fafadeb 100644 --- a/src/wx/po/sv_SE.po +++ b/src/wx/po/sv_SE.po @@ -5,7 +5,7 @@ # msgid "" msgstr "" -"Project-Id-Version: DVD-o-matic\n" +"Project-Id-Version: DCP-o-matic\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2013-04-09 11:14+0100\n" "PO-Revision-Date: 2013-04-09 10:13+0100\n" @@ -22,8 +22,8 @@ msgid "%" msgstr "%" #: src/wx/config_dialog.cc:61 -msgid "(restart DVD-o-matic to see language changes)" -msgstr "(starta om DVD-o-matic för att se språkändringar)" +msgid "(restart DCP-o-matic to see language changes)" +msgstr "(starta om DCP-o-matic för att se språkändringar)" #: src/wx/film_editor.cc:1269 msgid "1 channel" @@ -141,17 +141,17 @@ msgid "DCP Name" msgstr "DCP Namn" #: src/wx/wx_util.cc:61 -msgid "DVD-o-matic" -msgstr "DVD-o-matic" +msgid "DCP-o-matic" +msgstr "DCP-o-matic" #: src/wx/config_dialog.cc:44 -msgid "DVD-o-matic Preferences" -msgstr "DVD-o-matic Inställningar" +msgid "DCP-o-matic Preferences" +msgstr "DCP-o-matic Inställningar" #: src/wx/audio_dialog.cc:101 #, c-format -msgid "DVD-o-matic audio - %s" -msgstr "DVD-o-matic audio - %s" +msgid "DCP-o-matic audio - %s" +msgstr "DCP-o-matic audio - %s" #: src/wx/config_dialog.cc:102 msgid "Default DCI name details" diff --git a/src/wx/wscript b/src/wx/wscript index 7f9cde9ac..09bf40393 100644 --- a/src/wx/wscript +++ b/src/wx/wscript @@ -34,18 +34,18 @@ def build(bld): else: obj = bld(features = 'cxx cxxshlib') - obj.name = 'libdvdomatic-wx' + obj.name = 'libdcpomatic-wx' obj.includes = [ '..' ] obj.export_includes = ['.'] obj.uselib = 'WXWIDGETS' - obj.use = 'libdvdomatic' + obj.use = 'libdcpomatic' obj.source = sources - obj.target = 'dvdomatic-wx' + obj.target = 'dcpomatic-wx' - i18n.po_to_mo(os.path.join('src', 'wx'), 'libdvdomatic-wx', bld) + i18n.po_to_mo(os.path.join('src', 'wx'), 'libdcpomatic-wx', bld) def pot(bld): - i18n.pot(os.path.join('src', 'wx'), sources, 'libdvdomatic-wx') + i18n.pot(os.path.join('src', 'wx'), sources, 'libdcpomatic-wx') def pot_merge(bld): - i18n.pot_merge(os.path.join('src', 'wx'), 'libdvdomatic-wx') + i18n.pot_merge(os.path.join('src', 'wx'), 'libdcpomatic-wx') diff --git a/src/wx/wx_util.cc b/src/wx/wx_util.cc index 720a058cb..3dad6e7fd 100644 --- a/src/wx/wx_util.cc +++ b/src/wx/wx_util.cc @@ -58,7 +58,7 @@ add_label_to_grid_bag_sizer (wxGridBagSizer* s, wxWindow* p, wxString t, wxGBPos void error_dialog (wxWindow* parent, wxString m) { - wxMessageDialog* d = new wxMessageDialog (parent, m, _("DVD-o-matic"), wxOK); + wxMessageDialog* d = new wxMessageDialog (parent, m, _("DCP-o-matic"), wxOK); d->ShowModal (); d->Destroy (); } diff --git a/test/test.cc b/test/test.cc index 592bad836..39a921d36 100644 --- a/test/test.cc +++ b/test/test.cc @@ -42,7 +42,7 @@ #include "sndfile_decoder.h" #include "dcp_content_type.h" #define BOOST_TEST_DYN_LINK -#define BOOST_TEST_MODULE dvdomatic_test +#define BOOST_TEST_MODULE dcpomatic_test #include using std::string; @@ -90,7 +90,7 @@ new_test_film (string name) BOOST_AUTO_TEST_CASE (make_black_test) { /* This needs to happen in the first test */ - dvdomatic_setup (); + dcpomatic_setup (); libdcp::Size in_size (512, 512); libdcp::Size out_size (1024, 1024); @@ -392,7 +392,7 @@ BOOST_AUTO_TEST_CASE (client_server_test) new thread (boost::bind (&Server::run, server, 2)); /* Let the server get itself ready */ - dvdomatic_sleep (1); + dcpomatic_sleep (1); ServerDescription description ("localhost", 2); @@ -421,7 +421,7 @@ BOOST_AUTO_TEST_CASE (make_dcp_test) film->write_metadata (); while (JobManager::instance()->work_to_do ()) { - dvdomatic_sleep (1); + dcpomatic_sleep (1); } BOOST_CHECK_EQUAL (JobManager::instance()->errors(), false); @@ -452,7 +452,7 @@ BOOST_AUTO_TEST_CASE (make_dcp_with_range_test) film->make_dcp (); while (JobManager::instance()->work_to_do() && !JobManager::instance()->errors()) { - dvdomatic_sleep (1); + dcpomatic_sleep (1); } BOOST_CHECK_EQUAL (JobManager::instance()->errors(), false); @@ -689,10 +689,10 @@ BOOST_AUTO_TEST_CASE (job_manager_test) shared_ptr a (new TestJob (f)); JobManager::instance()->add (a); - dvdomatic_sleep (1); + dcpomatic_sleep (1); BOOST_CHECK_EQUAL (a->running (), true); a->set_finished_ok (); - dvdomatic_sleep (2); + dcpomatic_sleep (2); BOOST_CHECK_EQUAL (a->finished_ok(), true); } diff --git a/test/wscript b/test/wscript index 493270903..61c391663 100644 --- a/test/wscript +++ b/test/wscript @@ -9,7 +9,7 @@ def build(bld): obj = bld(features = 'cxx cxxprogram') obj.name = 'unit-tests' obj.uselib = 'BOOST_TEST CXML DCP OPENJPEG AVFORMAT AVFILTER AVCODEC AVUTIL SWSCALE POSTPROC' - obj.use = 'libdvdomatic' + obj.use = 'libdcpomatic' obj.source = 'test.cc' obj.target = 'unit-tests' obj.install_path = '' diff --git a/windows/dvdomatic.bmp b/windows/dvdomatic.bmp deleted file mode 100644 index 0a196f7a0..000000000 Binary files a/windows/dvdomatic.bmp and /dev/null differ diff --git a/windows/dvdomatic.ico b/windows/dvdomatic.ico deleted file mode 100644 index 225008cfe..000000000 Binary files a/windows/dvdomatic.ico and /dev/null differ diff --git a/windows/dvdomatic.rc b/windows/dvdomatic.rc deleted file mode 100644 index 17790cf0d..000000000 --- a/windows/dvdomatic.rc +++ /dev/null @@ -1,3 +0,0 @@ -id ICON "dvdomatic.ico" -taskbar_icon ICON "dvdomatic_taskbar.ico" -#include "wx-2.9/wx/msw/wx.rc" diff --git a/windows/dvdomatic_taskbar.ico b/windows/dvdomatic_taskbar.ico deleted file mode 100644 index f4489fa14..000000000 Binary files a/windows/dvdomatic_taskbar.ico and /dev/null differ diff --git a/windows/installer.nsi.32.in b/windows/installer.nsi.32.in index 553a94d2b..15a0a1886 100644 --- a/windows/installer.nsi.32.in +++ b/windows/installer.nsi.32.in @@ -1,14 +1,14 @@ !include "MUI2.nsh" -Name "DVD-o-matic" +Name "DCP-o-matic" RequestExecutionLevel admin -outFile "DVD-o-matic @version@ 32-bit Installer.exe" -!define MUI_ICON "%resources%/dvdomatic.ico" -!define MUI_UNICON "%resources%/dvdomatic.ico" -!define MUI_SPECIALBITMAP "%resources%/dvdomatic.bmp" +outFile "DCP-o-matic @version@ 32-bit Installer.exe" +!define MUI_ICON "%resources%/dcpomatic.ico" +!define MUI_UNICON "%resources%/dcpomatic.ico" +!define MUI_SPECIALBITMAP "%resources%/dcpomatic.bmp" -InstallDir "$PROGRAMFILES\DVD-o-matic" +InstallDir "$PROGRAMFILES\DCP-o-matic" !insertmacro MUI_PAGE_WELCOME !insertmacro MUI_PAGE_LICENSE "../../COPYING" @@ -81,9 +81,9 @@ File "%deps%/bin/libexpat-1.dll" File "%deps%/bin/libbz2.dll" File "%deps%/bin/cxml.dll" -File "%binaries%/src/wx/dvdomatic-wx.dll" -File "%binaries%/src/lib/dvdomatic.dll" -File "%binaries%/src/tools/dvdomatic.exe" +File "%binaries%/src/wx/dcpomatic-wx.dll" +File "%binaries%/src/lib/dcpomatic.dll" +File "%binaries%/src/tools/dcpomatic.exe" File "%binaries%/src/tools/servomatic_cli.exe" File "%binaries%/src/tools/servomatic_gui.exe" @@ -95,32 +95,32 @@ SetOutPath "$PROFILE\.magick" File "%deps%/etc/ImageMagick/delegates.xml" SetOutPath "$INSTDIR\locale\fr\LC_MESSAGES" -File "%binaries%/src/lib/mo/fr_FR/libdvdomatic.mo" -File "%binaries%/src/wx/mo/fr_FR/libdvdomatic-wx.mo" -File "%binaries%/src/tools/mo/fr_FR/dvdomatic.mo" +File "%binaries%/src/lib/mo/fr_FR/libdcpomatic.mo" +File "%binaries%/src/wx/mo/fr_FR/libdcpomatic-wx.mo" +File "%binaries%/src/tools/mo/fr_FR/dcpomatic.mo" SetOutPath "$INSTDIR\locale\it\LC_MESSAGES" -File "%binaries%/src/lib/mo/it_IT/libdvdomatic.mo" -File "%binaries%/src/wx/mo/it_IT/libdvdomatic-wx.mo" -File "%binaries%/src/tools/mo/it_IT/dvdomatic.mo" +File "%binaries%/src/lib/mo/it_IT/libdcpomatic.mo" +File "%binaries%/src/wx/mo/it_IT/libdcpomatic-wx.mo" +File "%binaries%/src/tools/mo/it_IT/dcpomatic.mo" SetOutPath "$INSTDIR\locale\es\LC_MESSAGES" -File "%binaries%/src/lib/mo/es_ES/libdvdomatic.mo" -File "%binaries%/src/wx/mo/es_ES/libdvdomatic-wx.mo" -File "%binaries%/src/tools/mo/es_ES/dvdomatic.mo" +File "%binaries%/src/lib/mo/es_ES/libdcpomatic.mo" +File "%binaries%/src/wx/mo/es_ES/libdcpomatic-wx.mo" +File "%binaries%/src/tools/mo/es_ES/dcpomatic.mo" SetOutPath "$INSTDIR\locale\sv\LC_MESSAGES" -File "%binaries%/src/lib/mo/sv_SE/libdvdomatic.mo" -File "%binaries%/src/wx/mo/sv_SE/libdvdomatic-wx.mo" -File "%binaries%/src/tools/mo/sv_SE/dvdomatic.mo" +File "%binaries%/src/lib/mo/sv_SE/libdcpomatic.mo" +File "%binaries%/src/wx/mo/sv_SE/libdcpomatic-wx.mo" +File "%binaries%/src/tools/mo/sv_SE/dcpomatic.mo" -CreateShortCut "$DESKTOP\DVD-o-matic.lnk" "$INSTDIR\bin\dvdomatic.exe" "" -CreateShortCut "$DESKTOP\DVD-o-matic encode server.lnk" "$INSTDIR\bin\servomatic_gui.exe" "" +CreateShortCut "$DESKTOP\DCP-o-matic.lnk" "$INSTDIR\bin\dcpomatic.exe" "" +CreateShortCut "$DESKTOP\DCP-o-matic encode server.lnk" "$INSTDIR\bin\servomatic_gui.exe" "" -CreateDirectory "$SMPROGRAMS\DVD-o-matic" -CreateShortCut "$SMPROGRAMS\DVD-o-matic\Uninstall DVD-o-matic.lnk" "$INSTDIR\Uninstall.exe" "" "$INSTDIR\Uninstall.exe" 0 -CreateShortCut "$SMPROGRAMS\DVD-o-matic\DVD-o-matic.lnk" "$INSTDIR\bin\dvdomatic.exe" "" "$INSTDIR\bin\dvdomatic.exe" 0 -CreateShortCut "$SMPROGRAMS\DVD-o-matic\DVD-o-matic encode server.lnk" "$INSTDIR\bin\servomatic_gui.exe" "" "$INSTDIR\bin\servomatic_gui.exe" 0 +CreateDirectory "$SMPROGRAMS\DCP-o-matic" +CreateShortCut "$SMPROGRAMS\DCP-o-matic\Uninstall DCP-o-matic.lnk" "$INSTDIR\Uninstall.exe" "" "$INSTDIR\Uninstall.exe" 0 +CreateShortCut "$SMPROGRAMS\DCP-o-matic\DCP-o-matic.lnk" "$INSTDIR\bin\dcpomatic.exe" "" "$INSTDIR\bin\dcpomatic.exe" 0 +CreateShortCut "$SMPROGRAMS\DCP-o-matic\DCP-o-matic encode server.lnk" "$INSTDIR\bin\servomatic_gui.exe" "" "$INSTDIR\bin\servomatic_gui.exe" 0 -WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\DVD-o-matic" "DisplayName" "DVD-o-matic (remove only)" -WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\DVD-o-matic" "UninstallString" "$INSTDIR\Uninstall.exe" +WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\DCP-o-matic" "DisplayName" "DCP-o-matic (remove only)" +WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\DCP-o-matic" "UninstallString" "$INSTDIR\Uninstall.exe" WriteUninstaller "$INSTDIR\Uninstall.exe" @@ -131,11 +131,11 @@ Section "Uninstall" RMDir /r "$INSTDIR\*.*" RMDir "$INSTDIR" -Delete "$DESKTOP\DVD-o-matic.lnk" -Delete "$DESKTOP\DVD-o-matic encode server.lnk" -Delete "$SMPROGRAMS\DVD-o-matic\*.*" -RmDir "$SMPROGRAMS\DVD-o-matic" -DeleteRegKey HKEY_LOCAL_MACHINE "SOFTWARE\DVD-o-matic" -DeleteRegKey HKEY_LOCAL_MACHINE "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\DVD-o-matic" +Delete "$DESKTOP\DCP-o-matic.lnk" +Delete "$DESKTOP\DCP-o-matic encode server.lnk" +Delete "$SMPROGRAMS\DCP-o-matic\*.*" +RmDir "$SMPROGRAMS\DCP-o-matic" +DeleteRegKey HKEY_LOCAL_MACHINE "SOFTWARE\DCP-o-matic" +DeleteRegKey HKEY_LOCAL_MACHINE "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\DCP-o-matic" SectionEnd diff --git a/windows/installer.nsi.64.in b/windows/installer.nsi.64.in index bb5456936..566907e39 100644 --- a/windows/installer.nsi.64.in +++ b/windows/installer.nsi.64.in @@ -1,16 +1,16 @@ !include "MUI2.nsh" !include "x64.nsh" -Name "DVD-o-matic" +Name "DCP-o-matic" RequestExecutionLevel admin -outFile "DVD-o-matic @version@ 64-bit Installer.exe" -!define MUI_ICON "%resources%/dvdomatic.ico" -!define MUI_UNICON "%resources%/dvdomatic.ico" -!define MUI_SPECIALBITMAP "%resources%/dvdomatic.bmp" +outFile "DCP-o-matic @version@ 64-bit Installer.exe" +!define MUI_ICON "%resources%/dcpomatic.ico" +!define MUI_UNICON "%resources%/dcpomatic.ico" +!define MUI_SPECIALBITMAP "%resources%/dcpomatic.bmp" -InstallDir "$PROGRAMFILES\DVD-o-matic" +InstallDir "$PROGRAMFILES\DCP-o-matic" !insertmacro MUI_PAGE_WELCOME !insertmacro MUI_PAGE_LICENSE "../../COPYING" @@ -32,7 +32,7 @@ ${If} ${RunningX64} ; disable registry redirection (enable access to 64-bit portion of registry) SetRegView 64 ; change install dir - StrCpy $INSTDIR "$PROGRAMFILES64\DVD-o-matic" + StrCpy $INSTDIR "$PROGRAMFILES64\DCP-o-matic" ${EndIf} SetOutPath "$INSTDIR\bin" @@ -91,9 +91,9 @@ File "%deps%/bin/libexpat-1.dll" File "%deps%/bin/libbz2.dll" File "%deps%/bin/cxml.dll" -File "%binaries%/src/wx/dvdomatic-wx.dll" -File "%binaries%/src/lib/dvdomatic.dll" -File "%binaries%/src/tools/dvdomatic.exe" +File "%binaries%/src/wx/dcpomatic-wx.dll" +File "%binaries%/src/lib/dcpomatic.dll" +File "%binaries%/src/tools/dcpomatic.exe" File "%binaries%/src/tools/servomatic_cli.exe" File "%binaries%/src/tools/servomatic_gui.exe" @@ -105,32 +105,32 @@ SetOutPath "$PROFILE\.magick" File "%deps%/etc/ImageMagick/delegates.xml" SetOutPath "$INSTDIR\locale\fr\LC_MESSAGES" -File "%binaries%/src/lib/mo/fr_FR/libdvdomatic.mo" -File "%binaries%/src/wx/mo/fr_FR/libdvdomatic-wx.mo" -File "%binaries%/src/tools/mo/fr_FR/dvdomatic.mo" +File "%binaries%/src/lib/mo/fr_FR/libdcpomatic.mo" +File "%binaries%/src/wx/mo/fr_FR/libdcpomatic-wx.mo" +File "%binaries%/src/tools/mo/fr_FR/dcpomatic.mo" SetOutPath "$INSTDIR\locale\it\LC_MESSAGES" -File "%binaries%/src/lib/mo/it_IT/libdvdomatic.mo" -File "%binaries%/src/wx/mo/it_IT/libdvdomatic-wx.mo" -File "%binaries%/src/tools/mo/it_IT/dvdomatic.mo" +File "%binaries%/src/lib/mo/it_IT/libdcpomatic.mo" +File "%binaries%/src/wx/mo/it_IT/libdcpomatic-wx.mo" +File "%binaries%/src/tools/mo/it_IT/dcpomatic.mo" SetOutPath "$INSTDIR\locale\es\LC_MESSAGES" -File "%binaries%/src/lib/mo/es_ES/libdvdomatic.mo" -File "%binaries%/src/wx/mo/es_ES/libdvdomatic-wx.mo" -File "%binaries%/src/tools/mo/es_ES/dvdomatic.mo" +File "%binaries%/src/lib/mo/es_ES/libdcpomatic.mo" +File "%binaries%/src/wx/mo/es_ES/libdcpomatic-wx.mo" +File "%binaries%/src/tools/mo/es_ES/dcpomatic.mo" SetOutPath "$INSTDIR\locale\sv\LC_MESSAGES" -File "%binaries%/src/lib/mo/sv_SE/libdvdomatic.mo" -File "%binaries%/src/wx/mo/sv_SE/libdvdomatic-wx.mo" -File "%binaries%/src/tools/mo/sv_SE/dvdomatic.mo" +File "%binaries%/src/lib/mo/sv_SE/libdcpomatic.mo" +File "%binaries%/src/wx/mo/sv_SE/libdcpomatic-wx.mo" +File "%binaries%/src/tools/mo/sv_SE/dcpomatic.mo" -CreateShortCut "$DESKTOP\DVD-o-matic.lnk" "$INSTDIR\bin\dvdomatic.exe" "" -CreateShortCut "$DESKTOP\DVD-o-matic encode server.lnk" "$INSTDIR\bin\servomatic_gui.exe" "" +CreateShortCut "$DESKTOP\DCP-o-matic.lnk" "$INSTDIR\bin\dcpomatic.exe" "" +CreateShortCut "$DESKTOP\DCP-o-matic encode server.lnk" "$INSTDIR\bin\servomatic_gui.exe" "" -CreateDirectory "$SMPROGRAMS\DVD-o-matic" -CreateShortCut "$SMPROGRAMS\DVD-o-matic\Uninstall DVD-o-matic.lnk" "$INSTDIR\Uninstall.exe" "" "$INSTDIR\Uninstall.exe" 0 -CreateShortCut "$SMPROGRAMS\DVD-o-matic\DVD-o-matic.lnk" "$INSTDIR\bin\dvdomatic.exe" "" "$INSTDIR\bin\dvdomatic.exe" 0 -CreateShortCut "$SMPROGRAMS\DVD-o-matic\DVD-o-matic encode server.lnk" "$INSTDIR\bin\servomatic_gui.exe" "" "$INSTDIR\bin\servomatic_gui.exe" 0 +CreateDirectory "$SMPROGRAMS\DCP-o-matic" +CreateShortCut "$SMPROGRAMS\DCP-o-matic\Uninstall DCP-o-matic.lnk" "$INSTDIR\Uninstall.exe" "" "$INSTDIR\Uninstall.exe" 0 +CreateShortCut "$SMPROGRAMS\DCP-o-matic\DCP-o-matic.lnk" "$INSTDIR\bin\dcpomatic.exe" "" "$INSTDIR\bin\dcpomatic.exe" 0 +CreateShortCut "$SMPROGRAMS\DCP-o-matic\DCP-o-matic encode server.lnk" "$INSTDIR\bin\servomatic_gui.exe" "" "$INSTDIR\bin\servomatic_gui.exe" 0 -WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\DVD-o-matic" "DisplayName" "DVD-o-matic (remove only)" -WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\DVD-o-matic" "UninstallString" "$INSTDIR\Uninstall.exe" +WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\DCP-o-matic" "DisplayName" "DCP-o-matic (remove only)" +WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\DCP-o-matic" "UninstallString" "$INSTDIR\Uninstall.exe" WriteUninstaller "$INSTDIR\Uninstall.exe" @@ -141,11 +141,11 @@ Section "Uninstall" RMDir /r "$INSTDIR\*.*" RMDir "$INSTDIR" -Delete "$DESKTOP\DVD-o-matic.lnk" -Delete "$DESKTOP\DVD-o-matic encode server.lnk" -Delete "$SMPROGRAMS\DVD-o-matic\*.*" -RmDir "$SMPROGRAMS\DVD-o-matic" -DeleteRegKey HKEY_LOCAL_MACHINE "SOFTWARE\DVD-o-matic" -DeleteRegKey HKEY_LOCAL_MACHINE "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\DVD-o-matic" +Delete "$DESKTOP\DCP-o-matic.lnk" +Delete "$DESKTOP\DCP-o-matic encode server.lnk" +Delete "$SMPROGRAMS\DCP-o-matic\*.*" +RmDir "$SMPROGRAMS\DCP-o-matic" +DeleteRegKey HKEY_LOCAL_MACHINE "SOFTWARE\DCP-o-matic" +DeleteRegKey HKEY_LOCAL_MACHINE "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\DCP-o-matic" SectionEnd diff --git a/wscript b/wscript index 502f27fd1..f784d760d 100644 --- a/wscript +++ b/wscript @@ -2,7 +2,7 @@ import subprocess import os import sys -APPNAME = 'dvdomatic' +APPNAME = 'dcpomatic' VERSION = '0.84pre' def options(opt): @@ -25,7 +25,7 @@ def configure(conf): '-Wall', '-Wno-attributes', '-Wextra']) if conf.options.target_windows: - conf.env.append_value('CXXFLAGS', ['-DDVDOMATIC_WINDOWS', '-DWIN32_LEAN_AND_MEAN', '-DBOOST_USE_WINDOWS_H', '-DUNICODE']) + conf.env.append_value('CXXFLAGS', ['-DDCPOMATIC_WINDOWS', '-DWIN32_LEAN_AND_MEAN', '-DBOOST_USE_WINDOWS_H', '-DUNICODE']) wxrc = os.popen('wx-config --rescomp').read().split()[1:] conf.env.append_value('WINRCFLAGS', wxrc) if conf.options.enable_debug: @@ -35,9 +35,9 @@ def configure(conf): boost_lib_suffix = '-mt' boost_thread = 'boost_thread_win32-mt' else: - conf.env.append_value('CXXFLAGS', '-DDVDOMATIC_POSIX') + conf.env.append_value('CXXFLAGS', '-DDCPOMATIC_POSIX') conf.env.append_value('CXXFLAGS', '-DPOSIX_LOCALE_PREFIX="%s/share/locale"' % conf.env['PREFIX']) - conf.env.append_value('CXXFLAGS', '-DPOSIX_ICON_PREFIX="%s/share/dvdomatic"' % conf.env['PREFIX']) + conf.env.append_value('CXXFLAGS', '-DPOSIX_ICON_PREFIX="%s/share/dcpomatic"' % conf.env['PREFIX']) boost_lib_suffix = '' boost_thread = 'boost_thread' conf.env.append_value('LINKFLAGS', '-pthread') @@ -50,7 +50,7 @@ def configure(conf): conf.env.VERSION = VERSION if conf.options.enable_debug: - conf.env.append_value('CXXFLAGS', ['-g', '-DDVDOMATIC_DEBUG']) + conf.env.append_value('CXXFLAGS', ['-g', '-DDCPOMATIC_DEBUG']) else: conf.env.append_value('CXXFLAGS', '-O2') @@ -228,16 +228,16 @@ def build(bld): d = { 'PREFIX' : '${PREFIX' } obj = bld(features = 'subst') - obj.source = 'dvdomatic.desktop.in' - obj.target = 'dvdomatic.desktop' + obj.source = 'dcpomatic.desktop.in' + obj.target = 'dcpomatic.desktop' obj.dict = d - bld.install_files('${PREFIX}/share/applications', 'dvdomatic.desktop') + bld.install_files('${PREFIX}/share/applications', 'dcpomatic.desktop') for r in ['22x22', '32x32', '48x48', '64x64', '128x128']: - bld.install_files('${PREFIX}/share/icons/hicolor/%s/apps' % r, 'icons/%s/dvdomatic.png' % r) + bld.install_files('${PREFIX}/share/icons/hicolor/%s/apps' % r, 'icons/%s/dcpomatic.png' % r) if not bld.env.TARGET_WINDOWS: - bld.install_files('${PREFIX}/share/dvdomatic', 'icons/taskbar_icon.png') + bld.install_files('${PREFIX}/share/dcpomatic', 'icons/taskbar_icon.png') bld.add_post_fun(post) @@ -259,8 +259,8 @@ def create_version_cc(version): try: text = '#include "version.h"\n' - text += 'char const * dvdomatic_git_commit = \"%s\";\n' % commit - text += 'char const * dvdomatic_version = \"%s\";\n' % version + text += 'char const * dcpomatic_git_commit = \"%s\";\n' % commit + text += 'char const * dcpomatic_version = \"%s\";\n' % version print('Writing version information to src/lib/version.cc') o = open('src/lib/version.cc', 'w') o.write(text) -- cgit v1.2.3 From 8a1042b767e2604b0af4850dd69fd6a848fd6ffe Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Sat, 4 May 2013 16:52:48 +0100 Subject: Add FFmpeg content dialog; moving ffmpeg-specific things out of the film editor. --- src/lib/film.cc | 62 +--------------- src/lib/film.h | 11 +-- src/lib/playlist.cc | 11 +++ src/lib/playlist.h | 2 + src/wx/ffmpeg_content_dialog.cc | 138 +++++++++++++++++++++++++++++++++++ src/wx/ffmpeg_content_dialog.h | 40 ++++++++++ src/wx/film_editor.cc | 132 ++++----------------------------- src/wx/film_editor.h | 6 -- src/wx/imagemagick_content_dialog.cc | 13 +++- src/wx/imagemagick_content_dialog.h | 5 +- src/wx/wscript | 1 + 11 files changed, 225 insertions(+), 196 deletions(-) create mode 100644 src/wx/ffmpeg_content_dialog.cc create mode 100644 src/wx/ffmpeg_content_dialog.h (limited to 'src/wx/wscript') diff --git a/src/lib/film.cc b/src/lib/film.cc index 8fed87122..7d1985d08 100644 --- a/src/lib/film.cc +++ b/src/lib/film.cc @@ -1154,66 +1154,10 @@ Film::content_length () const return _playlist->content_length (); } -vector -Film::ffmpeg_subtitle_streams () const -{ - shared_ptr f = _playlist->ffmpeg (); - if (f) { - return f->subtitle_streams (); - } - - return vector (); -} - -boost::optional -Film::ffmpeg_subtitle_stream () const -{ - shared_ptr f = _playlist->ffmpeg (); - if (f) { - return f->subtitle_stream (); - } - - return boost::none; -} - -vector -Film::ffmpeg_audio_streams () const -{ - shared_ptr f = _playlist->ffmpeg (); - if (f) { - return f->audio_streams (); - } - - return vector (); -} - -boost::optional -Film::ffmpeg_audio_stream () const -{ - shared_ptr f = _playlist->ffmpeg (); - if (f) { - return f->audio_stream (); - } - - return boost::none; -} - -void -Film::set_ffmpeg_subtitle_stream (FFmpegSubtitleStream s) -{ - shared_ptr f = _playlist->ffmpeg (); - if (f) { - f->set_subtitle_stream (s); - } -} - -void -Film::set_ffmpeg_audio_stream (FFmpegAudioStream s) +bool +Film::has_subtitles () const { - shared_ptr f = _playlist->ffmpeg (); - if (f) { - f->set_audio_stream (s); - } + return _playlist->has_subtitles (); } void diff --git a/src/lib/film.h b/src/lib/film.h index f4d7cde67..48b0d16c5 100644 --- a/src/lib/film.h +++ b/src/lib/film.h @@ -112,6 +112,8 @@ public: int audio_channels () const; int audio_frame_rate () const; bool has_audio () const; + + bool has_subtitles () const; float video_frame_rate () const; libdcp::Size video_size () const; @@ -119,17 +121,10 @@ public: ContentVideoFrame content_length () const; - std::vector ffmpeg_subtitle_streams () const; - boost::optional ffmpeg_subtitle_stream () const; - std::vector ffmpeg_audio_streams () const; - boost::optional ffmpeg_audio_stream () const; - - void set_ffmpeg_subtitle_stream (FFmpegSubtitleStream); - void set_ffmpeg_audio_stream (FFmpegAudioStream); - void set_loop (int); int loop () const; + enum TrimType { CPL, ENCODE diff --git a/src/lib/playlist.cc b/src/lib/playlist.cc index 72745f220..63b44f9d6 100644 --- a/src/lib/playlist.cc +++ b/src/lib/playlist.cc @@ -416,3 +416,14 @@ Playlist::ffmpeg () const return shared_ptr (); } + +bool +Playlist::has_subtitles () const +{ + shared_ptr fc = ffmpeg (); + if (!fc) { + return false; + } + + return !fc->subtitle_streams().empty(); +} diff --git a/src/lib/playlist.h b/src/lib/playlist.h index 935bbb2bd..e6acff694 100644 --- a/src/lib/playlist.h +++ b/src/lib/playlist.h @@ -82,6 +82,8 @@ public: return _audio_from; } + bool has_subtitles () const; + ContentList content () const { return _content; } diff --git a/src/wx/ffmpeg_content_dialog.cc b/src/wx/ffmpeg_content_dialog.cc new file mode 100644 index 000000000..540bae0a9 --- /dev/null +++ b/src/wx/ffmpeg_content_dialog.cc @@ -0,0 +1,138 @@ +/* + Copyright (C) 2013 Carl Hetherington + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + +*/ + +#include +#include "lib/ffmpeg_content.h" +#include "ffmpeg_content_dialog.h" +#include "wx_util.h" + +using std::vector; +using std::string; +using boost::shared_ptr; +using boost::lexical_cast; + +FFmpegContentDialog::FFmpegContentDialog (wxWindow* parent, shared_ptr content) + : wxDialog (parent, wxID_ANY, _("Video")) +{ + wxFlexGridSizer* grid = new wxFlexGridSizer (3, 6, 6); + grid->AddGrowableCol (1, 1); + + add_label_to_sizer (grid, this, _("Audio Stream")); + _audio_stream = new wxChoice (this, wxID_ANY); + grid->Add (_audio_stream, 1, wxEXPAND | wxALL, 6); + _audio_description = new wxStaticText (this, wxID_ANY, wxT ("")); + grid->Add (_audio_description, 1, wxALIGN_CENTER_VERTICAL | wxLEFT, 8); + + add_label_to_sizer (grid, this, "Subtitle stream"); + _subtitle_stream = new wxChoice (this, wxID_ANY); + grid->Add (_subtitle_stream, 1, wxEXPAND | wxALL, 6); + grid->AddSpacer (0); + + _audio_stream->Clear (); + vector a = content->audio_streams (); + for (vector::iterator i = a.begin(); i != a.end(); ++i) { + _audio_stream->Append (std_to_wx (i->name), new wxStringClientData (std_to_wx (lexical_cast (i->id)))); + } + + if (content->audio_stream()) { + checked_set (_audio_stream, lexical_cast (content->audio_stream()->id)); + } + + _subtitle_stream->Clear (); + vector s = content->subtitle_streams (); + for (vector::iterator i = s.begin(); i != s.end(); ++i) { + _subtitle_stream->Append (std_to_wx (i->name), new wxStringClientData (std_to_wx (lexical_cast (i->id)))); + } + + if (content->subtitle_stream()) { + checked_set (_subtitle_stream, lexical_cast (content->subtitle_stream()->id)); + } else { + _subtitle_stream->SetSelection (wxNOT_FOUND); + } + + wxBoxSizer* overall_sizer = new wxBoxSizer (wxVERTICAL); + overall_sizer->Add (grid, 1, wxEXPAND | wxALL, 6); + + wxSizer* buttons = CreateSeparatedButtonSizer (wxOK); + if (buttons) { + overall_sizer->Add (buttons, wxSizerFlags().Expand().DoubleBorder()); + } + + SetSizer (overall_sizer); + overall_sizer->Layout (); + overall_sizer->SetSizeHints (this); + + _audio_stream->Connect (wxID_ANY, wxEVT_COMMAND_CHOICE_SELECTED, wxCommandEventHandler (FFmpegContentDialog::audio_stream_changed), 0, this); + _subtitle_stream->Connect (wxID_ANY, wxEVT_COMMAND_CHOICE_SELECTED, wxCommandEventHandler (FFmpegContentDialog::subtitle_stream_changed), 0, this); +} + +void +FFmpegContentDialog::audio_stream_changed (wxCommandEvent &) +{ + shared_ptr c = _content.lock (); + if (!c) { + return; + } + + vector a = c->audio_streams (); + vector::iterator i = a.begin (); + string const s = string_client_data (_audio_stream->GetClientObject (_audio_stream->GetSelection ())); + while (i != a.end() && lexical_cast (i->id) != s) { + ++i; + } + + if (i != a.end ()) { + c->set_audio_stream (*i); + } + + if (!c->audio_stream ()) { + _audio_description->SetLabel (wxT ("")); + } else { + wxString s; + if (c->audio_channels() == 1) { + s << _("1 channel"); + } else { + s << c->audio_channels() << wxT (" ") << _("channels"); + } + s << wxT (", ") << c->audio_frame_rate() << _("Hz"); + _audio_description->SetLabel (s); + } +} + + + +void +FFmpegContentDialog::subtitle_stream_changed (wxCommandEvent &) +{ + shared_ptr c = _content.lock (); + if (!c) { + return; + } + + vector a = c->subtitle_streams (); + vector::iterator i = a.begin (); + string const s = string_client_data (_subtitle_stream->GetClientObject (_subtitle_stream->GetSelection ())); + while (i != a.end() && lexical_cast (i->id) != s) { + ++i; + } + + if (i != a.end ()) { + c->set_subtitle_stream (*i); + } +} diff --git a/src/wx/ffmpeg_content_dialog.h b/src/wx/ffmpeg_content_dialog.h new file mode 100644 index 000000000..5251ad5da --- /dev/null +++ b/src/wx/ffmpeg_content_dialog.h @@ -0,0 +1,40 @@ +/* + Copyright (C) 2013 Carl Hetherington + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + +*/ + +#include +#include +#include + +class wxSpinCtrl; +class FFmpegContent; + +class FFmpegContentDialog : public wxDialog +{ +public: + FFmpegContentDialog (wxWindow *, boost::shared_ptr); + +private: + void audio_stream_changed (wxCommandEvent &); + void subtitle_stream_changed (wxCommandEvent &); + + boost::weak_ptr _content; + wxChoice* _audio_stream; + wxStaticText* _audio_description; + wxChoice* _subtitle_stream; +}; diff --git a/src/wx/film_editor.cc b/src/wx/film_editor.cc index 4f08953b9..85c4f71f8 100644 --- a/src/wx/film_editor.cc +++ b/src/wx/film_editor.cc @@ -50,6 +50,7 @@ #include "scaler.h" #include "audio_dialog.h" #include "imagemagick_content_dialog.h" +#include "ffmpeg_content_dialog.h" #include "audio_mapping_view.h" using std::string; @@ -234,8 +235,6 @@ FilmEditor::connect_to_widgets () _subtitle_scale->Connect (wxID_ANY, wxEVT_COMMAND_SPINCTRL_UPDATED, wxCommandEventHandler (FilmEditor::subtitle_scale_changed), 0, this); _colour_lut->Connect (wxID_ANY, wxEVT_COMMAND_CHOICE_SELECTED, wxCommandEventHandler (FilmEditor::colour_lut_changed), 0, this); _j2k_bandwidth->Connect (wxID_ANY, wxEVT_COMMAND_SPINCTRL_UPDATED, wxCommandEventHandler (FilmEditor::j2k_bandwidth_changed), 0, this); - _ffmpeg_subtitle_stream->Connect (wxID_ANY, wxEVT_COMMAND_CHOICE_SELECTED, wxCommandEventHandler (FilmEditor::ffmpeg_subtitle_stream_changed), 0, this); - _ffmpeg_audio_stream->Connect (wxID_ANY, wxEVT_COMMAND_CHOICE_SELECTED, wxCommandEventHandler (FilmEditor::ffmpeg_audio_stream_changed), 0, this); _audio_gain->Connect (wxID_ANY, wxEVT_COMMAND_SPINCTRL_UPDATED, wxCommandEventHandler (FilmEditor::audio_gain_changed), 0, this); _audio_gain_calculate_button->Connect ( wxID_ANY, wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler (FilmEditor::audio_gain_calculate_button_clicked), 0, this @@ -420,16 +419,6 @@ FilmEditor::make_audio_panel () grid->Add (s); } - { - add_label_to_sizer (grid, _audio_panel, _("Audio Stream")); - wxBoxSizer* s = new wxBoxSizer (wxHORIZONTAL); - _ffmpeg_audio_stream = new wxChoice (_audio_panel, wxID_ANY); - s->Add (_ffmpeg_audio_stream, 1); - _audio = new wxStaticText (_audio_panel, wxID_ANY, wxT ("")); - s->Add (_audio, 1, wxALIGN_CENTER_VERTICAL | wxLEFT, 8); - grid->Add (s, 1, wxEXPAND); - } - _audio_mapping = new AudioMappingView (_audio_panel); _audio_sizer->Add (_audio_mapping, 1, wxEXPAND | wxALL, 6); @@ -448,10 +437,8 @@ FilmEditor::make_subtitle_panel () _with_subtitles = new wxCheckBox (_subtitle_panel, wxID_ANY, _("With Subtitles")); grid->Add (_with_subtitles, 1); + grid->AddSpacer (0); - _ffmpeg_subtitle_stream = new wxChoice (_subtitle_panel, wxID_ANY); - grid->Add (_ffmpeg_subtitle_stream); - { add_label_to_sizer (grid, _subtitle_panel, _("Subtitle Offset")); wxBoxSizer* s = new wxBoxSizer (wxHORIZONTAL); @@ -628,7 +615,6 @@ FilmEditor::film_changed (Film::Property p) setup_formats (); setup_format (); setup_subtitle_control_sensitivity (); - setup_streams (); setup_show_audio_sensitivity (); setup_length (); break; @@ -756,9 +742,7 @@ FilmEditor::film_content_changed (weak_ptr content, int property) if (property == FFmpegContentProperty::SUBTITLE_STREAMS) { setup_subtitle_control_sensitivity (); - setup_streams (); } else if (property == FFmpegContentProperty::AUDIO_STREAMS) { - setup_streams (); setup_show_audio_sensitivity (); } else if (property == VideoContentProperty::VIDEO_LENGTH || property == AudioContentProperty::AUDIO_LENGTH) { setup_length (); @@ -767,16 +751,8 @@ FilmEditor::film_content_changed (weak_ptr content, int property) setup_content_information (); } } else if (property == FFmpegContentProperty::AUDIO_STREAM) { - if (_film->ffmpeg_audio_stream()) { - checked_set (_ffmpeg_audio_stream, boost::lexical_cast (_film->ffmpeg_audio_stream()->id)); - } setup_dcp_name (); - setup_audio_details (); setup_show_audio_sensitivity (); - } else if (property == FFmpegContentProperty::SUBTITLE_STREAM) { - if (_film->ffmpeg_subtitle_stream()) { - checked_set (_ffmpeg_subtitle_stream, boost::lexical_cast (_film->ffmpeg_subtitle_stream()->id)); - } } } @@ -958,7 +934,6 @@ FilmEditor::set_things_sensitive (bool s) _bottom_crop->Enable (s); _filters_button->Enable (s); _scaler->Enable (s); - _ffmpeg_audio_stream->Enable (s); _dcp_content_type->Enable (s); _best_dcp_frame_rate->Enable (s); _dcp_frame_rate->Enable (s); @@ -1115,7 +1090,7 @@ FilmEditor::setup_subtitle_control_sensitivity () { bool h = false; if (_generally_sensitive && _film) { - h = !_film->ffmpeg_subtitle_streams().empty(); + h = !_film->has_subtitles (); } _with_subtitles->Enable (h); @@ -1125,7 +1100,6 @@ FilmEditor::setup_subtitle_control_sensitivity () j = _film->with_subtitles (); } - _ffmpeg_subtitle_stream->Enable (j); _subtitle_offset->Enable (j); _subtitle_scale->Enable (j); } @@ -1153,93 +1127,6 @@ FilmEditor::edit_dci_button_clicked (wxCommandEvent &) d->Destroy (); } -void -FilmEditor::setup_streams () -{ - if (!_film) { - return; - } - - _ffmpeg_audio_stream->Clear (); - vector a = _film->ffmpeg_audio_streams (); - for (vector::iterator i = a.begin(); i != a.end(); ++i) { - _ffmpeg_audio_stream->Append (std_to_wx (i->name), new wxStringClientData (std_to_wx (boost::lexical_cast (i->id)))); - } - - if (_film->ffmpeg_audio_stream()) { - checked_set (_ffmpeg_audio_stream, boost::lexical_cast (_film->ffmpeg_audio_stream()->id)); - } - - _ffmpeg_subtitle_stream->Clear (); - vector s = _film->ffmpeg_subtitle_streams (); - for (vector::iterator i = s.begin(); i != s.end(); ++i) { - _ffmpeg_subtitle_stream->Append (std_to_wx (i->name), new wxStringClientData (std_to_wx (boost::lexical_cast (i->id)))); - } - - if (_film->ffmpeg_subtitle_stream()) { - checked_set (_ffmpeg_subtitle_stream, boost::lexical_cast (_film->ffmpeg_subtitle_stream()->id)); - } else { - _ffmpeg_subtitle_stream->SetSelection (wxNOT_FOUND); - } -} - -void -FilmEditor::ffmpeg_audio_stream_changed (wxCommandEvent &) -{ - if (!_film) { - return; - } - - vector a = _film->ffmpeg_audio_streams (); - vector::iterator i = a.begin (); - string const s = string_client_data (_ffmpeg_audio_stream->GetClientObject (_ffmpeg_audio_stream->GetSelection ())); - while (i != a.end() && lexical_cast (i->id) != s) { - ++i; - } - - if (i != a.end ()) { - _film->set_ffmpeg_audio_stream (*i); - } -} - -void -FilmEditor::ffmpeg_subtitle_stream_changed (wxCommandEvent &) -{ - if (!_film) { - return; - } - - vector a = _film->ffmpeg_subtitle_streams (); - vector::iterator i = a.begin (); - string const s = string_client_data (_ffmpeg_subtitle_stream->GetClientObject (_ffmpeg_subtitle_stream->GetSelection ())); - while (i != a.end() && lexical_cast (i->id) != s) { - ++i; - } - - if (i != a.end ()) { - _film->set_ffmpeg_subtitle_stream (*i); - } -} - -void -FilmEditor::setup_audio_details () -{ - if (!_film->ffmpeg_audio_stream()) { - _audio->SetLabel (wxT ("")); - } else { - wxString s; - if (_film->audio_channels() == 1) { - s << _("1 channel"); - } else { - s << _film->audio_channels() << wxT (" ") << _("channels"); - } - s << wxT (", ") << _film->audio_frame_rate() << _("Hz"); - _audio->SetLabel (s); - } - - setup_notebook_size (); -} - void FilmEditor::active_jobs_changed (bool a) { @@ -1377,8 +1264,13 @@ FilmEditor::edit_content (shared_ptr c) ImageMagickContentDialog* d = new ImageMagickContentDialog (this, im); d->ShowModal (); d->Destroy (); + } - im->set_video_length (d->video_length() * 24); + shared_ptr ff = dynamic_pointer_cast (c); + if (ff) { + FFmpegContentDialog* d = new FFmpegContentDialog (this, ff); + d->ShowModal (); + d->Destroy (); } } @@ -1426,7 +1318,11 @@ FilmEditor::setup_content_button_sensitivity () shared_ptr selection = selected_content (); - _content_edit->Enable (selection && _generally_sensitive && dynamic_pointer_cast (selection)); + _content_edit->Enable ( + selection && _generally_sensitive && + (dynamic_pointer_cast (selection) || dynamic_pointer_cast (selection)) + ); + _content_remove->Enable (selection && _generally_sensitive); _content_earlier->Enable (selection && _generally_sensitive); _content_later->Enable (selection && _generally_sensitive); diff --git a/src/wx/film_editor.h b/src/wx/film_editor.h index 5944633a8..db657a7d3 100644 --- a/src/wx/film_editor.h +++ b/src/wx/film_editor.h @@ -88,8 +88,6 @@ private: void subtitle_scale_changed (wxCommandEvent &); void colour_lut_changed (wxCommandEvent &); void j2k_bandwidth_changed (wxCommandEvent &); - void ffmpeg_audio_stream_changed (wxCommandEvent &); - void ffmpeg_subtitle_stream_changed (wxCommandEvent &); void dcp_frame_rate_changed (wxCommandEvent &); void best_dcp_frame_rate_clicked (wxCommandEvent &); void edit_filters_clicked (wxCommandEvent &); @@ -103,8 +101,6 @@ private: void set_things_sensitive (bool); void setup_formats (); void setup_subtitle_control_sensitivity (); - void setup_streams (); - void setup_audio_details (); void setup_dcp_name (); void setup_show_audio_sensitivity (); void setup_scaling_description (); @@ -164,10 +160,8 @@ private: wxButton* _audio_gain_calculate_button; wxButton* _show_audio; wxSpinCtrl* _audio_delay; - wxChoice* _ffmpeg_audio_stream; AudioMappingView* _audio_mapping; wxCheckBox* _with_subtitles; - wxChoice* _ffmpeg_subtitle_stream; wxSpinCtrl* _subtitle_offset; wxSpinCtrl* _subtitle_scale; wxChoice* _colour_lut; diff --git a/src/wx/imagemagick_content_dialog.cc b/src/wx/imagemagick_content_dialog.cc index 726e4b8e2..24b92fdaf 100644 --- a/src/wx/imagemagick_content_dialog.cc +++ b/src/wx/imagemagick_content_dialog.cc @@ -26,6 +26,7 @@ using boost::shared_ptr; ImageMagickContentDialog::ImageMagickContentDialog (wxWindow* parent, shared_ptr content) : wxDialog (parent, wxID_ANY, _("Image")) + , _content (content) { wxFlexGridSizer* grid = new wxFlexGridSizer (3, 6, 6); grid->AddGrowableCol (1, 1); @@ -53,10 +54,16 @@ ImageMagickContentDialog::ImageMagickContentDialog (wxWindow* parent, shared_ptr overall_sizer->SetSizeHints (this); checked_set (_video_length, content->video_length () / 24); + _video_length->Connect (wxID_ANY, wxEVT_COMMAND_SPINCTRL_UPDATED, wxCommandEventHandler (ImageMagickContentDialog::video_length_changed), 0, this); } -int -ImageMagickContentDialog::video_length () const +void +ImageMagickContentDialog::video_length_changed (wxCommandEvent &) { - return _video_length->GetValue (); + shared_ptr c = _content.lock (); + if (!c) { + return; + } + + c->set_video_length (_video_length->GetValue() * 24); } diff --git a/src/wx/imagemagick_content_dialog.h b/src/wx/imagemagick_content_dialog.h index 2fa955929..b22ff6817 100644 --- a/src/wx/imagemagick_content_dialog.h +++ b/src/wx/imagemagick_content_dialog.h @@ -27,8 +27,9 @@ class ImageMagickContentDialog : public wxDialog public: ImageMagickContentDialog (wxWindow *, boost::shared_ptr); - int video_length () const; - private: + void video_length_changed (wxCommandEvent &); + + boost::weak_ptr _content; wxSpinCtrl* _video_length; }; diff --git a/src/wx/wscript b/src/wx/wscript index 09bf40393..001e8469e 100644 --- a/src/wx/wscript +++ b/src/wx/wscript @@ -10,6 +10,7 @@ sources = """ config_dialog.cc dci_metadata_dialog.cc dir_picker_ctrl.cc + ffmpeg_content_dialog.cc film_editor.cc film_viewer.cc filter_dialog.cc -- cgit v1.2.3 From 454a961e1a03f60cf05040b832c4f8f01b481fa7 Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Mon, 6 May 2013 14:10:14 +0100 Subject: Add basic timeline window. --- src/lib/audio_content.cc | 6 ++ src/lib/audio_content.h | 2 + src/lib/content.h | 2 + src/lib/ffmpeg_content.cc | 6 ++ src/lib/ffmpeg_content.h | 1 + src/lib/film.cc | 7 ++ src/lib/film.h | 1 + src/lib/types.h | 1 + src/lib/video_content.cc | 6 ++ src/lib/video_content.h | 1 + src/wx/film_editor.cc | 13 ++++ src/wx/film_editor.h | 2 + src/wx/timeline.cc | 191 ++++++++++++++++++++++++++++++++++++++++++++++ src/wx/timeline.h | 37 +++++++++ src/wx/timeline_dialog.cc | 41 ++++++++++ src/wx/timeline_dialog.h | 34 +++++++++ src/wx/wscript | 2 + 17 files changed, 353 insertions(+) create mode 100644 src/wx/timeline.cc create mode 100644 src/wx/timeline.h create mode 100644 src/wx/timeline_dialog.cc create mode 100644 src/wx/timeline_dialog.h (limited to 'src/wx/wscript') diff --git a/src/lib/audio_content.cc b/src/lib/audio_content.cc index 9968f4725..dfa48d97e 100644 --- a/src/lib/audio_content.cc +++ b/src/lib/audio_content.cc @@ -43,3 +43,9 @@ AudioContent::AudioContent (AudioContent const & o) { } + +Time +AudioContent::temporal_length () const +{ + return audio_length() / audio_frame_rate(); +} diff --git a/src/lib/audio_content.h b/src/lib/audio_content.h index 2362786d9..18107843c 100644 --- a/src/lib/audio_content.h +++ b/src/lib/audio_content.h @@ -45,6 +45,8 @@ public: virtual int audio_channels () const = 0; virtual ContentAudioFrame audio_length () const = 0; virtual int audio_frame_rate () const = 0; + + Time temporal_length () const; }; #endif diff --git a/src/lib/content.h b/src/lib/content.h index d39fc9e1a..e1cf41df0 100644 --- a/src/lib/content.h +++ b/src/lib/content.h @@ -25,6 +25,7 @@ #include #include #include +#include "types.h" namespace cxml { class Node; @@ -45,6 +46,7 @@ public: virtual std::string information () const = 0; virtual void as_xml (xmlpp::Node *) const; virtual boost::shared_ptr clone () const = 0; + virtual Time temporal_length () const = 0; boost::filesystem::path file () const { boost::mutex::scoped_lock lm (_mutex); diff --git a/src/lib/ffmpeg_content.cc b/src/lib/ffmpeg_content.cc index 719c4cb53..a61f777c8 100644 --- a/src/lib/ffmpeg_content.cc +++ b/src/lib/ffmpeg_content.cc @@ -280,3 +280,9 @@ FFmpegContent::clone () const { return shared_ptr (new FFmpegContent (*this)); } + +double +FFmpegContent::temporal_length () const +{ + return video_length() / video_frame_rate(); +} diff --git a/src/lib/ffmpeg_content.h b/src/lib/ffmpeg_content.h index 8bf4d42a5..6d7151498 100644 --- a/src/lib/ffmpeg_content.h +++ b/src/lib/ffmpeg_content.h @@ -89,6 +89,7 @@ public: std::string information () const; void as_xml (xmlpp::Node *) const; boost::shared_ptr clone () const; + double temporal_length () const; /* AudioContent */ int audio_channels () const; diff --git a/src/lib/film.cc b/src/lib/film.cc index 2dc97c1b3..a385625e7 100644 --- a/src/lib/film.cc +++ b/src/lib/film.cc @@ -1075,6 +1075,13 @@ Film::player () const return shared_ptr (new Player (shared_from_this (), _playlist)); } +shared_ptr +Film::playlist () const +{ + boost::mutex::scoped_lock lm (_state_mutex); + return _playlist; +} + ContentList Film::content () const { diff --git a/src/lib/film.h b/src/lib/film.h index 8748e18f5..e2f9b101a 100644 --- a/src/lib/film.h +++ b/src/lib/film.h @@ -103,6 +103,7 @@ public: bool have_dcp () const; boost::shared_ptr player () const; + boost::shared_ptr playlist () const; /* Proxies for some Playlist methods */ diff --git a/src/lib/types.h b/src/lib/types.h index c2bb9d853..f9e9b2f4b 100644 --- a/src/lib/types.h +++ b/src/lib/types.h @@ -29,6 +29,7 @@ class Content; typedef std::vector > ContentList; typedef int64_t ContentAudioFrame; typedef int ContentVideoFrame; +typedef double Time; /** @struct Crop * @brief A description of the crop of an image or video. diff --git a/src/lib/video_content.cc b/src/lib/video_content.cc index 9fb2b9bce..2af6ba908 100644 --- a/src/lib/video_content.cc +++ b/src/lib/video_content.cc @@ -104,3 +104,9 @@ VideoContent::information () const return s.str (); } + +Time +VideoContent::temporal_length () const +{ + return video_length() / video_frame_rate(); +} diff --git a/src/lib/video_content.h b/src/lib/video_content.h index 75e507d4d..b2ec87e2b 100644 --- a/src/lib/video_content.h +++ b/src/lib/video_content.h @@ -42,6 +42,7 @@ public: void as_xml (xmlpp::Node *) const; virtual std::string information () const; + Time temporal_length () const; ContentVideoFrame video_length () const { boost::mutex::scoped_lock lm (_mutex); diff --git a/src/wx/film_editor.cc b/src/wx/film_editor.cc index db3e03d78..c50782452 100644 --- a/src/wx/film_editor.cc +++ b/src/wx/film_editor.cc @@ -52,6 +52,7 @@ #include "imagemagick_content_dialog.h" #include "ffmpeg_content_dialog.h" #include "audio_mapping_view.h" +#include "timeline_dialog.h" using std::string; using std::cout; @@ -215,6 +216,7 @@ FilmEditor::connect_to_widgets () _content_edit->Connect (wxID_ANY, wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler (FilmEditor::content_edit_clicked), 0, this); _content_earlier->Connect (wxID_ANY, wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler (FilmEditor::content_earlier_clicked), 0, this); _content_later->Connect (wxID_ANY, wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler (FilmEditor::content_later_clicked), 0, this); + _timeline_button->Connect (wxID_ANY, wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler (FilmEditor::timeline_clicked), 0, this); _loop_content->Connect (wxID_ANY, wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler (FilmEditor::loop_content_toggled), 0, this); _loop_count->Connect (wxID_ANY, wxEVT_COMMAND_SPINCTRL_UPDATED, wxCommandEventHandler (FilmEditor::loop_count_changed), 0, this); _left_crop->Connect (wxID_ANY, wxEVT_COMMAND_SPINCTRL_UPDATED, wxCommandEventHandler (FilmEditor::left_crop_changed), 0, this); @@ -388,6 +390,9 @@ FilmEditor::make_content_panel () font.SetPointSize(font.GetPointSize() - 1); _playlist_description->SetFont(font); + _timeline_button = new wxButton (_content_panel, wxID_ANY, _("Timeline...")); + _content_sizer->Add (_timeline_button, 0, wxALL, 6); + _loop_count->SetRange (2, 1024); } @@ -1449,3 +1454,11 @@ FilmEditor::setup_playlist_description () _playlist_description->SetLabel (std_to_wx (_film->playlist_description ())); } + +void +FilmEditor::timeline_clicked (wxCommandEvent &) +{ + TimelineDialog* d = new TimelineDialog (this, _film->playlist ()); + d->ShowModal (); + d->Destroy (); +} diff --git a/src/wx/film_editor.h b/src/wx/film_editor.h index baaeb46d7..fddd213b9 100644 --- a/src/wx/film_editor.h +++ b/src/wx/film_editor.h @@ -93,6 +93,7 @@ private: void edit_filters_clicked (wxCommandEvent &); void loop_content_toggled (wxCommandEvent &); void loop_count_changed (wxCommandEvent &); + void timeline_clicked (wxCommandEvent &); /* Handle changes to the model */ void film_changed (Film::Property); @@ -145,6 +146,7 @@ private: wxTextCtrl* _content_information; wxCheckBox* _loop_content; wxSpinCtrl* _loop_count; + wxButton* _timeline_button; wxStaticText* _playlist_description; wxButton* _edit_dci_button; wxChoice* _format; diff --git a/src/wx/timeline.cc b/src/wx/timeline.cc new file mode 100644 index 000000000..828756362 --- /dev/null +++ b/src/wx/timeline.cc @@ -0,0 +1,191 @@ +/* + Copyright (C) 2013 Carl Hetherington + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + +*/ + +#include +#include +#include "timeline.h" +#include "wx_util.h" +#include "playlist.h" + +using std::list; +using std::cout; +using std::max; +using boost::shared_ptr; + +int const Timeline::_track_height = 64; + +Timeline::Timeline (wxWindow* parent, shared_ptr pl) + : wxPanel (parent) + , _playlist (pl) +{ + SetDoubleBuffered (true); + + Connect (wxID_ANY, wxEVT_PAINT, wxPaintEventHandler (Timeline::paint), 0, this); + + if (pl->audio_from() == Playlist::AUDIO_FFMPEG) { + SetMinSize (wxSize (640, _track_height * 2 + 96)); + } else { + SetMinSize (wxSize (640, _track_height * (max (1UL, pl->audio().size()) + 1) + 96)); + } +} + +template +int +plot_content_list ( + list > content, wxGraphicsContext* gc, int x, int y, double pixels_per_second, int track_height, wxString type, bool consecutive + ) +{ + Time t = 0; + for (typename list >::iterator i = content.begin(); i != content.end(); ++i) { + Time const len = (*i)->temporal_length (); + wxGraphicsPath path = gc->CreatePath (); + path.MoveToPoint (x + t * pixels_per_second, y); + path.AddLineToPoint (x + (t + len) * pixels_per_second, y); + path.AddLineToPoint (x + (t + len) * pixels_per_second, y + track_height); + path.AddLineToPoint (x + t * pixels_per_second, y + track_height); + path.AddLineToPoint (x + t * pixels_per_second, y); + gc->StrokePath (path); + gc->FillPath (path); + + wxString name = wxString::Format ("%s [%s]", std_to_wx ((*i)->file().filename().string()), type); + wxDouble name_width; + wxDouble name_height; + wxDouble name_descent; + wxDouble name_leading; + gc->GetTextExtent (name, &name_width, &name_height, &name_descent, &name_leading); + + gc->Clip (wxRegion (x + t * pixels_per_second, y, len * pixels_per_second, track_height)); + gc->DrawText (name, t * pixels_per_second + 12, y + track_height - name_height - 4); + gc->ResetClip (); + + if (consecutive) { + t += len; + } else { + y += track_height; + } + } + + if (consecutive) { + y += track_height; + } + + return y; +} + +void +Timeline::paint (wxPaintEvent &) +{ + wxPaintDC dc (this); + + shared_ptr pl = _playlist.lock (); + if (!pl) { + return; + } + + wxGraphicsContext* gc = wxGraphicsContext::Create (dc); + if (!gc) { + return; + } + + int const x_offset = 8; + int y = 8; + int const width = GetSize().GetWidth(); + double const pixels_per_second = (width - x_offset * 2) / (pl->content_length() / pl->video_frame_rate()); + + gc->SetFont (gc->CreateFont (*wxNORMAL_FONT)); + + gc->SetPen (*wxBLACK_PEN); +#if wxMAJOR_VERSION == 2 && wxMINOR_VERSION >= 9 + gc->SetPen (*wxThePenList->FindOrCreatePen (wxColour (0, 0, 0), 4, wxPENSTYLE_SOLID)); + gc->SetBrush (*wxTheBrushList->FindOrCreateBrush (wxColour (149, 121, 232, 255), wxBRUSHSTYLE_SOLID)); +#else + gc->SetPen (*wxThePenList->FindOrCreatePen (wxColour (0, 0, 0), 4, SOLID)); + gc->SetBrush (*wxTheBrushList->FindOrCreateBrush (wxColour (149, 121, 232, 255), SOLID)); +#endif + y = plot_content_list (pl->video (), gc, x_offset, y, pixels_per_second, _track_height, _("video"), true); + +#if wxMAJOR_VERSION == 2 && wxMINOR_VERSION >= 9 + gc->SetBrush (*wxTheBrushList->FindOrCreateBrush (wxColour (242, 92, 120, 255), wxBRUSHSTYLE_SOLID)); +#else + gc->SetBrush (*wxTheBrushList->FindOrCreateBrush (wxColour (242, 92, 120, 255), SOLID)); +#endif + y = plot_content_list (pl->audio (), gc, x_offset, y, pixels_per_second, _track_height, _("audio"), pl->audio_from() == Playlist::AUDIO_FFMPEG); + + /* Time axis */ + +#if wxMAJOR_VERSION == 2 && wxMINOR_VERSION >= 9 + gc->SetPen (*wxThePenList->FindOrCreatePen (wxColour (0, 0, 0), 1, wxPENSTYLE_SOLID)); +#else + gc->SetPen (*wxThePenList->FindOrCreatePen (wxColour (0, 0, 0), 1, SOLID)); +#endif + + int mark_interval = rint (128 / pixels_per_second); + if (mark_interval > 5) { + mark_interval -= mark_interval % 5; + } + if (mark_interval > 10) { + mark_interval -= mark_interval % 10; + } + if (mark_interval > 60) { + mark_interval -= mark_interval % 60; + } + if (mark_interval > 3600) { + mark_interval -= mark_interval % 3600; + } + + if (mark_interval < 1) { + mark_interval = 1; + } + + wxGraphicsPath path = gc->CreatePath (); + path.MoveToPoint (x_offset, y + 40); + path.AddLineToPoint (width, y + 40); + gc->StrokePath (path); + + double t = 0; + while ((t * pixels_per_second) < width) { + wxGraphicsPath path = gc->CreatePath (); + path.MoveToPoint (x_offset + t * pixels_per_second, y + 36); + path.AddLineToPoint (x_offset + t * pixels_per_second, y + 44); + gc->StrokePath (path); + + int tc = t; + int const h = tc / 3600; + tc -= h * 3600; + int const m = tc / 60; + tc -= m * 60; + int const s = tc; + + wxString str = wxString::Format ("%02d:%02d:%02d", h, m, s); + wxDouble str_width; + wxDouble str_height; + wxDouble str_descent; + wxDouble str_leading; + gc->GetTextExtent (str, &str_width, &str_height, &str_descent, &str_leading); + + int const tx = x_offset + t * pixels_per_second; + if ((tx + str_width) < width) { + gc->DrawText (str, x_offset + t * pixels_per_second, y + 60); + } + t += mark_interval; + } + + delete gc; +} + diff --git a/src/wx/timeline.h b/src/wx/timeline.h new file mode 100644 index 000000000..48aebc637 --- /dev/null +++ b/src/wx/timeline.h @@ -0,0 +1,37 @@ +/* + Copyright (C) 2013 Carl Hetherington + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + +*/ + +#include +#include +#include + +class Playlist; + +class Timeline : public wxPanel +{ +public: + Timeline (wxWindow *, boost::shared_ptr); + +private: + void paint (wxPaintEvent &); + + static int const _track_height; + + boost::weak_ptr _playlist; +}; diff --git a/src/wx/timeline_dialog.cc b/src/wx/timeline_dialog.cc new file mode 100644 index 000000000..5633c29e7 --- /dev/null +++ b/src/wx/timeline_dialog.cc @@ -0,0 +1,41 @@ +/* + Copyright (C) 2013 Carl Hetherington + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + +*/ + +#include +#include +#include "timeline_dialog.h" +#include "wx_util.h" +#include "playlist.h" + +using std::list; +using std::cout; +using boost::shared_ptr; + +TimelineDialog::TimelineDialog (wxWindow* parent, shared_ptr pl) + : wxDialog (parent, wxID_ANY, _("Timeline"), wxDefaultPosition, wxSize (640, 512), wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER) + , _timeline (this, pl) +{ + wxBoxSizer* sizer = new wxBoxSizer (wxVERTICAL); + + sizer->Add (&_timeline, 1, wxEXPAND | wxALL, 12); + + SetSizer (sizer); + sizer->Layout (); + sizer->SetSizeHints (this); +} diff --git a/src/wx/timeline_dialog.h b/src/wx/timeline_dialog.h new file mode 100644 index 000000000..e58de5540 --- /dev/null +++ b/src/wx/timeline_dialog.h @@ -0,0 +1,34 @@ +/* + Copyright (C) 2013 Carl Hetherington + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + +*/ + +#include +#include +#include +#include "timeline.h" + +class Playlist; + +class TimelineDialog : public wxDialog +{ +public: + TimelineDialog (wxWindow *, boost::shared_ptr); + +private: + Timeline _timeline; +}; diff --git a/src/wx/wscript b/src/wx/wscript index 001e8469e..c63ef128d 100644 --- a/src/wx/wscript +++ b/src/wx/wscript @@ -22,6 +22,8 @@ sources = """ new_film_dialog.cc properties_dialog.cc server_dialog.cc + timeline.cc + timeline_dialog.cc wx_util.cc wx_ui_signaller.cc """ -- cgit v1.2.3 From 02e4022f540915f8a38f9ab9576ac896fe39a1ab Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Tue, 21 May 2013 22:25:09 +0100 Subject: Vaguely working new layout. --- branch-notes | 7 +- src/lib/content.cc | 2 +- src/lib/content.h | 2 +- src/lib/examine_content_job.cc | 5 +- src/lib/examine_content_job.h | 3 +- src/lib/ffmpeg_content.cc | 18 +- src/lib/ffmpeg_content.h | 2 +- src/lib/film.cc | 82 +------- src/lib/film.h | 39 ---- src/lib/imagemagick_content.cc | 4 +- src/lib/imagemagick_content.h | 2 +- src/lib/sndfile_content.cc | 4 +- src/lib/sndfile_content.h | 2 +- src/lib/writer.cc | 15 +- src/tools/po/es_ES.po | 5 - src/wx/ffmpeg_content_dialog.cc | 167 --------------- src/wx/ffmpeg_content_dialog.h | 47 ----- src/wx/film_editor.cc | 451 ++++++++++++++++++---------------------- src/wx/film_editor.h | 40 ++-- src/wx/wscript | 1 - test/test.cc | 5 - 21 files changed, 245 insertions(+), 658 deletions(-) delete mode 100644 src/wx/ffmpeg_content_dialog.cc delete mode 100644 src/wx/ffmpeg_content_dialog.h (limited to 'src/wx/wscript') diff --git a/branch-notes b/branch-notes index 0ed4dbb6a..134883135 100644 --- a/branch-notes +++ b/branch-notes @@ -1,3 +1,8 @@ ffmpeg content selected stream is really a playlist thing. - +things to put back + frame rate description + trust content header? + overall length? + trim method (trim in general) + A/B diff --git a/src/lib/content.cc b/src/lib/content.cc index 578dafd67..618dafee2 100644 --- a/src/lib/content.cc +++ b/src/lib/content.cc @@ -62,7 +62,7 @@ Content::as_xml (xmlpp::Node* node) const } void -Content::examine (shared_ptr, shared_ptr, bool) +Content::examine (shared_ptr, shared_ptr) { string const d = md5_digest (_file); boost::mutex::scoped_lock lm (_mutex); diff --git a/src/lib/content.h b/src/lib/content.h index fd6288acc..b8062b280 100644 --- a/src/lib/content.h +++ b/src/lib/content.h @@ -43,7 +43,7 @@ public: Content (boost::shared_ptr); Content (Content const &); - virtual void examine (boost::shared_ptr, boost::shared_ptr, bool); + virtual void examine (boost::shared_ptr, boost::shared_ptr); virtual std::string summary () const = 0; virtual std::string information () const = 0; virtual void as_xml (xmlpp::Node *) const; diff --git a/src/lib/examine_content_job.cc b/src/lib/examine_content_job.cc index aad7f265e..21ab4a71d 100644 --- a/src/lib/examine_content_job.cc +++ b/src/lib/examine_content_job.cc @@ -27,10 +27,9 @@ using std::string; using boost::shared_ptr; -ExamineContentJob::ExamineContentJob (shared_ptr f, shared_ptr c, bool q) +ExamineContentJob::ExamineContentJob (shared_ptr f, shared_ptr c) : Job (f) , _content (c) - , _quick (q) { } @@ -48,7 +47,7 @@ ExamineContentJob::name () const void ExamineContentJob::run () { - _content->examine (_film, shared_from_this (), _quick); + _content->examine (_film, shared_from_this ()); set_progress (1); set_state (FINISHED_OK); } diff --git a/src/lib/examine_content_job.h b/src/lib/examine_content_job.h index dc0d53fff..86f1ab111 100644 --- a/src/lib/examine_content_job.h +++ b/src/lib/examine_content_job.h @@ -26,7 +26,7 @@ class Log; class ExamineContentJob : public Job { public: - ExamineContentJob (boost::shared_ptr, boost::shared_ptr, bool); + ExamineContentJob (boost::shared_ptr, boost::shared_ptr); ~ExamineContentJob (); std::string name () const; @@ -34,6 +34,5 @@ public: private: boost::shared_ptr _content; - bool _quick; }; diff --git a/src/lib/ffmpeg_content.cc b/src/lib/ffmpeg_content.cc index fcc775f0a..2a4283353 100644 --- a/src/lib/ffmpeg_content.cc +++ b/src/lib/ffmpeg_content.cc @@ -112,26 +112,17 @@ FFmpegContent::as_xml (xmlpp::Node* node) const } void -FFmpegContent::examine (shared_ptr film, shared_ptr job, bool quick) +FFmpegContent::examine (shared_ptr film, shared_ptr job) { job->set_progress_unknown (); - Content::examine (film, job, quick); + Content::examine (film, job); shared_ptr decoder (new FFmpegDecoder (film, shared_from_this (), true, false, false)); ContentVideoFrame video_length = 0; - if (quick) { - video_length = decoder->video_length (); - film->log()->log (String::compose ("Video length obtained from header as %1 frames", decoder->video_length ())); - } else { - while (!decoder->pass ()) { - /* keep going */ - } - - video_length = decoder->video_frame (); - film->log()->log (String::compose ("Video length examined as %1 frames", decoder->video_frame ())); - } + video_length = decoder->video_length (); + film->log()->log (String::compose ("Video length obtained from header as %1 frames", decoder->video_length ())); { boost::mutex::scoped_lock lm (_mutex); @@ -332,7 +323,6 @@ FFmpegContent::audio_mapping () const return AudioMapping (); } - cout << "returning am from stream " << _audio_stream.get() << ".\n"; return _audio_stream->mapping; } diff --git a/src/lib/ffmpeg_content.h b/src/lib/ffmpeg_content.h index d79e4ec35..9d842515e 100644 --- a/src/lib/ffmpeg_content.h +++ b/src/lib/ffmpeg_content.h @@ -88,7 +88,7 @@ public: return boost::dynamic_pointer_cast (Content::shared_from_this ()); } - void examine (boost::shared_ptr, boost::shared_ptr, bool); + void examine (boost::shared_ptr, boost::shared_ptr); std::string summary () const; std::string information () const; void as_xml (xmlpp::Node *) const; diff --git a/src/lib/film.cc b/src/lib/film.cc index 487499e32..ef67a2704 100644 --- a/src/lib/film.cc +++ b/src/lib/film.cc @@ -94,13 +94,9 @@ int const Film::state_version = 4; Film::Film (string d, bool must_exist) : _playlist (new Playlist) , _use_dci_name (true) - , _trust_content_headers (true) , _dcp_content_type (Config::instance()->default_dcp_content_type ()) , _format (Config::instance()->default_format ()) , _scaler (Scaler::from_id ("bicubic")) - , _trim_start (0) - , _trim_end (0) - , _trim_type (CPL) , _ab (false) , _audio_gain (0) , _audio_delay (0) @@ -163,15 +159,11 @@ Film::Film (Film const & o) , _directory (o._directory) , _name (o._name) , _use_dci_name (o._use_dci_name) - , _trust_content_headers (o._trust_content_headers) , _dcp_content_type (o._dcp_content_type) , _format (o._format) , _crop (o._crop) , _filters (o._filters) , _scaler (o._scaler) - , _trim_start (o._trim_start) - , _trim_end (o._trim_end) - , _trim_type (o._trim_type) , _ab (o._ab) , _audio_gain (o._audio_gain) , _audio_delay (o._audio_delay) @@ -355,7 +347,7 @@ Film::analyse_audio () void Film::examine_content (shared_ptr c) { - shared_ptr j (new ExamineContentJob (shared_from_this(), c, trust_content_headers ())); + shared_ptr j (new ExamineContentJob (shared_from_this(), c)); JobManager::instance()->add (j); } @@ -413,7 +405,6 @@ Film::write_metadata () const root->add_child("Version")->add_child_text (boost::lexical_cast (state_version)); root->add_child("Name")->add_child_text (_name); root->add_child("UseDCIName")->add_child_text (_use_dci_name ? "1" : "0"); - root->add_child("TrustContentHeaders")->add_child_text (_trust_content_headers ? "1" : "0"); if (_dcp_content_type) { root->add_child("DCPContentType")->add_child_text (_dcp_content_type->dci_name ()); @@ -423,14 +414,6 @@ Film::write_metadata () const root->add_child("Format")->add_child_text (_format->id ()); } - switch (_trim_type) { - case CPL: - root->add_child("TrimType")->add_child_text ("CPL"); - break; - case ENCODE: - root->add_child("TrimType")->add_child_text ("Encode"); - } - root->add_child("LeftCrop")->add_child_text (boost::lexical_cast (_crop.left)); root->add_child("RightCrop")->add_child_text (boost::lexical_cast (_crop.right)); root->add_child("TopCrop")->add_child_text (boost::lexical_cast (_crop.top)); @@ -441,8 +424,6 @@ Film::write_metadata () const } root->add_child("Scaler")->add_child_text (_scaler->id ()); - root->add_child("TrimStart")->add_child_text (boost::lexical_cast (_trim_start)); - root->add_child("TrimEnd")->add_child_text (boost::lexical_cast (_trim_end)); root->add_child("AB")->add_child_text (_ab ? "1" : "0"); root->add_child("AudioGain")->add_child_text (boost::lexical_cast (_audio_gain)); root->add_child("AudioDelay")->add_child_text (boost::lexical_cast (_audio_delay)); @@ -476,7 +457,6 @@ Film::read_metadata () _name = f.string_child ("Name"); _use_dci_name = f.bool_child ("UseDCIName"); - _trust_content_headers = f.bool_child ("TrustContentHeaders"); { optional c = f.optional_string_child ("DCPContentType"); @@ -492,15 +472,6 @@ Film::read_metadata () } } - { - optional c = f.optional_string_child ("TrimType"); - if (!c || c.get() == "CPL") { - _trim_type = CPL; - } else if (c && c.get() == "Encode") { - _trim_type = ENCODE; - } - } - _crop.left = f.number_child ("LeftCrop"); _crop.right = f.number_child ("RightCrop"); _crop.top = f.number_child ("TopCrop"); @@ -514,8 +485,6 @@ Film::read_metadata () } _scaler = Scaler::from_id (f.string_child ("Scaler")); - _trim_start = f.number_child ("TrimStart"); - _trim_end = f.number_child ("TrimEnd"); _ab = f.bool_child ("AB"); _audio_gain = f.number_child ("AudioGain"); _audio_delay = f.number_child ("AudioDelay"); @@ -686,25 +655,6 @@ Film::set_use_dci_name (bool u) signal_changed (USE_DCI_NAME); } -void -Film::set_trust_content_headers (bool t) -{ - { - boost::mutex::scoped_lock lm (_state_mutex); - _trust_content_headers = t; - } - - signal_changed (TRUST_CONTENT_HEADERS); - - Playlist::ContentList content = _playlist->content (); - if (!_trust_content_headers && !content.empty()) { - /* We just said that we don't trust the content's header */ - for (Playlist::ContentList::iterator i = content.begin(); i != content.end(); ++i) { - examine_content (*i); - } - } -} - void Film::set_dcp_content_type (DCPContentType const * t) { @@ -812,36 +762,6 @@ Film::set_scaler (Scaler const * s) signal_changed (SCALER); } -void -Film::set_trim_start (int t) -{ - { - boost::mutex::scoped_lock lm (_state_mutex); - _trim_start = t; - } - signal_changed (TRIM_START); -} - -void -Film::set_trim_end (int t) -{ - { - boost::mutex::scoped_lock lm (_state_mutex); - _trim_end = t; - } - signal_changed (TRIM_END); -} - -void -Film::set_trim_type (TrimType t) -{ - { - boost::mutex::scoped_lock lm (_state_mutex); - _trim_type = t; - } - signal_changed (TRIM_TYPE); -} - void Film::set_ab (bool a) { diff --git a/src/lib/film.h b/src/lib/film.h index c0417382f..6dd2b446d 100644 --- a/src/lib/film.h +++ b/src/lib/film.h @@ -120,11 +120,6 @@ public: void set_loop (int); int loop () const; - enum TrimType { - CPL, - ENCODE - }; - /** Identifiers for the parts of our state; used for signalling changes. */ @@ -132,7 +127,6 @@ public: NONE, NAME, USE_DCI_NAME, - TRUST_CONTENT_HEADERS, /** The playlist's content list has changed (i.e. content has been added, moved around or removed) */ CONTENT, LOOP, @@ -141,10 +135,7 @@ public: CROP, FILTERS, SCALER, - TRIM_START, - TRIM_END, AB, - TRIM_TYPE, AUDIO_GAIN, AUDIO_DELAY, WITH_SUBTITLES, @@ -174,11 +165,6 @@ public: return _use_dci_name; } - bool trust_content_headers () const { - boost::mutex::scoped_lock lm (_state_mutex); - return _trust_content_headers; - } - DCPContentType const * dcp_content_type () const { boost::mutex::scoped_lock lm (_state_mutex); return _dcp_content_type; @@ -204,21 +190,6 @@ public: return _scaler; } - int trim_start () const { - boost::mutex::scoped_lock lm (_state_mutex); - return _trim_start; - } - - int trim_end () const { - boost::mutex::scoped_lock lm (_state_mutex); - return _trim_end; - } - - TrimType trim_type () const { - boost::mutex::scoped_lock lm (_state_mutex); - return _trim_type; - } - bool ab () const { boost::mutex::scoped_lock lm (_state_mutex); return _ab; @@ -275,7 +246,6 @@ public: void set_directory (std::string); void set_name (std::string); void set_use_dci_name (bool); - void set_trust_content_headers (bool); void add_content (boost::shared_ptr); void remove_content (boost::shared_ptr); void set_dcp_content_type (DCPContentType const *); @@ -287,10 +257,7 @@ public: void set_bottom_crop (int); void set_filters (std::vector); void set_scaler (Scaler const *); - void set_trim_start (int); - void set_trim_end (int); void set_ab (bool); - void set_trim_type (TrimType); void set_audio_gain (float); void set_audio_delay (int); void set_with_subtitles (bool); @@ -340,7 +307,6 @@ private: std::string _name; /** True if a auto-generated DCI-compliant name should be used for our DCP */ bool _use_dci_name; - bool _trust_content_headers; /** The type of content that this Film represents (feature, trailer etc.) */ DCPContentType const * _dcp_content_type; /** The format to present this Film in (flat, scope, etc.) */ @@ -351,11 +317,6 @@ private: std::vector _filters; /** Scaler algorithm to use */ Scaler const * _scaler; - /** Frames to trim off the start of the DCP */ - int _trim_start; - /** Frames to trim off the end of the DCP */ - int _trim_end; - TrimType _trim_type; /** true to create an A/B comparison DCP, where the left half of the image is the video without any filters or post-processing, and the right half has the specified filters and post-processing. diff --git a/src/lib/imagemagick_content.cc b/src/lib/imagemagick_content.cc index 2e42e25f3..f9daf204e 100644 --- a/src/lib/imagemagick_content.cc +++ b/src/lib/imagemagick_content.cc @@ -66,9 +66,9 @@ ImageMagickContent::as_xml (xmlpp::Node* node) const } void -ImageMagickContent::examine (shared_ptr film, shared_ptr job, bool quick) +ImageMagickContent::examine (shared_ptr film, shared_ptr job) { - Content::examine (film, job, quick); + Content::examine (film, job); shared_ptr decoder (new ImageMagickDecoder (film, shared_from_this())); { diff --git a/src/lib/imagemagick_content.h b/src/lib/imagemagick_content.h index 366049002..b7f2cd2c3 100644 --- a/src/lib/imagemagick_content.h +++ b/src/lib/imagemagick_content.h @@ -34,7 +34,7 @@ public: return boost::dynamic_pointer_cast (Content::shared_from_this ()); }; - void examine (boost::shared_ptr, boost::shared_ptr, bool); + void examine (boost::shared_ptr, boost::shared_ptr); std::string summary () const; void as_xml (xmlpp::Node *) const; boost::shared_ptr clone () const; diff --git a/src/lib/sndfile_content.cc b/src/lib/sndfile_content.cc index 13b118fb2..758ae942d 100644 --- a/src/lib/sndfile_content.cc +++ b/src/lib/sndfile_content.cc @@ -93,10 +93,10 @@ SndfileContent::clone () const } void -SndfileContent::examine (shared_ptr film, shared_ptr job, bool quick) +SndfileContent::examine (shared_ptr film, shared_ptr job) { job->set_progress_unknown (); - Content::examine (film, job, quick); + Content::examine (film, job); SndfileDecoder dec (film, shared_from_this()); diff --git a/src/lib/sndfile_content.h b/src/lib/sndfile_content.h index 1ef4b3f02..bb7fa5f50 100644 --- a/src/lib/sndfile_content.h +++ b/src/lib/sndfile_content.h @@ -38,7 +38,7 @@ public: return boost::dynamic_pointer_cast (Content::shared_from_this ()); } - void examine (boost::shared_ptr, boost::shared_ptr, bool); + void examine (boost::shared_ptr, boost::shared_ptr); std::string summary () const; std::string information () const; void as_xml (xmlpp::Node *) const; diff --git a/src/lib/writer.cc b/src/lib/writer.cc index f1451763e..96c797c5a 100644 --- a/src/lib/writer.cc +++ b/src/lib/writer.cc @@ -264,15 +264,8 @@ Writer::finish () _sound_asset_writer->finalize (); int const frames = _last_written_frame + 1; - int duration = 0; - if (_film->trim_type() == Film::CPL) { - duration = frames - _film->trim_start() - _film->trim_end(); - _picture_asset->set_entry_point (_film->trim_start ()); - } else { - duration = frames; - } - _picture_asset->set_duration (duration); + _picture_asset->set_duration (frames); /* Hard-link the video MXF into the DCP */ @@ -296,11 +289,7 @@ Writer::finish () _picture_asset->set_directory (_film->dir (_film->dcp_name ())); _picture_asset->set_file_name (_film->dcp_video_mxf_filename ()); - - if (_film->trim_type() == Film::CPL) { - _sound_asset->set_entry_point (_film->trim_start ()); - } - _sound_asset->set_duration (duration); + _sound_asset->set_duration (frames); libdcp::DCP dcp (_film->dir (_film->dcp_name())); diff --git a/src/tools/po/es_ES.po b/src/tools/po/es_ES.po index b64478334..bceb9ffff 100644 --- a/src/tools/po/es_ES.po +++ b/src/tools/po/es_ES.po @@ -85,7 +85,6 @@ msgstr "No se pudo cargar la película %s (%s)" msgid "Could not open film at %s (%s)" msgstr "No se pudo cargar la película en %s (%s)" -<<<<<<< HEAD #: src/tools/dcpomatic.cc:287 src/tools/dcpomatic.cc:410 #: src/tools/dcpomatic.cc:531 msgid "DCP-o-matic" @@ -101,10 +100,6 @@ msgstr "Película cambiada" msgid "DVD-o-matic" msgstr "DVD-o-matic" -#: src/tools/dvdomatic.cc:76 -msgid "Film changed" -msgstr "Película cambiada" - #: src/tools/dvdomatic.cc:425 msgid "Free, open-source DCP generation from almost anything." msgstr "" diff --git a/src/wx/ffmpeg_content_dialog.cc b/src/wx/ffmpeg_content_dialog.cc deleted file mode 100644 index 2731782ca..000000000 --- a/src/wx/ffmpeg_content_dialog.cc +++ /dev/null @@ -1,167 +0,0 @@ -/* -*- c-basic-offset: 8; default-tab-width: 8; -*- */ - -/* - Copyright (C) 2013 Carl Hetherington - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - -*/ - -#include -#include "lib/ffmpeg_content.h" -#include "lib/playlist.h" -#include "ffmpeg_content_dialog.h" -#include "wx_util.h" -#include "audio_mapping_view.h" - -using std::vector; -using std::string; -using std::cout; -using boost::shared_ptr; -using boost::lexical_cast; -using boost::dynamic_pointer_cast; - -FFmpegContentDialog::FFmpegContentDialog (wxWindow* parent, shared_ptr content) - : wxDialog (parent, wxID_ANY, _("Video")) - , _content (content) -{ - wxFlexGridSizer* grid = new wxFlexGridSizer (3, 6, 6); - grid->AddGrowableCol (1, 1); - - add_label_to_sizer (grid, this, _("Audio stream")); - _audio_stream = new wxChoice (this, wxID_ANY); - grid->Add (_audio_stream, 1, wxEXPAND | wxALL, 6); - _audio_description = new wxStaticText (this, wxID_ANY, wxT ("")); - grid->Add (_audio_description, 1, wxALIGN_CENTER_VERTICAL | wxLEFT, 8); - - add_label_to_sizer (grid, this, _("Subtitle stream")); - _subtitle_stream = new wxChoice (this, wxID_ANY); - grid->Add (_subtitle_stream, 1, wxEXPAND | wxALL, 6); - grid->AddSpacer (0); - - _audio_stream->Clear (); - vector > a = content->audio_streams (); - for (vector >::iterator i = a.begin(); i != a.end(); ++i) { - _audio_stream->Append (std_to_wx ((*i)->name), new wxStringClientData (std_to_wx (lexical_cast ((*i)->id)))); - } - - if (content->audio_stream()) { - checked_set (_audio_stream, lexical_cast (content->audio_stream()->id)); - } - - _subtitle_stream->Clear (); - vector > s = content->subtitle_streams (); - if (s.empty ()) { - _subtitle_stream->Enable (false); - } - for (vector >::iterator i = s.begin(); i != s.end(); ++i) { - _subtitle_stream->Append (std_to_wx ((*i)->name), new wxStringClientData (std_to_wx (lexical_cast ((*i)->id)))); - } - - if (content->subtitle_stream()) { - checked_set (_subtitle_stream, lexical_cast (content->subtitle_stream()->id)); - } else { - _subtitle_stream->SetSelection (wxNOT_FOUND); - } - - wxBoxSizer* overall_sizer = new wxBoxSizer (wxVERTICAL); - - overall_sizer->Add (grid, 1, wxEXPAND | wxALL, 6); - - _audio_mapping = new AudioMappingView (this); - _audio_mapping->set_mapping (content->audio_mapping ()); - overall_sizer->Add (_audio_mapping, 1, wxEXPAND | wxALL, 6); - - wxSizer* buttons = CreateSeparatedButtonSizer (wxOK); - if (buttons) { - overall_sizer->Add (buttons, wxSizerFlags().Expand().DoubleBorder()); - } - - SetSizer (overall_sizer); - overall_sizer->Layout (); - overall_sizer->SetSizeHints (this); - - _audio_stream->Connect (wxID_ANY, wxEVT_COMMAND_CHOICE_SELECTED, wxCommandEventHandler (FFmpegContentDialog::audio_stream_changed), 0, this); - _subtitle_stream->Connect (wxID_ANY, wxEVT_COMMAND_CHOICE_SELECTED, wxCommandEventHandler (FFmpegContentDialog::subtitle_stream_changed), 0, this); - _audio_mapping->Changed.connect (bind (&FFmpegContentDialog::audio_mapping_changed, this, _1)); -} - -void -FFmpegContentDialog::audio_stream_changed (wxCommandEvent &) -{ - shared_ptr c = _content.lock (); - if (!c) { - return; - } - - vector > a = c->audio_streams (); - vector >::iterator i = a.begin (); - string const s = string_client_data (_audio_stream->GetClientObject (_audio_stream->GetSelection ())); - while (i != a.end() && lexical_cast ((*i)->id) != s) { - ++i; - } - - if (i != a.end ()) { - c->set_audio_stream (*i); - } - - if (!c->audio_stream ()) { - _audio_description->SetLabel (wxT ("")); - } else { - wxString s; - if (c->audio_channels() == 1) { - s << _("1 channel"); - } else { - s << c->audio_channels() << wxT (" ") << _("channels"); - } - s << wxT (", ") << c->content_audio_frame_rate() << _("Hz"); - _audio_description->SetLabel (s); - } -} - - - -void -FFmpegContentDialog::subtitle_stream_changed (wxCommandEvent &) -{ - shared_ptr c = _content.lock (); - if (!c) { - return; - } - - vector > a = c->subtitle_streams (); - vector >::iterator i = a.begin (); - string const s = string_client_data (_subtitle_stream->GetClientObject (_subtitle_stream->GetSelection ())); - while (i != a.end() && lexical_cast ((*i)->id) != s) { - ++i; - } - - if (i != a.end ()) { - c->set_subtitle_stream (*i); - } -} - -void -FFmpegContentDialog::audio_mapping_changed (AudioMapping m) -{ - shared_ptr content = _content.lock (); - - if (!content || !content->audio_stream()) { - return; - } - - content->audio_stream()->mapping = m; -} - diff --git a/src/wx/ffmpeg_content_dialog.h b/src/wx/ffmpeg_content_dialog.h deleted file mode 100644 index 302c8166f..000000000 --- a/src/wx/ffmpeg_content_dialog.h +++ /dev/null @@ -1,47 +0,0 @@ -/* -*- c-basic-offset: 8; default-tab-width: 8; -*- */ - -/* - Copyright (C) 2013 Carl Hetherington - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - -*/ - -#include -#include -#include -#include "lib/audio_mapping.h" - -class wxSpinCtrl; -class FFmpegContent; -class AudioMappingView; -class Region; - -class FFmpegContentDialog : public wxDialog -{ -public: - FFmpegContentDialog (wxWindow *, boost::shared_ptr); - -private: - void audio_stream_changed (wxCommandEvent &); - void subtitle_stream_changed (wxCommandEvent &); - void audio_mapping_changed (AudioMapping); - - boost::weak_ptr _content; - wxChoice* _audio_stream; - wxStaticText* _audio_description; - wxChoice* _subtitle_stream; - AudioMappingView* _audio_mapping; -}; diff --git a/src/wx/film_editor.cc b/src/wx/film_editor.cc index 177202d25..4955d9f3d 100644 --- a/src/wx/film_editor.cc +++ b/src/wx/film_editor.cc @@ -52,8 +52,8 @@ #include "scaler.h" #include "audio_dialog.h" #include "imagemagick_content_dialog.h" -#include "ffmpeg_content_dialog.h" #include "timeline_dialog.h" +#include "audio_mapping_view.h" using std::string; using std::cout; @@ -77,20 +77,15 @@ FilmEditor::FilmEditor (shared_ptr f, wxWindow* parent) , _timeline_dialog (0) { wxBoxSizer* s = new wxBoxSizer (wxVERTICAL); - _notebook = new wxNotebook (this, wxID_ANY); - s->Add (_notebook, 1); - make_film_panel (); - _notebook->AddPage (_film_panel, _("Film"), true); - make_content_panel (); - _notebook->AddPage (_content_panel, _("Content"), false); - make_video_panel (); - _notebook->AddPage (_video_panel, _("Video"), false); - make_audio_panel (); - _notebook->AddPage (_audio_panel, _("Audio"), false); - make_subtitle_panel (); - _notebook->AddPage (_subtitle_panel, _("Subtitles"), false); + _main_notebook = new wxNotebook (this, wxID_ANY); + s->Add (_main_notebook, 1); + make_content_panel (); + _main_notebook->AddPage (_content_panel, _("Content"), true); + make_dcp_panel (); + _main_notebook->AddPage (_dcp_panel, _("DCP"), false); + setup_formats (); set_film (f); @@ -104,75 +99,49 @@ FilmEditor::FilmEditor (shared_ptr f, wxWindow* parent) } void -FilmEditor::make_film_panel () +FilmEditor::make_dcp_panel () { - _film_panel = new wxPanel (_notebook); - _film_sizer = new wxBoxSizer (wxVERTICAL); - _film_panel->SetSizer (_film_sizer); + _dcp_panel = new wxPanel (_main_notebook); + _dcp_sizer = new wxBoxSizer (wxVERTICAL); + _dcp_panel->SetSizer (_dcp_sizer); wxGridBagSizer* grid = new wxGridBagSizer (4, 4); - _film_sizer->Add (grid, 0, wxALL, 8); + _dcp_sizer->Add (grid, 0, wxEXPAND | wxALL, 8); int r = 0; - add_label_to_grid_bag_sizer (grid, _film_panel, _("Name"), wxGBPosition (r, 0)); - _name = new wxTextCtrl (_film_panel, wxID_ANY); + add_label_to_grid_bag_sizer (grid, _dcp_panel, _("Name"), wxGBPosition (r, 0)); + _name = new wxTextCtrl (_dcp_panel, wxID_ANY); grid->Add (_name, wxGBPosition(r, 1), wxDefaultSpan, wxEXPAND); ++r; - add_label_to_grid_bag_sizer (grid, _film_panel, _("DCP Name"), wxGBPosition (r, 0)); - _dcp_name = new wxStaticText (_film_panel, wxID_ANY, wxT ("")); + add_label_to_grid_bag_sizer (grid, _dcp_panel, _("DCP Name"), wxGBPosition (r, 0)); + _dcp_name = new wxStaticText (_dcp_panel, wxID_ANY, wxT ("")); grid->Add (_dcp_name, wxGBPosition(r, 1), wxDefaultSpan, wxALIGN_CENTER_VERTICAL); ++r; - _use_dci_name = new wxCheckBox (_film_panel, wxID_ANY, _("Use DCI name")); + _use_dci_name = new wxCheckBox (_dcp_panel, wxID_ANY, _("Use DCI name")); grid->Add (_use_dci_name, wxGBPosition (r, 0), wxDefaultSpan, wxALIGN_CENTER_VERTICAL); - _edit_dci_button = new wxButton (_film_panel, wxID_ANY, _("Details...")); + _edit_dci_button = new wxButton (_dcp_panel, wxID_ANY, _("Details...")); grid->Add (_edit_dci_button, wxGBPosition (r, 1), wxDefaultSpan); ++r; - _trust_content_headers = new wxCheckBox (_film_panel, wxID_ANY, _("Trust content headers")); - grid->Add (_trust_content_headers, wxGBPosition (r, 0), wxGBSpan(1, 2)); - ++r; - - add_label_to_grid_bag_sizer (grid, _film_panel, _("Content Type"), wxGBPosition (r, 0)); - _dcp_content_type = new wxChoice (_film_panel, wxID_ANY); + add_label_to_grid_bag_sizer (grid, _dcp_panel, _("Content Type"), wxGBPosition (r, 0)); + _dcp_content_type = new wxChoice (_dcp_panel, wxID_ANY); grid->Add (_dcp_content_type, wxGBPosition (r, 1)); ++r; { - add_label_to_grid_bag_sizer (grid, _film_panel, _("DCP Frame Rate"), wxGBPosition (r, 0)); + add_label_to_grid_bag_sizer (grid, _dcp_panel, _("DCP Frame Rate"), wxGBPosition (r, 0)); wxBoxSizer* s = new wxBoxSizer (wxHORIZONTAL); - _dcp_frame_rate = new wxChoice (_film_panel, wxID_ANY); + _dcp_frame_rate = new wxChoice (_dcp_panel, wxID_ANY); s->Add (_dcp_frame_rate, 1, wxALIGN_CENTER_VERTICAL); - _best_dcp_frame_rate = new wxButton (_film_panel, wxID_ANY, _("Use best")); + _best_dcp_frame_rate = new wxButton (_dcp_panel, wxID_ANY, _("Use best")); s->Add (_best_dcp_frame_rate, 1, wxALIGN_CENTER_VERTICAL | wxALL | wxEXPAND, 6); grid->Add (s, wxGBPosition (r, 1)); } ++r; - _frame_rate_description = new wxStaticText (_film_panel, wxID_ANY, wxT ("\n \n "), wxDefaultPosition, wxDefaultSize); - grid->Add (_frame_rate_description, wxGBPosition (r, 0), wxGBSpan (1, 2), wxEXPAND | wxALIGN_CENTER_VERTICAL | wxALL, 6); - wxFont font = _frame_rate_description->GetFont(); - font.SetStyle(wxFONTSTYLE_ITALIC); - font.SetPointSize(font.GetPointSize() - 1); - _frame_rate_description->SetFont(font); - ++r; - - add_label_to_grid_bag_sizer (grid, _film_panel, _("Length"), wxGBPosition (r, 0)); - _length = new wxStaticText (_film_panel, wxID_ANY, wxT ("")); - grid->Add (_length, wxGBPosition (r, 1), wxDefaultSpan, wxALIGN_CENTER_VERTICAL); - ++r; - - add_label_to_grid_bag_sizer (grid, _film_panel, _("Trim method"), wxGBPosition (r, 0)); - _trim_type = new wxChoice (_film_panel, wxID_ANY); - grid->Add (_trim_type, wxGBPosition (r, 1), wxDefaultSpan, wxALIGN_CENTER_VERTICAL); - ++r; - - _ab = new wxCheckBox (_film_panel, wxID_ANY, _("A/B")); - grid->Add (_ab, wxGBPosition (r, 0)); - ++r; - vector const ct = DCPContentType::all (); for (vector::const_iterator i = ct.begin(); i != ct.end(); ++i) { _dcp_content_type->Append (std_to_wx ((*i)->pretty_name ())); @@ -182,9 +151,6 @@ FilmEditor::make_film_panel () for (list::const_iterator i = dfr.begin(); i != dfr.end(); ++i) { _dcp_frame_rate->Append (std_to_wx (boost::lexical_cast (*i))); } - - _trim_type->Append (_("encode all frames and play the subset")); - _trim_type->Append (_("encode only the subset")); } void @@ -194,13 +160,10 @@ FilmEditor::connect_to_widgets () _use_dci_name->Connect (wxID_ANY, wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler (FilmEditor::use_dci_name_toggled), 0, this); _edit_dci_button->Connect (wxID_ANY, wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler (FilmEditor::edit_dci_button_clicked), 0, this); _format->Connect (wxID_ANY, wxEVT_COMMAND_CHOICE_SELECTED, wxCommandEventHandler (FilmEditor::format_changed), 0, this); - _trust_content_headers->Connect (wxID_ANY, wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler (FilmEditor::trust_content_headers_changed), 0, this); _content->Connect (wxID_ANY, wxEVT_COMMAND_LIST_ITEM_SELECTED, wxListEventHandler (FilmEditor::content_selection_changed), 0, this); _content->Connect (wxID_ANY, wxEVT_COMMAND_LIST_ITEM_DESELECTED, wxListEventHandler (FilmEditor::content_selection_changed), 0, this); - _content->Connect (wxID_ANY, wxEVT_COMMAND_LIST_ITEM_ACTIVATED, wxListEventHandler (FilmEditor::content_activated), 0, this); _content_add->Connect (wxID_ANY, wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler (FilmEditor::content_add_clicked), 0, this); _content_remove->Connect (wxID_ANY, wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler (FilmEditor::content_remove_clicked), 0, this); - _content_properties->Connect (wxID_ANY, wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler (FilmEditor::content_properties_clicked), 0, this); _content_timeline->Connect (wxID_ANY, wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler (FilmEditor::content_timeline_clicked), 0, this); _loop_content->Connect (wxID_ANY, wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler (FilmEditor::loop_content_toggled), 0, this); _loop_count->Connect (wxID_ANY, wxEVT_COMMAND_SPINCTRL_UPDATED, wxCommandEventHandler (FilmEditor::loop_count_changed), 0, this); @@ -213,8 +176,6 @@ FilmEditor::connect_to_widgets () _dcp_content_type->Connect (wxID_ANY, wxEVT_COMMAND_CHOICE_SELECTED, wxCommandEventHandler (FilmEditor::dcp_content_type_changed), 0, this); _dcp_frame_rate->Connect (wxID_ANY, wxEVT_COMMAND_CHOICE_SELECTED, wxCommandEventHandler (FilmEditor::dcp_frame_rate_changed), 0, this); _best_dcp_frame_rate->Connect (wxID_ANY, wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler (FilmEditor::best_dcp_frame_rate_clicked), 0, this); - _ab->Connect (wxID_ANY, wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler (FilmEditor::ab_toggled), 0, this); - _trim_type->Connect (wxID_ANY, wxEVT_COMMAND_CHOICE_SELECTED, wxCommandEventHandler (FilmEditor::trim_type_changed), 0, this); _with_subtitles->Connect (wxID_ANY, wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler (FilmEditor::with_subtitles_toggled), 0, this); _subtitle_offset->Connect (wxID_ANY, wxEVT_COMMAND_SPINCTRL_UPDATED, wxCommandEventHandler (FilmEditor::subtitle_offset_changed), 0, this); _subtitle_scale->Connect (wxID_ANY, wxEVT_COMMAND_SPINCTRL_UPDATED, wxCommandEventHandler (FilmEditor::subtitle_scale_changed), 0, this); @@ -226,12 +187,15 @@ FilmEditor::connect_to_widgets () ); _show_audio->Connect (wxID_ANY, wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler (FilmEditor::show_audio_clicked), 0, this); _audio_delay->Connect (wxID_ANY, wxEVT_COMMAND_SPINCTRL_UPDATED, wxCommandEventHandler (FilmEditor::audio_delay_changed), 0, this); + _audio_stream->Connect (wxID_ANY, wxEVT_COMMAND_CHOICE_SELECTED, wxCommandEventHandler (FilmEditor::audio_stream_changed), 0, this); + _subtitle_stream->Connect (wxID_ANY, wxEVT_COMMAND_CHOICE_SELECTED, wxCommandEventHandler (FilmEditor::subtitle_stream_changed), 0, this); + _audio_mapping->Changed.connect (bind (&FilmEditor::audio_mapping_changed, this, _1)); } void FilmEditor::make_video_panel () { - _video_panel = new wxPanel (_notebook); + _video_panel = new wxPanel (_content_notebook); _video_sizer = new wxBoxSizer (wxVERTICAL); _video_panel->SetSizer (_video_sizer); @@ -323,10 +287,10 @@ FilmEditor::make_video_panel () void FilmEditor::make_content_panel () { - _content_panel = new wxPanel (_notebook); + _content_panel = new wxPanel (_main_notebook); _content_sizer = new wxBoxSizer (wxVERTICAL); _content_panel->SetSizer (_content_sizer); - + { wxBoxSizer* s = new wxBoxSizer (wxHORIZONTAL); @@ -341,8 +305,6 @@ FilmEditor::make_content_panel () b->Add (_content_add, 1, wxEXPAND | wxLEFT | wxRIGHT); _content_remove = new wxButton (_content_panel, wxID_ANY, _("Remove")); b->Add (_content_remove, 1, wxEXPAND | wxLEFT | wxRIGHT); - _content_properties = new wxButton (_content_panel, wxID_ANY, _("Properties...")); - b->Add (_content_properties); _content_timeline = new wxButton (_content_panel, wxID_ANY, _("Timeline...")); b->Add (_content_timeline, 1, wxEXPAND | wxLEFT | wxRIGHT); @@ -351,9 +313,6 @@ FilmEditor::make_content_panel () _content_sizer->Add (s, 0.75, wxEXPAND | wxALL, 6); } - _content_information = new wxTextCtrl (_content_panel, wxID_ANY, wxT ("\n \n "), wxDefaultPosition, wxDefaultSize, wxTE_READONLY | wxTE_MULTILINE); - _content_sizer->Add (_content_information, 1, wxEXPAND | wxALL, 6); - wxBoxSizer* h = new wxBoxSizer (wxHORIZONTAL); _loop_content = new wxCheckBox (_content_panel, wxID_ANY, _("Loop everything")); h->Add (_loop_content, 0, wxALL, 6); @@ -362,36 +321,48 @@ FilmEditor::make_content_panel () add_label_to_sizer (h, _content_panel, _("times")); _content_sizer->Add (h, 0, wxALL, 6); + _content_notebook = new wxNotebook (_content_panel, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxNB_LEFT); + _content_sizer->Add (_content_notebook, 1, wxEXPAND | wxTOP, 6); + + make_video_panel (); + _content_notebook->AddPage (_video_panel, _("Video"), false); + make_audio_panel (); + _content_notebook->AddPage (_audio_panel, _("Audio"), false); + make_subtitle_panel (); + _content_notebook->AddPage (_subtitle_panel, _("Subtitles"), false); + _loop_count->SetRange (2, 1024); } void FilmEditor::make_audio_panel () { - _audio_panel = new wxPanel (_notebook); + _audio_panel = new wxPanel (_content_notebook); _audio_sizer = new wxBoxSizer (wxVERTICAL); _audio_panel->SetSizer (_audio_sizer); - wxFlexGridSizer* grid = new wxFlexGridSizer (2, 4, 4); + wxFlexGridSizer* grid = new wxFlexGridSizer (3, 4, 4); _audio_sizer->Add (grid, 0, wxALL, 8); _show_audio = new wxButton (_audio_panel, wxID_ANY, _("Show Audio...")); grid->Add (_show_audio, 1); grid->AddSpacer (0); + grid->AddSpacer (0); + add_label_to_sizer (grid, _audio_panel, _("Audio Gain")); { - add_label_to_sizer (grid, _audio_panel, _("Audio Gain")); wxBoxSizer* s = new wxBoxSizer (wxHORIZONTAL); _audio_gain = new wxSpinCtrl (_audio_panel); s->Add (_audio_gain, 1); add_label_to_sizer (s, _audio_panel, _("dB")); - _audio_gain_calculate_button = new wxButton (_audio_panel, wxID_ANY, _("Calculate...")); - s->Add (_audio_gain_calculate_button, 1, wxEXPAND); - grid->Add (s); + grid->Add (s, 1); } + + _audio_gain_calculate_button = new wxButton (_audio_panel, wxID_ANY, _("Calculate...")); + grid->Add (_audio_gain_calculate_button); + add_label_to_sizer (grid, _audio_panel, _("Audio Delay")); { - add_label_to_sizer (grid, _audio_panel, _("Audio Delay")); wxBoxSizer* s = new wxBoxSizer (wxHORIZONTAL); _audio_delay = new wxSpinCtrl (_audio_panel); s->Add (_audio_delay, 1); @@ -400,6 +371,21 @@ FilmEditor::make_audio_panel () grid->Add (s); } + grid->AddSpacer (0); + + add_label_to_sizer (grid, _audio_panel, _("Audio Stream")); + _audio_stream = new wxChoice (_audio_panel, wxID_ANY); + grid->Add (_audio_stream, 1); + _audio_description = new wxStaticText (_audio_panel, wxID_ANY, wxT ("")); + grid->AddSpacer (0); + + grid->Add (_audio_description, 1, wxALIGN_CENTER_VERTICAL | wxLEFT, 8); + grid->AddSpacer (0); + grid->AddSpacer (0); + + _audio_mapping = new AudioMappingView (_audio_panel); + _audio_sizer->Add (_audio_mapping, 1, wxEXPAND | wxALL, 6); + _audio_gain->SetRange (-60, 60); _audio_delay->SetRange (-1000, 1000); } @@ -407,7 +393,7 @@ FilmEditor::make_audio_panel () void FilmEditor::make_subtitle_panel () { - _subtitle_panel = new wxPanel (_notebook); + _subtitle_panel = new wxPanel (_content_notebook); _subtitle_sizer = new wxBoxSizer (wxVERTICAL); _subtitle_panel->SetSizer (_subtitle_sizer); wxFlexGridSizer* grid = new wxFlexGridSizer (2, 4, 4); @@ -435,6 +421,11 @@ FilmEditor::make_subtitle_panel () grid->Add (s); } + add_label_to_sizer (grid, _subtitle_panel, _("Subtitle stream")); + _subtitle_stream = new wxChoice (_subtitle_panel, wxID_ANY); + grid->Add (_subtitle_stream, 1, wxEXPAND | wxALL, 6); + grid->AddSpacer (0); + _subtitle_offset->SetRange (-1024, 1024); _subtitle_scale->SetRange (1, 1000); } @@ -483,27 +474,6 @@ FilmEditor::bottom_crop_changed (wxCommandEvent &) _film->set_bottom_crop (_bottom_crop->GetValue ()); } -void -FilmEditor::trust_content_headers_changed (wxCommandEvent &) -{ - if (!_film) { - return; - } - - _film->set_trust_content_headers (_trust_content_headers->GetValue ()); -} - -/** Called when the DCP A/B switch has been toggled */ -void -FilmEditor::ab_toggled (wxCommandEvent &) -{ - if (!_film) { - return; - } - - _film->set_ab (_ab->GetValue ()); -} - /** Called when the name widget has been changed */ void FilmEditor::name_changed (wxCommandEvent &) @@ -594,16 +564,12 @@ FilmEditor::film_changed (Film::Property p) setup_format (); setup_subtitle_control_sensitivity (); setup_show_audio_sensitivity (); - setup_length (); break; case Film::LOOP: checked_set (_loop_content, _film->loop() > 1); checked_set (_loop_count, _film->loop()); setup_loop_sensitivity (); break; - case Film::TRUST_CONTENT_HEADERS: - checked_set (_trust_content_headers, _film->trust_content_headers ()); - break; case Film::FORMAT: setup_format (); break; @@ -623,7 +589,7 @@ FilmEditor::film_changed (Film::Property p) string const b = p.first + " " + p.second; _filters->SetLabel (std_to_wx (b)); } - _film_sizer->Layout (); + _dcp_sizer->Layout (); break; } case Film::NAME: @@ -634,15 +600,9 @@ FilmEditor::film_changed (Film::Property p) checked_set (_dcp_content_type, DCPContentType::as_index (_film->dcp_content_type ())); setup_dcp_name (); break; - case Film::AB: - checked_set (_ab, _film->ab ()); - break; case Film::SCALER: checked_set (_scaler, Scaler::as_index (_film->scaler ())); break; - case Film::TRIM_TYPE: - checked_set (_trim_type, _film->trim_type() == Film::CPL ? 0 : 1); - break; case Film::AUDIO_GAIN: checked_set (_audio_gain, _film->audio_gain ()); break; @@ -689,7 +649,6 @@ FilmEditor::film_changed (Film::Property p) } _best_dcp_frame_rate->Enable (_film->best_dcp_video_frame_rate () != _film->dcp_video_frame_rate ()); - setup_frame_rate_description (); break; } } @@ -709,12 +668,6 @@ FilmEditor::film_content_changed (weak_ptr content, int property) setup_subtitle_control_sensitivity (); } else if (property == FFmpegContentProperty::AUDIO_STREAMS) { setup_show_audio_sensitivity (); - } else if (property == VideoContentProperty::VIDEO_LENGTH || property == AudioContentProperty::AUDIO_LENGTH) { - setup_length (); - boost::shared_ptr c = content.lock (); - if (selected_content() && c == selected_content()) { - setup_content_information (); - } } else if (property == FFmpegContentProperty::AUDIO_STREAM) { setup_dcp_name (); setup_show_audio_sensitivity (); @@ -741,46 +694,6 @@ FilmEditor::setup_format () setup_scaling_description (); } -void -FilmEditor::setup_length () -{ - stringstream s; - Time const length = _film->length (); - - s << time_to_hms (length); - _length->SetLabel (std_to_wx (s.str ())); -} - -void -FilmEditor::setup_frame_rate_description () -{ - wxString d; - int lines = 0; - -#if 0 - XXX - - if (_film->video_frame_rate()) { - d << std_to_wx (FrameRateConversion (_film->video_frame_rate(), _film->dcp_frame_rate()).description); - ++lines; - if (_film->audio_frame_rate() && _film->audio_frame_rate() != _film->target_audio_sample_rate ()) { - d << wxString::Format ( - _("Audio will be resampled from %dHz to %dHz\n"), - _film->audio_frame_rate(), - _film->target_audio_sample_rate() - ); - ++lines; - } - } -#endif - - for (int i = lines; i < 2; ++i) { - d << wxT ("\n "); - } - - _frame_rate_description->SetLabel (d); -} - /** Called when the format widget has been changed */ void FilmEditor::format_changed (wxCommandEvent &) @@ -841,16 +754,11 @@ FilmEditor::set_film (shared_ptr f) film_changed (Film::USE_DCI_NAME); film_changed (Film::CONTENT); film_changed (Film::LOOP); - film_changed (Film::TRUST_CONTENT_HEADERS); film_changed (Film::DCP_CONTENT_TYPE); film_changed (Film::FORMAT); film_changed (Film::CROP); film_changed (Film::FILTERS); film_changed (Film::SCALER); - film_changed (Film::TRIM_START); - film_changed (Film::TRIM_END); - film_changed (Film::AB); - film_changed (Film::TRIM_TYPE); film_changed (Film::AUDIO_GAIN); film_changed (Film::AUDIO_DELAY); film_changed (Film::WITH_SUBTITLES); @@ -865,8 +773,6 @@ FilmEditor::set_film (shared_ptr f) film_content_changed (boost::shared_ptr (), FFmpegContentProperty::SUBTITLE_STREAM); film_content_changed (boost::shared_ptr (), FFmpegContentProperty::AUDIO_STREAMS); film_content_changed (boost::shared_ptr (), FFmpegContentProperty::AUDIO_STREAM); - - setup_content_information (); } /** Updates the sensitivity of lots of widgets to a given value. @@ -882,7 +788,6 @@ FilmEditor::set_things_sensitive (bool s) _edit_dci_button->Enable (s); _format->Enable (s); _content->Enable (s); - _trust_content_headers->Enable (s); _content->Enable (s); _left_crop->Enable (s); _right_crop->Enable (s); @@ -893,8 +798,6 @@ FilmEditor::set_things_sensitive (bool s) _dcp_content_type->Enable (s); _best_dcp_frame_rate->Enable (s); _dcp_frame_rate->Enable (s); - _ab->Enable (s); - _trim_type->Enable (s); _colour_lut->Enable (s); _j2k_bandwidth->Enable (s); _audio_gain->Enable (s); @@ -952,20 +855,16 @@ FilmEditor::audio_delay_changed (wxCommandEvent &) } void -FilmEditor::setup_notebook_size () +FilmEditor::setup_main_notebook_size () { - _notebook->InvalidateBestSize (); - - _film_sizer->Layout (); - _film_sizer->SetSizeHints (_film_panel); - _video_sizer->Layout (); - _video_sizer->SetSizeHints (_video_panel); - _audio_sizer->Layout (); - _audio_sizer->SetSizeHints (_audio_panel); - _subtitle_sizer->Layout (); - _subtitle_sizer->SetSizeHints (_subtitle_panel); - - _notebook->Fit (); + _main_notebook->InvalidateBestSize (); + + _content_sizer->Layout (); + _content_sizer->SetSizeHints (_content_panel); + _dcp_sizer->Layout (); + _dcp_sizer->SetSizeHints (_dcp_panel); + + _main_notebook->Fit (); Fit (); } @@ -1006,7 +905,7 @@ FilmEditor::setup_formats () _format->Append (std_to_wx ((*i)->name ())); } - _film_sizer->Layout (); + _dcp_sizer->Layout (); } void @@ -1132,8 +1031,6 @@ FilmEditor::setup_content () /* Select the item of content if non was selected before */ _content->SetItemState (0, wxLIST_STATE_SELECTED, wxLIST_STATE_SELECTED); } - - setup_content_information (); } void @@ -1172,61 +1069,10 @@ FilmEditor::content_remove_clicked (wxCommandEvent &) } } -void -FilmEditor::content_activated (wxListEvent& ev) -{ - Playlist::ContentList c = _film->content (); - assert (ev.GetIndex() >= 0 && size_t (ev.GetIndex()) < c.size ()); - - content_properties (c[ev.GetIndex()]); -} - -void -FilmEditor::content_properties_clicked (wxCommandEvent &) -{ - shared_ptr c = selected_content (); - if (!c) { - return; - } - - content_properties (c); -} - -void -FilmEditor::content_properties (shared_ptr content) -{ - shared_ptr ic = dynamic_pointer_cast (content); - if (ic) { - ImageMagickContentDialog* d = new ImageMagickContentDialog (this, ic); - d->ShowModal (); - d->Destroy (); - } - - shared_ptr fc = dynamic_pointer_cast (content); - if (fc) { - FFmpegContentDialog* d = new FFmpegContentDialog (this, fc); - d->ShowModal (); - d->Destroy (); - } -} - void FilmEditor::content_selection_changed (wxListEvent &) { setup_content_button_sensitivity (); - setup_content_information (); -} - -void -FilmEditor::setup_content_information () -{ - shared_ptr c = selected_content (); - if (!c) { - _content_information->SetValue (wxT ("")); - return; - } - - _content_information->SetValue (std_to_wx (c->information ())); } void @@ -1236,11 +1082,6 @@ FilmEditor::setup_content_button_sensitivity () shared_ptr selection = selected_content (); - _content_properties->Enable ( - selection && _generally_sensitive && - (dynamic_pointer_cast (selection) || dynamic_pointer_cast (selection)) - ); - _content_remove->Enable (selection && _generally_sensitive); _content_timeline->Enable (_generally_sensitive); } @@ -1320,12 +1161,6 @@ XXX _scaling_description->SetLabel (d); } -void -FilmEditor::trim_type_changed (wxCommandEvent &) -{ - _film->set_trim_type (_trim_type->GetSelection () == 0 ? Film::CPL : Film::ENCODE); -} - void FilmEditor::loop_content_toggled (wxCommandEvent &) { @@ -1361,3 +1196,127 @@ FilmEditor::content_timeline_clicked (wxCommandEvent &) _timeline_dialog = new TimelineDialog (this, _film); _timeline_dialog->Show (); } + +void +FilmEditor::setup_content_properties () +{ + _audio_stream->Clear (); + _subtitle_stream->Clear (); + + shared_ptr c = selected_content (); + if (!c) { + return; + } + + shared_ptr fc = dynamic_pointer_cast (c); + if (fc) { + + vector > a = fc->audio_streams (); + for (vector >::iterator i = a.begin(); i != a.end(); ++i) { + _audio_stream->Append (std_to_wx ((*i)->name), new wxStringClientData (std_to_wx (lexical_cast ((*i)->id)))); + } + + if (fc->audio_stream()) { + checked_set (_audio_stream, lexical_cast (fc->audio_stream()->id)); + } + + vector > s = fc->subtitle_streams (); + if (s.empty ()) { + _subtitle_stream->Enable (false); + } + for (vector >::iterator i = s.begin(); i != s.end(); ++i) { + _subtitle_stream->Append (std_to_wx ((*i)->name), new wxStringClientData (std_to_wx (lexical_cast ((*i)->id)))); + } + + if (fc->subtitle_stream()) { + checked_set (_subtitle_stream, lexical_cast (fc->subtitle_stream()->id)); + } else { + _subtitle_stream->SetSelection (wxNOT_FOUND); + } + + /* XXX: should be general audiocontent */ + _audio_mapping->set_mapping (fc->audio_mapping ()); + } +} + +void +FilmEditor::audio_stream_changed (wxCommandEvent &) +{ + shared_ptr c = selected_content (); + if (!c) { + return; + } + + shared_ptr fc = dynamic_pointer_cast (c); + if (!fc) { + return; + } + + vector > a = fc->audio_streams (); + vector >::iterator i = a.begin (); + string const s = string_client_data (_audio_stream->GetClientObject (_audio_stream->GetSelection ())); + while (i != a.end() && lexical_cast ((*i)->id) != s) { + ++i; + } + + if (i != a.end ()) { + fc->set_audio_stream (*i); + } + + if (!fc->audio_stream ()) { + _audio_description->SetLabel (wxT ("")); + } else { + wxString s; + if (fc->audio_channels() == 1) { + s << _("1 channel"); + } else { + s << fc->audio_channels() << wxT (" ") << _("channels"); + } + s << wxT (", ") << fc->content_audio_frame_rate() << _("Hz"); + _audio_description->SetLabel (s); + } +} + + + +void +FilmEditor::subtitle_stream_changed (wxCommandEvent &) +{ + shared_ptr c = selected_content (); + if (!c) { + return; + } + + shared_ptr fc = dynamic_pointer_cast (c); + if (!fc) { + return; + } + + vector > a = fc->subtitle_streams (); + vector >::iterator i = a.begin (); + string const s = string_client_data (_subtitle_stream->GetClientObject (_subtitle_stream->GetSelection ())); + while (i != a.end() && lexical_cast ((*i)->id) != s) { + ++i; + } + + if (i != a.end ()) { + fc->set_subtitle_stream (*i); + } +} + +void +FilmEditor::audio_mapping_changed (AudioMapping m) +{ + shared_ptr c = selected_content (); + if (!c) { + return; + } + + shared_ptr fc = dynamic_pointer_cast (c); + if (!fc) { + return; + } + + /* XXX: should be general to audiocontent */ + fc->audio_stream()->mapping = m; +} diff --git a/src/wx/film_editor.h b/src/wx/film_editor.h index 4bdba9979..9123dfdb4 100644 --- a/src/wx/film_editor.h +++ b/src/wx/film_editor.h @@ -34,6 +34,7 @@ class wxListEvent; class Film; class AudioDialog; class TimelineDialog; +class AudioMappingView; /** @class FilmEditor * @brief A wx widget to edit a film's metadata, and perform various functions. @@ -48,7 +49,7 @@ public: boost::signals2::signal FileChanged; private: - void make_film_panel (); + void make_dcp_panel (); void make_content_panel (); void make_video_panel (); void make_audio_panel (); @@ -65,15 +66,11 @@ private: void bottom_crop_changed (wxCommandEvent &); void trust_content_headers_changed (wxCommandEvent &); void content_selection_changed (wxListEvent &); - void content_activated (wxListEvent &); void content_add_clicked (wxCommandEvent &); void content_remove_clicked (wxCommandEvent &); - void content_properties_clicked (wxCommandEvent &); void imagemagick_video_length_changed (wxCommandEvent &); void format_changed (wxCommandEvent &); - void trim_type_changed (wxCommandEvent &); void dcp_content_type_changed (wxCommandEvent &); - void ab_toggled (wxCommandEvent &); void scaler_changed (wxCommandEvent &); void audio_gain_changed (wxCommandEvent &); void audio_gain_calculate_button_clicked (wxCommandEvent &); @@ -90,6 +87,9 @@ private: void loop_content_toggled (wxCommandEvent &); void loop_count_changed (wxCommandEvent &); void content_timeline_clicked (wxCommandEvent &); + void audio_stream_changed (wxCommandEvent &); + void subtitle_stream_changed (wxCommandEvent &); + void audio_mapping_changed (AudioMapping); /* Handle changes to the model */ void film_changed (Film::Property); @@ -101,22 +101,20 @@ private: void setup_dcp_name (); void setup_show_audio_sensitivity (); void setup_scaling_description (); - void setup_notebook_size (); - void setup_frame_rate_description (); + void setup_main_notebook_size (); void setup_content (); void setup_format (); - void setup_length (); - void setup_content_information (); void setup_content_button_sensitivity (); void setup_loop_sensitivity (); + void setup_content_properties (); void active_jobs_changed (bool); boost::shared_ptr selected_content (); - void content_properties (boost::shared_ptr); - wxNotebook* _notebook; - wxPanel* _film_panel; - wxSizer* _film_sizer; + wxNotebook* _main_notebook; + wxNotebook* _content_notebook; + wxPanel* _dcp_panel; + wxSizer* _dcp_sizer; wxPanel* _content_panel; wxSizer* _content_sizer; wxPanel* _video_panel; @@ -128,24 +126,20 @@ private: /** The film we are editing */ boost::shared_ptr _film; - /** The Film's name */ wxTextCtrl* _name; wxStaticText* _dcp_name; wxCheckBox* _use_dci_name; wxListCtrl* _content; wxButton* _content_add; wxButton* _content_remove; - wxButton* _content_properties; wxButton* _content_earlier; wxButton* _content_later; wxButton* _content_timeline; - wxTextCtrl* _content_information; wxCheckBox* _loop_content; wxSpinCtrl* _loop_count; wxButton* _edit_dci_button; wxChoice* _format; wxStaticText* _format_description; - wxCheckBox* _trust_content_headers; wxStaticText* _scaling_description; wxSpinCtrl* _left_crop; wxSpinCtrl* _right_crop; @@ -166,14 +160,10 @@ private: wxChoice* _dcp_content_type; wxChoice* _dcp_frame_rate; wxButton* _best_dcp_frame_rate; - wxStaticText* _frame_rate_description; - wxStaticText* _length; - /** The Film's audio details */ - wxStaticText* _audio; - - wxChoice* _trim_type; - /** Selector to generate an A/B comparison DCP */ - wxCheckBox* _ab; + wxChoice* _audio_stream; + wxStaticText* _audio_description; + wxChoice* _subtitle_stream; + AudioMappingView* _audio_mapping; std::vector _formats; diff --git a/src/wx/wscript b/src/wx/wscript index c63ef128d..884eabc3a 100644 --- a/src/wx/wscript +++ b/src/wx/wscript @@ -10,7 +10,6 @@ sources = """ config_dialog.cc dci_metadata_dialog.cc dir_picker_ctrl.cc - ffmpeg_content_dialog.cc film_editor.cc film_viewer.cc filter_dialog.cc diff --git a/test/test.cc b/test/test.cc index 82b958216..eaf210370 100644 --- a/test/test.cc +++ b/test/test.cc @@ -153,8 +153,6 @@ BOOST_AUTO_TEST_CASE (film_metadata_test) f_filters.push_back (Filter::from_id ("pphb")); f_filters.push_back (Filter::from_id ("unsharp")); f->set_filters (f_filters); - f->set_trim_start (42); - f->set_trim_end (99); f->set_ab (true); f->write_metadata (); @@ -175,8 +173,6 @@ BOOST_AUTO_TEST_CASE (film_metadata_test) BOOST_CHECK_EQUAL (g_filters.size(), 2); BOOST_CHECK_EQUAL (g_filters.front(), Filter::from_id ("pphb")); BOOST_CHECK_EQUAL (g_filters.back(), Filter::from_id ("unsharp")); - BOOST_CHECK_EQUAL (g->trim_start(), 42); - BOOST_CHECK_EQUAL (g->trim_end(), 99); BOOST_CHECK_EQUAL (g->ab(), true); g->write_metadata (); @@ -354,7 +350,6 @@ BOOST_AUTO_TEST_CASE (make_dcp_with_range_test) // film->examine_content (); film->set_format (Format::from_nickname ("Flat")); film->set_dcp_content_type (DCPContentType::from_pretty_name ("Test")); - film->set_trim_end (42); film->make_dcp (); while (JobManager::instance()->work_to_do() && !JobManager::instance()->errors()) { -- cgit v1.2.3 From c77dabbe4e6bb031edf4aa82f5e890fe605bafe1 Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Sun, 26 May 2013 00:21:53 +0100 Subject: Add unfinished timing tab; fix crash on reconstruction of timeline; fix lack of black / silence at end of films. --- src/lib/content.cc | 2 -- src/lib/player.cc | 61 +++++++++++++++++++------------ src/lib/player.h | 4 +-- src/lib/sndfile_content.cc | 1 + src/wx/film_editor.cc | 54 ++++++++++++++++++++-------- src/wx/film_editor.h | 8 +++-- src/wx/timecode.cc | 90 ++++++++++++++++++++++++++++++++++++++++++++++ src/wx/timecode.h | 36 +++++++++++++++++++ src/wx/timeline.cc | 20 +++++------ src/wx/timeline.h | 5 +-- src/wx/wscript | 1 + 11 files changed, 226 insertions(+), 56 deletions(-) create mode 100644 src/wx/timecode.cc create mode 100644 src/wx/timecode.h (limited to 'src/wx/wscript') diff --git a/src/lib/content.cc b/src/lib/content.cc index ad61f4d6c..aaf2e4f9c 100644 --- a/src/lib/content.cc +++ b/src/lib/content.cc @@ -1,5 +1,3 @@ -/* -*- c-basic-offset: 8; default-tab-width: 8; -*- */ - /* Copyright (C) 2013 Carl Hetherington diff --git a/src/lib/player.cc b/src/lib/player.cc index ff13f95db..786180a6a 100644 --- a/src/lib/player.cc +++ b/src/lib/player.cc @@ -1,5 +1,3 @@ -/* -*- c-basic-offset: 8; default-tab-width: 8; -*- */ - /* Copyright (C) 2013 Carl Hetherington @@ -103,18 +101,18 @@ Player::pass () shared_ptr earliest; for (list >::iterator i = _pieces.begin(); i != _pieces.end(); ++i) { - cout << "check " << (*i)->content->file() << " start=" << (*i)->content->start() << ", next=" << (*i)->decoder->next() << ", end=" << (*i)->content->end() << "\n"; +// cout << "check " << (*i)->content->file() << " start=" << (*i)->content->start() << ", next=" << (*i)->decoder->next() << ", end=" << (*i)->content->end() << "\n"; if (((*i)->decoder->next() + (*i)->content->start()) >= (*i)->content->end()) { continue; } - if (!_audio && dynamic_pointer_cast ((*i)->content)) { + if (!_audio && dynamic_pointer_cast ((*i)->decoder) && !dynamic_pointer_cast ((*i)->decoder)) { continue; } Time const t = (*i)->content->start() + (*i)->decoder->next(); if (t < earliest_t) { - cout << "\t candidate; " << t << " " << (t / TIME_HZ) << ".\n"; +// cout << "\t candidate; " << t << " " << (t / TIME_HZ) << ".\n"; earliest_t = t; earliest = *i; } @@ -148,8 +146,6 @@ Player::pass () void Player::process_video (weak_ptr weak_content, shared_ptr image, bool same, shared_ptr sub, Time time) { - cout << "[V]\n"; - shared_ptr content = weak_content.lock (); if (!content) { return; @@ -208,13 +204,13 @@ Player::seek (Time t) return; } - cout << "seek to " << t << " " << (t / TIME_HZ) << "\n"; +// cout << "seek to " << t << " " << (t / TIME_HZ) << "\n"; for (list >::iterator i = _pieces.begin(); i != _pieces.end(); ++i) { Time s = t - (*i)->content->start (); s = max (static_cast