export LD_LIBRARY_PATH=build/src/lib:build/src/wx:build/src/asdcplib/src:$LD_LIBRARY_PATH
if [ "$1" == "--debug" ]; then
shift
- gdb --args build/src/tools/dvdomatic "$1"
+ gdb --args build/src/tools/dvdomatic $*
elif [ "$1" == "--valgrind" ]; then
shift
- valgrind --tool="memcheck" build/src/tools/dvdomatic "$1"
+ valgrind --tool="memcheck" build/src/tools/dvdomatic $*
else
- build/src/tools/dvdomatic "$1"
+ build/src/tools/dvdomatic $*
fi
#include "lib/exceptions.h"
#include "lib/version.h"
#include "lib/ui_signaller.h"
+#include "lib/log.h"
+using std::cout;
using std::string;
using std::stringstream;
using std::map;
static FilmEditor* film_editor = 0;
static FilmViewer* film_viewer = 0;
-
static shared_ptr<Film> film;
+static std::string log_level;
+static std::string film_to_load;
static void set_menu_sensitivity ();
maybe_save_then_delete_film ();
film.reset (new Film (d->get_path (), false));
+ film->log()->set_level (log_level);
#if BOOST_FILESYSTEM_VERSION == 3
film->set_name (boost::filesystem::path (d->get_path()).filename().generic_string());
#else
if (r == wxID_OK) {
maybe_save_then_delete_film ();
film.reset (new Film (wx_to_std (c->GetPath ())));
+ film->log()->set_level (log_level);
set_film ();
}
}
};
+static const wxCmdLineEntryDesc command_line_description[] = {
+ { wxCMD_LINE_OPTION, wxT("l"), wxT("log"), wxT("set log level (silent, verbose or timing)"), wxCMD_LINE_VAL_STRING, wxCMD_LINE_PARAM_OPTIONAL },
+ { wxCMD_LINE_PARAM, 0, 0, wxT("film to load"), wxCMD_LINE_VAL_STRING, wxCMD_LINE_PARAM_MULTIPLE | wxCMD_LINE_PARAM_OPTIONAL },
+ { wxCMD_LINE_NONE }
+};
+
class App : public wxApp
{
bool OnInit ()
{
+ if (!wxApp::OnInit()) {
+ return false;
+ }
+
#ifdef DVDOMATIC_POSIX
unsetenv ("UBUNTU_MENUPROXY");
#endif
dvdomatic_setup ();
- if (argc == 2 && boost::filesystem::is_directory (wx_to_std (argv[1]))) {
- film.reset (new Film (wx_to_std (argv[1])));
+ if (!film_to_load.empty() && boost::filesystem::is_directory (film_to_load)) {
+ film.reset (new Film (film_to_load));
+ film->log()->set_level (log_level);
}
Frame* f = new Frame (_("DVD-o-matic"));
return true;
}
+ void OnInitCmdLine (wxCmdLineParser& parser)
+ {
+ parser.SetDesc (command_line_description);
+ parser.SetSwitchChars (wxT ("-"));
+ }
+
+ bool OnCmdLineParsed (wxCmdLineParser& parser)
+ {
+ if (parser.GetParamCount() > 0) {
+ film_to_load = wx_to_std (parser.GetParam(0));
+ }
+
+ wxString log;
+ if (parser.Found(wxT("log"), &log)) {
+ log_level = wx_to_std (log);
+ }
+
+ return true;
+ }
+
void idle (wxIdleEvent &)
{
ui_signaller->ui_idle ();
conf.check_cfg(package = 'libswresample', args = '--cflags --libs', uselib_store = 'SWRESAMPLE', mandatory = False)
conf.check_cfg(package = 'libpostproc', args = '--cflags --libs', uselib_store = 'POSTPROC', mandatory = True)
conf.check_cfg(package = 'sndfile', args = '--cflags --libs', uselib_store = 'SNDFILE', mandatory = True)
- conf.check_cfg(package = 'libdcp', atleast_version = '0.32', args = '--cflags --libs', uselib_store = 'DCP', mandatory = True)
+ conf.check_cfg(package = 'libdcp', atleast_version = '0.33', args = '--cflags --libs', uselib_store = 'DCP', mandatory = True)
conf.check_cfg(package = 'glib-2.0', args = '--cflags --libs', uselib_store = 'GLIB', mandatory = True)
conf.check_cfg(package = '', path = 'Magick++-config', args = '--cppflags --cxxflags --libs', uselib_store = 'MAGICK', mandatory = True)
conf.check_cc(fragment = """