From fad3626ed40c389fc2cc72ce221fa86e80eb2b57 Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Thu, 23 Jan 2014 00:40:07 +0000 Subject: Bump version --- ChangeLog | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'ChangeLog') diff --git a/ChangeLog b/ChangeLog index d50255261..1b0832f4b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2014-01-23 Carl Hetherington + + * Version 1.63.6 released. + 2014-01-23 Carl Hetherington * Fix recovery of DCP encoding after a crash with a 3D DCP. -- cgit v1.2.3 From a76938561c26dd59d29e45150d1954d14171f6e7 Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Fri, 24 Jan 2014 13:23:01 +0000 Subject: Try to fix repeatedly-reported exceptions. --- ChangeLog | 4 ++++ src/lib/exceptions.h | 1 + 2 files changed, 5 insertions(+) (limited to 'ChangeLog') diff --git a/ChangeLog b/ChangeLog index 1b0832f4b..92926c2d1 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2014-01-24 Carl Hetherington + + * Try to fix repeatedly-reported exceptions. + 2014-01-23 Carl Hetherington * Version 1.63.6 released. diff --git a/src/lib/exceptions.h b/src/lib/exceptions.h index c1240538f..3423a5754 100644 --- a/src/lib/exceptions.h +++ b/src/lib/exceptions.h @@ -253,6 +253,7 @@ public: boost::mutex::scoped_lock lm (_mutex); if (_exception) { boost::rethrow_exception (_exception); + _exception = boost::exception_ptr (); } } -- cgit v1.2.3 From 779ff4ae4d3a906ae5e7befc3e27666b5f91d3a0 Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Sun, 26 Jan 2014 20:11:41 +0000 Subject: ChangeLog and change default JPEG2000 bandwidth to 100MBps. --- ChangeLog | 6 ++++++ src/lib/config.cc | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) (limited to 'ChangeLog') diff --git a/ChangeLog b/ChangeLog index 92926c2d1..429a3f027 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2014-01-26 Carl Hetherington + + * Change default JPEG2000 bandwith to 100MBps. + + * Updated fr_FR translation from Theirry Journet. + 2014-01-24 Carl Hetherington * Try to fix repeatedly-reported exceptions. diff --git a/src/lib/config.cc b/src/lib/config.cc index 5a9e1619a..30f85850d 100644 --- a/src/lib/config.cc +++ b/src/lib/config.cc @@ -63,7 +63,7 @@ Config::Config () , _default_still_length (10) , _default_container (Ratio::from_id ("185")) , _default_dcp_content_type (DCPContentType::from_dci_name ("TST")) - , _default_j2k_bandwidth (200000000) + , _default_j2k_bandwidth (100000000) , _default_audio_delay (0) , _kdm_email ( _("Dear Projectionist\n\nPlease find attached KDMs for $CPL_NAME.\n\nThe KDMs are valid from $START_TIME until $END_TIME.\n\nBest regards,\nDCP-o-matic") -- cgit v1.2.3 From 11544ebe755cdcf345f53c581c2b1370ccd95e87 Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Tue, 28 Jan 2014 11:24:53 +0000 Subject: Try to prevent windows machines going to sleep during encodes. --- ChangeLog | 4 ++++ src/lib/cross.cc | 8 ++++++++ src/lib/cross.h | 1 + src/lib/encoder.cc | 2 ++ 4 files changed, 15 insertions(+) (limited to 'ChangeLog') diff --git a/ChangeLog b/ChangeLog index 429a3f027..e5398c26f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2014-01-28 Carl Hetherington + + * Try to prevent Windows machines going to sleep during encodes. + 2014-01-26 Carl Hetherington * Change default JPEG2000 bandwith to 100MBps. diff --git a/src/lib/cross.cc b/src/lib/cross.cc index 57b3f93b2..9f7a76124 100644 --- a/src/lib/cross.cc +++ b/src/lib/cross.cc @@ -298,3 +298,11 @@ dcpomatic_fseek (FILE* stream, int64_t offset, int whence) return fseek (stream, offset, whence); #endif } + +void +kick () +{ +#ifdef DCPOMATIC_WINDOWS + SetThreadExecutionState (ES_CONTINUOUS); +#endif +} diff --git a/src/lib/cross.h b/src/lib/cross.h index 7e032e5a1..822b36631 100644 --- a/src/lib/cross.h +++ b/src/lib/cross.h @@ -35,3 +35,4 @@ extern boost::filesystem::path app_contents (); #endif extern FILE * fopen_boost (boost::filesystem::path, std::string); extern int dcpomatic_fseek (FILE *, int64_t, int); +void kick (); diff --git a/src/lib/encoder.cc b/src/lib/encoder.cc index fbec3e4d0..92b4763be 100644 --- a/src/lib/encoder.cc +++ b/src/lib/encoder.cc @@ -180,6 +180,8 @@ Encoder::frame_done () void Encoder::process_video (shared_ptr image, Eyes eyes, ColourConversion conversion, bool same) { + kick (); + boost::mutex::scoped_lock lock (_mutex); /* XXX: discard 3D here if required */ -- cgit v1.2.3 From 3d08813c0b084c89dd8a74df55c918a4686dd79b Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Mon, 27 Jan 2014 11:23:09 +0000 Subject: Allow choice of whether or not to install the server/main program on Windows. --- ChangeLog | 4 +++ platform/windows/wscript | 93 ++++++++++++++++++++++++++++++------------------ 2 files changed, 63 insertions(+), 34 deletions(-) (limited to 'ChangeLog') diff --git a/ChangeLog b/ChangeLog index 429a3f027..e23e96c21 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2014-01-28 Carl Hetherington + + * Add option to not install main program / server on Windows. + 2014-01-26 Carl Hetherington * Change default JPEG2000 bandwith to 100MBps. diff --git a/platform/windows/wscript b/platform/windows/wscript index a488f3023..2c16858c2 100644 --- a/platform/windows/wscript +++ b/platform/windows/wscript @@ -1,7 +1,13 @@ from __future__ import print_function +import os -def write_installer(bits): - f = open('installer.%d.nsi.test' % bits, 'w') +def write_installer(bits, version): + try: + os.makedirs('build/platform/windows') + except: + pass + + f = open('build/platform/windows/installer.%d.nsi' % bits, 'w') print('!include "MUI2.nsh"', file=f) if bits == 64: print('!include "x64.nsh"', file=f) @@ -9,28 +15,22 @@ def write_installer(bits): print('Name "DCP-o-matic"', file=f) print('RequestExecutionLevel admin', file=f) - print('outFile "DCP-o-matic @version@ %d-bit Installer.exe"' % bits, file=f) + print('outFile "DCP-o-matic %s %d-bit Installer.exe"' % (version, bits), file=f) print(""" !define MUI_ICON "%resources%/dcpomatic.ico" !define MUI_UNICON "%resources%/dcpomatic.ico" !define MUI_SPECIALBITMAP "%resources%/dcpomatic.bmp" +!include "Sections.nsh" InstallDir "$PROGRAMFILES\\DCP-o-matic" !insertmacro MUI_PAGE_WELCOME !insertmacro MUI_PAGE_LICENSE "../../../COPYING" !insertmacro MUI_PAGE_DIRECTORY -!insertmacro MUI_PAGE_INSTFILES -!insertmacro MUI_PAGE_FINISH - -!insertmacro MUI_UNPAGE_WELCOME -!insertmacro MUI_UNPAGE_CONFIRM -!insertmacro MUI_UNPAGE_INSTFILES -!insertmacro MUI_UNPAGE_FINISH - -!insertmacro MUI_LANGUAGE "English" +!insertmacro MUI_PAGE_COMPONENTS -Section "install" "Installation info" +Section "Common files (required)" SEC_COMMON +SectionIn RO """, file=f) if bits == 64: @@ -46,6 +46,7 @@ ${EndIf} print(""" SetOutPath "$INSTDIR\\bin" +WriteUninstaller "$INSTDIR\Uninstall.exe" File "%static_deps%/bin/libintl-8.dll" File "%static_deps%/bin/libboost_chrono-mt.dll" @@ -119,11 +120,6 @@ File "%cdist_deps%/bin/ffprobe.exe" File "%binaries%/src/wx/dcpomatic-wx.dll" File "%binaries%/src/lib/dcpomatic.dll" -File "%binaries%/src/tools/dcpomatic.exe" -File "%binaries%/src/tools/dcpomatic_batch.exe" -File "%binaries%/src/tools/dcpomatic_cli.exe" -File "%binaries%/src/tools/dcpomatic_server_cli.exe" -File "%binaries%/src/tools/dcpomatic_server.exe" # I don't know why, but sometimes it seems that # delegates.xml must be in with the binaries, and @@ -153,26 +149,56 @@ File "%binaries%/src/lib/mo/de_DE/libdcpomatic.mo" File "%binaries%/src/wx/mo/de_DE/libdcpomatic-wx.mo" File "%binaries%/src/tools/mo/de_DE/dcpomatic.mo" -CreateShortCut "$DESKTOP\\DCP-o-matic.lnk" "$INSTDIR\\bin\\dcpomatic.exe" "" -CreateShortCut "$DESKTOP\\DCP-o-matic batch converter.lnk" "$INSTDIR\\bin\\dcpomatic_batch.exe" "" -CreateShortCut "$DESKTOP\\DCP-o-matic encode server.lnk" "$INSTDIR\\bin\\dcpomatic_server.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" + +SectionEnd + +Section "DCP-o-matic" SEC_MASTER +SetOutPath "$INSTDIR\\bin" CreateDirectory "$SMPROGRAMS\\DCP-o-matic" -CreateShortCut "$SMPROGRAMS\\DCP-o-matic\\Uninstall DCP-o-matic.lnk" "$INSTDIR\\Uninstall.exe" "" "$INSTDIR\\Uninstall.exe" 0 +File "%binaries%/src/tools/dcpomatic.exe" +File "%binaries%/src/tools/dcpomatic_batch.exe" +File "%binaries%/src/tools/dcpomatic_cli.exe" +CreateShortCut "$DESKTOP\\DCP-o-matic.lnk" "$INSTDIR\\bin\\dcpomatic.exe" "" CreateShortCut "$SMPROGRAMS\\DCP-o-matic\\DCP-o-matic.lnk" "$INSTDIR\\bin\\dcpomatic.exe" "" "$INSTDIR\\bin\\dcpomatic.exe" 0 +CreateShortCut "$DESKTOP\\DCP-o-matic batch converter.lnk" "$INSTDIR\\bin\\dcpomatic_batch.exe" "" CreateShortCut "$SMPROGRAMS\\DCP-o-matic\\DCP-o-matic batch converter.lnk" "$INSTDIR\\bin\\dcpomatic.exe" "" "$INSTDIR\\bin\\dcpomatic_batch.exe" 0 -CreateShortCut "$SMPROGRAMS\\DCP-o-matic\\DCP-o-matic encode server.lnk" "$INSTDIR\\bin\\dcpomatic_server.exe" "" "$INSTDIR\\bin\\dcpomatic_server.exe" 0 - +CreateShortCut "$SMPROGRAMS\\DCP-o-matic\\Uninstall DCP-o-matic.lnk" "$INSTDIR\\Uninstall.exe" "" "$INSTDIR\\Uninstall.exe" 0 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" - SectionEnd - - + +Section "Encode server" SEC_SERVER +SetOutPath "$INSTDIR\\bin" +CreateDirectory "$SMPROGRAMS\\DCP-o-matic" +File "%binaries%/src/tools/dcpomatic_server_cli.exe" +File "%binaries%/src/tools/dcpomatic_server.exe" +CreateShortCut "$DESKTOP\\DCP-o-matic encode server.lnk" "$INSTDIR\\bin\\dcpomatic_server.exe" "" +CreateShortCut "$SMPROGRAMS\\DCP-o-matic\\DCP-o-matic encode server.lnk" "$INSTDIR\\bin\\dcpomatic_server.exe" "" "$INSTDIR\\bin\\dcpomatic_server.exe" 0 +CreateShortCut "$SMPROGRAMS\\DCP-o-matic\\Uninstall DCP-o-matic.lnk" "$INSTDIR\\Uninstall.exe" "" "$INSTDIR\\Uninstall.exe" 0 +SectionEnd + +LangString DESC_SEC_MASTER ${LANG_ENGLISH} "DCP-o-matic" +LangString DESC_SEC_SERVER ${LANG_ENGLISH} "DCP-o-matic encode server" + +!insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN + !insertmacro MUI_DESCRIPTION_TEXT ${SEC_MASTER} $(DESC_SEC_MASTER) + !insertmacro MUI_DESCRIPTION_TEXT ${SEC_SERVER} $(DESC_SEC_SERVER) +!insertmacro MUI_FUNCTION_DESCRIPTION_END + +!insertmacro MUI_PAGE_INSTFILES +!insertmacro MUI_PAGE_FINISH + +!insertmacro MUI_UNPAGE_WELCOME +!insertmacro MUI_UNPAGE_CONFIRM +!insertmacro MUI_UNPAGE_INSTFILES +!insertmacro MUI_UNPAGE_FINISH +!insertmacro MUI_LANGUAGE "English" + Section "Uninstall" - RMDir /r "$INSTDIR\\*.*" RMDir "$INSTDIR" Delete "$DESKTOP\\DCP-o-matic.lnk" @@ -182,11 +208,10 @@ 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 + SectionEnd """, file=f) def build(bld): - write_installer(32) - write_installer(64) + write_installer(32, bld.env.VERSION) + write_installer(64, bld.env.VERSION) -- cgit v1.2.3 From 259486c47986e8cfe2d81462cb1a60a8d096e1fc Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Tue, 28 Jan 2014 15:56:45 +0000 Subject: Bump version --- ChangeLog | 4 ++++ debian/changelog | 5 +++-- wscript | 2 +- 3 files changed, 8 insertions(+), 3 deletions(-) (limited to 'ChangeLog') diff --git a/ChangeLog b/ChangeLog index e5398c26f..fee3c6876 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2014-01-28 Carl Hetherington + + * Version 1.63.7 released. + 2014-01-28 Carl Hetherington * Try to prevent Windows machines going to sleep during encodes. diff --git a/debian/changelog b/debian/changelog index f66069e3d..447f201f7 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,4 +1,4 @@ -dcpomatic (1.63.6-1) UNRELEASED; urgency=low +dcpomatic (1.63.7-1) UNRELEASED; urgency=low * New upstream release. * New upstream release. @@ -78,8 +78,9 @@ dcpomatic (1.63.6-1) UNRELEASED; urgency=low * New upstream release. * New upstream release. * New upstream release. + * New upstream release. - -- Carl Hetherington Thu, 23 Jan 2014 00:40:06 +0000 + -- Carl Hetherington Tue, 28 Jan 2014 15:56:45 +0000 dcpomatic (0.87-1) UNRELEASED; urgency=low diff --git a/wscript b/wscript index 8790cf9a4..b56d1514b 100644 --- a/wscript +++ b/wscript @@ -3,7 +3,7 @@ import os import sys APPNAME = 'dcpomatic' -VERSION = '1.63.6devel' +VERSION = '1.63.7' def options(opt): opt.load('compiler_cxx') -- cgit v1.2.3 From 51893eb9db4ee3064473eb57f17df36856767149 Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Tue, 28 Jan 2014 22:52:24 +0000 Subject: Use Mbit/s instead of MBps. --- ChangeLog | 2 ++ src/wx/config_dialog.cc | 2 +- src/wx/film_editor.cc | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) (limited to 'ChangeLog') diff --git a/ChangeLog b/ChangeLog index fea0ebc78..2d71fc969 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,7 @@ 2014-01-28 Carl Hetherington + * Use Mbit/s instead of the incorrect MBps. + * Try to prevent Windows machines going to sleep during encodes. * Add option to not install main program / server on Windows. diff --git a/src/wx/config_dialog.cc b/src/wx/config_dialog.cc index 2b07dd1dc..2e6f0557f 100644 --- a/src/wx/config_dialog.cc +++ b/src/wx/config_dialog.cc @@ -230,7 +230,7 @@ ConfigDialog::make_defaults_panel () wxBoxSizer* s = new wxBoxSizer (wxHORIZONTAL); _default_j2k_bandwidth = new wxSpinCtrl (_defaults_panel); s->Add (_default_j2k_bandwidth); - add_label_to_sizer (s, _defaults_panel, _("MBps"), false); + add_label_to_sizer (s, _defaults_panel, _("Mbit/s"), false); table->Add (s, 1); } diff --git a/src/wx/film_editor.cc b/src/wx/film_editor.cc index 677614fb1..061305436 100644 --- a/src/wx/film_editor.cc +++ b/src/wx/film_editor.cc @@ -177,7 +177,7 @@ FilmEditor::make_dcp_panel () wxSizer* s = new wxBoxSizer (wxHORIZONTAL); _j2k_bandwidth = new wxSpinCtrl (_dcp_panel, wxID_ANY); s->Add (_j2k_bandwidth, 1); - add_label_to_sizer (s, _dcp_panel, _("MBps"), false); + add_label_to_sizer (s, _dcp_panel, _("Mbit/s"), false); grid->Add (s, wxGBPosition (r, 1)); } ++r; -- cgit v1.2.3 From 4c2ae591ee17599b4fbb7ffc24a06f27ed985c05 Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Wed, 29 Jan 2014 21:47:29 +0000 Subject: Fix typo causing incorrectly timed subtitles when their content position is non-zero. Reported-by: Thierry Journet --- ChangeLog | 4 ++++ src/lib/player.cc | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) (limited to 'ChangeLog') diff --git a/ChangeLog b/ChangeLog index 19beeb5d9..84efa7546 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2014-01-29 Carl Hetherington + + * Fix missing subtitles when subtitled content is at a non-zero position. + 2014-01-28 Carl Hetherington * Use Mbit/s instead of the incorrect MBps. diff --git a/src/lib/player.cc b/src/lib/player.cc index ce5109733..1c54d0fc5 100644 --- a/src/lib/player.cc +++ b/src/lib/player.cc @@ -695,7 +695,7 @@ Player::update_subtitle () to = rint (to * vc->video_frame_rate() / _film->video_frame_rate()); } - _out_subtitle.from = from * piece->content->position (); + _out_subtitle.from = from + piece->content->position (); _out_subtitle.to = to + piece->content->position (); } -- cgit v1.2.3 From 62a1e9d6cda70050b813d4ba0c3e83b7350f360d Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Wed, 29 Jan 2014 22:03:05 +0000 Subject: Add subtitle X offset option. Suggested-by: Thierry Journet --- ChangeLog | 2 ++ src/lib/ffmpeg_content.cc | 2 +- src/lib/film.cc | 4 +++- src/lib/player.cc | 9 ++++++-- src/lib/subtitle_content.cc | 51 +++++++++++++++++++++++++++++++++------------ src/lib/subtitle_content.h | 29 ++++++++++++++++++-------- src/wx/subtitle_panel.cc | 46 ++++++++++++++++++++++++++++++---------- src/wx/subtitle_panel.h | 6 ++++-- 8 files changed, 110 insertions(+), 39 deletions(-) (limited to 'ChangeLog') diff --git a/ChangeLog b/ChangeLog index 84efa7546..38a37430f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,7 @@ 2014-01-29 Carl Hetherington + * Add subtitle X offset option. + * Fix missing subtitles when subtitled content is at a non-zero position. 2014-01-28 Carl Hetherington diff --git a/src/lib/ffmpeg_content.cc b/src/lib/ffmpeg_content.cc index f59551d1d..2c5fcf70e 100644 --- a/src/lib/ffmpeg_content.cc +++ b/src/lib/ffmpeg_content.cc @@ -62,7 +62,7 @@ FFmpegContent::FFmpegContent (shared_ptr f, shared_ptr c = node->node_children ("SubtitleStream"); for (list::const_iterator i = c.begin(); i != c.end(); ++i) { diff --git a/src/lib/film.cc b/src/lib/film.cc index 1290cbda2..8690d3ee0 100644 --- a/src/lib/film.cc +++ b/src/lib/film.cc @@ -83,8 +83,10 @@ using libdcp::Signer; /* 5 -> 6 * AudioMapping XML changed. + * 6 -> 7 + * Subtitle offset changed to subtitle y offset, and subtitle x offset added. */ -int const Film::state_version = 6; +int const Film::state_version = 7; /** Construct a Film object in a given directory. * diff --git a/src/lib/player.cc b/src/lib/player.cc index 1c54d0fc5..e661a7b36 100644 --- a/src/lib/player.cc +++ b/src/lib/player.cc @@ -521,7 +521,11 @@ Player::content_changed (weak_ptr w, int property, bool frequent) _have_valid_pieces = false; Changed (frequent); - } else if (property == SubtitleContentProperty::SUBTITLE_OFFSET || property == SubtitleContentProperty::SUBTITLE_SCALE) { + } else if ( + property == SubtitleContentProperty::SUBTITLE_X_OFFSET || + property == SubtitleContentProperty::SUBTITLE_Y_OFFSET || + property == SubtitleContentProperty::SUBTITLE_SCALE + ) { update_subtitle (); Changed (frequent); @@ -658,7 +662,8 @@ Player::update_subtitle () dcpomatic::Rect in_rect = _in_subtitle.rect; libdcp::Size scaled_size; - in_rect.y += sc->subtitle_offset (); + in_rect.x += sc->subtitle_x_offset (); + in_rect.y += sc->subtitle_y_offset (); /* We will scale the subtitle up to fit _video_container_size, and also by the additional subtitle_scale */ scaled_size.width = in_rect.width * _video_container_size.width * sc->subtitle_scale (); diff --git a/src/lib/subtitle_content.cc b/src/lib/subtitle_content.cc index 6c0d3af86..8f88574e5 100644 --- a/src/lib/subtitle_content.cc +++ b/src/lib/subtitle_content.cc @@ -30,25 +30,34 @@ using boost::shared_ptr; using boost::lexical_cast; using boost::dynamic_pointer_cast; -int const SubtitleContentProperty::SUBTITLE_OFFSET = 500; -int const SubtitleContentProperty::SUBTITLE_SCALE = 501; +int const SubtitleContentProperty::SUBTITLE_X_OFFSET = 500; +int const SubtitleContentProperty::SUBTITLE_Y_OFFSET = 501; +int const SubtitleContentProperty::SUBTITLE_SCALE = 502; SubtitleContent::SubtitleContent (shared_ptr f, boost::filesystem::path p) : Content (f, p) - , _subtitle_offset (0) + , _subtitle_x_offset (0) + , _subtitle_y_offset (0) , _subtitle_scale (1) { } -SubtitleContent::SubtitleContent (shared_ptr f, shared_ptr node) +SubtitleContent::SubtitleContent (shared_ptr f, shared_ptr node, int version) : Content (f, node) - , _subtitle_offset (0) + , _subtitle_x_offset (0) + , _subtitle_y_offset (0) , _subtitle_scale (1) { LocaleGuard lg; + + if (version >= 7) { + _subtitle_x_offset = node->number_child ("SubtitleXOffset"); + _subtitle_y_offset = node->number_child ("SubtitleYOffset"); + } else { + _subtitle_y_offset = node->number_child ("SubtitleOffset"); + } - _subtitle_offset = node->number_child ("SubtitleOffset"); _subtitle_scale = node->number_child ("SubtitleScale"); } @@ -61,8 +70,12 @@ SubtitleContent::SubtitleContent (shared_ptr f, vector sc = dynamic_pointer_cast (c[i]); - if (sc->subtitle_offset() != ref->subtitle_offset()) { - throw JoinError (_("Content to be joined must have the same subtitle offset.")); + if (sc->subtitle_x_offset() != ref->subtitle_x_offset()) { + throw JoinError (_("Content to be joined must have the same subtitle X offset.")); + } + + if (sc->subtitle_y_offset() != ref->subtitle_y_offset()) { + throw JoinError (_("Content to be joined must have the same subtitle Y offset.")); } if (sc->subtitle_scale() != ref->subtitle_scale()) { @@ -70,7 +83,8 @@ SubtitleContent::SubtitleContent (shared_ptr f, vectorsubtitle_offset (); + _subtitle_x_offset = ref->subtitle_x_offset (); + _subtitle_y_offset = ref->subtitle_y_offset (); _subtitle_scale = ref->subtitle_scale (); } @@ -79,18 +93,29 @@ SubtitleContent::as_xml (xmlpp::Node* root) const { LocaleGuard lg; - root->add_child("SubtitleOffset")->add_child_text (lexical_cast (_subtitle_offset)); + root->add_child("SubtitleXOffset")->add_child_text (lexical_cast (_subtitle_x_offset)); + root->add_child("SubtitleYOffset")->add_child_text (lexical_cast (_subtitle_y_offset)); root->add_child("SubtitleScale")->add_child_text (lexical_cast (_subtitle_scale)); } void -SubtitleContent::set_subtitle_offset (double o) +SubtitleContent::set_subtitle_x_offset (double o) +{ + { + boost::mutex::scoped_lock lm (_mutex); + _subtitle_x_offset = o; + } + signal_changed (SubtitleContentProperty::SUBTITLE_X_OFFSET); +} + +void +SubtitleContent::set_subtitle_y_offset (double o) { { boost::mutex::scoped_lock lm (_mutex); - _subtitle_offset = o; + _subtitle_y_offset = o; } - signal_changed (SubtitleContentProperty::SUBTITLE_OFFSET); + signal_changed (SubtitleContentProperty::SUBTITLE_Y_OFFSET); } void diff --git a/src/lib/subtitle_content.h b/src/lib/subtitle_content.h index 854647d18..388637688 100644 --- a/src/lib/subtitle_content.h +++ b/src/lib/subtitle_content.h @@ -25,7 +25,8 @@ class SubtitleContentProperty { public: - static int const SUBTITLE_OFFSET; + static int const SUBTITLE_X_OFFSET; + static int const SUBTITLE_Y_OFFSET; static int const SUBTITLE_SCALE; }; @@ -33,17 +34,23 @@ class SubtitleContent : public virtual Content { public: SubtitleContent (boost::shared_ptr, boost::filesystem::path); - SubtitleContent (boost::shared_ptr, boost::shared_ptr); + SubtitleContent (boost::shared_ptr, boost::shared_ptr, int version); SubtitleContent (boost::shared_ptr, std::vector >); void as_xml (xmlpp::Node *) const; - void set_subtitle_offset (double); + void set_subtitle_x_offset (double); + void set_subtitle_y_offset (double); void set_subtitle_scale (double); - double subtitle_offset () const { + double subtitle_x_offset () const { boost::mutex::scoped_lock lm (_mutex); - return _subtitle_offset; + return _subtitle_x_offset; + } + + double subtitle_y_offset () const { + boost::mutex::scoped_lock lm (_mutex); + return _subtitle_y_offset; } double subtitle_scale () const { @@ -53,11 +60,15 @@ public: private: friend class ffmpeg_pts_offset_test; - + + /** x offset for placing subtitles, as a proportion of the container width; + * +ve is further right, -ve is further left. + */ + double _subtitle_x_offset; /** y offset for placing subtitles, as a proportion of the container height; - +ve is further down the frame, -ve is further up. - */ - double _subtitle_offset; + * +ve is further down the frame, -ve is further up. + */ + double _subtitle_y_offset; /** scale factor to apply to subtitles */ double _subtitle_scale; }; diff --git a/src/wx/subtitle_panel.cc b/src/wx/subtitle_panel.cc index 0e3f2e89d..02c8776d6 100644 --- a/src/wx/subtitle_panel.cc +++ b/src/wx/subtitle_panel.cc @@ -41,14 +41,23 @@ SubtitlePanel::SubtitlePanel (FilmEditor* e) grid->AddSpacer (0); { - add_label_to_sizer (grid, this, _("Subtitle Offset"), true); + add_label_to_sizer (grid, this, _("Subtitle X Offset"), true); wxBoxSizer* s = new wxBoxSizer (wxHORIZONTAL); - _offset = new wxSpinCtrl (this); - s->Add (_offset); + _x_offset = new wxSpinCtrl (this); + s->Add (_x_offset); add_label_to_sizer (s, this, _("%"), false); grid->Add (s); } + { + add_label_to_sizer (grid, this, _("Subtitle Y Offset"), true); + wxBoxSizer* s = new wxBoxSizer (wxHORIZONTAL); + _y_offset = new wxSpinCtrl (this); + s->Add (_y_offset); + add_label_to_sizer (s, this, _("%"), false); + grid->Add (s); + } + { add_label_to_sizer (grid, this, _("Subtitle Scale"), true); wxBoxSizer* s = new wxBoxSizer (wxHORIZONTAL); @@ -62,12 +71,14 @@ SubtitlePanel::SubtitlePanel (FilmEditor* e) _stream = new wxChoice (this, wxID_ANY); grid->Add (_stream, 1, wxEXPAND); - _offset->SetRange (-100, 100); + _x_offset->SetRange (-100, 100); + _y_offset->SetRange (-100, 100); _scale->SetRange (1, 1000); _scale->SetValue (100); _with_subtitles->Bind (wxEVT_COMMAND_CHECKBOX_CLICKED, boost::bind (&SubtitlePanel::with_subtitles_toggled, this)); - _offset->Bind (wxEVT_COMMAND_SPINCTRL_UPDATED, boost::bind (&SubtitlePanel::offset_changed, this)); + _x_offset->Bind (wxEVT_COMMAND_SPINCTRL_UPDATED, boost::bind (&SubtitlePanel::x_offset_changed, this)); + _y_offset->Bind (wxEVT_COMMAND_SPINCTRL_UPDATED, boost::bind (&SubtitlePanel::y_offset_changed, this)); _scale->Bind (wxEVT_COMMAND_SPINCTRL_UPDATED, boost::bind (&SubtitlePanel::scale_changed, this)); _stream->Bind (wxEVT_COMMAND_CHOICE_SELECTED, boost::bind (&SubtitlePanel::stream_changed, this)); } @@ -119,8 +130,10 @@ SubtitlePanel::film_content_changed (int property) } } setup_sensitivity (); - } else if (property == SubtitleContentProperty::SUBTITLE_OFFSET) { - checked_set (_offset, scs ? (scs->subtitle_offset() * 100) : 0); + } else if (property == SubtitleContentProperty::SUBTITLE_X_OFFSET) { + checked_set (_x_offset, scs ? (scs->subtitle_x_offset() * 100) : 0); + } else if (property == SubtitleContentProperty::SUBTITLE_Y_OFFSET) { + checked_set (_y_offset, scs ? (scs->subtitle_y_offset() * 100) : 0); } else if (property == SubtitleContentProperty::SUBTITLE_SCALE) { checked_set (_scale, scs ? (scs->subtitle_scale() * 100) : 100); } @@ -147,7 +160,8 @@ SubtitlePanel::setup_sensitivity () } _with_subtitles->Enable (h); - _offset->Enable (j); + _x_offset->Enable (j); + _y_offset->Enable (j); _scale->Enable (j); _stream->Enable (j); } @@ -175,11 +189,20 @@ SubtitlePanel::stream_changed () } void -SubtitlePanel::offset_changed () +SubtitlePanel::x_offset_changed () +{ + SubtitleContentList c = _editor->selected_subtitle_content (); + if (c.size() == 1) { + c.front()->set_subtitle_x_offset (_x_offset->GetValue() / 100.0); + } +} + +void +SubtitlePanel::y_offset_changed () { SubtitleContentList c = _editor->selected_subtitle_content (); if (c.size() == 1) { - c.front()->set_subtitle_offset (_offset->GetValue() / 100.0); + c.front()->set_subtitle_y_offset (_y_offset->GetValue() / 100.0); } } @@ -196,6 +219,7 @@ void SubtitlePanel::content_selection_changed () { film_content_changed (FFmpegContentProperty::SUBTITLE_STREAMS); - film_content_changed (SubtitleContentProperty::SUBTITLE_OFFSET); + film_content_changed (SubtitleContentProperty::SUBTITLE_X_OFFSET); + film_content_changed (SubtitleContentProperty::SUBTITLE_Y_OFFSET); film_content_changed (SubtitleContentProperty::SUBTITLE_SCALE); } diff --git a/src/wx/subtitle_panel.h b/src/wx/subtitle_panel.h index 19df26436..20d7c40c2 100644 --- a/src/wx/subtitle_panel.h +++ b/src/wx/subtitle_panel.h @@ -33,14 +33,16 @@ public: private: void with_subtitles_toggled (); - void offset_changed (); + void x_offset_changed (); + void y_offset_changed (); void scale_changed (); void stream_changed (); void setup_sensitivity (); wxCheckBox* _with_subtitles; - wxSpinCtrl* _offset; + wxSpinCtrl* _x_offset; + wxSpinCtrl* _y_offset; wxSpinCtrl* _scale; wxChoice* _stream; }; -- cgit v1.2.3 From b651309f08107a5fc2fdb0cccdd5f05d94018311 Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Wed, 29 Jan 2014 22:46:41 +0000 Subject: Bump version --- ChangeLog | 4 ++++ debian/changelog | 5 +++-- wscript | 2 +- 3 files changed, 8 insertions(+), 3 deletions(-) (limited to 'ChangeLog') diff --git a/ChangeLog b/ChangeLog index 38a37430f..572e5f18f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2014-01-29 Carl Hetherington + + * Version 1.63.8 released. + 2014-01-29 Carl Hetherington * Add subtitle X offset option. diff --git a/debian/changelog b/debian/changelog index 447f201f7..29259b1e2 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,4 +1,4 @@ -dcpomatic (1.63.7-1) UNRELEASED; urgency=low +dcpomatic (1.63.8-1) UNRELEASED; urgency=low * New upstream release. * New upstream release. @@ -79,8 +79,9 @@ dcpomatic (1.63.7-1) UNRELEASED; urgency=low * New upstream release. * New upstream release. * New upstream release. + * New upstream release. - -- Carl Hetherington Tue, 28 Jan 2014 15:56:45 +0000 + -- Carl Hetherington Wed, 29 Jan 2014 22:46:41 +0000 dcpomatic (0.87-1) UNRELEASED; urgency=low diff --git a/wscript b/wscript index 63fecdd59..ef4e10f48 100644 --- a/wscript +++ b/wscript @@ -3,7 +3,7 @@ import os import sys APPNAME = 'dcpomatic' -VERSION = '1.63.7devel' +VERSION = '1.63.8' def options(opt): opt.load('compiler_cxx') -- cgit v1.2.3 From 49ece445d2392c9b2f4172b7dafd94a13d5431fc Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Sun, 2 Feb 2014 23:46:54 +0000 Subject: Bump version --- ChangeLog | 4 ++++ debian/changelog | 5 +++-- wscript | 2 +- 3 files changed, 8 insertions(+), 3 deletions(-) (limited to 'ChangeLog') diff --git a/ChangeLog b/ChangeLog index 572e5f18f..b9a027fce 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2014-02-02 Carl Hetherington + + * Version 1.64.0 released. + 2014-01-29 Carl Hetherington * Version 1.63.8 released. diff --git a/debian/changelog b/debian/changelog index 29259b1e2..6290cc9e7 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,4 +1,4 @@ -dcpomatic (1.63.8-1) UNRELEASED; urgency=low +dcpomatic (1.64.0-1) UNRELEASED; urgency=low * New upstream release. * New upstream release. @@ -80,8 +80,9 @@ dcpomatic (1.63.8-1) UNRELEASED; urgency=low * New upstream release. * New upstream release. * New upstream release. + * New upstream release. - -- Carl Hetherington Wed, 29 Jan 2014 22:46:41 +0000 + -- Carl Hetherington Sun, 02 Feb 2014 23:46:54 +0000 dcpomatic (0.87-1) UNRELEASED; urgency=low diff --git a/wscript b/wscript index 8bd7d1e6b..dfe8b46d5 100644 --- a/wscript +++ b/wscript @@ -3,7 +3,7 @@ import os import sys APPNAME = 'dcpomatic' -VERSION = '1.63.8devel' +VERSION = '1.64.0' def options(opt): opt.load('compiler_cxx') -- cgit v1.2.3