From 8caed20c973636343a8a337dc78b34a399b74d78 Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Wed, 17 Mar 2010 16:01:58 +0000 Subject: [PATCH] fixes for various consistency/settings issues in monitor section; minor edit to PACKAGER_README git-svn-id: svn://localhost/ardour2/branches/3.0@6771 d708f5d6-7413-0410-9779-e7cbd77b26cf --- PACKAGER_README | 4 +- gtk2_ardour/monitor_section.cc | 76 ++++++++++++++++++++++---------- libs/ardour/ardour/debug.h | 1 + libs/ardour/debug.cc | 1 + libs/ardour/monitor_processor.cc | 31 ++++++++++--- 5 files changed, 81 insertions(+), 32 deletions(-) diff --git a/PACKAGER_README b/PACKAGER_README index 3b797d3c58..a6c018800a 100644 --- a/PACKAGER_README +++ b/PACKAGER_README @@ -1,6 +1,6 @@ (1) VST SUPPORT -Please do not distribution Ardour with VST support under the package +Please do not distribute Ardour with VST support under the package name "ardour" (or any case-variant on that). Use some other name such as "ardourvst", "ArdourVST", "ardour-vst" etc. In the near future, work will be done to make it possible to share as much as possible of @@ -9,4 +9,4 @@ the packaging. (2) STANDARD TEMPLATES The templates in ./templates are intended for installation in -$prefix/share/ardour2/templates. +$prefix/share/ardour3/templates. diff --git a/gtk2_ardour/monitor_section.cc b/gtk2_ardour/monitor_section.cc index ca40dc614a..8909a1649c 100644 --- a/gtk2_ardour/monitor_section.cc +++ b/gtk2_ardour/monitor_section.cc @@ -692,35 +692,32 @@ MonitorSection::map_state () } } - act = ActionManager::get_action (X_("Monitor"), "monitor-solo"); - if (act) { - Glib::RefPtr ract = Glib::RefPtr::cast_dynamic (act); - if (ract) { - ract->set_active (_monitor->mono()); - } - } - act = ActionManager::get_action (X_("Monitor"), "monitor-cut-all"); if (act) { - Glib::RefPtr ract = Glib::RefPtr::cast_dynamic (act); - if (ract) { - ract->set_active (_monitor->cut_all()); + Glib::RefPtr tact = Glib::RefPtr::cast_dynamic (act); + if (tact) { + cerr << "Set monitor cut all action to " << _monitor->cut_all () << endl; + tact->set_active (_monitor->cut_all()); + } else { + cerr << " no global cut action\n"; } + } else { + cerr << " no global cut action2\n"; } act = ActionManager::get_action (X_("Monitor"), "monitor-dim-all"); if (act) { - Glib::RefPtr ract = Glib::RefPtr::cast_dynamic (act); - if (ract) { - ract->set_active (_monitor->dim_all()); + Glib::RefPtr tact = Glib::RefPtr::cast_dynamic (act); + if (tact) { + tact->set_active (_monitor->dim_all()); } } - + act = ActionManager::get_action (X_("Monitor"), "monitor-mono"); if (act) { - Glib::RefPtr ract = Glib::RefPtr::cast_dynamic (act); - if (ract) { - ract->set_active (_monitor->mono()); + Glib::RefPtr tact = Glib::RefPtr::cast_dynamic (act); + if (tact) { + tact->set_active (_monitor->mono()); } } @@ -729,11 +726,44 @@ MonitorSection::map_state () assert (nchans == _channel_buttons.size ()); for (uint32_t n = 0; n < nchans; ++n) { - ChannelButtonSet* cbs = _channel_buttons[n]; - cbs->cut.set_active (_monitor->cut (n)); - cbs->dim.set_active (_monitor->dimmed (n)); - cbs->solo.set_active (_monitor->soloed (n)); - cbs->invert.set_active (_monitor->inverted (n)); + + char action_name[32]; + + snprintf (action_name, sizeof (action_name), "monitor-cut-%u", n+1); + act = ActionManager::get_action (X_("Monitor"), action_name); + if (act) { + Glib::RefPtr tact = Glib::RefPtr::cast_dynamic (act); + if (tact) { + tact->set_active (_monitor->cut (n)); + } + } + + snprintf (action_name, sizeof (action_name), "monitor-dim-%u", n+1); + act = ActionManager::get_action (X_("Monitor"), action_name); + if (act) { + Glib::RefPtr tact = Glib::RefPtr::cast_dynamic (act); + if (tact) { + tact->set_active (_monitor->dimmed (n)); + } + } + + snprintf (action_name, sizeof (action_name), "monitor-solo-%u", n+1); + act = ActionManager::get_action (X_("Monitor"), action_name); + if (act) { + Glib::RefPtr tact = Glib::RefPtr::cast_dynamic (act); + if (tact) { + tact->set_active (_monitor->soloed (n)); + } + } + + snprintf (action_name, sizeof (action_name), "monitor-invert-%u", n+1); + act = ActionManager::get_action (X_("Monitor"), action_name); + if (act) { + Glib::RefPtr tact = Glib::RefPtr::cast_dynamic (act); + if (tact) { + tact->set_active (_monitor->inverted (n)); + } + } } } diff --git a/libs/ardour/ardour/debug.h b/libs/ardour/ardour/debug.h index 5b4405b7d8..e2f3ff2c49 100644 --- a/libs/ardour/ardour/debug.h +++ b/libs/ardour/ardour/debug.h @@ -44,6 +44,7 @@ namespace PBD { extern uint64_t MidiIO; extern uint64_t MackieControl; extern uint64_t MidiClock; + extern uint64_t Monitor; } } diff --git a/libs/ardour/debug.cc b/libs/ardour/debug.cc index d169850694..b329350006 100644 --- a/libs/ardour/debug.cc +++ b/libs/ardour/debug.cc @@ -41,4 +41,5 @@ uint64_t PBD::DEBUG::SessionEvents = PBD::new_debug_bit ("sessionevents"); uint64_t PBD::DEBUG::MidiIO = PBD::new_debug_bit ("midiio"); uint64_t PBD::DEBUG::MackieControl = PBD::new_debug_bit ("mackiecontrol"); uint64_t PBD::DEBUG::MidiClock = PBD::new_debug_bit ("midiclock"); +uint64_t PBD::DEBUG::Monitor = PBD::new_debug_bit ("monitor"); diff --git a/libs/ardour/monitor_processor.cc b/libs/ardour/monitor_processor.cc index f7dbd7bfdb..aa1609a844 100644 --- a/libs/ardour/monitor_processor.cc +++ b/libs/ardour/monitor_processor.cc @@ -4,6 +4,7 @@ #include "ardour/amp.h" #include "ardour/dB.h" +#include "ardour/debug.h" #include "ardour/audio_buffer.h" #include "ardour/monitor_processor.h" #include "ardour/session.h" @@ -243,6 +244,20 @@ MonitorProcessor::run (BufferSet& bufs, sframes_t /*start_frame*/, sframes_t /*e } } + DEBUG_TRACE (DEBUG::Monitor, + string_compose("channel %1 sb %2 gc %3 gd %4 cd %5 dl %6 cp %7 cc %8 cs %9 sc %10 TG %11\n", + chn, + solo_boost, + global_cut, + global_dim, + _channels[chn].dim, + dim_level, + _channels[chn].polarity, + _channels[chn].cut, + _channels[chn].soloed, + solo_cnt, + target_gain)); + if (target_gain != _channels[chn].current_gain || target_gain != 1.0f) { Amp::apply_gain (*b, nframes, _channels[chn].current_gain, target_gain); @@ -331,13 +346,15 @@ MonitorProcessor::set_cut (uint32_t chn, bool yn) void MonitorProcessor::set_solo (uint32_t chn, bool solo) { - _channels[chn].soloed = solo; - - if (solo) { - solo_cnt++; - } else { - if (solo_cnt > 0) { - solo_cnt--; + if (solo != _channels[chn].soloed) { + _channels[chn].soloed = solo; + + if (solo) { + solo_cnt++; + } else { + if (solo_cnt > 0) { + solo_cnt--; + } } } }