diff options
| author | Carl Hetherington <cth@carlh.net> | 2012-12-04 19:42:21 +0000 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2012-12-04 19:42:21 +0000 |
| commit | 3e915b00219ee8c97e50bbc775d90d0dddce87b6 (patch) | |
| tree | decb09d8d8c2cc90993db5e499030957ca59260e /src/tools | |
| parent | 8a9dd3e93325051c546193f680414d0c108b8332 (diff) | |
| parent | d7fe5fa4178af87b5f1e5a571a78313fa00c3327 (diff) | |
Merge branch 'dead-wood'
Diffstat (limited to 'src/tools')
| -rw-r--r-- | src/tools/alignomatic.cc | 317 | ||||
| -rw-r--r-- | src/tools/dvdomatic.cc | 20 | ||||
| -rw-r--r-- | src/tools/playomatic.cc | 67 | ||||
| -rw-r--r-- | src/tools/wscript | 6 |
4 files changed, 1 insertions, 409 deletions
diff --git a/src/tools/alignomatic.cc b/src/tools/alignomatic.cc deleted file mode 100644 index 9cab6c430..000000000 --- a/src/tools/alignomatic.cc +++ /dev/null @@ -1,317 +0,0 @@ -/* - Copyright (C) 2012 Carl Hetherington <cth@carlh.net> - - 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 <gtkmm.h> -#include "lib/util.h" -#include "lib/config.h" -#include "lib/screen.h" -#include "lib/format.h" -#include "gtk/gtk_util.h" -#include "gtk/alignment.h" - -using namespace std; -using namespace boost; - -static Alignment* alignment = 0; -static Gtk::ComboBoxText* format_combo = 0; -static Format const * format = 0; -static Gtk::ComboBoxText* screen_combo = 0; -static shared_ptr<Screen> screen; -static Gtk::Button* add_screen = 0; -static Gtk::Entry* screen_name = 0; -static Gtk::SpinButton* x_position = 0; -static Gtk::SpinButton* y_position = 0; -static Gtk::SpinButton* width = 0; -static Gtk::Button* calculate_width = 0; -static Gtk::SpinButton* height = 0; -static Gtk::Button* calculate_height = 0; -static Gtk::Button* save = 0; -static bool screen_dirty = false; - -enum GeometryPart { - GEOMETRY_PART_X, - GEOMETRY_PART_Y, - GEOMETRY_PART_WIDTH, - GEOMETRY_PART_HEIGHT -}; - -void -update_sensitivity () -{ - bool const dims = format && screen; - - x_position->set_sensitive (dims); - y_position->set_sensitive (dims); - width->set_sensitive (dims); - calculate_width->set_sensitive (dims); - height->set_sensitive (dims); - calculate_height->set_sensitive (dims); - - screen_name->set_sensitive (screen); - save->set_sensitive (screen_dirty); -} - -void -update_alignment () -{ - if (!screen || !format) { - return; - } - - delete alignment; - alignment = new Alignment (screen->position (format), screen->size (format)); - alignment->set_text_line (0, screen->name ()); - alignment->set_text_line (1, format->name ()); -} - -void -update_entries () -{ - if (!screen || !format) { - return; - } - - Position p = screen->position (format); - x_position->set_value (p.x); - y_position->set_value (p.y); - Size s = screen->size (format); - width->set_value (s.width); - height->set_value (s.height); - - update_sensitivity (); -} - -void -screen_changed () -{ - if (screen_combo->get_active_row_number() < 0) { - return; - } - - vector<shared_ptr<Screen> > screens = Config::instance()->screens (); - - if (screens[screen_combo->get_active_row_number()] == screen) { - return; - } - - screen = screens[screen_combo->get_active_row_number()]; - - update_entries (); - update_alignment (); - - screen_name->set_text (screen->name ()); - - screen_dirty = false; - update_sensitivity (); -} - -void -format_changed () -{ - vector<Format const *> formats = Format::all (); - - if (formats[format_combo->get_active_row_number()] == format) { - return; - } - - format = formats[format_combo->get_active_row_number()]; - - update_entries (); - update_alignment (); - update_sensitivity (); -} - -void -geometry_changed (GeometryPart p) -{ - if (p == GEOMETRY_PART_X && screen->position(format).x == x_position->get_value_as_int()) { - return; - } - - if (p == GEOMETRY_PART_Y && screen->position(format).y == y_position->get_value_as_int()) { - return; - } - - if (p == GEOMETRY_PART_WIDTH && screen->size(format).width == width->get_value_as_int()) { - return; - } - - if (p == GEOMETRY_PART_HEIGHT && screen->size(format).height == height->get_value_as_int()) { - return; - } - - screen->set_geometry ( - format, - Position (x_position->get_value_as_int(), y_position->get_value_as_int()), - Size (width->get_value_as_int(), height->get_value_as_int()) - ); - - update_alignment (); - - screen_dirty = true; - update_sensitivity (); -} - -void -save_clicked () -{ - Config::instance()->write (); - screen_dirty = false; - update_sensitivity (); -} - -void -calculate_width_clicked () -{ - width->set_value (height->get_value_as_int() * format->ratio_as_float ()); -} - -void -calculate_height_clicked () -{ - height->set_value (width->get_value_as_int() / format->ratio_as_float ()); -} - -void -update_screen_combo () -{ - screen_combo->clear (); - - vector<shared_ptr<Screen> > screens = Config::instance()->screens (); - for (vector<shared_ptr<Screen> >::iterator i = screens.begin(); i != screens.end(); ++i) { - screen_combo->append_text ((*i)->name ()); - } -} - -void -screen_name_changed () -{ - screen->set_name (screen_name->get_text ()); - - int const r = screen_combo->get_active_row_number (); - update_screen_combo (); - screen_combo->set_active (r); - - screen_dirty = true; - update_sensitivity (); -} - -void -add_screen_clicked () -{ - shared_ptr<Screen> s (new Screen ("New Screen")); - vector<shared_ptr<Screen> > screens = Config::instance()->screens (); - screens.push_back (s); - Config::instance()->set_screens (screens); - update_screen_combo (); - screen_combo->set_active (screens.size() - 1); -} - -int -main (int argc, char* argv[]) -{ - dvdomatic_setup (); - - Gtk::Main kit (argc, argv); - - Gtk::Dialog dialog ("Align-o-matic"); - - screen_combo = Gtk::manage (new Gtk::ComboBoxText); - update_screen_combo (); - screen_combo->signal_changed().connect (sigc::ptr_fun (&screen_changed)); - - add_screen = Gtk::manage (new Gtk::Button ("Add")); - add_screen->signal_clicked().connect (sigc::ptr_fun (&add_screen_clicked)); - - screen_name = Gtk::manage (new Gtk::Entry ()); - screen_name->signal_changed().connect (sigc::ptr_fun (&screen_name_changed)); - - format_combo = Gtk::manage (new Gtk::ComboBoxText); - vector<Format const *> formats = Format::all (); - for (vector<Format const *>::iterator i = formats.begin(); i != formats.end(); ++i) { - format_combo->append_text ((*i)->name ()); - } - - format_combo->signal_changed().connect (sigc::ptr_fun (&format_changed)); - - save = Gtk::manage (new Gtk::Button ("Save")); - save->signal_clicked().connect (sigc::ptr_fun (&save_clicked)); - - x_position = Gtk::manage (new Gtk::SpinButton ()); - x_position->signal_value_changed().connect (sigc::bind (ptr_fun (&geometry_changed), GEOMETRY_PART_X)); - x_position->set_range (0, 2048); - x_position->set_increments (1, 16); - y_position = Gtk::manage (new Gtk::SpinButton ()); - y_position->signal_value_changed().connect (sigc::bind (sigc::ptr_fun (&geometry_changed), GEOMETRY_PART_Y)); - y_position->set_range (0, 1080); - y_position->set_increments (1, 16); - width = Gtk::manage (new Gtk::SpinButton ()); - width->signal_value_changed().connect (sigc::bind (sigc::ptr_fun (&geometry_changed), GEOMETRY_PART_WIDTH)); - width->set_range (0, 2048); - width->set_increments (1, 16); - height = Gtk::manage (new Gtk::SpinButton ()); - height->signal_value_changed().connect (sigc::bind (sigc::ptr_fun (&geometry_changed), GEOMETRY_PART_HEIGHT)); - height->set_range (0, 1080); - height->set_increments (1, 16); - - calculate_width = Gtk::manage (new Gtk::Button ("Calculate")); - calculate_width->signal_clicked().connect (sigc::ptr_fun (&calculate_width_clicked)); - calculate_height = Gtk::manage (new Gtk::Button ("Calculate")); - calculate_height->signal_clicked().connect (sigc::ptr_fun (&calculate_height_clicked)); - - Gtk::Table table; - table.set_row_spacings (12); - table.set_col_spacings (12); - table.set_border_width (12); - - int n = 0; - table.attach (left_aligned_label ("Screen"), 0, 1, n, n + 1); - table.attach (*screen_combo, 1, 2, n, n + 1); - table.attach (*add_screen, 2, 3, n, n + 1); - ++n; - table.attach (left_aligned_label ("Screen Name"), 0, 1, n, n + 1); - table.attach (*screen_name, 1, 2, n, n + 1); - ++n; - table.attach (left_aligned_label ("Format"), 0, 1, n, n + 1); - table.attach (*format_combo, 1, 2, n, n + 1); - ++n; - table.attach (left_aligned_label ("x"), 0, 1, n, n + 1); - table.attach (*x_position, 1, 2, n, n + 1); - ++n; - table.attach (left_aligned_label ("y"), 0, 1, n, n + 1); - table.attach (*y_position, 1, 2, n, n + 1); - ++n; - table.attach (left_aligned_label ("Width"), 0, 1, n, n + 1); - table.attach (*width, 1, 2, n, n + 1); - table.attach (*calculate_width, 2, 3, n, n + 1); - ++n; - table.attach (left_aligned_label ("Height"), 0, 1, n, n + 1); - table.attach (*height, 1, 2, n, n + 1); - table.attach (*calculate_height, 2, 3, n, n + 1); - ++n; - - dialog.get_vbox()->pack_start (table, false, false); - dialog.add_action_widget (*save, 0); - update_sensitivity (); - dialog.show_all (); - - Gtk::Main::run (dialog); - - return 0; -} diff --git a/src/tools/dvdomatic.cc b/src/tools/dvdomatic.cc index 535e6d749..ea93436be 100644 --- a/src/tools/dvdomatic.cc +++ b/src/tools/dvdomatic.cc @@ -27,7 +27,6 @@ #include "wx/job_manager_view.h" #include "wx/config_dialog.h" #include "wx/job_wrapper.h" -//#include "gtk/dvd_title_dialog.h" #include "wx/wx_util.h" #include "wx/new_film_dialog.h" #include "wx/properties_dialog.h" @@ -136,7 +135,6 @@ enum { ID_edit_preferences, ID_jobs_make_dcp, ID_jobs_send_dcp_to_tms, - ID_jobs_copy_from_dvd, ID_jobs_examine_content, ID_jobs_make_dcp_from_existing_transcode, ID_help_about @@ -161,9 +159,6 @@ setup_menu (wxMenuBar* m) wxMenu* jobs = new wxMenu; add_item (jobs, "&Make DCP", ID_jobs_make_dcp, NEEDS_FILM); add_item (jobs, "&Send DCP to TMS", ID_jobs_send_dcp_to_tms, NEEDS_FILM); -#ifdef DVDOMATIC_POSIX - add_item (jobs, "Copy from &DVD...", ID_jobs_copy_from_dvd, NEEDS_FILM); -#endif jobs->AppendSeparator (); add_item (jobs, "&Examine content", ID_jobs_examine_content, NEEDS_FILM); add_item (jobs, "Make DCP from existing &transcode", ID_jobs_make_dcp_from_existing_transcode, NEEDS_FILM); @@ -202,7 +197,6 @@ public: 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_copy_from_dvd, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler (Frame::jobs_copy_from_dvd)); Connect (ID_jobs_examine_content, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler (Frame::jobs_examine_content)); Connect (ID_jobs_make_dcp_from_existing_transcode, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler (Frame::jobs_make_dcp_from_existing_transcode)); Connect (ID_help_about, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler (Frame::help_about)); @@ -328,20 +322,6 @@ public: JobWrapper::make_dcp (this, film, false); } - void jobs_copy_from_dvd (wxCommandEvent &) - { - try { - -// DVDTitleDialog d; -// if (d.run () != Gtk::RESPONSE_OK) { -// return; -// } - film->copy_from_dvd (); - } catch (DVDError& e) { - error_dialog (this, e.what ()); - } - } - void jobs_send_dcp_to_tms (wxCommandEvent &) { film->send_dcp_to_tms (); diff --git a/src/tools/playomatic.cc b/src/tools/playomatic.cc deleted file mode 100644 index b6fcd43cd..000000000 --- a/src/tools/playomatic.cc +++ /dev/null @@ -1,67 +0,0 @@ -/* - Copyright (C) 2012 Carl Hetherington <cth@carlh.net> - - 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 <iostream> -#include "lib/util.h" -#include "gtk/film_player.h" -#include "gtk/film_list.h" - -using namespace std; - -static FilmPlayer* film_player = 0; - -void -film_changed (Film const * f) -{ - film_player->set_film (f); -} - -int -main (int argc, char* argv[]) -{ - dvdomatic_setup (); - - Gtk::Main kit (argc, argv); - - if (argc != 2) { - cerr << "Syntax: " << argv[0] << " <directory>\n"; - exit (EXIT_FAILURE); - } - - Gtk::Window* window = new Gtk::Window (); - - FilmList* film_list = new FilmList (argv[1]); - film_player = new FilmPlayer (); - - Gtk::HBox hbox; - hbox.pack_start (film_list->widget(), true, true); - hbox.pack_start (film_player->widget(), true, true); - - film_list->SelectionChanged.connect (sigc::ptr_fun (&film_changed)); - - window->set_title ("Play-o-matic"); - window->add (hbox); - window->show_all (); - - window->maximize (); - Gtk::Main::run (*window); - - return 0; -} - diff --git a/src/tools/wscript b/src/tools/wscript index 048bdff07..9c1ca7524 100644 --- a/src/tools/wscript +++ b/src/tools/wscript @@ -8,11 +8,7 @@ def build(bld): obj.target = t if not bld.env.DISABLE_GUI: -# p = ['dvdomatic', 'alignomatic'] - p = ['dvdomatic', 'servomatic_gui'] - if not bld.env.DISABLE_PLAYER: - p.append('playomatic') - for t in p: + for t in ['dvdomatic', 'servomatic_gui']: obj = bld(features = 'cxx cxxprogram') obj.includes = ['..'] obj.use = ['libdvdomatic', 'libdvdomatic-wx'] |
