From bb95f333f15ace7c032bb5b5761b512b6fe2e84e Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Fri, 8 Mar 2013 21:03:28 +0000 Subject: Numerous fixes to A/B mode so that at least it doesn't crash (#72). --- src/tools/servomatic_gui.cc | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'src/tools/servomatic_gui.cc') diff --git a/src/tools/servomatic_gui.cc b/src/tools/servomatic_gui.cc index 610ba8005..dd169725f 100644 --- a/src/tools/servomatic_gui.cc +++ b/src/tools/servomatic_gui.cc @@ -25,8 +25,11 @@ #include "lib/server.h" #include "lib/config.h" -using namespace std; -using namespace boost; +using std::cout; +using std::string; +using boost::shared_ptr; +using boost::thread; +using boost::bind; enum { ID_status = 1, @@ -52,7 +55,7 @@ private: string _log; }; -static MemoryLog memory_log; +static shared_ptr memory_log (new MemoryLog); class StatusDialog : public wxDialog { @@ -77,7 +80,7 @@ public: private: void update (wxTimerEvent &) { - _text->ChangeValue (std_to_wx (memory_log.get ())); + _text->ChangeValue (std_to_wx (memory_log->get ())); _sizer->Layout (); } @@ -141,7 +144,7 @@ private: void main_thread () { - Server server (&memory_log); + Server server (memory_log); server.run (Config::instance()->num_local_encoding_threads ()); } -- cgit v1.2.3 From e7aad9759e44ff3e1aa17ad8d5548a02646a67c5 Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Sun, 7 Apr 2013 16:22:04 +0100 Subject: Fix servomatic_gui start-up on Linux (#98). --- icons/taskbar_icon.png | Bin 0 -> 141 bytes src/tools/servomatic_gui.cc | 24 ++++++++++++++++++++++-- wscript | 4 ++++ 3 files changed, 26 insertions(+), 2 deletions(-) create mode 100644 icons/taskbar_icon.png (limited to 'src/tools/servomatic_gui.cc') diff --git a/icons/taskbar_icon.png b/icons/taskbar_icon.png new file mode 100644 index 000000000..fd6b6e968 Binary files /dev/null and b/icons/taskbar_icon.png differ diff --git a/src/tools/servomatic_gui.cc b/src/tools/servomatic_gui.cc index dd169725f..52ec0a3a3 100644 --- a/src/tools/servomatic_gui.cc +++ b/src/tools/servomatic_gui.cc @@ -94,7 +94,15 @@ class TaskBarIcon : public wxTaskBarIcon public: TaskBarIcon () { +#ifdef __WXMSW__ wxIcon icon (std_to_wx ("taskbar_icon")); +#endif +#ifdef __WXGTK__ + wxInitAllImageHandlers(); + wxBitmap bitmap (wxString::Format ("%s/taskbar_icon.png", POSIX_ICON_PREFIX), wxBITMAP_TYPE_PNG); + wxIcon icon; + icon.CopyFromBitmap (bitmap); +#endif SetIcon (icon, std_to_wx ("DVD-o-matic encode server")); Connect (ID_status, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler (TaskBarIcon::status)); @@ -128,20 +136,31 @@ public: App () : wxApp () , _thread (0) + , _icon (0) {} private: bool OnInit () { + if (!wxApp::OnInit ()) { + return false; + } + dvdomatic_setup (); - new TaskBarIcon; - + _icon = new TaskBarIcon; _thread = new thread (bind (&App::main_thread, this)); + return true; } + int OnExit () + { + delete _icon; + return wxApp::OnExit (); + } + void main_thread () { Server server (memory_log); @@ -149,6 +168,7 @@ private: } boost::thread* _thread; + TaskBarIcon* _icon; }; IMPLEMENT_APP (App) diff --git a/wscript b/wscript index 7ee3899e7..f7c696433 100644 --- a/wscript +++ b/wscript @@ -37,6 +37,7 @@ def configure(conf): else: conf.env.append_value('CXXFLAGS', '-DDVDOMATIC_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']) boost_lib_suffix = '' boost_thread = 'boost_thread' conf.env.append_value('LINKFLAGS', '-pthread') @@ -231,6 +232,9 @@ def build(bld): for r in ['22x22', '32x32', '48x48', '64x64', '128x128']: bld.install_files('${PREFIX}/share/icons/hicolor/%s/apps' % r, 'icons/%s/dvdomatic.png' % r) + if not bld.env.TARGET_WINDOWS: + bld.install_files('${PREFIX}/share/dvdomatic', 'icons/taskbar_icon.png') + bld.add_post_fun(post) def dist(ctx): -- cgit v1.2.3 From d0702ff32eace9f49676600fef22f935a4e5e16a Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Sun, 7 Apr 2013 23:08:38 +0100 Subject: wx2.8 fixes. --- src/tools/servomatic_gui.cc | 2 +- src/wx/film_editor.cc | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) (limited to 'src/tools/servomatic_gui.cc') diff --git a/src/tools/servomatic_gui.cc b/src/tools/servomatic_gui.cc index 52ec0a3a3..5e36660eb 100644 --- a/src/tools/servomatic_gui.cc +++ b/src/tools/servomatic_gui.cc @@ -99,7 +99,7 @@ public: #endif #ifdef __WXGTK__ wxInitAllImageHandlers(); - wxBitmap bitmap (wxString::Format ("%s/taskbar_icon.png", POSIX_ICON_PREFIX), wxBITMAP_TYPE_PNG); + wxBitmap bitmap (wxString::Format (wxT ("%s/taskbar_icon.png"), POSIX_ICON_PREFIX), wxBITMAP_TYPE_PNG); wxIcon icon; icon.CopyFromBitmap (bitmap); #endif diff --git a/src/wx/film_editor.cc b/src/wx/film_editor.cc index eb36ce1ff..5e597ac30 100644 --- a/src/wx/film_editor.cc +++ b/src/wx/film_editor.cc @@ -822,10 +822,10 @@ FilmEditor::setup_frame_rate_description () _film->target_audio_sample_rate() ); } else { - d << "\n"; + d << wxT ("\n"); } #else - d << "\n"; + d << wxT ("\n"); #endif } @@ -1268,9 +1268,9 @@ FilmEditor::setup_audio_details () if (_film->audio_stream()->channels() == 1) { s << _("1 channel"); } else { - s << _film->audio_stream()->channels () << " " << _("channels"); + s << _film->audio_stream()->channels () << wxT (" ") << _("channels"); } - s << ", " << _film->audio_stream()->sample_rate() << _("Hz"); + s << wxT (", ") << _film->audio_stream()->sample_rate() << _("Hz"); _audio->SetLabel (s); } @@ -1390,7 +1390,7 @@ FilmEditor::setup_scaling_description () } for (int i = lines; i < 4; ++i) { - d << " \n"; + d << wxT (" \n"); } _scaling_description->SetLabel (d); -- cgit v1.2.3