[Gridflow-cvs] [svn] commit: r3313 - in /trunk/format: aalib.c dc1394.c jpeg.c main.c mpeg3.c netpbm.c opengl.c png.c quartz.m quicktimeapple.c quicktimehw.c sdl.c videodev.c x11.c

gridflow-cvs at artengine.ca gridflow-cvs at artengine.ca
Thu Mar 27 17:34:30 EDT 2008


Author: matju
Date: Thu Mar 27 17:34:29 2008
New Revision: 3313

Log:
uniformising #io: #in: #out: prefixes to #io. (with a period instead of colon)

Modified:
    trunk/format/aalib.c
    trunk/format/dc1394.c
    trunk/format/jpeg.c
    trunk/format/main.c
    trunk/format/mpeg3.c
    trunk/format/netpbm.c
    trunk/format/opengl.c
    trunk/format/png.c
    trunk/format/quartz.m
    trunk/format/quicktimeapple.c
    trunk/format/quicktimehw.c
    trunk/format/sdl.c
    trunk/format/videodev.c
    trunk/format/x11.c

Modified: trunk/format/aalib.c
==============================================================================
--- trunk/format/aalib.c (original)
+++ trunk/format/aalib.c Thu Mar 27 17:34:29 2008
@@ -143,16 +143,16 @@
 	post("aalib image size: %s",(new Dim(3,v))->to_s());
 }
 
-\classinfo {
+\end class FormatAALib {
+
 	Ruby drivers = rb_ivar_set(rself,SI(@drivers),rb_hash_new());
 	const aa_driver *const *p = aa_drivers;
 	for (; *p; p++) {
 		rb_hash_aset(drivers,ID2SYM(rb_intern((*p)->shortname)), PTR2FIX(*p));
 	}
 // IEVAL(rself,"GridFlow.post('aalib supports: %s', @drivers.keys.join(', '))");
-	install_format("#in:aalib",2,"");
+	install_format("#io.aalib",2,"");
 }
-\end class FormatAALib
 void startup_aalib () {
 	\startall
 }

Modified: trunk/format/dc1394.c
==============================================================================
--- trunk/format/dc1394.c (original)
+++ trunk/format/dc1394.c Thu Mar 27 17:34:29 2008
@@ -333,13 +333,7 @@
 	gfpost("i'd like to get a frame from the cam, but how?");
 }
 
-\classinfo {
-	install_format("#io:dc1394",4,"");
-	//IEVAL(rself,ruby_code);
-	rb_funcall(rself,SI(instance_eval),3,rb_str_new2(ruby_code),
-		rb_str_new2(__FILE__),INT2NUM(ruby_lineno+3));
-}
-\end class FormatDC1394
+\end class FormatDC1394 {install_format("#io.dc1394",4,"");}
 void startup_dc1394 () {
 	\startall
 }

Modified: trunk/format/jpeg.c
==============================================================================
--- trunk/format/jpeg.c (original)
+++ trunk/format/jpeg.c Thu Mar 27 17:34:29 2008
@@ -118,7 +118,7 @@
 	bit_packing = new BitPacking(is_le(),3,3,mask);
 }
 
-\classinfo {install_format("#io:jpeg",6,"jpeg jpg");}
+\classinfo {install_format("#io.jpeg",6,"jpeg jpg");}
 \end class FormatJPEG
 void startup_jpeg () {
 	\startall

Modified: trunk/format/main.c
==============================================================================
--- trunk/format/main.c (original)
+++ trunk/format/main.c Thu Mar 27 17:34:29 2008
@@ -56,6 +56,7 @@
 */
 
 std::map<std::string,std::string> suffix_table;
+std::map<std::string,std::string> format_table;
 void suffixes_are (const char *name, const char *suffixes) {
 	std::string name2 = name;
 	char *suff2 = strdup(suffixes);
@@ -67,7 +68,7 @@
 	}
 }
 
-\class SuffixLookup < GridObject {
+\class SuffixLookup : FObject {
   \decl void initialize ();
   \decl 0 symbol (String str);
 };
@@ -82,8 +83,24 @@
 		std::map<std::string,std::string>::iterator u = suffix_table.find(std::string(t+1));
 		if (u!=suffix_table.end()) outlet_symbol(bself->out[0],gensym((char *)u->second.data()));
 	}
+	free(s);
 }
 \end class SuffixLookup {install("gf.suffix_lookup",1,3);}
+
+// not in use
+\class FormatLookup : FObject {
+  \decl void initialize ();
+  \decl 0 symbol (String str);
+};
+\def void initialize () {}
+\def 0 symbol (String str) {
+	char *s = strdup(rb_str_ptr(str));
+	std::map<std::string,std::string>::iterator u = format_table.find(std::string(s));
+	if (u!=format_table.end()) outlet_symbol(bself->out[0],gensym((char *)u->second.data()));
+	else outlet_bang(bself->out[0]);
+	free(s);
+}
+\end class FormatLookup {install("gf.format_lookup",1,1);}
 
 \class Format < GridObject
 \def void initialize (Symbol mode, ...) {
@@ -256,7 +273,7 @@
 	//@stream.close if @stream
 	//GridFlow.hunt_zombies
 }
-\end class FormatGrid {install_format("#io:grid",6,"grid");}
+\end class FormatGrid {install_format("#io.grid",6,"grid");}
 
 void startup_format () {
 	\startall

Modified: trunk/format/mpeg3.c
==============================================================================
--- trunk/format/mpeg3.c (original)
+++ trunk/format/mpeg3.c Thu Mar 27 17:34:29 2008
@@ -86,7 +86,7 @@
 	if (!mpeg) RAISE("IO Error: can't open file `%s': %s", filename, strerror(errno));
 }
 
-\classinfo {install_format("#io:mpeg",4,"mpg mpeg");}
+\classinfo {install_format("#io.mpeg",4,"mpg mpeg");}
 \end class FormatMPEG3
 void startup_mpeg3 () {
 	\startall

Modified: trunk/format/netpbm.c
==============================================================================
--- trunk/format/netpbm.c (original)
+++ trunk/format/netpbm.c Thu Mar 27 17:34:29 2008
@@ -89,8 +89,8 @@
 } GRID_FINISH {
 	fflush(f);
 } GRID_END
-
-\classinfo {install_format("#io:netpbm",6,"ppm pgm pnm pam");}
+/* was supposed to be "#io.netpbm" but there's backwards compat. */
+\classinfo {install_format("#io.ppm",6,"ppm pgm pnm pam");}
 \end class FormatNetPBM
 
 void startup_netpbm () {

Modified: trunk/format/opengl.c
==============================================================================
--- trunk/format/opengl.c (original)
+++ trunk/format/opengl.c Thu Mar 27 17:34:29 2008
@@ -171,7 +171,7 @@
 	gfpost("@clock = Clock.new self");
 }
 
-\classinfo {install_format("#io:opengl",2,"");}
+\classinfo {install_format("#io.opengl",2,"");}
 \end class FormatOpenGL
 void startup_opengl () {
 	\startall

Modified: trunk/format/png.c
==============================================================================
--- trunk/format/png.c (original)
+++ trunk/format/png.c Thu Mar 27 17:34:29 2008
@@ -113,7 +113,7 @@
 	bit_packing = new BitPacking(is_le(),3,3,mask);
 }
 
-\classinfo { install_format("#io:png",4,"png"); }
+\classinfo {install_format("#io.png",4,"png");}
 \end class FormatPNG
 void startup_png () {
 	\startall

Modified: trunk/format/quartz.m
==============================================================================
--- trunk/format/quartz.m (original)
+++ trunk/format/quartz.m Thu Mar 27 17:34:29 2008
@@ -209,7 +209,6 @@
 \def 0 delete_m () {
 	[window autorelease];
 }
-
 \def 0 close () {
 	IEVAL(rself,"@clock.unset");
 	SUPER;
@@ -217,17 +216,13 @@
 	[window setReleasedWhenClosed: YES];
 	[window close];
 }
-
-\classinfo {
+\end class FormatQuartz {
 	NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
 	distantFuture = [NSDate distantFuture];
 	distantPast = [NSDate distantPast];
 	[NSApplication sharedApplication];
 	install_format("#io:quartz",2,"");
-\end ruby
-);}
-
-\end class FormatQuartz
+}
 void startup_quartz () {
         \startall
 }

Modified: trunk/format/quicktimeapple.c
==============================================================================
--- trunk/format/quicktimeapple.c (original)
+++ trunk/format/quicktimeapple.c Thu Mar 27 17:34:29 2008
@@ -335,7 +335,7 @@
 } GRID_FLOW {
 } GRID_FINISH {
 } GRID_END
-\end class FormatQuickTimeCamera {install_format("#io:quicktimecamera",4,"");}
+\end class FormatQuickTimeCamera {install_format("#io.quicktimecamera",4,"");}
 
 \class FormatQuickTimeApple : Format {
 	Movie movie;
@@ -465,7 +465,7 @@
 
 \classinfo {
 	EnterMovies();
-	install_format("#io:quicktime",4,"mov");
+	install_format("#io.quicktime",4,"mov");
 }
 \end class FormatQuickTimeApple
 void startup_quicktimeapple () {

Modified: trunk/format/quicktimehw.c
==============================================================================
--- trunk/format/quicktimehw.c (original)
+++ trunk/format/quicktimehw.c Thu Mar 27 17:34:29 2008
@@ -209,7 +209,7 @@
 	bit_packing = new BitPacking(is_le(),3,3,mask);
 }
 
-\classinfo {install_format("#io:quicktime",6,"mov");
+\classinfo {install_format("#io.quicktime",6,"mov");
 //  def self.info; %[codecs: #{@codecs.keys.join' '}] end
 //#define L fprintf(stderr,"%s:%d in %s\n",__FILE__,__LINE__,__PRETTY_FUNCTION__);
 #ifdef LQT_VERSION

Modified: trunk/format/sdl.c
==============================================================================
--- trunk/format/sdl.c (original)
+++ trunk/format/sdl.c Thu Mar 27 17:34:29 2008
@@ -106,7 +106,7 @@
 	IEVAL(rself,"@clock = Clock.new self");
 }
 
-\end class FormatSDL {install_format("#io:sdl",2,"");}
+\end class FormatSDL {install_format("#io.sdl",2,"");}
 void startup_sdl () {
 	\startall
 }

Modified: trunk/format/videodev.c
==============================================================================
--- trunk/format/videodev.c (original)
+++ trunk/format/videodev.c Thu Mar 27 17:34:29 2008
@@ -752,7 +752,7 @@
 	rb_funcall(rself,SI(initialize2),0); // name conflict...
 }
 
-\end class FormatVideoDev {install_format("#io:videodev",4,"");}
+\end class FormatVideoDev {install_format("#io.videodev",4,"");}
 void startup_videodev () {
 	\startall
 }

Modified: trunk/format/x11.c
==============================================================================
--- trunk/format/x11.c (original)
+++ trunk/format/x11.c Thu Mar 27 17:34:29 2008
@@ -660,7 +660,7 @@
 	show_section(0,0,sx,sy);
 }
 
-\end class FormatX11 {install_format("#io:x11",6,"");}
+\end class FormatX11 {install_format("#io.x11",6,"");}
 void startup_x11 () {
 	\startall
 }



More information about the Gridflow-cvs mailing list