SwiftlyTilting Posted January 26, 2010 Share Posted January 26, 2010 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 Quote Link to comment https://forums.phpfreaks.com/topic/189819-help-with-zend_is_callable-trying-to-make-a-midi-extension/ Share on other sites More sharing options...
SwiftlyTilting Posted January 26, 2010 Author Share Posted January 26, 2010 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 Quote Link to comment https://forums.phpfreaks.com/topic/189819-help-with-zend_is_callable-trying-to-make-a-midi-extension/#findComment-1001754 Share on other sites More sharing options...
SwiftlyTilting Posted January 26, 2010 Author Share Posted January 26, 2010 I solved this by sending a message to the window instead of trying to call the callback function.. it works, though i'd like to be able to call a php function from the callback if possible. cheers Quote Link to comment https://forums.phpfreaks.com/topic/189819-help-with-zend_is_callable-trying-to-make-a-midi-extension/#findComment-1001823 Share on other sites More sharing options...
berkon Posted March 11, 2013 Share Posted March 11, 2013 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! Quote Link to comment https://forums.phpfreaks.com/topic/189819-help-with-zend_is_callable-trying-to-make-a-midi-extension/#findComment-1417955 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.