-0ee1e8c65e2977638375a8f96dbea201210aac98
-f2851b7066d0e12102b0f3aabc2b827a261206a9
*/
#include "audio_analysis.h"
+#include "dcpomatic_assert.h"
#include "cross.h"
#include <boost/filesystem.hpp>
#include <stdint.h>
void
AudioAnalysis::add_point (int c, AudioPoint const & p)
{
- assert (c < channels ());
+ DCPOMATIC_ASSERT (c < channels ());
_data[c].push_back (p);
}
AudioPoint
AudioAnalysis::get_point (int c, int p) const
{
- assert (p < points (c));
+ DCPOMATIC_ASSERT (p < points (c));
return _data[c][p];
}
int
AudioAnalysis::points (int c) const
{
- assert (c < channels ());
+ DCPOMATIC_ASSERT (c < channels ());
return _data[c].size ();
}
*/
#include "audio_buffers.h"
+#include "dcpomatic_assert.h"
#include <cassert>
#include <cstring>
#include <cmath>
void
AudioBuffers::allocate (int channels, int frames)
{
- assert (frames >= 0);
- assert (channels >= 0);
+ DCPOMATIC_ASSERT (frames >= 0);
+ DCPOMATIC_ASSERT (channels >= 0);
_channels = channels;
_frames = frames;
float*
AudioBuffers::data (int c) const
{
- assert (c >= 0 && c < _channels);
+ DCPOMATIC_ASSERT (c >= 0 && c < _channels);
return _data[c];
}
void
AudioBuffers::set_frames (int f)
{
- assert (f <= _allocated_frames);
+ DCPOMATIC_ASSERT (f <= _allocated_frames);
for (int c = 0; c < _channels; ++c) {
for (int i = f; i < _frames; ++i) {
void
AudioBuffers::make_silent (int c)
{
- assert (c >= 0 && c < _channels);
+ DCPOMATIC_ASSERT (c >= 0 && c < _channels);
for (int i = 0; i < _frames; ++i) {
_data[c][i] = 0;
void
AudioBuffers::make_silent (int from, int frames)
{
- assert ((from + frames) <= _allocated_frames);
+ DCPOMATIC_ASSERT ((from + frames) <= _allocated_frames);
for (int c = 0; c < _channels; ++c) {
for (int i = from; i < (from + frames); ++i) {
return;
}
- assert (from->channels() == channels());
+ DCPOMATIC_ASSERT (from->channels() == channels());
- assert (from);
- assert (read_offset >= 0 && (read_offset + frames_to_copy) <= from->_allocated_frames);
- assert (write_offset >= 0 && (write_offset + frames_to_copy) <= _allocated_frames);
+ DCPOMATIC_ASSERT (from);
+ DCPOMATIC_ASSERT (read_offset >= 0 && (read_offset + frames_to_copy) <= from->_allocated_frames);
+ DCPOMATIC_ASSERT (write_offset >= 0 && (write_offset + frames_to_copy) <= _allocated_frames);
for (int i = 0; i < _channels; ++i) {
memcpy (_data[i] + write_offset, from->_data[i] + read_offset, frames_to_copy * sizeof(float));
return;
}
- assert (from >= 0);
- assert (from < _frames);
- assert (to >= 0);
- assert (to < _frames);
- assert (frames > 0);
- assert (frames <= _frames);
- assert ((from + frames) <= _frames);
- assert ((to + frames) <= _allocated_frames);
+ DCPOMATIC_ASSERT (from >= 0);
+ DCPOMATIC_ASSERT (from < _frames);
+ DCPOMATIC_ASSERT (to >= 0);
+ DCPOMATIC_ASSERT (to < _frames);
+ DCPOMATIC_ASSERT (frames > 0);
+ DCPOMATIC_ASSERT (frames <= _frames);
+ DCPOMATIC_ASSERT ((from + frames) <= _frames);
+ DCPOMATIC_ASSERT ((to + frames) <= _allocated_frames);
for (int i = 0; i < _channels; ++i) {
memmove (_data[i] + to, _data[i] + from, frames * sizeof(float));
AudioBuffers::accumulate_channel (AudioBuffers const * from, int from_channel, int to_channel, float gain)
{
int const N = frames ();
- assert (from->frames() == N);
- assert (to_channel <= _channels);
+ DCPOMATIC_ASSERT (from->frames() == N);
+ DCPOMATIC_ASSERT (to_channel <= _channels);
float* s = from->data (from_channel);
float* d = _data[to_channel];
void
AudioBuffers::accumulate_frames (AudioBuffers const * from, int read_offset, int write_offset, int frames)
{
- assert (_channels == from->channels ());
- assert (read_offset >= 0);
- assert (write_offset >= 0);
+ DCPOMATIC_ASSERT (_channels == from->channels ());
+ DCPOMATIC_ASSERT (read_offset >= 0);
+ DCPOMATIC_ASSERT (write_offset >= 0);
for (int i = 0; i < _channels; ++i) {
for (int j = 0; j < frames; ++j) {
void
AudioBuffers::copy_channel_from (AudioBuffers const * from, int from_channel, int to_channel)
{
- assert (from->frames() == frames());
+ DCPOMATIC_ASSERT (from->frames() == frames());
memcpy (data(to_channel), from->data(from_channel), frames() * sizeof (float));
}
: Content (f, c)
{
shared_ptr<AudioContent> ref = dynamic_pointer_cast<AudioContent> (c[0]);
- assert (ref);
+ DCPOMATIC_ASSERT (ref);
for (size_t i = 0; i < c.size(); ++i) {
shared_ptr<AudioContent> ac = dynamic_pointer_cast<AudioContent> (c[i]);
AudioContent::analyse_audio (boost::function<void()> finished)
{
shared_ptr<const Film> film = _film.lock ();
- assert (film);
+ DCPOMATIC_ASSERT (film);
shared_ptr<AnalyseAudioJob> job (new AnalyseAudioJob (film, dynamic_pointer_cast<AudioContent> (shared_from_this())));
boost::signals2::connection c = job->Finished.connect (finished);
AudioContent::resampled_audio_frame_rate () const
{
shared_ptr<const Film> film = _film.lock ();
- assert (film);
+ DCPOMATIC_ASSERT (film);
/* Resample to a DCI-approved sample rate */
double t = dcp_audio_frame_rate (audio_frame_rate ());
_audio_position = time.frames (frame_rate);
}
- assert (_audio_position.get() >= (_decoded_audio.frame + _decoded_audio.audio->frames()));
+ DCPOMATIC_ASSERT (_audio_position.get() >= (_decoded_audio.frame + _decoded_audio.audio->frames()));
add (data);
}
#include "cinema_sound_processor.h"
#include "dolby_cp750.h"
+#include "dcpomatic_assert.h"
#include <iostream>
#include <cassert>
CinemaSoundProcessor const *
CinemaSoundProcessor::from_index (int i)
{
- assert (i <= int(_cinema_sound_processors.size ()));
+ DCPOMATIC_ASSERT (i <= int(_cinema_sound_processors.size ()));
return _cinema_sound_processors[i];
}
{
/* XXX: should handle multiple paths more gracefully */
- assert (number_of_paths ());
+ DCPOMATIC_ASSERT (number_of_paths ());
string s = path(0).filename().string ();
if (number_of_paths() > 1) {
ContentTextSubtitle::period () const
{
/* XXX: assuming we have some subs and they are all at the same time */
- assert (!subs.empty ());
+ DCPOMATIC_ASSERT (!subs.empty ());
return ContentTimePeriod (
ContentTime::from_seconds (double (subs.front().in().to_ticks()) / 250),
ContentTime::from_seconds (double (subs.front().out().to_ticks()) / 250)
DCPContent::full_length () const
{
shared_ptr<const Film> film = _film.lock ();
- assert (film);
+ DCPOMATIC_ASSERT (film);
return DCPTime (video_length (), FrameRateChange (video_frame_rate (), film->video_frame_rate ()));
}
*/
#include "dcp_content_type.h"
+#include "dcpomatic_assert.h"
#include <cassert>
#include "i18n.h"
DCPContentType const *
DCPContentType::from_index (int n)
{
- assert (n >= 0 && n < int (_dcp_content_types.size ()));
+ DCPOMATIC_ASSERT (n >= 0 && n < int (_dcp_content_types.size ()));
return _dcp_content_types[n];
}
if (c->kdm ()) {
dcp.add (dcp::DecryptedKDM (c->kdm().get (), Config::instance()->decryption_private_key ()));
}
- assert (dcp.cpls().size() == 1);
+ DCPOMATIC_ASSERT (dcp.cpls().size() == 1);
_reels = dcp.cpls().front()->reels ();
_reel = _reels.begin ();
}
#include "util.h"
#include <dcp/picture_mxf_writer.h>
+#include <libcxml/cxml.h>
/** @file src/dcp_video_frame.h
* @brief A single frame of video destined for a DCP.
#include "frame_rate_change.h"
#include "safe_stringstream.h"
+#include "dcpomatic_assert.h"
#include <stdint.h>
#include <cmath>
#include <ostream>
template <class T>
static ContentTime from_frames (int64_t f, T r) {
- assert (r > 0);
+ DCPOMATIC_ASSERT (r > 0);
return ContentTime (f * HZ / r);
}
template <class T>
static DCPTime from_frames (int64_t f, T r) {
- assert (r > 0);
+ DCPOMATIC_ASSERT (r > 0);
return DCPTime (f * HZ / r);
}
{
}
+
+ProgrammingError::ProgrammingError (string file, int line)
+ : StringError (String::compose (_("Programming error at %1:%2"), file, line))
+{
+
+}
InvalidSignerError ();
};
+class ProgrammingError : public StringError
+{
+public:
+ ProgrammingError (std::string file, int line);
+};
+
/** @class ExceptionStore
* @brief A parent class for classes which have a need to catch and
* re-throw exceptions.
, SubtitleContent (f, c)
{
shared_ptr<FFmpegContent> ref = dynamic_pointer_cast<FFmpegContent> (c[0]);
- assert (ref);
+ DCPOMATIC_ASSERT (ref);
for (size_t i = 0; i < c.size(); ++i) {
shared_ptr<FFmpegContent> fc = dynamic_pointer_cast<FFmpegContent> (c[i]);
take_from_video_examiner (examiner);
shared_ptr<const Film> film = _film.lock ();
- assert (film);
+ DCPOMATIC_ASSERT (film);
{
boost::mutex::scoped_lock lm (_mutex);
FFmpegContent::full_length () const
{
shared_ptr<const Film> film = _film.lock ();
- assert (film);
+ DCPOMATIC_ASSERT (film);
return DCPTime (video_length_after_3d_combine(), FrameRateChange (video_frame_rate (), film->video_frame_rate ()));
}
shared_ptr<AudioBuffers>
FFmpegDecoder::deinterleave_audio (uint8_t** data, int size)
{
- assert (_ffmpeg_content->audio_channels());
- assert (bytes_per_audio_sample());
+ DCPOMATIC_ASSERT (_ffmpeg_content->audio_channels());
+ DCPOMATIC_ASSERT (bytes_per_audio_sample());
/* Deinterleave and convert to float */
- assert ((size % (bytes_per_audio_sample() * _ffmpeg_content->audio_channels())) == 0);
+ DCPOMATIC_ASSERT ((size % (bytes_per_audio_sample() * _ffmpeg_content->audio_channels())) == 0);
int const total_samples = size / bytes_per_audio_sample();
int const frames = total_samples / _ffmpeg_content->audio_channels();
*/
+#include "ffmpeg_stream.h"
+#include "dcpomatic_assert.h"
+#include <dcp/raw_convert.h>
+#include <libxml++/libxml++.h>
extern "C" {
#include <libavformat/avformat.h>
}
-#include <libxml++/libxml++.h>
-#include <dcp/raw_convert.h>
-#include "ffmpeg_stream.h"
using std::string;
using dcp::raw_convert;
++i;
}
- assert (false);
+ DCPOMATIC_ASSERT (false);
return 0;
}
string
Film::video_identifier () const
{
- assert (container ());
+ DCPOMATIC_ASSERT (container ());
SafeStringStream s;
s.imbue (std::locale::classic ());
return dcp::Size (4096, 2160);
}
- assert (false);
+ DCPOMATIC_ASSERT (false);
return dcp::Size ();
}
#include "types.h"
#include "isdcf_metadata.h"
#include "frame_rate_change.h"
+#include "ratio.h"
#include <dcp/key.h>
#include <dcp/encrypted_kdm.h>
#include <boost/signals2.hpp>
shared_ptr<Image>
Image::crop_scale_window (Crop crop, dcp::Size inter_size, dcp::Size out_size, Scaler const * scaler, AVPixelFormat out_format, bool out_aligned) const
{
- assert (scaler);
+ DCPOMATIC_ASSERT (scaler);
/* Empirical testing suggests that sws_scale() will crash if
the input image is not aligned.
*/
- assert (aligned ());
+ DCPOMATIC_ASSERT (aligned ());
- assert (out_size.width >= inter_size.width);
- assert (out_size.height >= inter_size.height);
+ DCPOMATIC_ASSERT (out_size.width >= inter_size.width);
+ DCPOMATIC_ASSERT (out_size.height >= inter_size.height);
/* Here's an image of out_size */
shared_ptr<Image> out (new Image (out_format, out_size, out_aligned));
shared_ptr<Image>
Image::scale (dcp::Size out_size, Scaler const * scaler, AVPixelFormat out_format, bool out_aligned) const
{
- assert (scaler);
+ DCPOMATIC_ASSERT (scaler);
/* Empirical testing suggests that sws_scale() will crash if
the input image is not aligned.
*/
- assert (aligned ());
+ DCPOMATIC_ASSERT (aligned ());
shared_ptr<Image> scaled (new Image (out_format, out_size, out_aligned));
void
Image::alpha_blend (shared_ptr<const Image> other, Position<int> position)
{
- assert (other->pixel_format() == PIX_FMT_RGBA);
+ DCPOMATIC_ASSERT (other->pixel_format() == PIX_FMT_RGBA);
int const other_bpp = 4;
int start_tx = position.x;
break;
}
default:
- assert (false);
+ DCPOMATIC_ASSERT (false);
}
}
Image::copy (shared_ptr<const Image> other, Position<int> position)
{
/* Only implemented for RGB24 onto RGB24 so far */
- assert (_pixel_format == PIX_FMT_RGB24 && other->pixel_format() == PIX_FMT_RGB24);
- assert (position.x >= 0 && position.y >= 0);
+ DCPOMATIC_ASSERT (_pixel_format == PIX_FMT_RGB24 && other->pixel_format() == PIX_FMT_RGB24);
+ DCPOMATIC_ASSERT (position.x >= 0 && position.y >= 0);
int const N = min (position.x + other->size().width, size().width) - position.x;
for (int ty = position.y, oy = 0; ty < size().height && oy < other->size().height; ++ty, ++oy) {
allocate ();
for (int i = 0; i < components(); ++i) {
- assert(line_size()[i] == other->line_size()[i]);
+ DCPOMATIC_ASSERT (line_size()[i] == other->line_size()[i]);
uint8_t* p = _data[i];
uint8_t* q = other->data()[i];
for (int j = 0; j < lines(i); ++j) {
Content::examine (job, calculate_digest);
shared_ptr<const Film> film = _film.lock ();
- assert (film);
+ DCPOMATIC_ASSERT (film);
shared_ptr<ImageExaminer> examiner (new ImageExaminer (film, shared_from_this(), job));
take_from_video_examiner (examiner);
ImageContent::full_length () const
{
shared_ptr<const Film> film = _film.lock ();
- assert (film);
+ DCPOMATIC_ASSERT (film);
return DCPTime (video_length_after_3d_combine(), FrameRateChange (video_frame_rate(), film->video_frame_rate()));
}
*/
-#include <dcp/util.h>
-#include <dcp/raw_convert.h>
#include "image_proxy.h"
#include "raw_image_proxy.h"
#include "magick_image_proxy.h"
#include "image.h"
#include "exceptions.h"
#include "cross.h"
+#include <dcp/util.h>
+#include <dcp/raw_convert.h>
+#include <libcxml/cxml.h>
#include "i18n.h"
shared_ptr<Piece> piece = ov.back ();
shared_ptr<VideoDecoder> decoder = dynamic_pointer_cast<VideoDecoder> (piece->decoder);
- assert (decoder);
+ DCPOMATIC_ASSERT (decoder);
shared_ptr<VideoContent> content = dynamic_pointer_cast<VideoContent> (piece->content);
- assert (content);
+ DCPOMATIC_ASSERT (content);
list<ContentVideo> content_video = decoder->get_video (dcp_to_content_video (piece, time), accurate);
if (content_video.empty ()) {
for (list<shared_ptr<Piece> >::iterator i = ov.begin(); i != ov.end(); ++i) {
shared_ptr<AudioContent> content = dynamic_pointer_cast<AudioContent> ((*i)->content);
- assert (content);
+ DCPOMATIC_ASSERT (content);
shared_ptr<AudioDecoder> decoder = dynamic_pointer_cast<AudioDecoder> ((*i)->decoder);
- assert (decoder);
+ DCPOMATIC_ASSERT (decoder);
if (content->audio_frame_rate() == 0) {
/* This AudioContent has no audio (e.g. if it is an FFmpegContent with no
PlayerVideo::j2k () const
{
shared_ptr<const J2KImageProxy> j2k = dynamic_pointer_cast<const J2KImageProxy> (_in);
- assert (j2k);
+ DCPOMATIC_ASSERT (j2k);
return j2k->j2k ();
}
++i;
}
- assert (i != _content.end ());
+ DCPOMATIC_ASSERT (i != _content.end ());
if (previous == _content.end ()) {
return;
}
++i;
}
- assert (i != _content.end ());
+ DCPOMATIC_ASSERT (i != _content.end ());
ContentList::iterator next = i;
++next;
*/
-#include <dcp/types.h>
#include "ratio.h"
#include "util.h"
+#include <dcp/types.h>
+#include <cfloat>
#include "i18n.h"
* @brief A class to describe one of FFmpeg's software scalers.
*/
-#include <iostream>
-#include <cassert>
+#include "dcpomatic_assert.h"
+#include "scaler.h"
extern "C" {
#include <libswscale/swscale.h>
}
-#include "scaler.h"
+#include <iostream>
+#include <cassert>
#include "i18n.h"
Scaler const *
Scaler::from_index (int i)
{
- assert (i <= int(_scalers.size ()));
+ DCPOMATIC_ASSERT (i <= int(_scalers.size ()));
return _scalers[i];
}
SndfileContent::full_length () const
{
shared_ptr<const Film> film = _film.lock ();
- assert (film);
+ DCPOMATIC_ASSERT (film);
return DCPTime (audio_length(), film->active_frame_rate_change (position ()));
}
SubRip s (shared_from_this ());
shared_ptr<const Film> film = _film.lock ();
- assert (film);
+ DCPOMATIC_ASSERT (film);
DCPTime len (s.length (), film->active_frame_rate_change (position ()));
string
SubRipContent::information () const
{
-
+
}
void
: Content (f, c)
{
shared_ptr<SubtitleContent> ref = dynamic_pointer_cast<SubtitleContent> (c[0]);
- assert (ref);
+ DCPOMATIC_ASSERT (ref);
list<shared_ptr<Font> > ref_fonts = ref->fonts ();
for (size_t i = 0; i < c.size(); ++i) {
return "4K";
}
- assert (false);
+ DCPOMATIC_ASSERT (false);
return "";
}
return RESOLUTION_4K;
}
- assert (false);
+ DCPOMATIC_ASSERT (false);
return RESOLUTION_2K;
}
int
round_to (float n, int r)
{
- assert (r == 1 || r == 2 || r == 4);
+ DCPOMATIC_ASSERT (r == 1 || r == 2 || r == 4);
return int (n + float(r) / 2) &~ (r - 1);
}
void
ensure_ui_thread ()
{
- assert (boost::this_thread::get_id() == ui_thread);
+ DCPOMATIC_ASSERT (boost::this_thread::get_id() == ui_thread);
}
string
audio_channel_name (int c)
{
- assert (MAX_DCP_AUDIO_CHANNELS == 12);
+ DCPOMATIC_ASSERT (MAX_DCP_AUDIO_CHANNELS == 12);
/// TRANSLATORS: these are the names of audio channels; Lfe (sub) is the low-frequency
/// enhancement channel (sub-woofer). HI is the hearing-impaired audio track and
#include "compose.hpp"
#include "types.h"
-#include "video_content.h"
+#include "exceptions.h"
+#include "dcpomatic_time.h"
#include <dcp/util.h>
extern "C" {
#include <libavcodec/avcodec.h>
int _timeout;
};
-extern int64_t video_frames_to_audio_frames (VideoContent::Frame v, float audio_sample_rate, float frames_per_second);
+extern int64_t video_frames_to_audio_frames (VideoFrame v, float audio_sample_rate, float frames_per_second);
/** @class ScopedTemporary
* @brief A temporary file which is deleted when the ScopedTemporary object goes out of scope.
, _video_length (0)
{
shared_ptr<VideoContent> ref = dynamic_pointer_cast<VideoContent> (c[0]);
- assert (ref);
+ DCPOMATIC_ASSERT (ref);
for (size_t i = 0; i < c.size(); ++i) {
shared_ptr<VideoContent> vc = dynamic_pointer_cast<VideoContent> (c[i]);
}
shared_ptr<const Film> film = _film.lock ();
- assert (film);
+ DCPOMATIC_ASSERT (film);
LOG_GENERAL ("Video length obtained from header as %1 frames", _video_length.frames (_video_frame_rate));
signal_changed (VideoContentProperty::VIDEO_SIZE);
return dcp::Size (s.width, s.height / 2);
}
- assert (false);
+ DCPOMATIC_ASSERT (false);
}
void
VideoContent::dcp_time_to_content_time (DCPTime t) const
{
shared_ptr<const Film> film = _film.lock ();
- assert (film);
+ DCPOMATIC_ASSERT (film);
return ContentTime (t, FrameRateChange (video_frame_rate(), film->video_frame_rate()));
}
VideoContent::scale_and_crop_to_fit_width ()
{
shared_ptr<const Film> film = _film.lock ();
- assert (film);
+ DCPOMATIC_ASSERT (film);
set_scale (VideoContentScale (film->container ()));
VideoContent::scale_and_crop_to_fit_height ()
{
shared_ptr<const Film> film = _film.lock ();
- assert (film);
+ DCPOMATIC_ASSERT (film);
set_scale (VideoContentScale (film->container ()));
optional<float>
VideoContent::fade (VideoFrame f) const
{
- assert (f >= 0);
+ DCPOMATIC_ASSERT (f >= 0);
if (f < fade_in().frames (video_frame_rate ())) {
return float (f) / _fade_in.frames (video_frame_rate ());
}
shared_ptr<const Film> film = _film.lock ();
- assert (film);
+ DCPOMATIC_ASSERT (film);
dcp::Size const container_size = film->frame_size ();
dcp::Size const scaled = scale().size (dynamic_pointer_cast<const VideoContent> (shared_from_this ()), container_size, container_size, 1);
class VideoContent : public virtual Content
{
public:
- typedef int Frame;
-
VideoContent (boost::shared_ptr<const Film>);
VideoContent (boost::shared_ptr<const Film>, DCPTime, ContentTime);
VideoContent (boost::shared_ptr<const Film>, boost::filesystem::path);
*/
#include "video_content_scale.h"
+#include "video_content.h"
#include "ratio.h"
#include "safe_stringstream.h"
#include "util.h"
to_push.push_back (ContentVideo (image, EYES_RIGHT, PART_WHOLE, frame));
break;
default:
- assert (false);
+ DCPOMATIC_ASSERT (false);
}
/* Now VideoDecoder is required never to have gaps in the frames that it presents
boost::filesystem::remove_all (_film->dir (_film->dcp_name ()));
shared_ptr<Job> job = _job.lock ();
- assert (job);
+ DCPOMATIC_ASSERT (job);
job->sub (_("Checking existing image data"));
check_existing_picture_mxf ();
_last_written_eyes = qi.eyes;
shared_ptr<Job> job = _job.lock ();
- assert (job);
+ DCPOMATIC_ASSERT (job);
int64_t total = _film->length().frames (_film->video_frame_rate ());
if (_film->three_d ()) {
/* _full_written and so on are incremented for each eye, so we need to double the total
++i;
}
- assert (i != _queue.rend());
+ DCPOMATIC_ASSERT (i != _queue.rend());
QueueItem qi = *i;
++_pushed_to_disk;
cpl->add (reel);
shared_ptr<Job> job = _job.lock ();
- assert (job);
+ DCPOMATIC_ASSERT (job);
job->sub (_("Computing image digest"));
_picture_mxf->hash (boost::bind (&Job::set_progress, job.get(), _1, false));
while (true) {
shared_ptr<Job> job = _job.lock ();
- assert (job);
+ DCPOMATIC_ASSERT (job);
if (N > 0) {
job->set_progress (float (_first_nonexistant_frame) / N);
++c;
}
- assert (c < MAX_DCP_AUDIO_CHANNELS);
+ DCPOMATIC_ASSERT (c < MAX_DCP_AUDIO_CHANNELS);
_plot->set_channel_visible (c, _channel_checkbox[c]->GetValue ());
}
++t;
}
- assert (t < AudioPoint::COUNT);
+ DCPOMATIC_ASSERT (t < AudioPoint::COUNT);
_plot->set_type_visible (t, _type_checkbox[t]->GetValue ());
}
}
}
- assert (fc.size() > 1);
+ DCPOMATIC_ASSERT (fc.size() > 1);
shared_ptr<Film> film = _film.lock ();
if (!film) {
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."));
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);
}
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]);
}
}
}
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);
}
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]);
*/
-#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;
KDMDialog::cpl () const
{
int const item = _cpl->GetSelection ();
- assert (item >= 0);
+ DCPOMATIC_ASSERT (item >= 0);
return _cpls[item].cpl_file;
}
}
SubtitleContentList c = _parent->selected_subtitle ();
- assert (c.size() == 1);
+ DCPOMATIC_ASSERT (c.size() == 1);
shared_ptr<SubtitleDecoder> decoder;
}
SubtitleContentList c = _parent->selected_subtitle ();
- assert (c.size() == 1);
+ DCPOMATIC_ASSERT (c.size() == 1);
_fonts_dialog = new FontsDialog (this, c.front ());
_fonts_dialog->Show ();
dcpomatic::Rect<int> bbox () const
{
- assert (_track);
+ DCPOMATIC_ASSERT (_track);
shared_ptr<const Film> film = _timeline.film ();
shared_ptr<const Content> content = _content.lock ();
void do_paint (wxGraphicsContext* gc)
{
- assert (_track);
+ DCPOMATIC_ASSERT (_track);
shared_ptr<const Film> film = _timeline.film ();
shared_ptr<const Content> cont = content ();
_down_view->content()->set_position (new_position);
shared_ptr<Film> film = _film.lock ();
- assert (film);
+ DCPOMATIC_ASSERT (film);
film->set_sequence_video (false);
}
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];
}
}
}
- assert (false);
+ DCPOMATIC_ASSERT (false);
}
VideoPanel::VideoPanel (ContentPanel* p)