File tree Expand file tree Collapse file tree 2 files changed +23
-12
lines changed
apps/devApps/StressofxOscReceiver/src Expand file tree Collapse file tree 2 files changed +23
-12
lines changed Original file line number Diff line number Diff line change @@ -47,16 +47,16 @@ void ofApp::update(){
4747 for (const auto & tester: testers_) {
4848 for (size_t i=0 ; i<10 ; i++) {
4949#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);
5656#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));
6060#endif
6161 msgs_out_++;
6262 }
@@ -93,8 +93,14 @@ void ofApp::draw() {
9393void ofApp::keyPressed (int key){
9494 if (key==' 1' ) mode_ = DYNA;
9595 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 ();
99105}
100106
Original file line number Diff line number Diff line change @@ -16,6 +16,7 @@ class ofApp : public ofBaseApp{
1616 STABLE
1717 };
1818
19+
1920 Mode mode_ { DYNA };
2021 long msgs_ { 0 };
2122 long msgs_out_ { 0 };
@@ -28,6 +29,10 @@ class ofApp : public ofBaseApp{
2829
2930 std::array<std::shared_ptr<Tester>, 10 > testers_;
3031
32+ auto reset_stats () {
33+ msgs_ = 0 ;
34+ msgs_out_ = 0 ;
35+ }
3136
3237public:
3338 void setup () override ;
You can’t perform that action at this time.
0 commit comments