From 3a72d3e7af018d4e4474d48d9007841a0c63c020 Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Sat, 25 May 2013 15:59:25 +0100 Subject: Try to fix memory leak in filter graph. --- src/lib/filter_graph.cc | 1 + 1 file changed, 1 insertion(+) (limited to 'src') diff --git a/src/lib/filter_graph.cc b/src/lib/filter_graph.cc index b0427a23d..8ff5e75df 100644 --- a/src/lib/filter_graph.cc +++ b/src/lib/filter_graph.cc @@ -150,6 +150,7 @@ FFmpegFilterGraph::process (AVFrame* frame) } images.push_back (shared_ptr (new SimpleImage (_frame))); + av_frame_unref (_frame); } return images; -- cgit v1.2.3 From 003de48cd0371a60d095dc9d02ed5763c410cf5e Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Wed, 29 May 2013 12:00:36 +0100 Subject: Build fixes for OS X. --- src/lib/image.cc | 8 ++++---- src/tools/servomatic_gui.cc | 5 ++++- src/wx/audio_plot.cc | 2 ++ src/wx/film_viewer.cc | 3 +++ test/wscript | 2 +- 5 files changed, 14 insertions(+), 6 deletions(-) (limited to 'src') diff --git a/src/lib/image.cc b/src/lib/image.cc index b166dfac6..bd527e91e 100644 --- a/src/lib/image.cc +++ b/src/lib/image.cc @@ -68,7 +68,7 @@ Image::lines (int n) const throw PixelFormatError (N_("lines()"), _pixel_format); } - return size().height / pow(2, d->log2_chroma_h); + return size().height / pow(2.0f, d->log2_chroma_h); } /** @return Number of components */ @@ -417,13 +417,13 @@ Image::bytes_per_pixel (int c) const bpp[0] = floor ((d->comp[0].depth_minus1 + 1 + 7) / 8); if (d->nb_components > 1) { - bpp[1] = floor ((d->comp[1].depth_minus1 + 1 + 7) / 8) / pow (2, d->log2_chroma_w); + bpp[1] = floor ((d->comp[1].depth_minus1 + 1 + 7) / 8) / pow (2.0f, d->log2_chroma_w); } if (d->nb_components > 2) { - bpp[2] = floor ((d->comp[2].depth_minus1 + 1 + 7) / 8) / pow (2, d->log2_chroma_w); + bpp[2] = floor ((d->comp[2].depth_minus1 + 1 + 7) / 8) / pow (2.0f, d->log2_chroma_w); } if (d->nb_components > 3) { - bpp[3] = floor ((d->comp[3].depth_minus1 + 1 + 7) / 8) / pow (2, d->log2_chroma_w); + bpp[3] = floor ((d->comp[3].depth_minus1 + 1 + 7) / 8) / pow (2.0f, d->log2_chroma_w); } if ((d->flags & PIX_FMT_PLANAR) == 0) { diff --git a/src/tools/servomatic_gui.cc b/src/tools/servomatic_gui.cc index 5e36660eb..000c2019f 100644 --- a/src/tools/servomatic_gui.cc +++ b/src/tools/servomatic_gui.cc @@ -102,8 +102,11 @@ public: wxBitmap bitmap (wxString::Format (wxT ("%s/taskbar_icon.png"), POSIX_ICON_PREFIX), wxBITMAP_TYPE_PNG); wxIcon icon; icon.CopyFromBitmap (bitmap); -#endif +#endif +#ifndef __WXOSX__ + /* XXX: fix this for OS X */ SetIcon (icon, std_to_wx ("DVD-o-matic encode server")); +#endif Connect (ID_status, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler (TaskBarIcon::status)); Connect (ID_quit, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler (TaskBarIcon::quit)); diff --git a/src/wx/audio_plot.cc b/src/wx/audio_plot.cc index cf44eb69f..3fec1d3fe 100644 --- a/src/wx/audio_plot.cc +++ b/src/wx/audio_plot.cc @@ -42,7 +42,9 @@ AudioPlot::AudioPlot (wxWindow* parent) , _gain (0) , _smoothing (max_smoothing / 2) { +#ifndef __WXOSX__ SetDoubleBuffered (true); +#endif for (int i = 0; i < MAX_AUDIO_CHANNELS; ++i) { _channel_visible[i] = false; diff --git a/src/wx/film_viewer.cc b/src/wx/film_viewer.cc index 4f2985a06..82490e329 100644 --- a/src/wx/film_viewer.cc +++ b/src/wx/film_viewer.cc @@ -59,7 +59,10 @@ FilmViewer::FilmViewer (shared_ptr f, wxWindow* p) , _display_frame_x (0) , _got_frame (false) { +#ifndef __WXOSX__ _panel->SetDoubleBuffered (true); +#endif + #if wxMAJOR_VERSION == 2 && wxMINOR_VERSION >= 9 _panel->SetBackgroundStyle (wxBG_STYLE_PAINT); #endif diff --git a/test/wscript b/test/wscript index 15d5410b3..5de1a99ce 100644 --- a/test/wscript +++ b/test/wscript @@ -3,7 +3,7 @@ def configure(conf): #define BOOST_TEST_MODULE Config test\n #include \n int main() {} - """, msg = 'Checking for boost unit testing library', lib = 'boost_unit_test_framework-mt', uselib_store = 'BOOST_TEST') + """, msg = 'Checking for boost unit testing library', lib = 'boost_unit_test_framework', uselib_store = 'BOOST_TEST') def build(bld): obj = bld(features = 'cxx cxxprogram') -- cgit v1.2.3 From b1da49fd4f3bc918de2ee4cdf49959258576977c Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Wed, 29 May 2013 16:06:58 +0100 Subject: Remove unnecessary include; add makedcp-osx. --- run/makedcp-osx | 15 +++++++++++++++ src/lib/ffmpeg_decoder.cc | 1 - 2 files changed, 15 insertions(+), 1 deletion(-) create mode 100755 run/makedcp-osx (limited to 'src') diff --git a/run/makedcp-osx b/run/makedcp-osx new file mode 100755 index 000000000..1b95ecc5d --- /dev/null +++ b/run/makedcp-osx @@ -0,0 +1,15 @@ +#!/bin/bash + +export DYLD_LIBRARY_PATH=$DYLD_LIBRARY_PATH:build/src/lib:build/src:/Users/carl/Environments/osx/10.8/lib +if [ "$1" == "--debug" ]; then + shift + gdb --args build/src/tools/makedcp "$@" +elif [ "$1" == "--memcheck" ]; then + shift + valgrind --tool="memcheck" --leak-check=full --show-reachable=yes build/src/tools/makedcp "$@" +elif [ "$1" == "--massif" ]; then + shift + valgrind --tool="massif" build/src/tools/makedcp "$@" +else + build/src/tools/makedcp "$@" +fi diff --git a/src/lib/ffmpeg_decoder.cc b/src/lib/ffmpeg_decoder.cc index 982139515..bcfbea431 100644 --- a/src/lib/ffmpeg_decoder.cc +++ b/src/lib/ffmpeg_decoder.cc @@ -29,7 +29,6 @@ #include #include extern "C" { -#include #include #include #include -- cgit v1.2.3 From 07ee845fddca9c7f4e714cf0df8f3e755af7ed81 Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Wed, 29 May 2013 23:02:00 +0100 Subject: Add magic lines to put the DVD-o-matic window at the front on OS X so that it gets a menu bar. Put our Rect in a namespace to hide from Carbon's version. --- src/lib/dcp_video_frame.cc | 2 +- src/lib/subtitle.cc | 10 +++++----- src/lib/subtitle.h | 6 +++--- src/lib/util.cc | 4 ++-- src/lib/util.h | 7 +++++++ src/tools/dvdomatic.cc | 9 +++++++++ src/wx/film_viewer.cc | 2 +- 7 files changed, 28 insertions(+), 12 deletions(-) (limited to 'src') diff --git a/src/lib/dcp_video_frame.cc b/src/lib/dcp_video_frame.cc index d674393a9..77b81a658 100644 --- a/src/lib/dcp_video_frame.cc +++ b/src/lib/dcp_video_frame.cc @@ -164,7 +164,7 @@ DCPVideoFrame::encode_locally () shared_ptr prepared = _input->scale_and_convert_to_rgb (_out_size, _padding, _scaler, true); if (_subtitle) { - Rect tx = subtitle_transformed_area ( + dvdomatic::Rect tx = subtitle_transformed_area ( float (_out_size.width) / _input->size().width, float (_out_size.height) / _input->size().height, _subtitle->area(), _subtitle_offset, _subtitle_scale diff --git a/src/lib/subtitle.cc b/src/lib/subtitle.cc index 5c1ad9706..5c2a0d0b5 100644 --- a/src/lib/subtitle.cc +++ b/src/lib/subtitle.cc @@ -108,13 +108,13 @@ Subtitle::Subtitle (Position p, shared_ptr i) * in the coordinate space of the source. * @param subtitle_scale scaling factor to apply to the subtitle image. */ -Rect +dvdomatic::Rect subtitle_transformed_area ( float target_x_scale, float target_y_scale, - Rect sub_area, int subtitle_offset, float subtitle_scale + dvdomatic::Rect sub_area, int subtitle_offset, float subtitle_scale ) { - Rect tx; + dvdomatic::Rect tx; sub_area.y += subtitle_offset; @@ -143,8 +143,8 @@ subtitle_transformed_area ( } /** @return area that this subtitle takes up, in the original uncropped source's coordinate space */ -Rect +dvdomatic::Rect Subtitle::area () const { - return Rect (_position.x, _position.y, _image->size().width, _image->size().height); + return dvdomatic::Rect (_position.x, _position.y, _image->size().width, _image->size().height); } diff --git a/src/lib/subtitle.h b/src/lib/subtitle.h index 38ba4e70e..e3a853695 100644 --- a/src/lib/subtitle.h +++ b/src/lib/subtitle.h @@ -46,17 +46,17 @@ public: return _image; } - Rect area () const; + dvdomatic::Rect area () const; private: Position _position; boost::shared_ptr _image; }; -Rect +dvdomatic::Rect subtitle_transformed_area ( float target_x_scale, float target_y_scale, - Rect sub_area, int subtitle_offset, float subtitle_scale + dvdomatic::Rect sub_area, int subtitle_offset, float subtitle_scale ); /** A Subtitle class with details of the time over which it should be shown */ diff --git a/src/lib/util.cc b/src/lib/util.cc index 2f8be6edd..b8b60c6f6 100644 --- a/src/lib/util.cc +++ b/src/lib/util.cc @@ -637,8 +637,8 @@ Socket::read_uint32 () /** @param other A Rect. * @return The intersection of this with `other'. */ -Rect -Rect::intersection (Rect const & other) const +dvdomatic::Rect +dvdomatic::Rect::intersection (Rect const & other) const { int const tx = max (x, other.x); int const ty = max (y, other.y); diff --git a/src/lib/util.h b/src/lib/util.h index d0c350a56..3e1d7f4b4 100644 --- a/src/lib/util.h +++ b/src/lib/util.h @@ -44,6 +44,8 @@ extern "C" { #define TIMING(...) #endif +#undef check + /** The maximum number of audio channels that we can cope with */ #define MAX_AUDIO_CHANNELS 6 @@ -150,6 +152,9 @@ struct Position int y; }; +namespace dvdomatic +{ + /** @struct Rect * @brief A rectangle. */ @@ -185,6 +190,8 @@ struct Rect Rect intersection (Rect const & other) const; }; +} + extern std::string crop_string (Position, libdcp::Size); extern int dcp_audio_sample_rate (int); extern std::string colour_lut_index_to_name (int index); diff --git a/src/tools/dvdomatic.cc b/src/tools/dvdomatic.cc index ff1560f0e..e6d4471db 100644 --- a/src/tools/dvdomatic.cc +++ b/src/tools/dvdomatic.cc @@ -23,6 +23,9 @@ #ifdef __WXMSW__ #include #endif +#ifdef __WXOSX__ +#include +#endif #include #include #include @@ -472,6 +475,12 @@ class App : public wxApp #ifdef DVDOMATIC_POSIX unsetenv ("UBUNTU_MENUPROXY"); +#endif + +#ifdef __WXOSX__ + ProcessSerialNumber serial; + GetCurrentProcess (&serial); + TransformProcessType (&serial, kProcessTransformToForegroundApplication); #endif wxInitAllImageHandlers (); diff --git a/src/wx/film_viewer.cc b/src/wx/film_viewer.cc index 82490e329..79642af9c 100644 --- a/src/wx/film_viewer.cc +++ b/src/wx/film_viewer.cc @@ -329,7 +329,7 @@ FilmViewer::raw_to_display () Size const cropped_size = _film->cropped_size (_film->size ()); - Rect tx = subtitle_transformed_area ( + dvdomatic::Rect tx = subtitle_transformed_area ( float (_film_size.width) / cropped_size.width, float (_film_size.height) / cropped_size.height, _raw_sub->area(), _film->subtitle_offset(), _film->subtitle_scale() -- cgit v1.2.3 From da360487fc8764f8591e73a8682e01b90fb9c5ab Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Wed, 29 May 2013 23:27:10 +0100 Subject: Fix to windows build. --- src/tools/wscript | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/tools/wscript b/src/tools/wscript index f36f0abef..ee4e7edef 100644 --- a/src/tools/wscript +++ b/src/tools/wscript @@ -20,7 +20,7 @@ def build(bld): obj.use = ['libdvdomatic', 'libdvdomatic-wx'] obj.source = '%s.cc' % t if bld.env.TARGET_WINDOWS: - obj.source += ' ../../windows/dvdomatic.rc' + obj.source += ' ../../platform/windows/dvdomatic.rc' obj.target = t i18n.po_to_mo(os.path.join('src', 'tools'), 'dvdomatic', bld) -- cgit v1.2.3 From ebabac1b19f7e039ed34f407a73f24dddaa4e493 Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Thu, 30 May 2013 12:15:01 +0100 Subject: Trim must be part of the video identifier if we are doing encode-trims. --- src/lib/film.cc | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src') diff --git a/src/lib/film.cc b/src/lib/film.cc index 81c7de77f..5573ee9d2 100644 --- a/src/lib/film.cc +++ b/src/lib/film.cc @@ -218,6 +218,10 @@ Film::video_state_identifier () const << "_" << j2k_bandwidth() << "_" << boost::lexical_cast (colour_lut()); + if (trim_type() == ENCODE) { + s << "_" << trim_start() << "_" << trim_end(); + } + if (dcp_ab()) { pair fa = Filter::ffmpeg_strings (Config::instance()->reference_filters()); s << "ab_" << Config::instance()->reference_scaler()->id() << "_" << fa.first << "_" << fa.second; -- cgit v1.2.3 From c1d35fc679f63d8a2f80287b6c6a9af984a449f5 Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Thu, 30 May 2013 12:53:33 +0100 Subject: Prevent extra frame skip on setting up new video (#147). --- src/wx/film_viewer.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/wx/film_viewer.cc b/src/wx/film_viewer.cc index 79642af9c..a5920b4bb 100644 --- a/src/wx/film_viewer.cc +++ b/src/wx/film_viewer.cc @@ -132,9 +132,9 @@ FilmViewer::film_changed (Film::Property p) if (_decoders.video == 0) { break; } + _decoders.video->set_subtitle_stream (_film->subtitle_stream()); _decoders.video->Video.connect (bind (&FilmViewer::process_video, this, _1, _2, _3, _4)); _decoders.video->OutputChanged.connect (boost::bind (&FilmViewer::decoder_changed, this)); - _decoders.video->set_subtitle_stream (_film->subtitle_stream()); calculate_sizes (); get_frame (); _panel->Refresh (); @@ -436,7 +436,7 @@ FilmViewer::get_frame () _display_frame.reset (); return; } - + try { _got_frame = false; while (!_got_frame) { -- cgit v1.2.3 From c7f73ab2c9e1a642f40f922303a63599aeadb30a Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Thu, 30 May 2013 13:02:31 +0100 Subject: Count frame number from 1. Move panel refresh to after getting the new frame on a timer event; this means that the view is refreshed after stop (and so displays the right frame). --- src/wx/film_viewer.cc | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/wx/film_viewer.cc b/src/wx/film_viewer.cc index a5920b4bb..6845031cf 100644 --- a/src/wx/film_viewer.cc +++ b/src/wx/film_viewer.cc @@ -207,9 +207,6 @@ FilmViewer::timer (wxTimerEvent &) return; } - _panel->Refresh (); - _panel->Update (); - get_frame (); if (_film->length()) { @@ -218,6 +215,9 @@ FilmViewer::timer (wxTimerEvent &) _slider->SetValue (new_slider_position); } } + + _panel->Refresh (); + _panel->Update (); } @@ -413,7 +413,8 @@ FilmViewer::process_video (shared_ptr image, bool, shared_ptrframes_per_second (); - _frame->SetLabel (wxString::Format (wxT("%d"), int (rint (t * fps)))); + /* Count frame number from 1 ... not sure if this is the best idea */ + _frame->SetLabel (wxString::Format (wxT("%d"), int (rint (t * fps)) + 1)); double w = t; int const h = (w / 3600); -- cgit v1.2.3 From f3ba7adfbdf847f8c3b78ceb73a20cee516448fd Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Thu, 30 May 2013 14:12:36 +0100 Subject: Keep track of the directory to put new films in across uses of the dialog (#143). --- src/wx/new_film_dialog.cc | 9 ++++++++- src/wx/new_film_dialog.h | 4 +++- 2 files changed, 11 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/wx/new_film_dialog.cc b/src/wx/new_film_dialog.cc index 90c2d727e..737b07fbb 100644 --- a/src/wx/new_film_dialog.cc +++ b/src/wx/new_film_dialog.cc @@ -29,6 +29,8 @@ using namespace std; using namespace boost; +string NewFilmDialog::_directory = Config::instance()->default_directory_or (wx_to_std (wxStandardPaths::Get().GetDocumentsDir())); + NewFilmDialog::NewFilmDialog (wxWindow* parent) : wxDialog (parent, wxID_ANY, _("New Film")) { @@ -49,7 +51,7 @@ NewFilmDialog::NewFilmDialog (wxWindow* parent) #else _folder = new wxDirPickerCtrl (this, wxDD_DIR_MUST_EXIST); #endif - _folder->SetPath (std_to_wx (Config::instance()->default_directory_or (wx_to_std (wxStandardPaths::Get().GetDocumentsDir())))); + _folder->SetPath (std_to_wx (_directory)); table->Add (_folder, 1, wxEXPAND); wxSizer* buttons = CreateSeparatedButtonSizer (wxOK | wxCANCEL); @@ -61,6 +63,11 @@ NewFilmDialog::NewFilmDialog (wxWindow* parent) overall_sizer->SetSizeHints (this); } +NewFilmDialog::~NewFilmDialog () +{ + _directory = wx_to_std (_folder->GetPath ()); +} + string NewFilmDialog::get_path () const { diff --git a/src/wx/new_film_dialog.h b/src/wx/new_film_dialog.h index 3d1253ecc..715f71f51 100644 --- a/src/wx/new_film_dialog.h +++ b/src/wx/new_film_dialog.h @@ -26,6 +26,7 @@ class NewFilmDialog : public wxDialog { public: NewFilmDialog (wxWindow *); + ~NewFilmDialog (); std::string get_path () const; @@ -35,5 +36,6 @@ private: DirPickerCtrl* _folder; #else wxDirPickerCtrl* _folder; -#endif +#endif + static std::string _directory; }; -- cgit v1.2.3 From 65f0df0142bb21c3bdc8ff755a7aa38ae187ed72 Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Fri, 31 May 2013 00:56:03 +0100 Subject: Fix silly 100 frame limit on trim. --- src/wx/film_editor.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/wx/film_editor.cc b/src/wx/film_editor.cc index a21782a6f..6456ae247 100644 --- a/src/wx/film_editor.cc +++ b/src/wx/film_editor.cc @@ -350,8 +350,8 @@ FilmEditor::make_video_panel () _right_crop->SetRange (0, 1024); _bottom_crop->SetRange (0, 1024); _still_duration->SetRange (1, 60 * 60); - _trim_start->SetRange (0, 100); - _trim_end->SetRange (0, 100); + _trim_start->SetRange (0, 24 * 60 * 60); + _trim_end->SetRange (0, 24 * 60 * 60); _j2k_bandwidth->SetRange (50, 250); } -- cgit v1.2.3 From 75ca9a37fc0567357ff737e7cc43bfcc19237501 Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Fri, 31 May 2013 10:29:06 +0100 Subject: Try to create directory for .dvdomatic if it doesn't exist. --- src/lib/config.cc | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src') diff --git a/src/lib/config.cc b/src/lib/config.cc index 8c65e371a..7d8e82335 100644 --- a/src/lib/config.cc +++ b/src/lib/config.cc @@ -122,6 +122,8 @@ Config::file () const { boost::filesystem::path p; p /= g_get_user_config_dir (); + boost::system::error_code ec; + boost::filesystem::create_directory (p, ec); p /= N_(".dvdomatic"); return p.string (); } -- cgit v1.2.3 From c8be8124ce89aee17df080745c9651d6e3975a4c Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Fri, 31 May 2013 22:08:14 +0100 Subject: Various OS X tweaks. --- platform/osx/Info.plist.in | 2 +- platform/osx/make_dmg.sh | 3 +++ src/tools/dvdomatic.cc | 27 +++++++++++++++++---------- src/wx/config_dialog.cc | 6 +++--- 4 files changed, 24 insertions(+), 14 deletions(-) (limited to 'src') diff --git a/platform/osx/Info.plist.in b/platform/osx/Info.plist.in index 3f4ab60ef..c904d91dd 100644 --- a/platform/osx/Info.plist.in +++ b/platform/osx/Info.plist.in @@ -9,7 +9,7 @@ CFBundleGetInfoString DCP generator CFBundleIconFile - appIcon.icns + DVD-o-matic.icns CFBundleIdentifier net.carlh.dvdomatic CFBundleInfoDictionaryVersion diff --git a/platform/osx/make_dmg.sh b/platform/osx/make_dmg.sh index 52db90575..2aeeea66a 100644 --- a/platform/osx/make_dmg.sh +++ b/platform/osx/make_dmg.sh @@ -17,10 +17,12 @@ appdir="DVD-o-matic.app" approot=$appdir/Contents libs=$approot/lib macos=$approot/MacOS +resources=$approot/Resources rm -rf $WORK/$appdir mkdir -p $WORK/$macos mkdir -p $WORK/$libs +mkdir -p $WORK/$resources cp build/src/tools/dvdomatic $WORK/$macos/ cp build/src/lib/libdvdomatic.dylib $WORK/$libs/ @@ -75,6 +77,7 @@ done cp build/platform/osx/Info.plist $WORK/$approot +cp icons/dvdomatic.icns $WORK/$resources/DVD-o-matic.icns exit 0 diff --git a/src/tools/dvdomatic.cc b/src/tools/dvdomatic.cc index e6d4471db..9586e8d1e 100644 --- a/src/tools/dvdomatic.cc +++ b/src/tools/dvdomatic.cc @@ -148,13 +148,10 @@ enum { 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 @@ -168,10 +165,14 @@ setup_menu (wxMenuBar* m) file->AppendSeparator (); add_item (file, _("&Properties..."), ID_file_properties, NEEDS_FILM); file->AppendSeparator (); - add_item (file, _("&Quit"), ID_file_quit, ALWAYS); + add_item (file, _("&Exit"), wxID_EXIT, ALWAYS); +#ifdef __WXOSX__ + add_item (file, _("&Preferences..."), wxID_PREFERENCES, ALWAYS); +#else wxMenu* edit = new wxMenu; - add_item (edit, _("&Preferences..."), ID_edit_preferences, ALWAYS); + add_item (edit, _("&Preferences..."), wxID_PREFERENCES, ALWAYS); +#endif jobs_menu = new wxMenu; add_item (jobs_menu, _("&Make DCP"), ID_jobs_make_dcp, NEEDS_FILM); @@ -181,10 +182,16 @@ setup_menu (wxMenuBar* m) add_item (jobs_menu, _("&Analyse audio"), ID_jobs_analyse_audio, NEEDS_FILM); wxMenu* help = new wxMenu; - add_item (help, _("About"), ID_help_about, ALWAYS); +#ifdef __WXOSX__ + add_item (help, _("About DVD-o-matic"), wxID_ABOUT, ALWAYS); +#else + add_item (help, _("About"), wxID_ABOUT, ALWAYS); +#endif m->Append (file, _("&File")); +#ifndef __WXOSX__ m->Append (edit, _("&Edit")); +#endif m->Append (jobs_menu, _("&Jobs")); m->Append (help, _("&Help")); } @@ -210,13 +217,13 @@ public: 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 (wxID_EXIT, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler (Frame::file_exit)); + Connect (wxID_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_ABOUT, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler (Frame::help_about)); Connect (wxID_ANY, wxEVT_MENU_OPEN, wxMenuEventHandler (Frame::menu_opened)); @@ -367,7 +374,7 @@ private: d->Destroy (); } - void file_quit (wxCommandEvent &) + void file_exit (wxCommandEvent &) { maybe_save_then_delete_film (); Close (true); diff --git a/src/wx/config_dialog.cc b/src/wx/config_dialog.cc index 98657b666..4daf581ba 100644 --- a/src/wx/config_dialog.cc +++ b/src/wx/config_dialog.cc @@ -18,7 +18,7 @@ */ /** @file src/config_dialog.cc - * @brief A dialogue to edit DCP-o-matic configuration. + * @brief A dialogue to edit DVD-o-matic configuration. */ #include @@ -43,7 +43,7 @@ using namespace std; using boost::bind; ConfigDialog::ConfigDialog (wxWindow* parent) - : wxDialog (parent, wxID_ANY, _("DCP-o-matic Preferences"), wxDefaultPosition, wxDefaultSize, wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER) + : wxDialog (parent, wxID_ANY, _("DVD-o-matic Preferences"), wxDefaultPosition, wxDefaultSize, wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER) { wxBoxSizer* s = new wxBoxSizer (wxVERTICAL); _notebook = new wxNotebook (this, wxID_ANY); @@ -95,7 +95,7 @@ ConfigDialog::make_misc_panel () table->Add (_language, 1, wxEXPAND); table->AddSpacer (0); - wxStaticText* restart = add_label_to_sizer (table, _misc_panel, _("(restart DCP-o-matic to see language changes)")); + wxStaticText* restart = add_label_to_sizer (table, _misc_panel, _("(restart DVD-o-matic to see language changes)")); wxFont font = restart->GetFont(); font.SetStyle (wxFONTSTYLE_ITALIC); font.SetPointSize (font.GetPointSize() - 1); -- cgit v1.2.3 From 2c5542df6592b297f49f51260f7d179a88bf0e77 Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Fri, 31 May 2013 23:37:13 +0100 Subject: More OS X installer tweaks. --- platform/osx/make_dmg.sh | 61 +++++++++++++++++++++++++++++++++++++----------- src/tools/dvdomatic.cc | 2 ++ 2 files changed, 50 insertions(+), 13 deletions(-) (limited to 'src') diff --git a/platform/osx/make_dmg.sh b/platform/osx/make_dmg.sh index 2aeeea66a..d9e36c390 100644 --- a/platform/osx/make_dmg.sh +++ b/platform/osx/make_dmg.sh @@ -1,18 +1,13 @@ #!/bin/bash -VERSION=$1 -if [ "$VERSION" == "" ]; then - echo "Syntax: $0 " - exit 1 -fi +version=`cat wscript | egrep ^VERSION | awk '{print $3}' | sed -e "s/'//g"` # DMG size in megabytes -DMG_SIZE=64 +DMG_SIZE=256 WORK=build/platform/osx ENV=/Users/carl/Environments/osx/10.8 DEPS=/Users/carl/cdist -dmg_name="DVD-o-matic-$VERSION" appdir="DVD-o-matic.app" approot=$appdir/Contents libs=$approot/lib @@ -79,11 +74,51 @@ done cp build/platform/osx/Info.plist $WORK/$approot cp icons/dvdomatic.icns $WORK/$resources/DVD-o-matic.icns -exit 0 +tmp_dmg=$WORK/dvdomatic_tmp.dmg +dmg="$WORK/DVD-o-matic $version.dmg" +vol_name=DVD-o-matic-$version -mkdir -p $WORK/mnt +mkdir -p $WORK/$vol_name + +rm -f $tmp_dmg "$dmg" +hdiutil create -megabytes $DMG_SIZE $tmp_dmg +device=$(hdid -nomount $tmp_dmg | grep Apple_HFS | cut -f 1 -d ' ') +newfs_hfs -v ${vol_name} $device +mount -t hfs "$device" $WORK/$vol_name + +cp -r $WORK/$appdir $WORK/$vol_name + +echo ' + tell application "Finder" + tell disk "'$vol_name'" + open + set current view of container window to icon view + set toolbar visible of container window to false + set statusbar visible of container window to false + set the bounds of container window to {400, 200, 800, 440} + set theViewOptions to the icon view options of container window + set arrangement of theViewOptions to not arranged + set icon size of theViewOptions to 64 + make new alias file at container window to POSIX file "/Applications" with properties {name:"Applications"} + set position of item "DVD-o-matic.app" of container window to {90, 100} + set position of item "Applications" of container window to {310, 100} + close + open + update without registering applications + delay 5 + eject + end tell + end tell +' | osascript + +chmod -Rf go-w $WORK/mnt +sync + +umount $device +hdiutil eject $device +hdiutil convert -format UDZO $tmp_dmg -imagekey zlib-level=9 -o "$dmg" +sips -i $WORK/$resources/DVD-o-matic.icns +DeRez -only icns $WORK/$resources/DVD-o-matic.icns > $WORK/$resources/DVD-o-matic.rsrc +Rez -append $WORK/$resources/DVD-o-matic.rsrc -o "$dmg" +SetFile -a C "$dmg" -hdiutil create -megabytes $DMG_SIZE build/platform/osx/dvdomatic.dmg -device=$(hdid -nomount build/platform/osx/dvdomatic.dmg | grep Apple_HFS | cut -f 1 -d ' ') -newfs_hfs -v "$dmg_name" "$device" -mount -t hfs "$device" build/platform/osx/mnt diff --git a/src/tools/dvdomatic.cc b/src/tools/dvdomatic.cc index 9586e8d1e..4c3a5260f 100644 --- a/src/tools/dvdomatic.cc +++ b/src/tools/dvdomatic.cc @@ -164,7 +164,9 @@ setup_menu (wxMenuBar* m) add_item (file, _("&Save"), ID_file_save, NEEDS_FILM); file->AppendSeparator (); add_item (file, _("&Properties..."), ID_file_properties, NEEDS_FILM); +#ifndef __WXOSX__ file->AppendSeparator (); +#endif add_item (file, _("&Exit"), wxID_EXIT, ALWAYS); #ifdef __WXOSX__ -- cgit v1.2.3