Jump to content

Recommended Posts

Hi PHP freaks :)

 

I'm using WinBinder extension to create a windows program to accept MIDI input.  I had to write some custom code for the Winbinder extension to be able to receive MIDI callback functions.

 

basically zend_is_callable causes my program to crash in some cases, not in other cases.  I don't really understand what this function does or how it could cause a crash in any case.

 

...
zval *fname;
char *pszFName  =  "wb_midi_callback";

TSRMLS_FETCH();   

MAKE_STD_ZVAL(fname);
ZVAL_STRING(fname, pszFName, 1);

if(!zend_is_callable(fname, 0, &pszFName TSRMLS_CC)) {
...

 

also, how does one use zend_is_callable_ex work?  maybe I can use that instead?

 

here is a thread with a little more info http://winbinder.org/forum/viewtopic.php?f=10&t=1079&p=4701#p4701

 

thanks for any insight

I figured out how to call zend_is_callable_ex but it acts the same way

 

I can reliably get the callback for midiIn open and close, but midi data messages cause the callback to crash at zend_is_callable

 

I haven't written C code in 10 years and am not familiar with the zend API at all so i'm very much in the dark on this.  any and all insight or advice appreciated

  • 3 years later...

Hi SwiftlyTilting,

 

I just read your posting from 2010. I'm also trying to access MIDI ports via PHP, but there doesn't seem to be any PHP extension for this. I saw that it obviously is possible (with some tricks) via WinBinder. You wrote that you found a way to do that.

 

I would greatly apreciate if you wouldn't mind to share the essential part of your code (that performs MIDI receive).

 

Thanks a lot!

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.