File tree 2 files changed +23
-12
lines changed
apps/devApps/StressofxOscReceiver/src
2 files changed +23
-12
lines changed Original file line number Diff line number Diff line change @@ -47,16 +47,16 @@ void ofApp::update(){
47
47
for (const auto & tester: testers_) {
48
48
for (size_t i=0 ; i<10 ; i++) {
49
49
#if defined(USE_EXPLICIT_FUNCTION)
50
- ofxOscMessage m;
51
- m.setAddress (" /test" );
52
- m.addIntArg (std::int32_t (i));
53
- m.addIntArg (port_);
54
- m.addIntArg (i);
55
- tester->sender_ ->sendMessage (m);
50
+ ofxOscMessage m;
51
+ m.setAddress (" /test" );
52
+ m.addIntArg (std::int32_t (i));
53
+ m.addIntArg (port_);
54
+ m.addIntArg (i);
55
+ tester->sender_ ->sendMessage (m);
56
56
#else
57
- ofxOscMessage m{" /test" };
58
- m.add (i);
59
- tester->sender_ ->sendMessage (m.add (port_).add (i));
57
+ ofxOscMessage m{" /test" };
58
+ m.add (i);
59
+ tester->sender_ ->sendMessage (m.add (port_).add (i));
60
60
#endif
61
61
msgs_out_++;
62
62
}
@@ -93,8 +93,14 @@ void ofApp::draw() {
93
93
void ofApp::keyPressed (int key){
94
94
if (key==' 1' ) mode_ = DYNA;
95
95
if (key==' 2' ) mode_ = STOP;
96
- if (key==' 3' ) mode_ = STABLE;
97
- msgs_ = 0 ;
98
- msgs_out_ = 0 ;
96
+ if (key==' 3' ) {
97
+ mode_ = STABLE;
98
+ for (const auto & tester: testers_) {
99
+ if (!tester->receiver_ ->isListening ()) {
100
+ tester->receiver_ ->start ();
101
+ }
102
+ }
103
+ }
104
+ reset_stats ();
99
105
}
100
106
Original file line number Diff line number Diff line change @@ -16,6 +16,7 @@ class ofApp : public ofBaseApp{
16
16
STABLE
17
17
};
18
18
19
+
19
20
Mode mode_ { DYNA };
20
21
long msgs_ { 0 };
21
22
long msgs_out_ { 0 };
@@ -28,6 +29,10 @@ class ofApp : public ofBaseApp{
28
29
29
30
std::array<std::shared_ptr<Tester>, 10 > testers_;
30
31
32
+ auto reset_stats () {
33
+ msgs_ = 0 ;
34
+ msgs_out_ = 0 ;
35
+ }
31
36
32
37
public:
33
38
void setup () override ;
You can’t perform that action at this time.
0 commit comments