*/
-#include "util.h"
#include "audio_buffers.h"
#include "dcpomatic_assert.h"
+#include "maths_util.h"
#include <cassert>
#include <cstring>
#include <cmath>
#include "exceptions.h"
#include "film.h"
#include "frame_rate_change.h"
+#include "maths_util.h"
#include <dcp/raw_convert.h>
#include <libcxml/cxml.h>
#include <libxml++/libxml++.h>
#include "font.h"
#include "font_data.h"
#include "hints.h"
+#include "maths_util.h"
#include "player.h"
#include "ratio.h"
#include "text_content.h"
#include "types.h"
-#include "util.h"
#include "video_content.h"
#include "writer.h"
#include <dcp/cpl.h>
#include "compose.hpp"
+#include "dcpomatic_assert.h"
#include "dcpomatic_socket.h"
#include "exceptions.h"
#include "image.h"
+#include "maths_util.h"
#include "rect.h"
#include "timer.h"
#include "util.h"
--- /dev/null
+/*
+ Copyright (C) 2012-2021 Carl Hetherington <cth@carlh.net>
+
+ This file is part of DCP-o-matic.
+
+ DCP-o-matic is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ DCP-o-matic is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with DCP-o-matic. If not, see <http://www.gnu.org/licenses/>.
+
+*/
+
+
+#include <cmath>
+
+
+double
+db_to_linear (double db)
+{
+ return pow(10, db / 20);
+}
+
+
+double
+linear_to_db (double linear)
+{
+ return 20 * log10(linear);
+}
+
--- /dev/null
+/*
+ Copyright (C) 2012-2021 Carl Hetherington <cth@carlh.net>
+
+ This file is part of DCP-o-matic.
+
+ DCP-o-matic is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ DCP-o-matic is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with DCP-o-matic. If not, see <http://www.gnu.org/licenses/>.
+
+*/
+
+
+#include <algorithm>
+
+
+#ifndef M_PI
+#define M_PI (3.14159265358979323846)
+#endif
+
+
+extern double db_to_linear (double db);
+extern double linear_to_db (double linear);
+
+
+template <class T>
+T clamp (T val, T minimum, T maximum)
+{
+ return std::max(std::min(val, maximum), minimum);
+}
+
#include "image_decoder.h"
#include "job.h"
#include "log.h"
+#include "maths_util.h"
#include "piece.h"
#include "player.h"
#include "player_video.h"
free (buffer);
}
-double
-db_to_linear (double db)
-{
- return pow(10, db / 20);
-}
-
-double
-linear_to_db (double linear)
-{
- return 20 * log10(linear);
-}
-
dcp::Size
scale_for_display (dcp::Size s, dcp::Size display_container, dcp::Size film_container, PixelQuanta quanta)
class SoundAsset;
}
-#ifndef M_PI
-#define M_PI (3.14159265358979323846)
-#endif
-
/** The maximum number of audio channels that we can have in a DCP */
#define MAX_DCP_AUDIO_CHANNELS 16
/** Message broadcast to find possible encoding servers */
return l;
}
-extern double db_to_linear (double db);
-extern double linear_to_db (double linear);
-
-
-template <class T>
-T clamp (T val, T minimum, T maximum)
-{
- return std::max(std::min(val, maximum), minimum);
-}
-
-
#endif
kdm_with_metadata.cc
log.cc
log_entry.cc
+ maths_util.cc
mid_side_decoder.cc
overlaps.cc
pixel_quanta.cc
*/
+
#include "audio_dialog.h"
#include "audio_plot.h"
#include "check_box.h"
#include "lib/audio_content.h"
#include "lib/film.h"
#include "lib/job_manager.h"
+#include "lib/maths_util.h"
#include <libxml++/libxml++.h>
#include <boost/filesystem.hpp>
#include <iostream>
+
using std::cout;
using std::list;
using std::make_shared;
using namespace boost::placeholders;
#endif
+
/** @param parent Parent window.
* @param film Film we are using.
* @param content Content to analyse, or 0 to analyse all of the film's audio.
*/
+
#include "audio_gain_dialog.h"
#include "wx_util.h"
-#include "lib/util.h"
-#include <cmath>
+#include "lib/maths_util.h"
#include <wx/spinctrl.h>
+#include <cmath>
+
AudioGainDialog::AudioGainDialog (wxWindow* parent, int c, int d, float v)
: TableDialog (parent, _("Channel gain"), 3, 1, true)
*/
+#include "audio_gain_dialog.h"
#include "audio_mapping_view.h"
#include "wx_util.h"
-#include "audio_gain_dialog.h"
#include "lib/audio_mapping.h"
-#include "lib/util.h"
+#include "lib/maths_util.h"
#include "lib/warnings.h"
#include <dcp/locale_convert.h>
#include <dcp/types.h>
using std::cout;
using std::list;
-using std::string;
-using std::min;
+using std::make_pair;
using std::max;
-using std::vector;
+using std::min;
using std::pair;
-using std::make_pair;
using std::shared_ptr;
+using std::string;
+using std::vector;
using boost::optional;
#if BOOST_VERSION >= 106100
using namespace boost::placeholders;
#include "lib/job_manager.h"
#include "lib/dcp_content.h"
#include "lib/audio_content.h"
+#include "lib/maths_util.h"
#include <wx/spinctrl.h>
#include <iostream>
#include "audio_plot.h"
-#include "wx_util.h"
#include "film_viewer.h"
+#include "wx_util.h"
#include "lib/audio_decoder.h"
#include "lib/audio_analysis.h"
#include "lib/compose.hpp"
+#include "lib/maths_util.h"
#include <wx/graphics.h>
#include <boost/bind/bind.hpp>
-#include <iostream>
#include <cfloat>
+#include <iostream>
using std::cout;
-using std::vector;
using std::list;
+using std::map;
using std::max;
using std::min;
-using std::map;
-using boost::bind;
-using boost::optional;
using std::shared_ptr;
+using std::vector;
using std::weak_ptr;
+using boost::bind;
+using boost::optional;
#if BOOST_VERSION >= 106100
using namespace boost::placeholders;
#endif