> > (iiii) is definitely not ai, so the struct variant is supposed to work > -- the array variant not. > > Am Montag, den 14.12.2009, 18:58 +0100 schrieb Kos: > > I tried to set the return value to int[], so it doesn't had to guess the > > return type. But then it segfaults. > > vala file: http://pastebin.org/64817 > > > generated c file: http://pastebin.org/64814 > > backtrace: see vala file > > > > I also tried to set the return value to a struct with 4 ints > > (org_freedesktop_MediaPlayer.State), but then the c-compiler errors: > > > vlc_test2.vala.c: In function ‘_dynamic_GetStatus0’: > > vlc_test2.vala.c:244: error: ‘result’ redeclared as different kind of symbol > > vlc_test2.vala.c:243: note: previous definition of ‘result’ was here > > > vlc_test2.vala.c:249: warning: ‘return’ with a value, in function returning > > Can you post a self-contained sample for this, please? What do I need to > install to test? > > Of course I want to give you the source files.
You can find the test-source here: http://pastebin.org/65108 I compile it with valac --pkg dbus-glib-1 vlc_test3.vala -g If you want to test it, you have to install VLC. After that you have to enable the DBus support of VLC by going to tools->preferences. There you will find a "show settings" radio button at the bottom left. Set it to All. Than you go to interface->control interface and check the 'D-Bus control interface' checkbox. Restart VLC. Now the GetStatus of org.mpris.vlc will return (2 0 0 0) when the program is running, but not playing. If you have amarok, it's a little bit easier. Just open amarok and make sure it isn't playing or pauzed. Than you have to change the org.mpris.vlc to org.mpris.amarok in my file and you should always get (2 0 0 0) when accessing GetStatus over DBus. Happy testing > Cheers, > > :M: > >
_______________________________________________ Vala-list mailing list Vala-list@gnome.org http://mail.gnome.org/mailman/listinfo/vala-list