From: Carl Hetherington Date: Mon, 3 Dec 2012 20:27:51 +0000 (+0000) Subject: Remove film player, DVD ripping, alignment, screen configs; never finished and not... X-Git-Tag: v2.0.48~1509^2^2 X-Git-Url: https://git.carlh.net/gitweb/?a=commitdiff_plain;ds=sidebyside;h=d7fe5fa4178af87b5f1e5a571a78313fa00c3327;p=dcpomatic.git Remove film player, DVD ripping, alignment, screen configs; never finished and not really very likely to be. --- diff --git a/src/lib/config.cc b/src/lib/config.cc index 7c52dc170..d19adc2a4 100644 --- a/src/lib/config.cc +++ b/src/lib/config.cc @@ -25,7 +25,6 @@ #include "config.h" #include "server.h" #include "scaler.h" -#include "screen.h" #include "filter.h" #include "sound_processor.h" @@ -82,8 +81,6 @@ Config::Config () _reference_filters.push_back (Filter::from_id (v)); } else if (k == "server") { _servers.push_back (ServerDescription::create_from_metadata (v)); - } else if (k == "screen") { - _screens.push_back (Screen::create_from_metadata (v)); } else if (k == "tms_ip") { _tms_ip = v; } else if (k == "tms_path") { @@ -139,10 +136,6 @@ Config::write () const f << "server " << (*i)->as_metadata () << "\n"; } - for (vector >::const_iterator i = _screens.begin(); i != _screens.end(); ++i) { - f << "screen " << (*i)->as_metadata () << "\n"; - } - f << "tms_ip " << _tms_ip << "\n"; f << "tms_path " << _tms_path << "\n"; f << "tms_user " << _tms_user << "\n"; diff --git a/src/lib/config.h b/src/lib/config.h index c57e6b953..5113236d6 100644 --- a/src/lib/config.h +++ b/src/lib/config.h @@ -29,7 +29,6 @@ #include class ServerDescription; -class Screen; class Scaler; class Filter; class SoundProcessor; @@ -75,10 +74,6 @@ public: return _servers; } - std::vector > screens () const { - return _screens; - } - Scaler const * reference_scaler () const { return _reference_scaler; } @@ -140,10 +135,6 @@ public: _servers = s; } - void set_screens (std::vector > s) { - _screens = s; - } - void set_reference_scaler (Scaler const * s) { _reference_scaler = s; } @@ -195,8 +186,6 @@ private: /** J2K encoding servers to use */ std::vector _servers; - /** Screen definitions */ - std::vector > _screens; /** Scaler to use for the "A" part of A/B comparisons */ Scaler const * _reference_scaler; /** Filters to use for the "A" part of A/B comparisons */ diff --git a/src/lib/copy_from_dvd_job.cc b/src/lib/copy_from_dvd_job.cc deleted file mode 100644 index dcf53ac54..000000000 --- a/src/lib/copy_from_dvd_job.cc +++ /dev/null @@ -1,124 +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. - -*/ - -/** @file src/copy_from_dvd_job.cc - * @brief A job to copy a film from a DVD. - */ - -#include -#include -#include -#include "copy_from_dvd_job.h" -#include "dvd.h" -#include "cross.h" -#include "film.h" - -using std::string; -using std::list; -using std::stringstream; -using boost::shared_ptr; - -/** @param f Film to write DVD data into. - */ -CopyFromDVDJob::CopyFromDVDJob (shared_ptr f, shared_ptr req) - : Job (f, req) -{ - -} - -string -CopyFromDVDJob::name () const -{ - return "Copy film from DVD"; -} - -void -CopyFromDVDJob::run () -{ - /* Remove any old DVD rips */ - boost::filesystem::remove_all (_film->dir ("dvd")); - - string const dvd = find_dvd (); - if (dvd.empty ()) { - set_error ("could not find DVD"); - set_state (FINISHED_ERROR); - } - - list const t = dvd_titles (dvd); - if (t.empty ()) { - set_error ("no titles found on DVD"); - set_state (FINISHED_ERROR); - } - - int longest_title = 0; - uint64_t longest_size = 0; - for (list::const_iterator i = t.begin(); i != t.end(); ++i) { - if (longest_size < i->size) { - longest_size = i->size; - longest_title = i->number; - } - } - - stringstream c; - c << "vobcopy -n " << longest_title << " -l -o \"" << _film->dir ("dvd") << "\" 2>&1"; - - FILE* f = popen (c.str().c_str(), "r"); - if (f == 0) { - set_error ("could not run vobcopy command"); - set_state (FINISHED_ERROR); - return; - } - - while (!feof (f)) { - char buf[256]; - if (fscanf (f, "%s", buf)) { - string s (buf); - if (!s.empty () && s[s.length() - 1] == '%') { - set_progress (atof (s.substr(0, s.length() - 1).c_str()) / 100.0); - } - } - } - - const string dvd_dir = _film->dir ("dvd"); - - string largest_file; - uintmax_t largest_size = 0; - for (boost::filesystem::directory_iterator i = boost::filesystem::directory_iterator (dvd_dir); i != boost::filesystem::directory_iterator(); ++i) { - uintmax_t const s = boost::filesystem::file_size (*i); - if (s > largest_size) { - -#if BOOST_FILESYSTEM_VERSION == 3 - largest_file = boost::filesystem::path(*i).generic_string(); -#else - largest_file = i->string (); -#endif - largest_size = s; - } - } - - _film->set_content (largest_file); - - int const r = pclose (f); - if (WEXITSTATUS (r) != 0) { - set_error ("call to vobcopy failed"); - set_state (FINISHED_ERROR); - } else { - set_state (FINISHED_OK); - } -} diff --git a/src/lib/copy_from_dvd_job.h b/src/lib/copy_from_dvd_job.h deleted file mode 100644 index 063e94358..000000000 --- a/src/lib/copy_from_dvd_job.h +++ /dev/null @@ -1,36 +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. - -*/ - -/** @file src/copy_from_dvd_job.h - * @brief A job to copy a film from a DVD. - */ - -#include "job.h" - -/** @class CopyFromDVDJob - * @brief A job to copy a film from a DVD using `vobcopy'. - */ -class CopyFromDVDJob : public Job -{ -public: - CopyFromDVDJob (boost::shared_ptr, boost::shared_ptr req); - - std::string name () const; - void run (); -}; diff --git a/src/lib/dvd.cc b/src/lib/dvd.cc deleted file mode 100644 index 19b59b588..000000000 --- a/src/lib/dvd.cc +++ /dev/null @@ -1,95 +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 -#include -#include "dvd.h" - -using namespace std; -using namespace boost; - -string -find_dvd () -{ - ifstream f ("/etc/mtab"); - while (f.good ()) { - string s; - getline (f, s); - vector b; - split (b, s, is_any_of (" ")); - if (b.size() >= 3 && b[2] == "udf") { - replace_all (b[1], "\\040", " "); - return b[1]; - } - } - - return ""; -} - -list -dvd_titles (string dvd) -{ - filesystem::path video (dvd); - video /= "VIDEO_TS"; - - list titles; - - for (filesystem::directory_iterator i = filesystem::directory_iterator (video); i != filesystem::directory_iterator(); ++i) { -#if BOOST_FILESYSTEM_VERSION == 3 - string const n = filesystem::path(*i).filename().generic_string(); -#else - string const n = filesystem::path(*i).filename(); -#endif - if (starts_with (n, "VTS_") && ends_with (n, ".VOB")) { - uint64_t const size = filesystem::file_size (filesystem::path (*i)); - vector p; - split (p, n, is_any_of ("_.")); - if (p.size() == 4) { - int const a = atoi (p[1].c_str ()); - int const b = atoi (p[2].c_str ()); - if (b == 0) { - continue; - } - - list::iterator j = titles.begin (); - while (j != titles.end() && j->number != a) { - ++j; - } - - if (j == titles.end ()) { - titles.push_back (DVDTitle (a, size)); - } else { - j->size += size; - } - } - } - } - - titles.sort (); - - return titles; -} - - -bool -operator< (DVDTitle const & a, DVDTitle const & b) -{ - return a.number < b.number; -} diff --git a/src/lib/dvd.h b/src/lib/dvd.h deleted file mode 100644 index 28fef4d16..000000000 --- a/src/lib/dvd.h +++ /dev/null @@ -1,36 +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 - -class DVDTitle -{ -public: - DVDTitle () : number (-1), size (0) {} - DVDTitle (int n, int s) : number (n), size (s) {} - - int number; - uint64_t size; -}; - -extern bool operator< (DVDTitle const &, DVDTitle const &); - -extern std::list dvd_titles (std::string); -extern std::string find_dvd (); diff --git a/src/lib/film.cc b/src/lib/film.cc index d5bf79d09..902306fb8 100644 --- a/src/lib/film.cc +++ b/src/lib/film.cc @@ -40,7 +40,6 @@ #include "ab_transcode_job.h" #include "transcode_job.h" #include "scp_dcp_job.h" -#include "copy_from_dvd_job.h" #include "make_dcp_job.h" #include "log.h" #include "options.h" @@ -328,13 +327,6 @@ Film::send_dcp_to_tms () JobManager::instance()->add (j); } -void -Film::copy_from_dvd () -{ - shared_ptr j (new CopyFromDVDJob (shared_from_this(), shared_ptr ())); - JobManager::instance()->add (j); -} - /** Count the number of frames that have been encoded for this film. * @return frame count. */ diff --git a/src/lib/film.h b/src/lib/film.h index 32456dfda..64e7a3a70 100644 --- a/src/lib/film.h +++ b/src/lib/film.h @@ -64,7 +64,6 @@ public: void examine_content (); void send_dcp_to_tms (); - void copy_from_dvd (); void make_dcp (bool); @@ -83,8 +82,6 @@ public: std::string content_path () const; ContentType content_type () const; - bool content_is_dvd () const; - std::string thumb_file (int) const; std::string thumb_base (int) const; SourceFrame thumb_frame (int) const; diff --git a/src/lib/player.cc b/src/lib/player.cc deleted file mode 100644 index 67aba36f2..000000000 --- a/src/lib/player.cc +++ /dev/null @@ -1,226 +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 -#include -#include -#include -#include -#include -#include -#include "player.h" -#include "filter.h" -#include "screen.h" -#include "exceptions.h" - -using namespace std; -using namespace boost; - -Player::Player (shared_ptr fs, shared_ptr screen, Split split) - : _stdout_reader_should_run (true) - , _position (0) - , _paused (false) -{ - assert (fs->format); - - if (pipe (_mplayer_stdin) < 0) { - throw PlayError ("could not create pipe"); - } - - if (pipe (_mplayer_stdout) < 0) { - throw PlayError ("could not create pipe"); - } - - if (pipe (_mplayer_stderr) < 0) { - throw PlayError ("could not create pipe"); - } - - int const p = fork (); - if (p < 0) { - throw PlayError ("could not fork for mplayer"); - } else if (p == 0) { - close (_mplayer_stdin[1]); - dup2 (_mplayer_stdin[0], STDIN_FILENO); - - close (_mplayer_stdout[0]); - dup2 (_mplayer_stdout[1], STDOUT_FILENO); - - close (_mplayer_stderr[0]); - dup2 (_mplayer_stderr[1], STDERR_FILENO); - - char* p[] = { strdup ("TERM=xterm"), strdup ("DISPLAY=:0"), 0 }; - environ = p; - - stringstream s; - s << "/usr/local/bin/mplayer"; - - s << " -vo x11 -noaspect -noautosub -nosub -vo x11 -noborder -slave -quiet -input nodefault-bindings:conf=/dev/null"; - s << " -sws " << fs->scaler->mplayer_id (); - - stringstream vf; - - Position position = screen->position (fs->format); - Size screen_size = screen->size (fs->format); - Size const cropped_size = fs->cropped_size (fs->size); - switch (split) { - case SPLIT_NONE: - vf << crop_string (Position (fs->left_crop, fs->top_crop), cropped_size); - s << " -geometry " << position.x << ":" << position.y; - break; - case SPLIT_LEFT: - { - Size split_size = cropped_size; - split_size.width /= 2; - vf << crop_string (Position (fs->left_crop, fs->top_crop), split_size); - screen_size.width /= 2; - s << " -geometry " << position.x << ":" << position.y; - break; - } - case SPLIT_RIGHT: - { - Size split_size = cropped_size; - split_size.width /= 2; - vf << crop_string (Position (fs->left_crop + split_size.width, fs->top_crop), split_size); - screen_size.width /= 2; - s << " -geometry " << (position.x + screen_size.width) << ":" << position.y; - break; - } - } - - vf << ",scale=" << screen_size.width << ":" << screen_size.height; - - pair filters = Filter::ffmpeg_strings (fs->filters); - - if (!filters.first.empty()) { - vf << "," << filters.first; - } - - if (!filters.second.empty ()) { - vf << ",pp=" << filters.second; - } - - s << " -vf " << vf.str(); - s << " \"" << fs->content_path() << "\" "; - - string cmd (s.str ()); - - vector b = split_at_spaces_considering_quotes (cmd); - - char** cl = new char*[b.size() + 1]; - for (vector::size_type i = 0; i < b.size(); ++i) { - cl[i] = strdup (b[i].c_str ()); - } - cl[b.size()] = 0; - - execv (cl[0], cl); - - stringstream e; - e << "exec of mplayer failed " << strerror (errno); - throw PlayError (e.str ()); - - } else { - _mplayer_pid = p; - command ("pause"); - - _stdout_reader = new boost::thread (boost::bind (&Player::stdout_reader, this)); - } -} - -Player::~Player () -{ - _stdout_reader_should_run = false; - _stdout_reader->join (); - delete _stdout_reader; - - close (_mplayer_stdin[0]); - close (_mplayer_stdout[1]); - kill (_mplayer_pid, SIGTERM); -} - -void -Player::command (string c) -{ - char buf[64]; - snprintf (buf, sizeof (buf), "%s\n", c.c_str ()); - write (_mplayer_stdin[1], buf, strlen (buf)); -} - -void -Player::stdout_reader () -{ - while (_stdout_reader_should_run) { - char buf[1024]; - int r = read (_mplayer_stdout[0], buf, sizeof (buf)); - if (r > 0) { - stringstream s (buf); - while (s.good ()) { - string line; - getline (s, line); - - vector b; - split (b, line, is_any_of ("=")); - if (b.size() < 2) { - continue; - } - - if (b[0] == "ANS_time_pos") { - set_position (atof (b[1].c_str ())); - } else if (b[0] == "ANS_pause") { - set_paused (b[1] == "yes"); - } - } - } - - usleep (5e5); - - snprintf (buf, sizeof (buf), "pausing_keep_force get_property time_pos\npausing_keep_force get_property pause\n"); - write (_mplayer_stdin[1], buf, strlen (buf)); - } -} - -void -Player::set_position (float p) -{ - /* XXX: could be an atomic */ - boost::mutex::scoped_lock lm (_state_mutex); - _position = p; -} - -void -Player::set_paused (bool p) -{ - /* XXX: could be an atomic */ - boost::mutex::scoped_lock lm (_state_mutex); - _paused = p; -} - -float -Player::position () const -{ - boost::mutex::scoped_lock lm (_state_mutex); - return _position; -} - -bool -Player::paused () const -{ - boost::mutex::scoped_lock lm (_state_mutex); - return _paused; -} diff --git a/src/lib/player.h b/src/lib/player.h deleted file mode 100644 index fc08deb9f..000000000 --- a/src/lib/player.h +++ /dev/null @@ -1,70 +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. - -*/ - -#ifndef DVDOMATIC_PLAYER_H -#define DVDOMATIC_PLAYER_H - -#include -#include -#include - -class FilmState; -class Screen; - -class Player -{ -public: - enum Split { - SPLIT_NONE, - SPLIT_LEFT, - SPLIT_RIGHT - }; - - Player (boost::shared_ptr, boost::shared_ptr, Split); - ~Player (); - - void command (std::string); - - float position () const; - bool paused () const; - - pid_t mplayer_pid () const { - return _mplayer_pid; - } - -private: - void stdout_reader (); - void set_position (float); - void set_paused (bool); - - int _mplayer_stdin[2]; - int _mplayer_stdout[2]; - int _mplayer_stderr[2]; - pid_t _mplayer_pid; - - boost::thread* _stdout_reader; - /* XXX: should probably be atomically accessed */ - bool _stdout_reader_should_run; - - mutable boost::mutex _state_mutex; - float _position; - bool _paused; -}; - -#endif diff --git a/src/lib/player_manager.cc b/src/lib/player_manager.cc deleted file mode 100644 index d22ef1064..000000000 --- a/src/lib/player_manager.cc +++ /dev/null @@ -1,136 +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 "player_manager.h" -#include "player.h" -#include "screen.h" - -using namespace std; -using namespace boost; - -PlayerManager* PlayerManager::_instance = 0; - -PlayerManager::PlayerManager () -{ - -} - -PlayerManager * -PlayerManager::instance () -{ - if (_instance == 0) { - _instance = new PlayerManager (); - } - - return _instance; -} - -void -PlayerManager::setup (shared_ptr f, shared_ptr sc) -{ - boost::mutex::scoped_lock lm (_players_mutex); - - _players.clear (); - _players.push_back (shared_ptr (new Player (f, sc, Player::SPLIT_NONE))); -} - -void -PlayerManager::setup (shared_ptr fs_a, shared_ptr fs_b, shared_ptr sc) -{ - boost::mutex::scoped_lock lm (_players_mutex); - - _players.clear (); - - _players.push_back (shared_ptr (new Player (fs_a, sc, Player::SPLIT_LEFT))); - _players.push_back (shared_ptr (new Player (fs_b, sc, Player::SPLIT_RIGHT))); -} - -void -PlayerManager::pause_or_unpause () -{ - boost::mutex::scoped_lock lm (_players_mutex); - - for (list >::iterator i = _players.begin(); i != _players.end(); ++i) { - (*i)->command ("pause"); - } -} - -void -PlayerManager::set_position (float p) -{ - boost::mutex::scoped_lock lm (_players_mutex); - - stringstream s; - s << "pausing_keep_force seek " << p << " 2"; - for (list >::iterator i = _players.begin(); i != _players.end(); ++i) { - (*i)->command (s.str ()); - } -} - -float -PlayerManager::position () const -{ - boost::mutex::scoped_lock lm (_players_mutex); - - if (_players.empty ()) { - return 0; - } - - return _players.front()->position (); -} - -void -PlayerManager::child_exited (pid_t pid) -{ - boost::mutex::scoped_lock lm (_players_mutex); - - list >::iterator i = _players.begin(); - while (i != _players.end() && (*i)->mplayer_pid() != pid) { - ++i; - } - - if (i == _players.end()) { - return; - } - - _players.erase (i); -} - -PlayerManager::State -PlayerManager::state () const -{ - boost::mutex::scoped_lock lm (_players_mutex); - - if (_players.empty ()) { - return QUIESCENT; - } - - if (_players.front()->paused ()) { - return PAUSED; - } - - return PLAYING; -} - -void -PlayerManager::stop () -{ - boost::mutex::scoped_lock lm (_players_mutex); - _players.clear (); -} diff --git a/src/lib/player_manager.h b/src/lib/player_manager.h deleted file mode 100644 index 70a31b229..000000000 --- a/src/lib/player_manager.h +++ /dev/null @@ -1,59 +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 -#include "player.h" - -class Player; -class FilmState; -class Screen; - -class PlayerManager -{ -public: - - void setup (boost::shared_ptr, boost::shared_ptr); - void setup (boost::shared_ptr, boost::shared_ptr, boost::shared_ptr); - void pause_or_unpause (); - void stop (); - - float position () const; - void set_position (float); - - enum State { - QUIESCENT, - PLAYING, - PAUSED - }; - - State state () const; - - void child_exited (pid_t); - - static PlayerManager* instance (); - -private: - PlayerManager (); - - mutable boost::mutex _players_mutex; - std::list > _players; - - static PlayerManager* _instance; -}; diff --git a/src/lib/scaler.cc b/src/lib/scaler.cc index 1e63d66b3..c81456a15 100644 --- a/src/lib/scaler.cc +++ b/src/lib/scaler.cc @@ -33,13 +33,11 @@ using namespace std; vector Scaler::_scalers; /** @param f FFmpeg id. - * @param m mplayer command line id. * @param i Our id. * @param n User-visible name. */ -Scaler::Scaler (int f, int m, string i, string n) +Scaler::Scaler (int f, string i, string n) : _ffmpeg_id (f) - , _mplayer_id (m) , _id (i) , _name (n) { @@ -59,15 +57,15 @@ Scaler::all () void Scaler::setup_scalers () { - _scalers.push_back (new Scaler (SWS_BICUBIC, 2, "bicubic", "Bicubic")); - _scalers.push_back (new Scaler (SWS_X, 3, "x", "X")); - _scalers.push_back (new Scaler (SWS_AREA, 5, "area", "Area")); - _scalers.push_back (new Scaler (SWS_GAUSS, 7, "gauss", "Gaussian")); - _scalers.push_back (new Scaler (SWS_LANCZOS, 9, "lanczos", "Lanczos")); - _scalers.push_back (new Scaler (SWS_SINC, 8, "sinc", "Sinc")); - _scalers.push_back (new Scaler (SWS_SPLINE, 10, "spline", "Spline")); - _scalers.push_back (new Scaler (SWS_BILINEAR, 1, "bilinear", "Bilinear")); - _scalers.push_back (new Scaler (SWS_FAST_BILINEAR, 0, "fastbilinear", "Fast Bilinear")); + _scalers.push_back (new Scaler (SWS_BICUBIC, "bicubic", "Bicubic")); + _scalers.push_back (new Scaler (SWS_X, "x", "X")); + _scalers.push_back (new Scaler (SWS_AREA, "area", "Area")); + _scalers.push_back (new Scaler (SWS_GAUSS, "gauss", "Gaussian")); + _scalers.push_back (new Scaler (SWS_LANCZOS, "lanczos", "Lanczos")); + _scalers.push_back (new Scaler (SWS_SINC, "sinc", "Sinc")); + _scalers.push_back (new Scaler (SWS_SPLINE, "spline", "Spline")); + _scalers.push_back (new Scaler (SWS_BILINEAR, "bilinear", "Bilinear")); + _scalers.push_back (new Scaler (SWS_FAST_BILINEAR, "fastbilinear", "Fast Bilinear")); } /** @param id One of our ids. diff --git a/src/lib/scaler.h b/src/lib/scaler.h index d5a83f732..c80f4b7db 100644 --- a/src/lib/scaler.h +++ b/src/lib/scaler.h @@ -33,18 +33,13 @@ class Scaler { public: - Scaler (int f, int m, std::string i, std::string n); + Scaler (int f, std::string i, std::string n); /** @return id used for calls to FFmpeg's pp_postprocess */ int ffmpeg_id () const { return _ffmpeg_id; } - /** @return number to use on an mplayer command line */ - int mplayer_id () const { - return _mplayer_id; - } - /** @return id for our use */ std::string id () const { return _id; @@ -65,7 +60,6 @@ private: /** id used for calls to FFmpeg's pp_postprocess */ int _ffmpeg_id; - int _mplayer_id; /** id for our use */ std::string _id; /** user-visible name for this scaler */ diff --git a/src/lib/screen.cc b/src/lib/screen.cc deleted file mode 100644 index 25e44f77d..000000000 --- a/src/lib/screen.cc +++ /dev/null @@ -1,104 +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 "screen.h" -#include "format.h" -#include "exceptions.h" - -using namespace std; -using namespace boost; - -Screen::Screen (string n) - : _name (n) -{ - vector f = Format::all (); - for (vector::iterator i = f.begin(); i != f.end(); ++i) { - set_geometry (*i, Position (0, 0), Size (2048, 1080)); - } -} - -void -Screen::set_geometry (Format const * f, Position p, Size s) -{ - _geometries[f] = Geometry (p, s); -} - -Position -Screen::position (Format const * f) const -{ - GeometryMap::const_iterator i = _geometries.find (f); - if (i == _geometries.end ()) { - throw PlayError ("format not found for screen"); - } - - return i->second.position; -} - -Size -Screen::size (Format const * f) const -{ - GeometryMap::const_iterator i = _geometries.find (f); - if (i == _geometries.end ()) { - throw PlayError ("format not found for screen"); - } - - return i->second.size; -} - -string -Screen::as_metadata () const -{ - stringstream s; - s << "\"" << _name << "\""; - - for (GeometryMap::const_iterator i = _geometries.begin(); i != _geometries.end(); ++i) { - s << " " << i->first->as_metadata() - << " " << i->second.position.x << " " << i->second.position.y - << " " << i->second.size.width << " " << i->second.size.height; - } - - return s.str (); -} - -shared_ptr -Screen::create_from_metadata (string v) -{ - vector b = split_at_spaces_considering_quotes (v); - - if (b.size() < 1) { - return shared_ptr (); - } - - shared_ptr s (new Screen (b[0])); - - vector::size_type i = 1; - while (b.size() > i) { - if (b.size() >= (i + 5)) { - s->set_geometry ( - Format::from_metadata (b[i].c_str()), - Position (atoi (b[i+1].c_str()), atoi (b[i+2].c_str())), - Size (atoi (b[i+3].c_str()), atoi (b[i+4].c_str())) - ); - } - i += 5; - } - - return s; -} diff --git a/src/lib/screen.h b/src/lib/screen.h deleted file mode 100644 index 663b3c3c4..000000000 --- a/src/lib/screen.h +++ /dev/null @@ -1,68 +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 -#include -#include "util.h" - -class Format; - -class Screen -{ -public: - Screen (std::string); - - void set_geometry (Format const *, Position, Size); - - std::string name () const { - return _name; - } - - void set_name (std::string n) { - _name = n; - } - - struct Geometry { - Geometry () {} - - Geometry (Position p, Size s) - : position (p) - , size (s) - {} - - Position position; - Size size; - }; - - typedef std::map GeometryMap; - GeometryMap geometries () const { - return _geometries; - } - - Position position (Format const *) const; - Size size (Format const *) const; - - std::string as_metadata () const; - static boost::shared_ptr create_from_metadata (std::string); - -private: - std::string _name; - GeometryMap _geometries; -}; diff --git a/src/lib/util.cc b/src/lib/util.cc index 219441865..6179eedac 100644 --- a/src/lib/util.cc +++ b/src/lib/util.cc @@ -56,11 +56,7 @@ extern "C" { #include "format.h" #include "dcp_content_type.h" #include "filter.h" -#include "screen.h" #include "sound_processor.h" -#ifndef DVDOMATIC_DISABLE_PLAYER -#include "player_manager.h" -#endif using namespace std; using namespace boost; @@ -191,34 +187,6 @@ stacktrace (ostream& out, int levels) } #endif -/** @return Version of vobcopy that is on the path (and hence that we will use) */ -static string -vobcopy_version () -{ - FILE* f = popen ("vobcopy -V 2>&1", "r"); - if (f == 0) { - throw EncodeError ("could not run vobcopy to check version"); - } - - string version = "unknown"; - - while (!feof (f)) { - char buf[256]; - if (fgets (buf, sizeof (buf), f)) { - string s (buf); - vector b; - split (b, s, is_any_of (" ")); - if (b.size() >= 2 && b[0] == "Vobcopy") { - version = b[1]; - } - } - } - - pclose (f); - - return version; -} - /** @param v Version as used by FFmpeg. * @return A string representation of v. */ @@ -236,7 +204,6 @@ dependency_version_summary () { stringstream s; s << "libopenjpeg " << opj_version () << ", " - << "vobcopy " << vobcopy_version() << ", " << "libavcodec " << ffmpeg_version_to_string (avcodec_version()) << ", " << "libavfilter " << ffmpeg_version_to_string (avfilter_version()) << ", " << "libavformat " << ffmpeg_version_to_string (avformat_version()) << ", " @@ -256,17 +223,6 @@ seconds (struct timeval t) return t.tv_sec + (double (t.tv_usec) / 1e6); } - -#ifdef DVDOMATIC_POSIX -void -sigchld_handler (int, siginfo_t* info, void *) -{ -#ifndef DVDOMATIC_DISABLE_PLAYER - PlayerManager::instance()->child_exited (info->si_pid); -#endif -} -#endif - /** Call the required functions to set up DVD-o-matic's static arrays, etc. * Must be called from the UI thread, if there is one. */ @@ -280,14 +236,6 @@ dvdomatic_setup () SoundProcessor::setup_sound_processors (); ui_thread = this_thread::get_id (); - -#ifdef DVDOMATIC_POSIX - struct sigaction sa; - sa.sa_flags = SA_SIGINFO; - sigemptyset (&sa.sa_mask); - sa.sa_sigaction = sigchld_handler; - sigaction (SIGCHLD, &sa, 0); -#endif } string diff --git a/src/lib/wscript b/src/lib/wscript index 969a69606..2d31e09a2 100644 --- a/src/lib/wscript +++ b/src/lib/wscript @@ -10,7 +10,6 @@ def build(bld): ab_transcoder.cc check_hashes_job.cc config.cc - copy_from_dvd_job.cc cross.cc dcp_content_type.cc dcp_video_frame.cc @@ -18,7 +17,6 @@ def build(bld): decoder_factory.cc delay_line.cc dolby_cp750.cc - dvd.cc encoder.cc encoder_factory.cc examine_content_job.cc @@ -40,7 +38,6 @@ def build(bld): make_dcp_job.cc scp_dcp_job.cc scaler.cc - screen.cc server.cc sound_processor.cc stream.cc @@ -54,7 +51,4 @@ def build(bld): version.cc """ - if not bld.env.DISABLE_PLAYER: - obj.source += " player.cc player_manager.cc" - obj.target = 'dvdomatic' 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 - - 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/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; -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 > 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 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 > screens = Config::instance()->screens (); - for (vector >::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 s (new Screen ("New Screen")); - vector > 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 formats = Format::all (); - for (vector::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 - - 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/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] << " \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'] diff --git a/src/wx/alignment.cc b/src/wx/alignment.cc deleted file mode 100644 index ee4ca51c1..000000000 --- a/src/wx/alignment.cc +++ /dev/null @@ -1,167 +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 -#include -#include "alignment.h" - -using namespace std; - -class AlignmentWidget : public Gtk::DrawingArea -{ -public: - void set_text_line (int n, string t) - { - if (int(_text.size()) < (n + 1)) { - _text.resize (n + 1); - } - - _text[n] = t; - queue_draw (); - } - -private: - bool on_expose_event (GdkEventExpose* ev) - { - if (!get_window ()) { - return false; - } - - Cairo::RefPtr c = get_window()->create_cairo_context (); - - Gtk::Allocation a = get_allocation (); - int const w = a.get_width (); - int const h = a.get_height (); - - c->rectangle (0, 0, w, h); - c->set_source_rgb (0, 0, 0); - c->fill (); - - c->set_source_rgb (1, 1, 1); - c->set_line_width (1); - - int const arrow_size = h / 8; - int const head_size = h / 32; - - /* arrow to left edge */ - c->move_to (arrow_size, h / 2); - c->line_to (0, h / 2); - c->rel_line_to (head_size, head_size); - c->move_to (0, h / 2); - c->rel_line_to (head_size, -head_size); - c->stroke (); - - /* arrow to right edge */ - c->move_to (w - arrow_size, h / 2); - c->line_to (w, h / 2); - c->rel_line_to (-head_size, head_size); - c->move_to (w, h / 2); - c->rel_line_to (-head_size, -head_size); - c->stroke (); - - /* arrow to top edge */ - c->move_to (w / 2, arrow_size); - c->line_to (w / 2, 0); - c->rel_line_to (head_size, head_size); - c->move_to (w / 2, 0); - c->rel_line_to (-head_size, head_size); - c->stroke (); - - /* arrow to bottom edge */ - c->move_to (w / 2, h - h / 8); - c->line_to (w / 2, h); - c->rel_line_to (head_size, -head_size); - c->move_to (w / 2, h); - c->rel_line_to (-head_size, -head_size); - c->stroke (); - - /* arrow to top-left corner */ - c->move_to (arrow_size, arrow_size); - c->line_to (0, 0); - c->rel_line_to (head_size, 0); - c->move_to (0, 0); - c->rel_line_to (0, head_size); - c->stroke (); - - /* arrow to top-right corner */ - c->move_to (w - arrow_size, arrow_size); - c->line_to (w, 0); - c->rel_line_to (0, head_size); - c->move_to (w, 0); - c->rel_line_to (-head_size, 0); - c->stroke (); - - /* arrow to bottom-left corner */ - c->move_to (arrow_size, h - arrow_size); - c->line_to (0, h); - c->rel_line_to (head_size, 0); - c->move_to (0, h); - c->rel_line_to (0, -head_size); - c->stroke (); - - /* arrow to bottom-right corner */ - c->move_to (w - arrow_size, h - arrow_size); - c->line_to (w, h); - c->rel_line_to (-head_size, 0); - c->line_to (w, h); - c->rel_line_to (0, -head_size); - c->stroke (); - - /* text */ - int max_height = 0; - for (vector::iterator i = _text.begin(); i != _text.end(); ++i) { - Cairo::TextExtents e; - c->get_text_extents (*i, e); - max_height = max (max_height, int (e.height)); - } - - int total_height = max_height * _text.size() * 2; - - for (vector::size_type i = 0; i < _text.size(); ++i) { - Cairo::TextExtents e; - c->get_text_extents (_text[i], e); - c->move_to ((w - e.width) / 2, ((h - total_height) / 2) + ((i * 2) + 1) * max_height); - c->text_path (_text[i]); - c->stroke (); - } - - return true; - } - - std::vector _text; -}; - -Alignment::Alignment (Position p, Size s) -{ - _widget = Gtk::manage (new AlignmentWidget); - add (*_widget); - show_all (); - - set_decorated (false); - set_resizable (false); - set_size_request (s.width, s.height); - move (p.x, p.y); -} - -void -Alignment::set_text_line (int n, string t) -{ - _widget->set_text_line (n, t); -} diff --git a/src/wx/alignment.h b/src/wx/alignment.h deleted file mode 100644 index fb740b7c0..000000000 --- a/src/wx/alignment.h +++ /dev/null @@ -1,35 +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 -#include "lib/util.h" - -class AlignmentWidget; - -class Alignment : public Gtk::Window -{ -public: - Alignment (Position, Size); - - void set_text_line (int, std::string); - -private: - AlignmentWidget* _widget; -}; diff --git a/src/wx/config_dialog.cc b/src/wx/config_dialog.cc index ef09b288e..9408be970 100644 --- a/src/wx/config_dialog.cc +++ b/src/wx/config_dialog.cc @@ -27,7 +27,6 @@ #include #include "lib/config.h" #include "lib/server.h" -#include "lib/screen.h" #include "lib/format.h" #include "lib/scaler.h" #include "lib/filter.h" diff --git a/src/wx/config_dialog.h b/src/wx/config_dialog.h index 8e85db653..615d36f83 100644 --- a/src/wx/config_dialog.h +++ b/src/wx/config_dialog.h @@ -28,7 +28,6 @@ class DirPickerCtrl; -class Screen; class ServerDescription; /** @class ConfigDialog diff --git a/src/wx/dvd_title_dialog.cc b/src/wx/dvd_title_dialog.cc deleted file mode 100644 index e9606d396..000000000 --- a/src/wx/dvd_title_dialog.cc +++ /dev/null @@ -1,80 +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 -#include "lib/exceptions.h" -#include "dvd_title_dialog.h" -#include "gtk_util.h" - -using namespace std; - -DVDTitleDialog::DVDTitleDialog () -{ - string const dvd = find_dvd (); - if (dvd.empty ()) { - throw DVDError ("could not find DVD"); - } - - list t = dvd_titles (dvd); - if (t.empty ()) { - throw DVDError ("no titles found on DVD"); - } - - set_title ("Choose DVD title"); - get_vbox()->set_border_width (6); - get_vbox()->set_spacing (3); - - Gtk::RadioButtonGroup g; - for (list::const_iterator i = t.begin(); i != t.end(); ++i) { - Gtk::RadioButton* b = manage (new Gtk::RadioButton); - stringstream s; -#if HAVE_G_FORMAT_SIZE - s << "Title " << i->number << ": " << g_format_size (i->size); -#else - s << "Title " << i->number << ": " << g_format_size_for_display (i->size); -#endif - b->set_label (s.str ()); - if (i == t.begin ()) { - b->set_active (); - g = b->get_group (); - } else { - b->set_group (g); - } - get_vbox()->pack_start (*b); - _buttons[*i] = b; - } - - add_button ("Cancel", Gtk::RESPONSE_CANCEL); - add_button ("Copy Title", Gtk::RESPONSE_OK); - - show_all (); -} - -DVDTitle -DVDTitleDialog::selected () -{ - std::map::const_iterator i = _buttons.begin (); - while (i != _buttons.end() && i->second->get_active() == false) { - ++i; - } - - assert (i != _buttons.end ()); - return i->first; -} diff --git a/src/wx/dvd_title_dialog.h b/src/wx/dvd_title_dialog.h deleted file mode 100644 index 26aef286f..000000000 --- a/src/wx/dvd_title_dialog.h +++ /dev/null @@ -1,32 +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 "lib/dvd.h" - -class DVDTitleDialog : public Gtk::Dialog -{ -public: - DVDTitleDialog (); - - DVDTitle selected (); - -private: - std::map _buttons; -}; diff --git a/src/wx/film_editor.cc b/src/wx/film_editor.cc index 703059780..67cd17d4a 100644 --- a/src/wx/film_editor.cc +++ b/src/wx/film_editor.cc @@ -34,7 +34,6 @@ #include "lib/ab_transcode_job.h" #include "lib/job_manager.h" #include "lib/filter.h" -#include "lib/screen.h" #include "lib/config.h" #include "filter_dialog.h" #include "wx_util.h" diff --git a/src/wx/film_player.cc b/src/wx/film_player.cc deleted file mode 100644 index 53779d650..000000000 --- a/src/wx/film_player.cc +++ /dev/null @@ -1,310 +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 "lib/screen.h" -#include "lib/config.h" -#include "lib/player_manager.h" -#include "lib/film.h" -#include "film_player.h" -#include "gtk_util.h" - -using namespace std; -using namespace boost; - -FilmPlayer::FilmPlayer (Film const * f) - : _play ("Play") - , _pause ("Pause") - , _stop ("Stop") - , _ab ("A/B") - , _ignore_position_changed (false) -{ - set_film (f); - - vector > const scr = Config::instance()->screens (); - for (vector >::const_iterator i = scr.begin(); i != scr.end(); ++i) { - _screen.append_text ((*i)->name ()); - } - - if (!scr.empty ()) { - _screen.set_active (0); - } - - _status.set_use_markup (true); - - _position.set_digits (0); - - _main_vbox.set_spacing (12); - - Gtk::HBox* l = manage (new Gtk::HBox); - l->pack_start (_play); - l->pack_start (_pause); - l->pack_start (_stop); - - Gtk::VBox* r = manage (new Gtk::VBox); - r->pack_start (_screen, false, false); - r->pack_start (_ab, false, false); - r->pack_start (*manage (new Gtk::Label ("")), true, true); - - Gtk::HBox* t = manage (new Gtk::HBox); - t->pack_start (*l, true, true); - t->pack_start (*r, false, false); - - _main_vbox.pack_start (*t, true, true); - _main_vbox.pack_start (_position, false, false); - _main_vbox.pack_start (_status, false, false); - - _play.signal_clicked().connect (sigc::mem_fun (*this, &FilmPlayer::play_clicked)); - _pause.signal_clicked().connect (sigc::mem_fun (*this, &FilmPlayer::pause_clicked)); - _stop.signal_clicked().connect (sigc::mem_fun (*this, &FilmPlayer::stop_clicked)); - _position.signal_value_changed().connect (sigc::mem_fun (*this, &FilmPlayer::position_changed)); - _position.signal_format_value().connect (sigc::mem_fun (*this, &FilmPlayer::format_position)); - - set_button_states (); - Glib::signal_timeout().connect (sigc::bind_return (sigc::mem_fun (*this, &FilmPlayer::update), true), 1000); - - Config::instance()->Changed.connect (sigc::mem_fun (*this, &FilmPlayer::update_screens)); -} - -void -FilmPlayer::set_film (Film const * f) -{ - _film = f; - - if (_film && _film->length() != 0 && _film->frames_per_second() != 0) { - _position.set_range (0, _film->length() / _film->frames_per_second()); - } - - if (_film) { - _film->Changed.connect (sigc::mem_fun (*this, &FilmPlayer::film_changed)); - } -} - -Gtk::Widget & -FilmPlayer::widget () -{ - return _main_vbox; -} - -void -FilmPlayer::set_button_states () -{ - if (_film == 0) { - _play.set_sensitive (false); - _pause.set_sensitive (false); - _stop.set_sensitive (false); - _screen.set_sensitive (false); - _position.set_sensitive (false); - _ab.set_sensitive (false); - return; - } - - PlayerManager::State s = PlayerManager::instance()->state (); - - switch (s) { - case PlayerManager::QUIESCENT: - _play.set_sensitive (true); - _pause.set_sensitive (false); - _stop.set_sensitive (false); - _screen.set_sensitive (true); - _position.set_sensitive (false); - _ab.set_sensitive (true); - break; - case PlayerManager::PLAYING: - _play.set_sensitive (false); - _pause.set_sensitive (true); - _stop.set_sensitive (true); - _screen.set_sensitive (false); - _position.set_sensitive (true); - _ab.set_sensitive (false); - break; - case PlayerManager::PAUSED: - _play.set_sensitive (true); - _pause.set_sensitive (false); - _stop.set_sensitive (true); - _screen.set_sensitive (false); - _position.set_sensitive (false); - _ab.set_sensitive (false); - break; - } -} - -void -FilmPlayer::play_clicked () -{ - PlayerManager* p = PlayerManager::instance (); - - switch (p->state ()) { - case PlayerManager::QUIESCENT: - _last_play_fs = _film->state_copy (); - if (_ab.get_active ()) { - shared_ptr fs_a = _film->state_copy (); - fs_a->filters.clear (); - /* This is somewhat arbitrary, but hey ho */ - fs_a->scaler = Scaler::from_id ("bicubic"); - p->setup (fs_a, _last_play_fs, screen ()); - } else { - p->setup (_last_play_fs, screen ()); - } - p->pause_or_unpause (); - break; - case PlayerManager::PLAYING: - break; - case PlayerManager::PAUSED: - p->pause_or_unpause (); - break; - } -} - -void -FilmPlayer::pause_clicked () -{ - PlayerManager* p = PlayerManager::instance (); - - switch (p->state ()) { - case PlayerManager::QUIESCENT: - break; - case PlayerManager::PLAYING: - p->pause_or_unpause (); - break; - case PlayerManager::PAUSED: - break; - } -} - -void -FilmPlayer::stop_clicked () -{ - PlayerManager::instance()->stop (); -} - -shared_ptr -FilmPlayer::screen () const -{ - vector > const s = Config::instance()->screens (); - if (s.empty ()) { - return shared_ptr (); - } - - int const r = _screen.get_active_row_number (); - if (r >= int (s.size ())) { - return s[0]; - } - - return s[r]; -} - -void -FilmPlayer::update () -{ - set_button_states (); - set_status (); -} - -void -FilmPlayer::set_status () -{ - PlayerManager::State s = PlayerManager::instance()->state (); - - stringstream m; - switch (s) { - case PlayerManager::QUIESCENT: - m << "Idle"; - break; - case PlayerManager::PLAYING: - m << "PLAYING"; - break; - case PlayerManager::PAUSED: - m << "Paused"; - break; - } - - _ignore_position_changed = true; - - if (s != PlayerManager::QUIESCENT) { - float const p = PlayerManager::instance()->position (); - if (_last_play_fs->frames_per_second != 0 && _last_play_fs->length != 0) { - m << " (" << seconds_to_hms (_last_play_fs->length / _last_play_fs->frames_per_second - p) << " remaining)"; - } - - _position.set_value (p); - } else { - _position.set_value (0); - } - - _ignore_position_changed = false; - - _status.set_markup (m.str ()); -} - -void -FilmPlayer::position_changed () -{ - if (_ignore_position_changed) { - return; - } - - PlayerManager::instance()->set_position (_position.get_value ()); -} - -string -FilmPlayer::format_position (double v) -{ - return seconds_to_hms (v); -} - -void -FilmPlayer::update_screens () -{ - string const c = _screen.get_active_text (); - - _screen.clear (); - - vector > const scr = Config::instance()->screens (); - bool have_last_active_text = false; - for (vector >::const_iterator i = scr.begin(); i != scr.end(); ++i) { - _screen.append_text ((*i)->name ()); - if ((*i)->name() == c) { - have_last_active_text = true; - } - } - - if (have_last_active_text) { - _screen.set_active_text (c); - } else if (!scr.empty ()) { - _screen.set_active (0); - } -} - -void -FilmPlayer::film_changed (Film::Property p) -{ - if (p == Film::CONTENT) { - setup_visibility (); - } -} - -void -FilmPlayer::setup_visibility () -{ - if (!_film) { - return; - } - - widget().property_visible() = (_film->content_type() == VIDEO); -} diff --git a/src/wx/film_player.h b/src/wx/film_player.h deleted file mode 100644 index bb60eeb3b..000000000 --- a/src/wx/film_player.h +++ /dev/null @@ -1,63 +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 "lib/film.h" - -class Film; -class Screen; -class FilmState; - -class FilmPlayer -{ -public: - FilmPlayer (Film const * f = 0); - - Gtk::Widget& widget (); - - void set_film (Film const *); - void setup_visibility (); - -private: - void play_clicked (); - void pause_clicked (); - void stop_clicked (); - void position_changed (); - std::string format_position (double); - void film_changed (Film::Property); - - void set_button_states (); - boost::shared_ptr screen () const; - void set_status (); - void update (); - void update_screens (); - - Film const * _film; - boost::shared_ptr _last_play_fs; - - Gtk::VBox _main_vbox; - Gtk::Button _play; - Gtk::Button _pause; - Gtk::Button _stop; - Gtk::Label _status; - Gtk::CheckButton _ab; - Gtk::ComboBoxText _screen; - Gtk::HScale _position; - bool _ignore_position_changed; -}; diff --git a/src/wx/wscript b/src/wx/wscript index e5431460f..d425c3e05 100644 --- a/src/wx/wscript +++ b/src/wx/wscript @@ -26,11 +26,4 @@ def build(bld): wx_ui_signaller.cc """ -# alignment.cc -# film_list.cc -# dvd_title_dialog.cc - - if not bld.env.DISABLE_PLAYER: - obj.source += " film_player.cc" - obj.target = 'dvdomatic-wx' diff --git a/test/dvd/VIDEO_TS/VIDEO_TS.BUP b/test/dvd/VIDEO_TS/VIDEO_TS.BUP deleted file mode 100644 index e69de29bb..000000000 diff --git a/test/dvd/VIDEO_TS/VIDEO_TS.IFO b/test/dvd/VIDEO_TS/VIDEO_TS.IFO deleted file mode 100644 index e69de29bb..000000000 diff --git a/test/dvd/VIDEO_TS/VIDEO_TS.VOB b/test/dvd/VIDEO_TS/VIDEO_TS.VOB deleted file mode 100644 index e69de29bb..000000000 diff --git a/test/dvd/VIDEO_TS/VST_01_1.VOB b/test/dvd/VIDEO_TS/VST_01_1.VOB deleted file mode 100644 index 190a18037..000000000 --- a/test/dvd/VIDEO_TS/VST_01_1.VOB +++ /dev/null @@ -1 +0,0 @@ -123 diff --git a/test/dvd/VIDEO_TS/VTS_01_0.IFO b/test/dvd/VIDEO_TS/VTS_01_0.IFO deleted file mode 100644 index e69de29bb..000000000 diff --git a/test/dvd/VIDEO_TS/VTS_01_0.VOB b/test/dvd/VIDEO_TS/VTS_01_0.VOB deleted file mode 100644 index e69de29bb..000000000 diff --git a/test/dvd/VIDEO_TS/VTS_01_1.VOB b/test/dvd/VIDEO_TS/VTS_01_1.VOB deleted file mode 100644 index e69de29bb..000000000 diff --git a/test/dvd/VIDEO_TS/VTS_02_0.VOB b/test/dvd/VIDEO_TS/VTS_02_0.VOB deleted file mode 100644 index 8d38505c1..000000000 --- a/test/dvd/VIDEO_TS/VTS_02_0.VOB +++ /dev/null @@ -1 +0,0 @@ -456 diff --git a/test/dvd/VIDEO_TS/VTS_02_1.VOB b/test/dvd/VIDEO_TS/VTS_02_1.VOB deleted file mode 100644 index d00491fd7..000000000 --- a/test/dvd/VIDEO_TS/VTS_02_1.VOB +++ /dev/null @@ -1 +0,0 @@ -1 diff --git a/test/dvd/VIDEO_TS/VTS_02_2.VOB b/test/dvd/VIDEO_TS/VTS_02_2.VOB deleted file mode 100644 index 48082f72f..000000000 --- a/test/dvd/VIDEO_TS/VTS_02_2.VOB +++ /dev/null @@ -1 +0,0 @@ -12 diff --git a/test/dvd/VIDEO_TS/VTS_02_3.VOB b/test/dvd/VIDEO_TS/VTS_02_3.VOB deleted file mode 100644 index 190a18037..000000000 --- a/test/dvd/VIDEO_TS/VTS_02_3.VOB +++ /dev/null @@ -1 +0,0 @@ -123 diff --git a/test/dvd/VIDEO_TS/VTS_02_4.VOB b/test/dvd/VIDEO_TS/VTS_02_4.VOB deleted file mode 100644 index 81c545efe..000000000 --- a/test/dvd/VIDEO_TS/VTS_02_4.VOB +++ /dev/null @@ -1 +0,0 @@ -1234 diff --git a/test/dvd/VIDEO_TS/VTS_03_0.IFO b/test/dvd/VIDEO_TS/VTS_03_0.IFO deleted file mode 100644 index e56e15bb7..000000000 --- a/test/dvd/VIDEO_TS/VTS_03_0.IFO +++ /dev/null @@ -1 +0,0 @@ -12345 diff --git a/test/dvd/VIDEO_TS/VTS_03_0.VOB b/test/dvd/VIDEO_TS/VTS_03_0.VOB deleted file mode 100644 index e56e15bb7..000000000 --- a/test/dvd/VIDEO_TS/VTS_03_0.VOB +++ /dev/null @@ -1 +0,0 @@ -12345 diff --git a/test/dvd/VIDEO_TS/VTS_03_1.VOB b/test/dvd/VIDEO_TS/VTS_03_1.VOB deleted file mode 100644 index 9f358a4ad..000000000 --- a/test/dvd/VIDEO_TS/VTS_03_1.VOB +++ /dev/null @@ -1 +0,0 @@ -123456 diff --git a/test/test.cc b/test/test.cc index d1286dd76..5addc2d75 100644 --- a/test/test.cc +++ b/test/test.cc @@ -27,7 +27,6 @@ #include "job_manager.h" #include "util.h" #include "exceptions.h" -#include "dvd.h" #include "delay_line.h" #include "image.h" #include "log.h" @@ -159,24 +158,6 @@ BOOST_AUTO_TEST_CASE (util_test) BOOST_CHECK_EQUAL (*i++, "them"); } -BOOST_AUTO_TEST_CASE (dvd_test) -{ - list const t = dvd_titles ("test/dvd"); - BOOST_CHECK_EQUAL (t.size(), 3); - list::const_iterator i = t.begin (); - - BOOST_CHECK_EQUAL (i->number, 1); - BOOST_CHECK_EQUAL (i->size, 0); - ++i; - - BOOST_CHECK_EQUAL (i->number, 2); - BOOST_CHECK_EQUAL (i->size, 14); - ++i; - - BOOST_CHECK_EQUAL (i->number, 3); - BOOST_CHECK_EQUAL (i->size, 7); -} - void do_positive_delay_line_test (int delay_length, int data_length) { diff --git a/wscript b/wscript index c3911e5d2..a069c358d 100644 --- a/wscript +++ b/wscript @@ -11,7 +11,6 @@ def options(opt): opt.add_option('--enable-debug', action='store_true', default = False, help = 'build with debugging information and without optimisation') opt.add_option('--disable-gui', action='store_true', default = False, help = 'disable building of GUI tools') - opt.add_option('--disable-player', action='store_true', default = False, help = 'disable building of the player components') opt.add_option('--target-windows', action='store_true', default = False, help = 'set up to do a cross-compile to Windows') def configure(conf): @@ -21,9 +20,6 @@ def configure(conf): conf.env.append_value('CXXFLAGS', ['-D__STDC_CONSTANT_MACROS', '-msse', '-mfpmath=sse', '-ffast-math', '-fno-strict-aliasing', '-Wall', '-Wno-attributes']) - # Turn off player for now - conf.options.disable_player = True - if conf.options.target_windows: conf.env.append_value('CXXFLAGS', ['-DDVDOMATIC_WINDOWS', '-DWIN32_LEAN_AND_MEAN', '-DBOOST_USE_WINDOWS_H']) wxrc = os.popen('wx-config --rescomp').read().split()[1:] @@ -32,7 +28,6 @@ def configure(conf): if conf.options.enable_debug: conf.env.append_value('CXXFLAGS', ['-mconsole']) conf.env.append_value('LINKFLAGS', ['-mconsole']) - conf.options.disable_player = True conf.check(lib = 'ws2_32', uselib_store = 'WINSOCK2', msg = "Checking for library winsock2") boost_lib_suffix = '-mt' boost_thread = 'boost_thread_win32-mt' @@ -44,12 +39,8 @@ def configure(conf): conf.env.TARGET_WINDOWS = conf.options.target_windows conf.env.DISABLE_GUI = conf.options.disable_gui - conf.env.DISABLE_PLAYER = conf.options.disable_player conf.env.VERSION = VERSION - if conf.options.disable_player: - conf.env.append_value('CXXFLAGS', '-DDVDOMATIC_DISABLE_PLAYER') - if conf.options.enable_debug: conf.env.append_value('CXXFLAGS', ['-g', '-DDVDOMATIC_DEBUG']) else: