13
0

Add option for record-only metronome.

This commit is contained in:
Robin Gareus 2017-04-01 23:52:43 +02:00
parent 4b1c288f87
commit 5ebe6fcde8
5 changed files with 11 additions and 0 deletions

View File

@ -147,6 +147,7 @@ CONFIG_VARIABLE (std::string, midi_audition_synth_uri, "midi-audition-synth-uri"
/* click */
CONFIG_VARIABLE (bool, clicking, "clicking", false)
CONFIG_VARIABLE (bool, click_record_only, "click-record-only", false)
CONFIG_VARIABLE (std::string, click_sound, "click-sound", "")
CONFIG_VARIABLE (std::string, click_emphasis_sound, "click-emphasis-sound", "")
CONFIG_VARIABLE (gain_t, click_gain, "click-gain", 1.0)

View File

@ -1896,6 +1896,7 @@ class LIBARDOUR_API Session : public PBD::StatefulDestructible, public PBD::Scop
typedef std::list<Click*> Clicks;
Clicks clicks;
bool _clicking;
bool _click_rec_only;
boost::shared_ptr<IO> _click_io;
boost::shared_ptr<Amp> _click_gain;
Sample* click_data;

View File

@ -295,6 +295,7 @@ Session::Session (AudioEngine &eng,
, _bundle_xml_node (0)
, _current_trans (0)
, _clicking (false)
, _click_rec_only (false)
, click_data (0)
, click_emphasis_data (0)
, click_length (0)

View File

@ -75,6 +75,10 @@ Session::click (framepos_t start, framecnt_t nframes)
return;
}
if (_click_rec_only && !actively_recording()) {
return;
}
start -= _worst_track_latency;
/* start could be negative at this point */
const framepos_t end = start + nframes;

View File

@ -4049,6 +4049,10 @@ Session::config_changed (std::string p, bool ours)
_clicking = false;
}
} else if (p == "click-record-only") {
_click_rec_only = Config->get_click_record_only();
} else if (p == "click-gain") {
if (_click_gain) {