Hey August, actually i can't reproduce the problem. Maybe you can give me some more info concerning the whereabouts. Following is the code for the external "test" that works for me.
best greetings, Thomas
#include <flext.h> class test: public flext_base { FLEXT_HEADER_S(test,flext_base,setup) public: test(); static void setup(t_classid c);
void m_start_f(float f) { if (f == 0.0) post("got a zero"); else post("got a non-zero"); }
FLEXT_CALLBACK_F(m_start_f) }; FLEXT_NEW("test",test)
void test::setup(t_classid c) { #ifdef INSETUP FLEXT_CADDMETHOD(c,0,m_start_f); #endif }
test::test() { #ifndef INSETUP FLEXT_ADDMETHOD(0,m_start_f); #endif AddInAnything(); }
----- Original Message ----- From: "august" august@alien.mur.at To: pd-dev@iem.at Sent: Saturday, March 06, 2004 4:47 PM Subject: [PD-dev] flext question
hola chicos,
I have a flext question. I want to add a simple float message to the first inlet of a flext external.
I have an AddInAnything() inlet already, pluse some methods such as:
FLEXT_ADDMETHOD_ (0, "start", m_start);
but when I add a method that only takes a float, such as:
FLEXT_ADDMETHOD (0, m_start_f);
where m_start_f is a simple function: void m_start_f( float f) { if (f == 0.0) post("got a zero"); else post("got a non-zero"); }
now, when I send a message with a "0" in it to the first inlet, nothing happens. all the other messages work fine. If I add a second inlet and put the method on the second inlet with FLEXT_ADDMETHOD (1, m_start_f); it works fine. but, I need it on the first inlet.
any ideas?
-august.
PD-dev mailing list PD-dev@iem.at http://iem.at/cgi-bin/mailman/listinfo/pd-dev