On Mon, Jul 09, 2007 at 09:50:43PM +0200, Julien Claassen wrote: > Hi again! > I now try to get the output of print captured. > Where does print actually print? on stdout (of midish), so it should be received on the midish_stdout pipe > Or do the tracklist chanlist functions output their results somewhere, where I > can get them directly? they return a list; so 'print [tracklist]' prints the result on stdout (on the midish_stdout pipe) > I think I'm too stupid for this. Just so you know what I did: > I send the command print [tracklist] to midish with sendline. Then I kind of > copied the wait_ready function: > for (;;) { > if (fgets(linebuf,LINELENGTH,midish_stdout) == NULL) { > exit(0); > } > sprintf(result,"%s",linebuf); /* trying to capture output in result */ > if (strcmp(linebuf,"+ready\n") == 0) { > break; > } > } > And now I'm lost, for I can't find the output and there's even > no output to the screen... hmmm... this seems correct; but you must call waitready() before calling your code snippet to ensure that midish is ready to accept input. I mean: startmidish(); waitready(); sendline("print [tracklist]"); /* you code snippet here */ stopmidish(); i hope i'm correct; i don't have my machine to test this. Let me know if it still not work cheers, -- AlexandreReceived on Mon, 9 Jul 2007 22:46:19 +0200
This archive was generated by hypermail 2.1.8 : Wed Nov 08 2017 - 16:32:19 CET