[Vala] Vala: JACK Audio Binding

2010-06-26 Thread Harry Van Haaren
Hey all, I'm learning Vala at the moment, primarily with the intention to develop apps which support JACK audio output. I'm gonna work towards GStreamer based audio routing, and JACK Transport to Start/Stop my app. For the while, I hope to have a play around with JACK using Vala. So I went lookin

Re: [Vala] Vala: JACK Audio Binding

2010-06-26 Thread Harry Van Haaren
ct some memory errors on some functions I > haven't used. It gives plenty of warning now (it should be updated for > vala 0.9), but it should compile. > > Also, the binding are for version 0.116. If you need features from > 0.118, they'll have to be added. > > Regards

Re: [Vala] Genie, subclassing and some help!

2010-06-29 Thread Harry Van Haaren
Hey! 2) Perhaps related, in the main.gs file, I have: > > init >Gtk.init(ref args) >create_indicator() >Gtk.main() > > However, if I don;t put the Gtk.main() in the function above (rather > than the init), it doesn't work. Why is this/is this on purpose? > Maybe you understand this al

[Vala] ValaIde & Valac: Command line compilation

2010-06-29 Thread Harry Van Haaren
Hey all, I'm wondering how things work if I develop my program using ValaIde, and then I want to compile it on a different PC/Platform. Would I have to download the ValaIde for that platform? Or could I do some valac -vide main.vala kind of magic? Cheers, -Harry _

[Vala] Manual VAPI writing

2010-06-29 Thread Harry Van Haaren
Hey all, I'm attempting to learn how to write .vapi files manually. I've looked trough the Jack binding, the GTK+ binding and the sfml bindings. Yet im stumped as to how to write a wrapper for the dead-simple function (declared in a file called bindMe.h): *int add (int a, int b) { return (a

Re: [Vala] Manual VAPI writing

2010-06-29 Thread Harry Van Haaren
Andrea wrote: > if your intent is to bind ad use the add function your binding it's > quite right, but can be simpler: > > [CCode (cheader_filename="bindMe.h")] > namespace Math > { > [CCode (cname="add")] >public static int add (int a, int b); > } > Thanks, that's what I needed to

Re: [Vala] Manual VAPI writing

2010-06-29 Thread Harry Van Haaren
> > Any pointers as to how to do this? Cheers, -Harry > Use cprefix="" - maybe you also need to set cname="int" in order to have > Vala know what to call the type of the values. > Yes! Thanks, that worked a charm. Next stumbling block found: when opening a file, sf_open(...) is called. To clos

Re: [Vala] ValaIde & Valac: Command line compilation

2010-06-30 Thread Harry Van Haaren
On Wed, Jun 30, 2010 at 10:41 AM, synkro wrote: > Hi! > > To cross compile for another target platform you need at least a C compiler > for that. You then redirect valac to us that compiler. For example: You > native platform is Windows and want to build a i386 Linux binary then you > need a Linu

Re: [Vala] Genie, subclassing and some help!

2010-06-30 Thread Harry Van Haaren
> > In the .vide project you have included a file in > > /home/andrew/Temp/appindicator-0.1.vapi > > Were going to need that file too. Put it in the vapi folder. > > The vapi is in the vapi/ dir, don't know why it has been set to another > directory sorry about that. The appindicator-0.1.vapi is in

[Vala] Void*, how to deal with it

2010-06-30 Thread Harry Van Haaren
Hey All, I've got a function in the JACK.vapi binding, that returns a buffer. Now it doesnt "physically" return the buffer, but returns a void* to the buffer. I checked the Vala tutorial for any references to void*, and didnt find anything... This is the function (to be called on a Port object

Re: [Vala] Genie, subclassing and some help!

2010-06-30 Thread Harry Van Haaren
Aha, fully understand the problem now at least. Do you have one of these "appIndicator" dock things in your panel? The following document [1] seems to say that they might re-design/ change some things in how the docks work. I'm running LXDE, (no fancy AppIndicator dock I dont think...). What I s

Re: [Vala] how to access the length attribute of multi dimensional arrays?

2010-07-01 Thread Harry Van Haaren
Hey, I've no experience with Multi-Dimensional arrays in Vala, but I can quote a tutorial: http://live.gnome.org/Vala/ValaForJavaProgrammers#Arrays It provides the basics of Vala for Java programmers (me.. in college ;-( but also has a piece that might be of intrest to you. HTH, -Harry On Fri,

Re: [Vala] Void*, how to deal with it

2010-07-02 Thread Harry Van Haaren
cast void* get_buffer to > DefaultAudioSample, something like this (untested!): > > DefaultAudioSample* buffer = > (DefaultAudioSample*)master_l.get_buffer(nframes); > > Let me know if it works. > alb > > > On Wed, 2010-06-30 at 14:26 +0100, Harry Van Haaren wrote: &g

Re: [Vala] Genie, subclassing and some help!

2010-07-03 Thread Harry Van Haaren
Don't worry got it solved, indicator was being lost (a local variable) > and so I had to bind it as a property of the class and now even > subclassing works! > Hey, Glad you got it working... any chance you'd post a .zip of the files as you had before with the working example..? To test on my LX

Re: [Vala] Genie, subclassing and some help!

2010-07-06 Thread Harry Van Haaren
Hey, Got this compiled after a little hassle, for people that want the command: valac --vapidir=./ --pkg gtk+-2.0 --pkg appindicator-0.1 --pkg webkit-1.0 indicator.gs webkit_view.gs main_window.gs main.gs with the appindicator.vapi in the same dir as the files. It should compile, assuming you ha

[Vala] Global "int" variable.. Problems?

2010-07-07 Thread Harry Van Haaren
Hey all, I'm getting some strange errors... I'm trying to use a global int to count something, but when I try compiling this: int index; public int main(string[] args) { stdout.printf("Ran program: %i",index); return 0; } I get the following errors: default/main.c:13: error: ‘index’ red

Re: [Vala] Global "int" variable.. Problems?

2010-07-07 Thread Harry Van Haaren
> Probably 'index' is already defined as a function or variable in some > header. > In fact if you put all the code in a namespace, it compiles with no errors. > Wauw, that simple.. Nice one. :-) Happy coding for me now, -Harry ___ vala-list mailing lis

Re: [Vala] array declaration

2010-07-07 Thread Harry Van Haaren
Hey, Coming from a C++ background I first tried typeHere nameHere[]; too. I noticed that newer languages seemed to have type[] name; configuration (Java, C# etc). I'm not part of the Vala team though, so I dont know the "official" status! -Harry On Wed, Jul 7, 2010 at 5:15 PM, pancake wr

Re: [Vala] Delegate on struct

2010-07-07 Thread Harry Van Haaren
Hey Nicolas, Any chance you'd compile with valac --save-temps ? And then maybe post line 113 from your test.c file so we can see what's really going on there? Cheers, -Harry On Thu, Jul 8, 2010 at 12:14 AM, Nicolas HENRY wrote: > Hello, > > I don't understand why this code produce a warning

Re: [Vala] Delegate on struct

2010-07-10 Thread Harry Van Haaren
unc_target_destroy_notify == NULL) ? NULL : > (t.my_struct_func_target_destroy_notify (t.my_struct_func_target), > NULL), t.my_struct_func = NULL, t.my_struct_func_target = NULL, > t.my_struct_func_target_destroy_notify = NULL), t.my_struct_func_target > = block1_data_ref (_data1_), t.my_st

Re: [Vala] clutter-gst and gst

2010-07-17 Thread Harry Van Haaren
Hey, The link you posted seems dead, I got a "page not found" after clicking it..? OTOH: Have you tried rebuilding your pipeline using the "gst-launch" command line tool? This should show if its a GStreamer error, or your code... I'm not familiar with GSt much, so I'll only be of limited use. Ch

Re: [Vala] gstreamer-controller bindings

2010-07-19 Thread Harry Van Haaren
Hey Rafael, What I've done when things don't seem to work, is figure out what the exact command is to compile the C file, and then edit the C file & compile it. (Without valac, because as you said, that would overwrite the C file.) How you can do this is pass valac the --save-temps switch, and

Re: [Vala] gstreamer-controller bindings

2010-07-19 Thread Harry Van Haaren
On Mon, Jul 19, 2010 at 2:54 PM, Shawn Ferris wrote: > So how to get this fixed without the fixes being overwritten by vapigen in >> the future >> > > You can use metadata to knudge vapigen to generate correct bindings. > True. That will only work if you know what the correct bindings are. I desc

Re: [Vala] Manual VAPI writing

2010-07-19 Thread Harry Van Haaren
Hey All, I had this working before, but due to Hard disk issues I lost the .vapi. Currently I have a vapi that will create the right types, initialize the object (and destroy it), but I cant figure the "read" function out anymore: // sf_count_tsf_read_float(SNDFILE *sndfile, floa

Re: [Vala] Manual VAPI writing

2010-07-19 Thread Harry Van Haaren
> > // sf_count_tsf_read_float(SNDFILE *sndfile, float *ptr, > > sf_count_t items) ; > > [CCode (cname="sf_read_float")] > > public static count_t read_float(float *array,count_t > numSamples); > > You don't want that to be a static method. Static means it doesn't wo

[Vala] Gtk Custom widget: drawing with "gtk theme" colours

2010-07-21 Thread Harry Van Haaren
Hey All, I've designed a couple of widgets now, (in various languanges: python C++ Vala) and googled for many tutorials regarding how to draw custom widgets in the GTK theme colours. I havent found any example code, or tutorial yet... I hope somebody has a pointer on how I can "extract" the colou

[Vala] exit() ? quit() ?

2010-07-21 Thread Harry Van Haaren
Hey all, Very simple question: Im looking for a "quit()" function, or "exit()". Does it exist? I'm trying to use it to quit the whole program from a constructor, so "return 0;" won't quite cut it.. -Harry ___ vala-list mailing list vala-list@gnome.org

Re: [Vala] exit() ? quit() ?

2010-07-21 Thread Harry Van Haaren
; Thanks, -Harry On Wed, Jul 21, 2010 at 11:42 PM, Robert Powell wrote: > > > On Wed, Jul 21, 2010 at 3:32 PM, Harry Van Haaren > wrote: > >> Hey all, >> >> Very simple question: Im looking for a "quit()" function, or "exit()". >>

Re: [Vala] exit() ? quit() ?

2010-07-21 Thread Harry Van Haaren
On Wed, Jul 21, 2010 at 11:50 PM, Robert Powell wrote: > > Add this to your vala file: > extern void exit(int exit_code); > That's perfect! So simple that I s/c/w ould have tought of it ;-) Cheers, -Harry ___ vala-list mailing list vala-list@gnome.org h

Re: [Vala] Gtk Custom widget: drawing with "gtk theme" colours

2010-07-22 Thread Harry Van Haaren
re! -Harry On Thu, Jul 22, 2010 at 7:20 PM, Mike Massonnet wrote: > Hi, > > 2010/7/21 Harry Van Haaren : > > Hey All, > > > > I've designed a couple of widgets now, (in various languanges: python C++ > > Vala) > > and googled for many tutorials regar

Re: [Vala] Where does monodevelop-vala hide C code?

2010-07-28 Thread Harry Van Haaren
Hey Nigel, Indeed if not told to keep the temporary files, valac will by default remove them after a compile. if compiling from the command line (which I highly recommend [1]), do the following: valac --save-temps file.vala I presume you have checked the MonoDevelop "project settings" dialog fo

Re: [Vala] vala autocomplete with monodevelop

2010-07-28 Thread Harry Van Haaren
On Wed, Jul 28, 2010 at 11:31 PM, Nigel Griffin wrote: > I'm wondering if anyone knows how to enable autocomplete with > monodevelop-vala. If my random google searches are to be believed, it seems > as though this can be accomplished somehow withe a afrodite library in vtg, > but I can't find in

Re: [Vala] vala autocomplete with monodevelop

2010-07-28 Thread Harry Van Haaren
On Thu, Jul 29, 2010 at 1:16 AM, Nigel Griffin wrote: > Thanks for the input. I did try valide, but I couldn't find any kind > vala-level source code debugging. Do you know if valide offers that, and if > so, how do I access it? > Just about every debugger available in linux is based on gdb in