Some more KDM hacking.
authorCarl Hetherington <cth@carlh.net>
Wed, 9 Jan 2013 23:18:28 +0000 (23:18 +0000)
committerCarl Hetherington <cth@carlh.net>
Wed, 9 Jan 2013 23:18:28 +0000 (23:18 +0000)
src/lib/film.cc
src/lib/film.h
src/tools/dvdomatic.cc
src/wx/kdm_dialog.cc
src/wx/kdm_dialog.h

index 6e49dd4ea2df0b3e8f08fad1560861157f471af0..1b53b3d3ebe48b6a96e1759df1c1566d4068eb96 100644 (file)
@@ -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
+{
+       
+}
+       
index b2f57eac81d0cee4940d395f58f5dc651e71682e..c9d99dae339ad1d705e13b950fe47aff0cb5e95b 100644 (file)
@@ -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,
index cfdd03a30549c3f7e7e58dd4374944eb550f03ee..7d7adcce839ff4f8e0a623f73cfebd26561e0f33 100644 (file)
@@ -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 ();
        }
        
index 34004902b79d905950b295782b236b519ed814a0..43d904d90b94dee3560c26a93a529a277c7d7976 100644 (file)
@@ -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 ());
+}
index 99e2603380128e5fa22edc20a87f4bd08972ce3a..d161223a8eab1259a14b62f9dd7af88a831cff72 100644 (file)
@@ -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>);