[PD-dev] sending data out using sprintf

2007-06-22 Thread nosehair911
I am trying to send some data out of an outlet using a symbol pointer. I have 
tried using sprintf like 
martin suggested with little succes. I am sure I am the one doing something 
wrong. I am getting a 
pointer symbol but I am not able to convert the pointer back.  In external#1 I 
have:

The out 
IplImage *frame;
char symstr[10];
t_symbol *sym;
sprintf(symstr, %p, frame);
sym = gensym(symstr);
outlet_symbol(x-m_outFrames, sym);

With this I get an address like:
symbol 0x1159da0

...but on the conversion in external#2 I get the problem. The conversion looks 
like:

The in---
IplImage *in_frame;
x-in_frame = (IplImage *)atol(s-s_name);
post(frame %s, x-in_frame);
post(symbol %s,s-s_name);

...with this I get this:
frame (null)
symbol 0x1159da0

So I'm getting the symbol in, but its not converting into in_fame.
Does anyone know what I am doing wrong or a way to use Pd's A_POINTER.  I have 
looked at
Gem and pdp but I cant figure it out.
Thanks,
Alain 



___
PD-dev mailing list
PD-dev@iem.at
http://lists.puredata.info/listinfo/pd-dev


Re: [PD-dev] sending data out using sprintf

2007-06-22 Thread Bryan Jurish
moin Alain,

I've never passed pointers around between externals myself, but...

On 2007-06-22 04:57:35, [EMAIL PROTECTED] appears to have written:
 I am trying to send some data out of an outlet using a symbol pointer. I have 
 tried using sprintf like 
 martin suggested with little succes. I am sure I am the one doing something 
 wrong. I am getting a 
 pointer symbol but I am not able to convert the pointer back.  In external#1 
 I have:
 
 The out 
 IplImage *frame;
 char symstr[10];
 t_symbol *sym;
 sprintf(symstr, %p, frame);
 sym = gensym(symstr);
 outlet_symbol(x-m_outFrames, sym);
 
 With this I get an address like:
 symbol 0x1159da0

... looks kosher to me ...

 ...but on the conversion in external#2 I get the problem. The conversion 
 looks like:
 
 The in---
 IplImage *in_frame;
 x-in_frame = (IplImage *)atol(s-s_name);
 post(frame %s, x-in_frame);
 post(symbol %s,s-s_name);

 ...with this I get this:
 frame (null)
 symbol 0x1159da0

first of all, you probably want to post(frame %p, x-in_frame), rather
than %s.  Second, in the docs for my atol (here under linux|glibc), I see:

  -- Function: long int atol (const char *STRING)
 This function is similar to the `strtol' function with a BASE
 argument of `10', except that it need not detect overflow errors.
 The `atol' function is provided mostly for compatibility with
 existing code; using `strtol' is more robust.

... so if your atol() is similar, then trying to convert a hex string to
a pointer with atol() is an exercise in futility (since in general,
10!=16).  strtol() ought to work better, auto-detetcting the hex-iness
of the string by its '0x' prefix.  You might also just want to roll out
the big guns and use the %x format to scanf(), but strtol() is likely
to be the better way to go.

marmosets,
Bryan

-- 
Bryan Jurish   There is *always* one more bug.
[EMAIL PROTECTED]  -Lubarsky's Law of Cybernetic Entomology

___
PD-dev mailing list
PD-dev@iem.at
http://lists.puredata.info/listinfo/pd-dev


Re: [PD-dev] sending data out using sprintf

2007-06-22 Thread Martin Peach
[EMAIL PROTECTED] wrote:
 I am trying to send some data out of an outlet using a symbol pointer. I have 
 tried using sprintf like 
 martin suggested with little succes. I am sure I am the one doing something 
 wrong. I am getting a 
 pointer symbol but I am not able to convert the pointer back.  In external#1 
 I have:

 The out 
 IplImage *frame;
 char symstr[10];
 t_symbol *sym;
 sprintf(symstr, %p, frame);
 sym = gensym(symstr);
 outlet_symbol(x-m_outFrames, sym);

 With this I get an address like:
 symbol 0x1159da0

 ...but on the conversion in external#2 I get the problem. The conversion 
 looks like:

 The in---
 IplImage *in_frame;
 x-in_frame = (IplImage *)atol(s-s_name);
 post(frame %s, x-in_frame);
 post(symbol %s,s-s_name);

 ...with this I get this:
 frame (null)
 symbol 0x1159da0

 So I'm getting the symbol in, but its not converting into in_fame.
 Does anyone know what I am doing wrong or a way to use Pd's A_POINTER.  I 
 have looked at
 Gem and pdp but I cant figure it out.
   
Oh yes, atol only converts base 10 but the pointer is in base 16 format. 
Maybe try:
x-in_frame = (IplImage *)sscanf(s-s_name, %p);
or:
x-in_frame = (IplImage *)sscanf(s-s_name, %x);

OTOH if you did
sprintf(symstr, %lu, frame);

first, then atol would probably work OK.

Martin


___
PD-dev mailing list
PD-dev@iem.at
http://lists.puredata.info/listinfo/pd-dev


[PD-dev] Pd external-window crash

2007-06-22 Thread nosehair911
I am trying to write an external library that uses opencv.  I am using os x 
10.4.9 and Pd extended 0.3.9.
To display images and movies opencv uses a call to a window. I have a 
standalone terminal program 
that call the window and displays the image correctly.
When I try to call a window from within Pd I get a window followed by a long 
stall and eventually a crash.
On my dock I get a second Pd app with no icon like when I open a Gemwin in Gem. 
 The original app 
seems responsive but the second app seems to be in a I want to crash state 
untill it does.
Does anyone how I can figure out what is happening here?  Is it a lib that Pd 
is lacking?  What is the 
best way to bugtrack this?
I know that Pd knows where the opencv libs are at because other opencv 
functions work flawlessly.
Thanks for any input.
Alain


___
PD-dev mailing list
PD-dev@iem.at
http://lists.puredata.info/listinfo/pd-dev


Re: [PD-dev] sending data out using sprintf

2007-06-22 Thread nosehair911
Well for never passing pointers around you have some great insight.  That did 
it. Thanks..
The final outcode for any interested parties:

x-in_frame = (IplImage *)strtol(s-s_name, NULL, 0);

Now I have another snag, but thats in another email.
Alain
 
 From: Bryan Jurish [EMAIL PROTECTED]
 Date: 2007/06/22 Fri AM 05:52:47 EDT
 To: [EMAIL PROTECTED]
 CC: pd-dev@iem.at
 Subject: Re: [PD-dev] sending data out using sprintf
 
 moin Alain,
 
 I've never passed pointers around between externals myself, but...
 
 On 2007-06-22 04:57:35, [EMAIL PROTECTED] appears to have written:
  I am trying to send some data out of an outlet using a symbol pointer. I 
  have tried using sprintf like 
  martin suggested with little succes. I am sure I am the one doing something 
  wrong. I am getting a 
  pointer symbol but I am not able to convert the pointer back.  In 
  external#1 I have:
  
  The out 
  IplImage *frame;
  char symstr[10];
  t_symbol *sym;
  sprintf(symstr, %p, frame);
  sym = gensym(symstr);
  outlet_symbol(x-m_outFrames, sym);
  
  With this I get an address like:
  symbol 0x1159da0
 
 ... looks kosher to me ...
 
  ...but on the conversion in external#2 I get the problem. The conversion 
  looks like:
  
  The in---
  IplImage *in_frame;
  x-in_frame = (IplImage *)atol(s-s_name);
  post(frame %s, x-in_frame);
  post(symbol %s,s-s_name);
 
  ...with this I get this:
  frame (null)
  symbol 0x1159da0
 
 first of all, you probably want to post(frame %p, x-in_frame), rather
 than %s.  Second, in the docs for my atol (here under linux|glibc), I see:
 
   -- Function: long int atol (const char *STRING)
  This function is similar to the `strtol' function with a BASE
  argument of `10', except that it need not detect overflow errors.
  The `atol' function is provided mostly for compatibility with
  existing code; using `strtol' is more robust.
 
 ... so if your atol() is similar, then trying to convert a hex string to
 a pointer with atol() is an exercise in futility (since in general,
 10!=16).  strtol() ought to work better, auto-detetcting the hex-iness
 of the string by its '0x' prefix.  You might also just want to roll out
 the big guns and use the %x format to scanf(), but strtol() is likely
 to be the better way to go.
 
 marmosets,
   Bryan
 
 -- 
 Bryan Jurish   There is *always* one more bug.
 [EMAIL PROTECTED]  -Lubarsky's Law of Cybernetic Entomology
 


___
PD-dev mailing list
PD-dev@iem.at
http://lists.puredata.info/listinfo/pd-dev


[PD-dev] changing netsend

2007-06-22 Thread Mathieu Bouchard

On Fri, 22 Jun 2007, Alex Q wrote:

I think that the list, float and symbol selectors are somewhat 
obvious and should be types, not selectors. Those selectors bring some 
ankward constructs like that. For this (pd!) software, it might be too 
late, but for the next dataflow generation, it is not...


float and symbol and pointer correspond to atomtypes and are used because 
pd is designed to accept those atoms using three separate methods; the 
type-signature could be considered part of the selector (it is in 
C++/Java) or could be considered part of the dispatch (it is in LISP). In 
pd it's neither (as in Python/Ruby/Perl/etc) because because it still has 
to be split in three methods, it's exposed right in the user's face. 
Instead I'd prolly enjoy a selector or atom called atom or value.


pd's list selector does not correspond to any atom type. What do you 
want to do with that?


 _ _ __ ___ _  _ _ ...
| Mathieu Bouchard - tél:+1.514.383.3801, Montréal QC Canada___
PD-dev mailing list
PD-dev@iem.at
http://lists.puredata.info/listinfo/pd-dev


Re: [PD-dev] Pd external-window crash

2007-06-22 Thread nosehair911
It seems like the window is made using Carbon.  Is there any special way Pd 
handles Carbon 
windows that would cause this stall? I can also compile opencv to use X11 
windowing thru finks gdk.  
Would Pd handle that better?
Alain

 
 From: [EMAIL PROTECTED]
 Date: 2007/06/22 Fri AM 10:53:54 EDT
 To: pd-dev@iem.at
 Subject: [PD-dev] Pd external-window crash
 
 I am trying to write an external library that uses opencv.  I am using os x 
 10.4.9 and Pd extended 
0.3.9.
 To display images and movies opencv uses a call to a window. I have a 
 standalone terminal 
program 
 that call the window and displays the image correctly.
 When I try to call a window from within Pd I get a window followed by a long 
 stall and eventually a 
crash.
 On my dock I get a second Pd app with no icon like when I open a Gemwin in 
 Gem.  The original 
app 
 seems responsive but the second app seems to be in a I want to crash state 
 untill it does.
 Does anyone how I can figure out what is happening here?  Is it a lib that Pd 
 is lacking?  What is the 
 best way to bugtrack this?
 I know that Pd knows where the opencv libs are at because other opencv 
 functions work flawlessly.
 Thanks for any input.
 Alain
 
 
 ___
 PD-dev mailing list
 PD-dev@iem.at
 http://lists.puredata.info/listinfo/pd-dev
 


___
PD-dev mailing list
PD-dev@iem.at
http://lists.puredata.info/listinfo/pd-dev


Re: [PD-dev] [ pure-data-Bugs-1607030 ] Pd crach when closeing patch with GOP enabled subpatch open

2007-06-22 Thread Steffen

On 22/06/2007, at 22.59, SourceForge.net wrote:
 Message generated for change (Settings changed) made by stffn
 (snip)
 Assigned to: Miller Puckette (millerpuckette)

is it rude to assign something to someone else, or is it expected  
behavior?




___
PD-dev mailing list
PD-dev@iem.at
http://lists.puredata.info/listinfo/pd-dev


Re: [PD-dev] Pd external-window crash

2007-06-22 Thread nosehair911
Well it looks like if I get a Gemwin opened first, then I can open an opencv 
window without a crash.  
Does anyone know what specifically does Gem do to get Pd to open a carbon 
window without a 
crash?
Alain

 
 From: [EMAIL PROTECTED]
 Date: 2007/06/22 Fri PM 02:37:30 EDT
 To: pd-dev@iem.at
 Subject: Re: [PD-dev] Pd external-window crash
 
 It seems like the window is made using Carbon.  Is there any special way Pd 
 handles Carbon 
 windows that would cause this stall? I can also compile opencv to use X11 
 windowing thru finks 
gdk.  
 Would Pd handle that better?
 Alain
 
  
  From: [EMAIL PROTECTED]
  Date: 2007/06/22 Fri AM 10:53:54 EDT
  To: pd-dev@iem.at
  Subject: [PD-dev] Pd external-window crash
  
  I am trying to write an external library that uses opencv.  I am using os x 
  10.4.9 and Pd extended 
 0.3.9.
  To display images and movies opencv uses a call to a window. I have a 
  standalone terminal 
 program 
  that call the window and displays the image correctly.
  When I try to call a window from within Pd I get a window followed by a 
  long stall and eventually a 
 crash.
  On my dock I get a second Pd app with no icon like when I open a Gemwin in 
  Gem.  The original 
 app 
  seems responsive but the second app seems to be in a I want to crash 
  state untill it does.
  Does anyone how I can figure out what is happening here?  Is it a lib that 
  Pd is lacking?  What is 
the 
  best way to bugtrack this?
  I know that Pd knows where the opencv libs are at because other opencv 
  functions work 
flawlessly.
  Thanks for any input.
  Alain
  
  
  ___
  PD-dev mailing list
  PD-dev@iem.at
  http://lists.puredata.info/listinfo/pd-dev
  
 
 
 ___
 PD-dev mailing list
 PD-dev@iem.at
 http://lists.puredata.info/listinfo/pd-dev
 


___
PD-dev mailing list
PD-dev@iem.at
http://lists.puredata.info/listinfo/pd-dev