move default_triggers_per_box into a namespace ; change value for Ardour to 16

This commit is contained in:
Paul Davis 2022-10-04 19:55:05 -06:00
parent 34d339ab5d
commit 3c0820e36e
4 changed files with 12 additions and 8 deletions

View File

@ -707,6 +707,13 @@ typedef PBD::RingBuffer<CueRecord> CueRecords;
class LIBARDOUR_API TriggerBox : public Processor
{
public:
#ifdef MIXBUS
static const int32_t default_triggers_per_box = 8;
#else
static const int32_t default_triggers_per_box = 16;
#endif
TriggerBox (Session&, DataType dt);
~TriggerBox ();

View File

@ -839,9 +839,6 @@ enum CueBehavior {
typedef std::vector<CaptureInfo*> CaptureInfos;
const int32_t default_triggers_per_box = 8;
struct FollowAction {
enum Type {
None,

View File

@ -3066,11 +3066,11 @@ TriggerBox::TriggerBox (Session& s, DataType dt)
/* default number of possible triggers. call ::add_trigger() to increase */
if (_data_type == DataType::AUDIO) {
for (uint32_t n = 0; n < default_triggers_per_box; ++n) {
for (uint32_t n = 0; n < TriggerBox::default_triggers_per_box; ++n) {
all_triggers.push_back (boost::make_shared<AudioTrigger> (n, *this));
}
} else {
for (uint32_t n = 0; n < default_triggers_per_box; ++n) {
for (uint32_t n = 0; n < TriggerBox::default_triggers_per_box; ++n) {
all_triggers.push_back (boost::make_shared<MIDITrigger> (n, *this));
}
}
@ -4369,7 +4369,7 @@ TriggerBox::determine_next_trigger (uint32_t current)
uint32_t runnable = 0;
std::vector<int32_t> possible_targets;
possible_targets.reserve (default_triggers_per_box);
possible_targets.reserve (TriggerBox::default_triggers_per_box);
/* count number of triggers that can actually be run (i.e. they have a region) */
@ -4481,7 +4481,7 @@ TriggerBox::determine_next_trigger (uint32_t current)
break;
case FollowAction::JumpTrigger:
for (std::size_t n = 0; n < default_triggers_per_box; ++n) {
for (std::size_t n = 0; n < TriggerBox::default_triggers_per_box; ++n) {
if (fa.targets.test (n) && all_triggers[n]->region()) {
possible_targets.push_back (n);
}

View File

@ -957,7 +957,7 @@ FollowActionIcon::render (ArdourCanvas::Rect const & area, Cairo::RefPtr<Cairo::
case FollowAction::JumpTrigger:
if (trigger->follow_action0().targets.count() == 1 ) { //Jump to a specific row; just draw the letter of the row we are jumping to
int cue_idx = -1;
for (int i = 0; i < default_triggers_per_box; i++) {
for (int i = 0; i < TriggerBox::default_triggers_per_box; i++) {
if (trigger->follow_action0().targets.test(i)) {
cue_idx = i;
break;