1 /* Copyright 2009-2010 Yorba Foundation
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.
11 class VideoProject : Project {
12 public TimecodeTimeSystem time_provider;
14 public override void load_complete() {
15 if (find_video_track() == null) {
16 add_track(new VideoTrack(this));
20 public VideoProject(string? filename) throws Error {
22 // TODO: When vala supports throwing from base constructor remove this check
24 time_provider = new TimecodeTimeSystem();
28 public override string get_app_name() {
32 public override TimeCode get_clip_time(ClipFile f) {
35 if (f.is_of_type(MediaType.VIDEO)) {
37 if (!get_framerate_fraction(out rate)) {
38 rate.numerator = 2997;
39 rate.denominator = 100;
41 t = frame_to_time(time_to_frame_with_rate(f.length, rate), rate);
43 t.get_from_length(f.length);
48 public void go_previous_frame() {
49 VideoTrack? video_track = find_video_track();
50 if (video_track != null) {
51 media_engine.go(video_track.previous_frame(transport_get_position()));
55 public void go_next_frame() {
56 VideoTrack? video_track = find_video_track();
57 if (video_track != null) {
58 media_engine.go(video_track.next_frame(transport_get_position()));
62 public bool get_framerate_fraction(out Fraction rate) {
63 foreach (Track track in tracks) {
64 VideoTrack video_track = track as VideoTrack;
65 if (video_track != null && video_track.get_framerate(out rate))