Knob: instantiate SimpleKnobImageSource by default
[libprolooks.git] / prolooks / LineGraphDemo.vala
blob64d63b5dbcd3f1e5fb002860f3da1a39bd22e5ce
1 /*
2 Copyright 2009 by Hans Baier, Krzysztof Foltman
3 License: LGPLv2+
4 */
6 using Gtk;
8 namespace Prolooks {
10 class TestFrequencyResponseSource : IHasFrequencyResponse, GLib.Object {
11 public float freq_gain (int subindex, float freq, float srate) {
12 return freq / srate;
14 public int sampling_rate() {
15 return 44100;
19 static int main (string[] args) {
20 Gtk.init (ref args);
21 var window = new Window (WindowType.TOPLEVEL);
22 var graph = new LineGraph ();
23 var freq_resp_src = new TestFrequencyResponseSource();
24 var freq_resp_grph_src = new FrequencyResponseGraphSource();
25 freq_resp_grph_src.freq_response_source = freq_resp_src;
26 graph.source = freq_resp_grph_src;
27 window.add (graph);
28 window.destroy += Gtk.main_quit;
29 window.show_all ();
30 Gtk.main ();
31 return 0;
35 } // namespace Prolooks