summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2013-01-09 23:18:28 +0000
committerCarl Hetherington <cth@carlh.net>2013-01-09 23:18:28 +0000
commit6bfdd0f45927a4dfecf10e851b1902a899de5aa2 (patch)
tree3e079a097f8a7d4ff3fb11020aaacca563fd09b5 /src
parent914849f57d4979d537fe4215576bc6e05d2f8795 (diff)
Some more KDM hacking.
Diffstat (limited to 'src')
-rw-r--r--src/lib/film.cc12
-rw-r--r--src/lib/film.h8
-rw-r--r--src/tools/dvdomatic.cc10
-rw-r--r--src/wx/kdm_dialog.cc41
-rw-r--r--src/wx/kdm_dialog.h5
5 files changed, 75 insertions, 1 deletions
diff --git a/src/lib/film.cc b/src/lib/film.cc
index 6e49dd4ea..1b53b3d3e 100644
--- a/src/lib/film.cc
+++ b/src/lib/film.cc
@@ -1384,3 +1384,15 @@ Film::audio_stream () const
return _external_audio_stream;
}
+
+void
+Film::make_kdms (
+ list<shared_ptr<Screen> >,
+ boost::locale::date_time from,
+ boost::locale::date_time until,
+ string directory
+ ) const
+{
+
+}
+
diff --git a/src/lib/film.h b/src/lib/film.h
index b2f57eac8..c9d99dae3 100644
--- a/src/lib/film.h
+++ b/src/lib/film.h
@@ -45,6 +45,7 @@ class Filter;
class Log;
class ExamineContentJob;
class ExternalAudioStream;
+class Screen;
/** @class Film
* @brief A representation of a video with sound.
@@ -100,6 +101,13 @@ public:
void set_dci_date_today ();
+ void make_kdms (
+ std::list<boost::shared_ptr<Screen> >,
+ boost::locale::date_time from,
+ boost::locale::date_time until,
+ std::string directory
+ );
+
enum Property {
NONE,
NAME,
diff --git a/src/tools/dvdomatic.cc b/src/tools/dvdomatic.cc
index cfdd03a30..7d7adcce8 100644
--- a/src/tools/dvdomatic.cc
+++ b/src/tools/dvdomatic.cc
@@ -338,7 +338,15 @@ public:
void jobs_make_kdms (wxCommandEvent &)
{
KDMDialog* d = new KDMDialog (this);
- d->ShowModal ();
+ if (d->ShowModal () == wxID_OK) {
+ _film->make_kdms (
+ d->screens (),
+ d->from (),
+ d->until (),
+ d->directory ()
+ );
+ }
+
d->Destroy ();
}
diff --git a/src/wx/kdm_dialog.cc b/src/wx/kdm_dialog.cc
index 34004902b..43d904d90 100644
--- a/src/wx/kdm_dialog.cc
+++ b/src/wx/kdm_dialog.cc
@@ -321,3 +321,44 @@ KDMDialog::remove_screen_clicked (wxCommandEvent &)
Config::instance()->write ();
}
+
+list<shared_ptr<Screen> >
+KDMDialog::screens () const
+{
+ list<shared_ptr<Screen> > s;
+
+ list<pair<wxTreeItemId, shared_ptr<Cinema> > > cinemas = selected_cinemas ();
+ for (list<pair<wxTreeItemId, shared_ptr<Cinema> > >::iterator i = cinemas.begin(); i != cinemas.end(); ++i) {
+ for (list<Screen>::iterator j = i->second->screens.begin(); j != i->second->screens.end(); ++j) {
+ s.push_back (*j);
+ }
+ }
+
+ list<pair<wxTreeItemId, shared_ptr<Screen> > > screens = selected_screens ();
+ for (list<pair<wxTreeItemId, shared_ptr<Screen> > >::iterator i = screens.begin(); i != screens.end(); ++i) {
+ s.push_back (i->second);
+ }
+
+ s.sort ();
+ s.uniq ();
+
+ return s;
+}
+
+boost::locale::date_time
+KDMDialog::from () const
+{
+
+}
+
+boost::locale::date_time
+KDMDialog::until () const
+{
+
+}
+
+string
+KDMDialog::directory () const
+{
+ return wx_to_std (_folder->GetPath ());
+}
diff --git a/src/wx/kdm_dialog.h b/src/wx/kdm_dialog.h
index 99e260338..d161223a8 100644
--- a/src/wx/kdm_dialog.h
+++ b/src/wx/kdm_dialog.h
@@ -36,6 +36,11 @@ class KDMDialog : public wxDialog
public:
KDMDialog (wxWindow *);
+ std::list<boost::shared_ptr<Screen> > screens () const;
+ boost::local::date_time from () const;
+ boost::local::date_time until () const;
+ std::string directory () const;
+
private:
void add_cinema (boost::shared_ptr<Cinema>);
void add_screen (boost::shared_ptr<Cinema>, boost::shared_ptr<Screen>);