summaryrefslogtreecommitdiff
path: root/src/wx
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2014-12-20 23:37:57 +0000
committerCarl Hetherington <cth@carlh.net>2014-12-20 23:37:57 +0000
commit4dbc6ef917aeceb906b1ef1caf6911033e7e2c54 (patch)
tree203675d00d5cc004be6205218f835b6d7a10e925 /src/wx
parentab32f60c2c9f2ad01dc8d96dc375df256dba0c41 (diff)
Hand-apply d849d411cff28ef5453085791d0b4d7cd73bd070 from master; replace all assert()s with thrown exceptions.
Diffstat (limited to 'src/wx')
-rw-r--r--src/wx/audio_dialog.cc4
-rw-r--r--src/wx/content_menu.cc12
-rw-r--r--src/wx/dcp_panel.cc2
-rw-r--r--src/wx/editable_list.h4
-rw-r--r--src/wx/hints_dialog.cc5
-rw-r--r--src/wx/kdm_dialog.cc2
-rw-r--r--src/wx/subtitle_panel.cc4
-rw-r--r--src/wx/timeline.cc6
-rw-r--r--src/wx/video_panel.cc6
9 files changed, 23 insertions, 22 deletions
diff --git a/src/wx/audio_dialog.cc b/src/wx/audio_dialog.cc
index 1f882e61f..1d41fc185 100644
--- a/src/wx/audio_dialog.cc
+++ b/src/wx/audio_dialog.cc
@@ -163,7 +163,7 @@ AudioDialog::channel_clicked (wxCommandEvent& ev)
++c;
}
- assert (c < MAX_DCP_AUDIO_CHANNELS);
+ DCPOMATIC_ASSERT (c < MAX_DCP_AUDIO_CHANNELS);
_plot->set_channel_visible (c, _channel_checkbox[c]->GetValue ());
}
@@ -186,7 +186,7 @@ AudioDialog::type_clicked (wxCommandEvent& ev)
++t;
}
- assert (t < AudioPoint::COUNT);
+ DCPOMATIC_ASSERT (t < AudioPoint::COUNT);
_plot->set_type_visible (t, _type_checkbox[t]->GetValue ());
}
diff --git a/src/wx/content_menu.cc b/src/wx/content_menu.cc
index c528447ac..15a234184 100644
--- a/src/wx/content_menu.cc
+++ b/src/wx/content_menu.cc
@@ -136,7 +136,7 @@ ContentMenu::join ()
}
}
- assert (fc.size() > 1);
+ DCPOMATIC_ASSERT (fc.size() > 1);
shared_ptr<Film> film = _film.lock ();
if (!film) {
@@ -245,8 +245,8 @@ ContentMenu::maybe_found_missing (weak_ptr<Job> j, weak_ptr<Content> oc, weak_pt
shared_ptr<Content> old_content = oc.lock ();
shared_ptr<Content> new_content = nc.lock ();
- assert (old_content);
- assert (new_content);
+ DCPOMATIC_ASSERT (old_content);
+ DCPOMATIC_ASSERT (new_content);
if (new_content->digest() != old_content->digest()) {
error_dialog (0, _("The content file(s) you specified are not the same as those that are missing. Either try again with the correct content file or remove the missing content."));
@@ -259,16 +259,16 @@ ContentMenu::maybe_found_missing (weak_ptr<Job> j, weak_ptr<Content> oc, weak_pt
void
ContentMenu::kdm ()
{
- assert (!_content.empty ());
+ DCPOMATIC_ASSERT (!_content.empty ());
shared_ptr<DCPContent> dcp = dynamic_pointer_cast<DCPContent> (_content.front ());
- assert (dcp);
+ DCPOMATIC_ASSERT (dcp);
wxFileDialog* d = new wxFileDialog (_parent, _("Select KDM"));
if (d->ShowModal() == wxID_OK) {
dcp->add_kdm (dcp::EncryptedKDM (dcp::file_to_string (wx_to_std (d->GetPath ()))));
shared_ptr<Film> film = _film.lock ();
- assert (film);
+ DCPOMATIC_ASSERT (film);
film->examine_content (dcp, true);
}
diff --git a/src/wx/dcp_panel.cc b/src/wx/dcp_panel.cc
index 18ba4ccfd..5b2d18f23 100644
--- a/src/wx/dcp_panel.cc
+++ b/src/wx/dcp_panel.cc
@@ -361,7 +361,7 @@ DCPPanel::container_changed ()
int const n = _container->GetSelection ();
if (n >= 0) {
vector<Ratio const *> ratios = Ratio::all ();
- assert (n < int (ratios.size()));
+ DCPOMATIC_ASSERT (n < int (ratios.size()));
_film->set_container (ratios[n]);
}
}
diff --git a/src/wx/editable_list.h b/src/wx/editable_list.h
index 481a14741..4119b889e 100644
--- a/src/wx/editable_list.h
+++ b/src/wx/editable_list.h
@@ -132,7 +132,7 @@ private:
}
std::vector<T> all = _get ();
- assert (item >= 0 && item < int (all.size ()));
+ DCPOMATIC_ASSERT (item >= 0 && item < int (all.size ()));
T copy (all[item]);
add_to_control (copy);
@@ -149,7 +149,7 @@ private:
}
std::vector<T> all = _get ();
- assert (item >= 0 && item < int (all.size ()));
+ DCPOMATIC_ASSERT (item >= 0 && item < int (all.size ()));
S* dialog = new S (this);
dialog->set (all[item]);
diff --git a/src/wx/hints_dialog.cc b/src/wx/hints_dialog.cc
index 9f8956948..b5d5c6971 100644
--- a/src/wx/hints_dialog.cc
+++ b/src/wx/hints_dialog.cc
@@ -17,11 +17,12 @@
*/
-#include <boost/algorithm/string.hpp>
-#include <wx/richtext/richtextctrl.h>
#include "lib/film.h"
#include "lib/ratio.h"
+#include "lib/video_content.h"
#include "hints_dialog.h"
+#include <boost/algorithm/string.hpp>
+#include <wx/richtext/richtextctrl.h>
using boost::shared_ptr;
using boost::dynamic_pointer_cast;
diff --git a/src/wx/kdm_dialog.cc b/src/wx/kdm_dialog.cc
index 6a1f8051f..9b1d6bc98 100644
--- a/src/wx/kdm_dialog.cc
+++ b/src/wx/kdm_dialog.cc
@@ -472,7 +472,7 @@ boost::filesystem::path
KDMDialog::cpl () const
{
int const item = _cpl->GetSelection ();
- assert (item >= 0);
+ DCPOMATIC_ASSERT (item >= 0);
return _cpls[item].cpl_file;
}
diff --git a/src/wx/subtitle_panel.cc b/src/wx/subtitle_panel.cc
index 07b987a67..1e137f233 100644
--- a/src/wx/subtitle_panel.cc
+++ b/src/wx/subtitle_panel.cc
@@ -308,7 +308,7 @@ SubtitlePanel::subtitle_view_clicked ()
}
SubtitleContentList c = _parent->selected_subtitle ();
- assert (c.size() == 1);
+ DCPOMATIC_ASSERT (c.size() == 1);
shared_ptr<SubtitleDecoder> decoder;
@@ -337,7 +337,7 @@ SubtitlePanel::fonts_dialog_clicked ()
}
SubtitleContentList c = _parent->selected_subtitle ();
- assert (c.size() == 1);
+ DCPOMATIC_ASSERT (c.size() == 1);
_fonts_dialog = new FontsDialog (this, c.front ());
_fonts_dialog->Show ();
diff --git a/src/wx/timeline.cc b/src/wx/timeline.cc
index 556e6f1b3..6bce881a4 100644
--- a/src/wx/timeline.cc
+++ b/src/wx/timeline.cc
@@ -96,7 +96,7 @@ public:
dcpomatic::Rect<int> bbox () const
{
- assert (_track);
+ DCPOMATIC_ASSERT (_track);
shared_ptr<const Film> film = _timeline.film ();
shared_ptr<const Content> content = _content.lock ();
@@ -145,7 +145,7 @@ private:
void do_paint (wxGraphicsContext* gc)
{
- assert (_track);
+ DCPOMATIC_ASSERT (_track);
shared_ptr<const Film> film = _timeline.film ();
shared_ptr<const Content> cont = content ();
@@ -749,7 +749,7 @@ Timeline::set_position_from_event (wxMouseEvent& ev)
_down_view->content()->set_position (new_position);
shared_ptr<Film> film = _film.lock ();
- assert (film);
+ DCPOMATIC_ASSERT (film);
film->set_sequence_video (false);
}
diff --git a/src/wx/video_panel.cc b/src/wx/video_panel.cc
index 716c29dda..cdd2eb5de 100644
--- a/src/wx/video_panel.cc
+++ b/src/wx/video_panel.cc
@@ -48,8 +48,8 @@ static VideoContentScale
index_to_scale (int n)
{
vector<VideoContentScale> scales = VideoContentScale::all ();
- assert (n >= 0);
- assert (n < int (scales.size ()));
+ DCPOMATIC_ASSERT (n >= 0);
+ DCPOMATIC_ASSERT (n < int (scales.size ()));
return scales[n];
}
@@ -63,7 +63,7 @@ scale_to_index (VideoContentScale scale)
}
}
- assert (false);
+ DCPOMATIC_ASSERT (false);
}
VideoPanel::VideoPanel (ContentPanel* p)