[PD-cvs] externals/grill/absattr absattr.cpp,1.5,1.6

Thomas Grill xovo at users.sourceforge.net
Sat Jan 20 15:26:47 CET 2007


Update of /cvsroot/pure-data/externals/grill/absattr
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3374

Modified Files:
	absattr.cpp 
Log Message:
use new ToSys* methods
a few fixes (printout and initialization)
attempt fix for bug #143.


Index: absattr.cpp
===================================================================
RCS file: /cvsroot/pure-data/externals/grill/absattr/absattr.cpp,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** absattr.cpp	2 Nov 2006 19:03:52 -0000	1.5
--- absattr.cpp	20 Jan 2007 14:26:45 -0000	1.6
***************
*** 3,7 ****
  absattr - patcher attributes
  
! Copyright (c) 2002-2006 Thomas Grill (gr at grrrr.org)
  For information on usage and redistribution, and for a DISCLAIMER OF ALL
  WARRANTIES, see the file, "license.txt," in this distribution.  
--- 3,7 ----
  absattr - patcher attributes
  
! Copyright (c) 2002-2007 Thomas Grill (gr at grrrr.org)
  For information on usage and redistribution, and for a DISCLAIMER OF ALL
  WARRANTIES, see the file, "license.txt," in this distribution.  
***************
*** 9,13 ****
  */
  
! #define VERSION "0.2.0"
  
  #include <flext.h>
--- 9,13 ----
  */
  
! #define VERSION "0.2.1"
  
  #include <flext.h>
***************
*** 45,50 ****
  
          // add to loadbang registry
!         Objects &o = loadbangs[parent].obj;
!         o.insert(this);
      }
  
--- 45,56 ----
  
          // add to loadbang registry
!         Loadbangs::iterator it = loadbangs.find(parent);
! 		if(it != loadbangs.end())
! 			it->second.obj.insert(this);
! 		else {
! 			Loadbang &lb = loadbangs[parent];
! 			lb.lasttime = -1;
! 			lb.obj.insert(this);
! 		}
      }
  
***************
*** 67,71 ****
          }
          else
!             error("%s - not found in loadbang registry");
      }
  
--- 73,77 ----
          }
          else
!             error("%s - not found in loadbang registry (parent=%i)",thisName(),parent);
      }
  
***************
*** 125,149 ****
      virtual void CbLoadbang() 
      { 
!         // all loadbangs have the same logical time
!     	double time = GetTime();
  
!         Loadbangs::iterator it = loadbangs.find(parent);
!         if(it != loadbangs.end()) {
!             Loadbang &lb = it->second;
!             // found
!             if(lb.lasttime < time) {
!                 // bang all objects with the same parent in the prioritized order
!                 for(Objects::iterator oit = lb.obj.begin(); oit != lb.obj.end(); ++oit) {
!                     absattr *o = *oit;
!                     FLEXT_ASSERT(o);
!                     if(o->loadbang) o->m_bang();
!                 }
  
!                 // set timestamp
!                 lb.lasttime = time;
              }
          }
-         else
-             error("%s - not found in database");
      }
  
--- 131,163 ----
      virtual void CbLoadbang() 
      { 
!         if(parent) {      
!             // we are a sub-abstraction, sharing a parent with others
  
!             // all loadbangs have the same logical time
!     	    double time = GetTime();
  
!             Loadbangs::iterator it = loadbangs.find(parent);
!             if(it != loadbangs.end()) {
!                 Loadbang &lb = it->second;
!                 // found
!                 if(lb.lasttime < time) {
!                     // bang all objects with the same parent in the prioritized order
!                     for(Objects::iterator oit = lb.obj.begin(); oit != lb.obj.end(); ++oit) {
!                         absattr *o = *oit;
!                         FLEXT_ASSERT(o);
!                         if(o->loadbang) o->m_bang();
!                     }
! 
!                     // set timestamp
!                     lb.lasttime = time;
!                 }
              }
+             else
+                 error("%s - not found in database",thisName());
+         }
+         else {
+             // loadbang only this
+             if(loadbang) m_bang();
          }
      }
  
***************
*** 250,253 ****
--- 264,269 ----
  	static void Setup(t_classid cl)
      {
+ 	    post("absattr " VERSION ", (C)2006-2007 Thomas Grill");
+ 
          sym_attributes = MakeSymbol("attributes");
          sym_loadbang = MakeSymbol("loadbang");





More information about the Pd-cvs mailing list