4 * Copyright (C) 1997-2017 Adam Williams <broadcast at earthling dot net>
5 * Copyright (C) 2003-2016 Cinelerra CV contributors
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
24 #include "edlsession.h"
26 #include "mainclock.h"
30 MainClock::MainClock(MWindow *mwindow, int x, int y, int w)
31 : BC_Title(x, y, "", CLOCKFONT, //MEDIUM_7SEGMENT,
32 mwindow->theme->clock_fg_color, 0, w)
34 this->mwindow = mwindow;
36 set_bg_color(mwindow->theme->clock_bg_color);
37 // *** CONTEXT_HELP ***
38 context_help_set_keyword("Time Format section");
41 MainClock::~MainClock()
45 void MainClock::set_position_offset(double value)
47 position_offset = value;
50 void MainClock::update(double position)
52 lock_window("MainClock::update");
53 char string[BCTEXTLEN];
54 position += position_offset;
55 double timecode_offset =
56 mwindow->edl->session->time_format == TIME_TIMECODE ?
57 mwindow->get_timecode_offset() : 0 ;
58 Units::totext(string, position,
59 mwindow->edl->session->time_format,
60 mwindow->edl->session->sample_rate,
61 mwindow->edl->session->frame_rate,
62 mwindow->edl->session->frames_per_foot,
64 BC_Title::update(string);
68 void MainClock::clear()
70 lock_window("MainClock::clear");