Initial commit
[fillmore] / src / fillmore / FillmoreClassFactory.vala
1 /* Copyright 2009-2010 Yorba Foundation
2  *
3  * This software is licensed under the GNU Lesser General Public License
4  * (version 2.1 or later).  See the COPYING file in this distribution. 
5  */
6
7 class TrackSeparator : Gtk.HSeparator {
8 //this class is referenced in the resource file
9 }
10
11 class FillmoreTrackView : Gtk.VBox, TrackView {
12     TrackView track_view;
13     public FillmoreTrackView(TrackView track_view) {
14         this.track_view = track_view;
15         track_view.clip_view_added.connect(on_clip_view_added);
16
17         pack_start(track_view, true, true, 0);
18         pack_start(new TrackSeparator(), false, false, 0);
19         can_focus = false;
20     }
21
22     public void move_to_top(ClipView clip_view) {
23         track_view.move_to_top(clip_view);
24     }
25
26     public void resize() {
27         track_view.resize();
28     }
29
30     public Model.Track get_track() {
31         return track_view.get_track();
32     }
33
34     public int get_track_height() {
35         return track_view.get_track_height();
36     }
37
38     void on_clip_view_added(ClipView clip_view) {
39         clip_view_added(clip_view);
40     }
41
42     Gtk.Widget? find_child(double x, double y) {
43         return track_view.find_child(x, y);
44     }
45
46     void select_all() {
47         track_view.select_all();
48     }
49 }
50
51 public class FillmoreClassFactory : ClassFactory {
52     public override TrackView get_track_view(Model.Track track, TimeLine timeline) {
53         TrackView track_view = base.get_track_view(track, timeline);
54         return new FillmoreTrackView(track_view);
55     }
56 }