mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-17 20:26:30 +01:00
restore independent gain control over click/metronome
git-svn-id: svn://localhost/ardour2/branches/3.0@11370 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
parent
d17918e32e
commit
19ebdba1cb
6 changed files with 55 additions and 20 deletions
|
|
@ -923,6 +923,14 @@ RCOptionEditor::RCOptionEditor ()
|
||||||
|
|
||||||
add_option (_("Misc"), new ClickOptions (_rc_config, this));
|
add_option (_("Misc"), new ClickOptions (_rc_config, this));
|
||||||
|
|
||||||
|
add_option (_("Misc"),
|
||||||
|
new FaderOption (
|
||||||
|
"click-gain",
|
||||||
|
_("Click Gain Level"),
|
||||||
|
sigc::mem_fun (*_rc_config, &RCConfiguration::get_click_gain),
|
||||||
|
sigc::mem_fun (*_rc_config, &RCConfiguration::set_click_gain)
|
||||||
|
));
|
||||||
|
|
||||||
/* TRANSPORT */
|
/* TRANSPORT */
|
||||||
|
|
||||||
add_option (_("Transport"),
|
add_option (_("Transport"),
|
||||||
|
|
|
||||||
|
|
@ -107,6 +107,7 @@ CONFIG_VARIABLE (bool, quieten_at_speed, "quieten-at-speed", true)
|
||||||
CONFIG_VARIABLE (bool, clicking, "clicking", false)
|
CONFIG_VARIABLE (bool, clicking, "clicking", false)
|
||||||
CONFIG_VARIABLE (std::string, click_sound, "click-sound", "")
|
CONFIG_VARIABLE (std::string, click_sound, "click-sound", "")
|
||||||
CONFIG_VARIABLE (std::string, click_emphasis_sound, "click-emphasis-sound", "")
|
CONFIG_VARIABLE (std::string, click_emphasis_sound, "click-emphasis-sound", "")
|
||||||
|
CONFIG_VARIABLE (gain_t, click_gain, "click-gain", 1.0)
|
||||||
|
|
||||||
/* transport control and related */
|
/* transport control and related */
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -85,6 +85,7 @@ namespace Evoral {
|
||||||
|
|
||||||
namespace ARDOUR {
|
namespace ARDOUR {
|
||||||
|
|
||||||
|
class Amp;
|
||||||
class AudioEngine;
|
class AudioEngine;
|
||||||
class AudioFileSource;
|
class AudioFileSource;
|
||||||
class AudioRegion;
|
class AudioRegion;
|
||||||
|
|
@ -723,6 +724,7 @@ class Session : public PBD::StatefulDestructible, public PBD::ScopedConnectionLi
|
||||||
/* clicking */
|
/* clicking */
|
||||||
|
|
||||||
boost::shared_ptr<IO> click_io() { return _click_io; }
|
boost::shared_ptr<IO> click_io() { return _click_io; }
|
||||||
|
boost::shared_ptr<Amp> click_gain() { return _click_gain; }
|
||||||
|
|
||||||
/* disk, buffer loads */
|
/* disk, buffer loads */
|
||||||
|
|
||||||
|
|
@ -1380,6 +1382,7 @@ class Session : public PBD::StatefulDestructible, public PBD::ScopedConnectionLi
|
||||||
Clicks clicks;
|
Clicks clicks;
|
||||||
bool _clicking;
|
bool _clicking;
|
||||||
boost::shared_ptr<IO> _click_io;
|
boost::shared_ptr<IO> _click_io;
|
||||||
|
boost::shared_ptr<Amp> _click_gain;
|
||||||
Sample* click_data;
|
Sample* click_data;
|
||||||
Sample* click_emphasis_data;
|
Sample* click_emphasis_data;
|
||||||
framecnt_t click_length;
|
framecnt_t click_length;
|
||||||
|
|
|
||||||
|
|
@ -377,18 +377,26 @@ Session::when_engine_running ()
|
||||||
XMLNode* child = 0;
|
XMLNode* child = 0;
|
||||||
|
|
||||||
_click_io.reset (new ClickIO (*this, "click"));
|
_click_io.reset (new ClickIO (*this, "click"));
|
||||||
|
_click_gain.reset (new Amp (*this));
|
||||||
|
_click_gain->activate ();
|
||||||
|
|
||||||
if (state_tree && (child = find_named_node (*state_tree->root(), "Click")) != 0) {
|
if (state_tree && (child = find_named_node (*state_tree->root(), "Click")) != 0) {
|
||||||
|
|
||||||
/* existing state for Click */
|
/* existing state for Click */
|
||||||
int c;
|
int c = 0;
|
||||||
|
|
||||||
if (Stateful::loading_state_version < 3000) {
|
if (Stateful::loading_state_version < 3000) {
|
||||||
c = _click_io->set_state_2X (*child->children().front(), Stateful::loading_state_version, false);
|
c = _click_io->set_state_2X (*child->children().front(), Stateful::loading_state_version, false);
|
||||||
} else {
|
} else {
|
||||||
c = _click_io->set_state (*child->children().front(), Stateful::loading_state_version);
|
const XMLNodeList& children (child->children());
|
||||||
|
XMLNodeList::const_iterator i = children.begin();
|
||||||
|
if ((c = _click_io->set_state (**i, Stateful::loading_state_version)) == 0) {
|
||||||
|
++i;
|
||||||
|
if (i != children.end()) {
|
||||||
|
c = _click_gain->set_state (**i, Stateful::loading_state_version);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if (c == 0) {
|
if (c == 0) {
|
||||||
_clicking = Config->get_clicking ();
|
_clicking = Config->get_clicking ();
|
||||||
|
|
|
||||||
|
|
@ -20,6 +20,7 @@
|
||||||
#include <list>
|
#include <list>
|
||||||
#include <cerrno>
|
#include <cerrno>
|
||||||
|
|
||||||
|
#include "ardour/amp.h"
|
||||||
#include "ardour/ardour.h"
|
#include "ardour/ardour.h"
|
||||||
#include "ardour/audio_buffer.h"
|
#include "ardour/audio_buffer.h"
|
||||||
#include "ardour/buffer_set.h"
|
#include "ardour/buffer_set.h"
|
||||||
|
|
@ -131,6 +132,7 @@ Session::click (framepos_t start, framecnt_t nframes)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
_click_gain->run (bufs, 0, 0, nframes, false);
|
||||||
_click_io->copy_to_outputs (bufs, DataType::AUDIO, nframes, 0);
|
_click_io->copy_to_outputs (bufs, DataType::AUDIO, nframes, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1167,15 +1167,16 @@ Session::state(bool full_state)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (_click_io) {
|
if (_click_io) {
|
||||||
child = node->add_child ("Click");
|
XMLNode* gain_child = node->add_child ("Click");
|
||||||
child->add_child_nocopy (_click_io->state (full_state));
|
gain_child->add_child_nocopy (_click_io->state (full_state));
|
||||||
|
gain_child->add_child_nocopy (_click_gain->state (full_state));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (full_state) {
|
if (full_state) {
|
||||||
child = node->add_child ("NamedSelections");
|
XMLNode* ns_child = node->add_child ("NamedSelections");
|
||||||
for (NamedSelectionList::iterator i = named_selections.begin(); i != named_selections.end(); ++i) {
|
for (NamedSelectionList::iterator i = named_selections.begin(); i != named_selections.end(); ++i) {
|
||||||
if (full_state) {
|
if (full_state) {
|
||||||
child->add_child_nocopy ((*i)->get_state());
|
ns_child->add_child_nocopy ((*i)->get_state());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -1409,7 +1410,13 @@ Session::set_state (const XMLNode& node, int version)
|
||||||
if ((child = find_named_node (node, "Click")) == 0) {
|
if ((child = find_named_node (node, "Click")) == 0) {
|
||||||
warning << _("Session: XML state has no click section") << endmsg;
|
warning << _("Session: XML state has no click section") << endmsg;
|
||||||
} else if (_click_io) {
|
} else if (_click_io) {
|
||||||
_click_io->set_state (*child, version);
|
const XMLNodeList& children (child->children());
|
||||||
|
XMLNodeList::const_iterator i = children.begin();
|
||||||
|
_click_io->set_state (**i, version);
|
||||||
|
++i;
|
||||||
|
if (i != children.end()) {
|
||||||
|
_click_gain->set_state (**i, version);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((child = find_named_node (node, "ControlProtocols")) != 0) {
|
if ((child = find_named_node (node, "ControlProtocols")) != 0) {
|
||||||
|
|
@ -3481,6 +3488,12 @@ Session::config_changed (std::string p, bool ours)
|
||||||
_clicking = false;
|
_clicking = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
} else if (p == "click-gain") {
|
||||||
|
|
||||||
|
if (_click_gain) {
|
||||||
|
_click_gain->set_gain (Config->get_click_gain(), this);
|
||||||
|
}
|
||||||
|
|
||||||
} else if (p == "send-mtc") {
|
} else if (p == "send-mtc") {
|
||||||
|
|
||||||
if (Config->get_send_mtc ()) {
|
if (Config->get_send_mtc ()) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue