comparison AgentList.cpp @ 23:633ec097fa56

Expose the processing parameters Simon suggests
author Chris Cannam
date Tue, 03 Sep 2013 17:32:09 +0100
parents 6afcb5edd7ab
children
comparison
equal deleted inserted replaced
22:6afcb5edd7ab 23:633ec097fa56
73 } 73 }
74 #endif 74 #endif
75 } // removeDuplicates() 75 } // removeDuplicates()
76 76
77 77
78 void AgentList::beatTrack(EventList el, double stop) 78 void AgentList::beatTrack(EventList el, AgentParameters params, double stop)
79 { 79 {
80 EventList::iterator ei = el.begin(); 80 EventList::iterator ei = el.begin();
81 bool phaseGiven = !empty() && ((*begin())->beatTime >= 0); // if given for one, assume given for others 81 bool phaseGiven = !empty() && ((*begin())->beatTime >= 0); // if given for one, assume given for others
82 while (ei != el.end()) { 82 while (ei != el.end()) {
83 Event ev = *ei; 83 Event ev = *ei;
100 if ((prevBeatInterval>=0) && !created && (ev.time<5.0)) { 100 if ((prevBeatInterval>=0) && !created && (ev.time<5.0)) {
101 #ifdef DEBUG_BEATROOT 101 #ifdef DEBUG_BEATROOT
102 std::cerr << "Creating a new agent" << std::endl; 102 std::cerr << "Creating a new agent" << std::endl;
103 #endif 103 #endif
104 // Create new agent with different phase 104 // Create new agent with different phase
105 Agent *newAgent = new Agent(prevBeatInterval); 105 Agent *newAgent = new Agent(params, prevBeatInterval);
106 // This may add another agent to our list as well 106 // This may add another agent to our list as well
107 newAgent->considerAsBeat(ev, *this); 107 newAgent->considerAsBeat(ev, *this);
108 add(newAgent); 108 add(newAgent);
109 } 109 }
110 prevBeatInterval = currentAgent->beatInterval; 110 prevBeatInterval = currentAgent->beatInterval;