////////////////////////////////////////////////////////////////////// // JTestObj.cpp - a minimal external module for NeatTools // generated by Rob Salgado's ModuleMaker // // It has two left-inputs (JInteger, JString) and // two outputs: a right-output JInteger and a bottom-output JString. // The color of module is changed by the JInteger-input. // The text drawn on the lower-right corner of the module is changed by // the JString-input. // // ////////////////////////////////////////////////////////////////////// #include "JTestObj.h" #include "JLinkObj.h" /// #include "JInteger.h" #include "JIntegerData.h" #include "JIntegerProperty.h" #include "JIntegerListProperty.h" /// //#include "JRealData.h" //#include "JRealProperty.h" /// #include "JString.h" #include "JStringData.h" #include "JStringProperty.h" // //#include "JBytesData.h" // #include #include #include //#include // ------------------------------------------------------------------------ // // // Register() registers the module with NeatTools // char* theJTestObj = JTestObj().Register(); // ------------------------------------------------------------------------ // // void JTestObj::writeContent(JOutputStream& os) { //call base-class writeContent() first JAddObj::writeContent(os); //write a table of "persistent variables", //which comprise the "state" of this instance of the module // format: // put_x_(os, INTERNAL_VARIABLE_TAG, PERSISTENT_VARIABLE) putInteger(os, "persistentInteger1", persistentInteger1); //use JObject for JStrings putObject(os, "persistentString1", persistentString1); } // ------------------------------------------------------------------------ // // void JTestObj::readContent(JDictionary& dict) { #ifdef COUT ofstream fout("C:\\_Desktop\\log.txt",ios::app); fout <<"(START READ CONTENT)"<value; //do update repaint(); //you might want to repaint() broadcast(INTEGER_OUTPUT); //ping INTEGER_OUTPUT...because it might want to know return true; //leave and announce that the property was found } if (prop.getName() == JString("Persistent String #1")) { persistentString1 = ((JStringProperty*)&prop)->value; //do update repaint(); //you might want to repaint() broadcast(STRING_OUTPUT); //ping STRING_OUTPUT...because it might want to know return true; //leave and announce that the property was found } return false; //leave and announce that the property was not found } // ------------------------------------------------------------------------ //