26 #include "ardour/debug.h"
41 bool newval = fabs (v) >= 0.5;
42 if (newval != _value) {
64 , _dim_all_control (_dim_all_ptr)
65 , _cut_all_control (_cut_all_ptr)
66 , _mono_control (_mono_ptr)
67 , _dim_level_control (_dim_level_ptr)
68 , _solo_boost_level_control (_solo_boost_level_ptr)
70 , _dim_all (*_dim_all_ptr)
71 , _cut_all (*_cut_all_ptr)
73 , _dim_level (*_dim_level_ptr)
74 , _solo_boost_level (*_solo_boost_level_ptr)
116 if ((prop = node.
property (
X_(
"type"))) == 0) {
117 error <<
string_compose (
X_(
"programming error: %1"),
X_(
"MonitorProcessor XML settings have no type information"))
122 if (prop->
value() !=
X_(
"monitor")) {
128 if ((prop = node.
property (
X_(
"channels"))) == 0) {
129 error <<
string_compose (
X_(
"programming error: %1"),
X_(
"MonitorProcessor XML settings are missing a channel cnt"))
136 if ((prop = node.
property (
X_(
"dim-level"))) != 0) {
141 if ((prop = node.
property (
X_(
"solo-boost-level"))) != 0) {
146 if ((prop = node.
property (
X_(
"cut-all"))) != 0) {
150 if ((prop = node.
property (
X_(
"dim-all"))) != 0) {
154 if ((prop = node.
property (
X_(
"mono"))) != 0) {
159 for (XMLNodeList::const_iterator i = node.
children().begin(); i != node.
children().end(); ++i) {
161 if ((*i)->name() ==
X_(
"Channel")) {
162 if ((prop = (*i)->property (
X_(
"id"))) == 0) {
170 if (sscanf (prop->
value().c_str(),
"%u", &chn) != 1) {
171 error <<
string_compose (
X_(
"programming error: %1"),
X_(
"MonitorProcessor XML settings has an unreadable channel ID"))
177 error <<
string_compose (
X_(
"programming error: %1"),
X_(
"MonitorProcessor XML settings has an illegal channel count"))
183 if ((prop = (*i)->property (
"cut")) != 0) {
191 if ((prop = (*i)->property (
"dim")) != 0) {
196 if ((prop = (*i)->property (
"invert")) != 0) {
204 if ((prop = (*i)->property (
"solo")) != 0) {
215 for (vector<ChannelRecord*>::const_iterator x =
_channels.begin(); x !=
_channels.end(); ++x) {
247 snprintf (buf,
sizeof (buf),
"%u", limit);
253 for (vector<ChannelRecord*>::const_iterator x =
_channels.begin(); x !=
_channels.end(); ++x, ++chn) {
256 snprintf (buf,
sizeof (buf),
"%u", chn);
293 target_gain =
_channels[chn]->polarity *
_channels[chn]->cut * dim_level * global_cut * global_dim * solo_boost;
296 target_gain =
_channels[chn]->polarity *
_channels[chn]->cut * dim_level * global_cut * global_dim * solo_boost;
315 gain_t scale = 1.f / (float)chn;
322 for (
pframes_t n = 0; n < nframes; ++n) {
332 for (
pframes_t n = 0; n < nframes; ++n) {
333 buf[n] += obuf[n] * scale;
344 memcpy (obuf, buf,
sizeof (
Sample) * nframes);
516 , cut_control (cut_ptr)
517 , dim_control (dim_ptr)
518 , polarity_control (polarity_ptr)
519 , soloed_control (soloed_ptr)
523 , polarity (*polarity_ptr)
524 , soloed (*soloed_ptr)
bool can_support_io_configuration(const ChanCount &in, ChanCount &out)
framecnt_t nominal_frame_rate() const
ARDOUR::Session & _session
bool inverted(uint32_t chn) const
int atoi(const string &s)
const std::string & value() const
boost::shared_ptr< PBD::Controllable > channel_polarity_control(uint32_t) const
MPControl< gain_t > & cut
void set_cut(uint32_t, bool cut)
bool configure_io(ChanCount in, ChanCount out)
boost::shared_ptr< PBD::Controllable > channel_cut_control(uint32_t) const
LIBARDOUR_API uint64_t Monitor
LIBPBD_API Transmitter error
const XMLNodeList & children(const std::string &str=std::string()) const
bool cut(uint32_t chn) const
MPControl< bool > & _dim_all
std::ostream & endmsg(std::ostream &ostr)
int set_state(const XMLNode &, int version)
MPControl< volatile gain_t > & _dim_level
bool soloed(uint32_t chn) const
XMLProperty * property(const char *)
bool string_is_affirmative(const std::string &str)
MPControl< bool > & _cut_all
audio_iterator audio_begin()
bool display_to_user() const
bool dimmed(uint32_t chn) const
void set_solo(uint32_t, bool)
virtual bool configure_io(ChanCount in, ChanCount out)
#define DEBUG_TRACE(bits, str)
void set_dim(uint32_t, bool dim)
audio_iterator audio_end()
MPControl< bool > & _mono
XMLProperty * add_property(const char *name, const std::string &value)
int set_state(const XMLNode &, int)
void allocate_channels(uint32_t)
void add_child_nocopy(XMLNode &)
MPControl< bool > & soloed
std::vector< ChannelRecord * > _channels
LIBARDOUR_API PBD::PropertyDescriptor< bool > solo
MPControl< volatile gain_t > & _solo_boost_level
void set_polarity(uint32_t, bool invert)
virtual XMLNode & state(bool full)
static float dB_to_coefficient(float dB)
MonitorProcessor(Session &)
boost::shared_ptr< PBD::Controllable > channel_dim_control(uint32_t) const
const Sample * data(framecnt_t offset=0) const
boost::shared_ptr< PBD::Controllable > channel_solo_control(uint32_t) const
XMLNode & state(bool full)
void run(BufferSet &, framepos_t, framepos_t, pframes_t, bool)
MPControl< gain_t > & polarity
std::string string_compose(const std::string &fmt, const T1 &o1)
double atof(const string &s)