diff options
author | Guenter Geiger <ggeiger@users.sourceforge.net> | 2003-05-09 16:04:00 +0000 |
---|---|---|
committer | Guenter Geiger <ggeiger@users.sourceforge.net> | 2003-05-09 16:04:00 +0000 |
commit | 9c0e19a3be2288db79e2502e5fa450c3e20a668d (patch) | |
tree | ca97ce615e037a533304fc4660dcf372ca3b9cd6 /pd/src/m_binbuf.c | |
parent | ef50dd62804d54af7da18d8bd8413c0dccd729b8 (diff) |
This commit was generated by cvs2svn to compensate for changes in r610,
which included commits to RCS files with non-trunk default branches.
svn path=/trunk/; revision=611
Diffstat (limited to 'pd/src/m_binbuf.c')
-rw-r--r-- | pd/src/m_binbuf.c | 64 |
1 files changed, 57 insertions, 7 deletions
diff --git a/pd/src/m_binbuf.c b/pd/src/m_binbuf.c index fab30baf..c40e5dff 100644 --- a/pd/src/m_binbuf.c +++ b/pd/src/m_binbuf.c @@ -16,7 +16,7 @@ #ifdef UNIX #include <unistd.h> #endif -#ifdef NT +#ifdef MSW #include <io.h> #endif #include <fcntl.h> @@ -599,7 +599,7 @@ broken: static int binbuf_doopen(char *s, int mode) { char namebuf[MAXPDSTRING]; -#ifdef NT +#ifdef MSW mode |= O_BINARY; #endif sys_bashfilename(s, namebuf); @@ -903,14 +903,13 @@ static t_binbuf *binbuf_convert(t_binbuf *oldb, int maxtopd) else if (!strcmp(second, "button")) { binbuf_addv(newb, "ssffs;", - gensym("#X"), gensym("msg"), + gensym("#X"), gensym("obj"), atom_getfloatarg(2, natom, nextmess), atom_getfloatarg(3, natom, nextmess), - gensym("bang")); + gensym("bng")); nobj++; } - else if (!strcmp(second, "slider") || !strcmp(second, "number") - || !strcmp(second, "flonum") || !strcmp(second, "toggle")) + else if (!strcmp(second, "number") || !strcmp(second, "flonum")) { binbuf_addv(newb, "ssff;", gensym("#X"), gensym("floatatom"), @@ -918,6 +917,33 @@ static t_binbuf *binbuf_convert(t_binbuf *oldb, int maxtopd) atom_getfloatarg(3, natom, nextmess)); nobj++; } + else if (!strcmp(second, "slider")) + { + binbuf_addv(newb, "ssffsffffffsssfffffffff;", + gensym("#X"), gensym("obj"), + atom_getfloatarg(2, natom, nextmess), + atom_getfloatarg(3, natom, nextmess), + gensym("vsl"), + atom_getfloatarg(4, natom, nextmess), + atom_getfloatarg(5, natom, nextmess), + atom_getfloatarg(7, natom, nextmess), + atom_getfloatarg(7, natom, nextmess) + + (atom_getfloatarg(5, natom, nextmess) - 1) + * atom_getfloatarg(6, natom, nextmess), + 0., 0., + gensym("empty"), gensym("empty"), gensym("empty"), + 0., -8., 0., 8., -262144., -1., -1., 0., 1.); + nobj++; + } + else if (!strcmp(second, "toggle")) + { + binbuf_addv(newb, "ssffs;", + gensym("#X"), gensym("obj"), + atom_getfloatarg(2, natom, nextmess), + atom_getfloatarg(3, natom, nextmess), + gensym("tgl")); + nobj++; + } else if (!strcmp(second, "inlet")) { binbuf_addv(newb, "ssffs;", @@ -1014,6 +1040,30 @@ static t_binbuf *binbuf_convert(t_binbuf *oldb, int maxtopd) atom_getfloatarg(2, natom, nextmess), atom_getfloatarg(3, natom, nextmess), 15., 1.); + else if (classname == gensym("bng")) + binbuf_addv(newb, "ssffff;", gensym("#P"), + gensym("button"), + atom_getfloatarg(2, natom, nextmess), + atom_getfloatarg(3, natom, nextmess), + atom_getfloatarg(5, natom, nextmess), 0.); + else if (classname == gensym("tgl")) + binbuf_addv(newb, "ssffff;", gensym("#P"), + gensym("toggle"), + atom_getfloatarg(2, natom, nextmess), + atom_getfloatarg(3, natom, nextmess), + atom_getfloatarg(5, natom, nextmess), 0.); + else if (classname == gensym("vsl")) + binbuf_addv(newb, "ssffffff;", gensym("#P"), + gensym("slider"), + atom_getfloatarg(2, natom, nextmess), + atom_getfloatarg(3, natom, nextmess), + atom_getfloatarg(5, natom, nextmess), + atom_getfloatarg(6, natom, nextmess), + (atom_getfloatarg(8, natom, nextmess) - + atom_getfloatarg(7, natom, nextmess)) / + (atom_getfloatarg(6, natom, nextmess) == 1? 1 : + atom_getfloatarg(6, natom, nextmess) - 1), + atom_getfloatarg(7, natom, nextmess)); else { SETSYMBOL(outmess, gensym("#P")); @@ -1069,7 +1119,7 @@ static t_binbuf *binbuf_convert(t_binbuf *oldb, int maxtopd) } if (!maxtopd) binbuf_addv(newb, "ss;", gensym("#P"), gensym("pop")); -#if 1 +#if 0 binbuf_write(newb, "import-result.pd", "/tmp", 0); #endif return (newb); |