comparison CollidoscopeApp/src/PGranularNode.cpp @ 3:7fb593d53361

added comments
author Fiore Martin <f.martin@qmul.ac.uk>
date Tue, 12 Jul 2016 18:29:38 +0200
parents 02467299402e
children 75b744078d66
comparison
equal deleted inserted replaced
2:dd889fff8423 3:7fb593d53361
57 } 57 }
58 58
59 void PGranularNode::process (ci::audio::Buffer *buffer ) 59 void PGranularNode::process (ci::audio::Buffer *buffer )
60 { 60 {
61 // only update PGranular if the atomic value has changed from the previous time 61 // only update PGranular if the atomic value has changed from the previous time
62
63 const boost::optional<size_t> selectionSize = mSelectionSize.get(); 62 const boost::optional<size_t> selectionSize = mSelectionSize.get();
64 if ( selectionSize ){ 63 if ( selectionSize ){
65 mPGranularLoop->setSelectionSize( *selectionSize ); 64 mPGranularLoop->setSelectionSize( *selectionSize );
66 for ( size_t i = 0; i < kMaxVoices; i++ ){ 65 for ( size_t i = 0; i < kMaxVoices; i++ ){
67 mPGranularNotes[i]->setSelectionSize( *selectionSize ); 66 mPGranularNotes[i]->setSelectionSize( *selectionSize );
110 } 109 }
111 110
112 } 111 }
113 } 112 }
114 113
114 // Called back when new grnular is triggered of turned off. Sends notification message to graphic thread.
115 void PGranularNode::operator()( char msgType, int ID ) { 115 void PGranularNode::operator()( char msgType, int ID ) {
116 116
117 switch ( msgType ){ 117 switch ( msgType ){
118 case 't': { // trigger 118 case 't': { // trigger
119 CursorTriggerMsg msg = makeCursorTriggerMsg( Command::TRIGGER_UPDATE, ID ); // put ID 119 CursorTriggerMsg msg = makeCursorTriggerMsg( Command::TRIGGER_UPDATE, ID ); // put ID