Skip to content

Commit 970be7e

Browse files
committed
tweak UNDER_CONSTRUCTION
1 parent 21f0a58 commit 970be7e

File tree

2 files changed

+16
-22
lines changed

2 files changed

+16
-22
lines changed

seq/seqActor.c++

Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -56,37 +56,34 @@ void SeqActor::addMessage(float when, const char* msg) {
5656

5757
#ifdef UNDER_CONSTRUCTION
5858
void SeqActor::deleteEvent(Event* e) {
59-
myList.erase(e);
59+
myList.remove(*e);
6060
}
6161

6262
void SeqActor::deleteEvent(float when) {
6363
for (auto e: myList)
64-
if (when == e.key)
65-
myList.erase(e.myActorHandle);
64+
if (when == e.when)
65+
myList.remove(e);
6666
}
6767

6868
void SeqActor::deleteEvent(float when, float aHandle) {
69-
VActor* a = getByHandle(aHandle);
70-
if (!a)
71-
return;
7269
for (auto e: myList)
73-
if (a == e.contents->actor() && when == e.key)
74-
myList.erase(e.myActorHandle);
70+
if (aHandle == e.myActorHandle && when == e.when)
71+
myList.remove(e);
7572
}
7673

7774
void SeqActor::deleteAllEventsBefore(float when) {
7875
for (auto e: myList)
79-
if (e.key < when)
80-
myList.erase(e.myActorHandle);
76+
if (e.when < when)
77+
myList.remove(e);
8178
}
8279

8380
void SeqActor::deleteAllEventsAfter(float when) {
8481
for (auto e: myList)
85-
if (e.key >= when)
86-
myList.erase(e.myActorHandle);
82+
if (e.when >= when)
83+
myList.remove(e);
8784
}
8885

89-
void SeqActor::deleteAll() {
86+
void SeqActor::deleteAllEvents() {
9087
myList.clear();
9188
}
9289
#endif // UNDER_CONSTRUCTION

seq/seqActor.h

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,7 @@
33
#include "../msg/messageGroup.h"
44
#include <list>
55

6-
class Event
7-
{
8-
public:
6+
struct Event {
97
VActor& actor; // what am in?
108
float myActorHandle; // whom does it happen to?
119
// float myReturnValue; // if event returns a value, store it here
@@ -14,12 +12,11 @@ class Event
1412
// float when_beat; // Under construction. #defined to be 'when', for now.
1513
char msg[512]; // what happens?
1614
Event(VActor& a, float w, const char* m): actor(a), when(w) { strcpy(msg, m); }
17-
~Event() {}
15+
Event() = delete;
1816
};
1917
#define when_beat when /* hack. does this work for different myBeatLength's? ;;;;*/
2018

21-
class SeqActor : public VActor
22-
{
19+
class SeqActor : public VActor {
2320
public:
2421
SeqActor();
2522
SeqActor(SeqActor&);
@@ -35,11 +32,11 @@ class SeqActor : public VActor
3532
void setLoopStart(float start) { myLoopStart = start; }
3633
void setLoopEnd(float end) { myLoopEnd = end; }
3734

38-
/// void addMessage(const float when, const float returnID, char*) {}
3935
void addMessage(float when, const char*);
4036
void addMessage(const Event&);
4137

4238
#ifdef UNDER_CONSTRUCTION
39+
void addMessage(const float when, const float returnID, char*) {}
4340
// void addMessagesRet(const float howMany);
4441
// void addMessages(const float howMany);
4542

@@ -71,8 +68,8 @@ class SeqActor : public VActor
7168
int myNumLoops;
7269
float myBeatLength;
7370
float myNowBeat;
74-
using SeqList = std::list<Event>;
75-
SeqList::iterator myIter;
71+
using SeqList = std::list<Event>;
72+
SeqList::iterator myIter;
7673
SeqList myList;
7774

7875
public:

0 commit comments

Comments
 (0)