Lumiera  0.pre.03
»edit your freedom«
TimeCode Class Reference

#include "stage/widget/timecode-widget.hpp"

Description

Widget for timecode input and display.

Adapted implementation from the Ardour DAW

Definition at line 64 of file timecode-widget.hpp.

Public Types

enum  Mode {
  SMPTE,
  MinSec,
  Frames,
  Off
}
 

Public Member Functions

 TimeCode (string clock_name, string widget_name, bool editable)
 
Time current_duration (Time position=Time::ZERO) const
 
Time current_time (Time position=Time::ZERO) const
 
void focus ()
 
Mode mode () const
 
string name () const
 
void set (Time when, bool force=false)
 
void set_mode (Mode)
 
void set_widget_name (string)
 

Static Public Member Functions

static bool has_focus ()
 

Static Public Attributes

static sigc::signal< void > ModeChanged
 

Public Attributes

sigc::signal< void > ChangeAborted
 
sigc::signal< void > ValueChanged
 

Private Types

enum  Field {
  SMPTE_Hours,
  SMPTE_Minutes,
  SMPTE_Seconds,
  SMPTE_Frames,
  MS_Hours,
  MS_Minutes,
  MS_Seconds,
  VFrames
}
 

Private Member Functions

Time audio_time_from_display () const
 
void build_ops_menu ()
 
bool drop_focus_handler (GdkEventFocus *ev)
 
bool field_button_press_event (GdkEventButton *ev, Field)
 
bool field_button_release_event (GdkEventButton *ev, Field)
 
bool field_button_scroll_event (GdkEventScroll *ev, Field)
 
bool field_focus_gain_event (GdkEventFocus *, Field)
 
bool field_focus_loss_event (GdkEventFocus *, Field)
 
bool field_key_press_event (GdkEventKey *ev, Field)
 
bool field_key_release_event (GdkEventKey *ev, Field)
 
bool field_motion_notify_event (GdkEventMotion *ev, Field)
 
int get_frames (Field, Time pos=Time::ZERO, int dir=1)
 
void get_ink_pixel_size (Glib::RefPtr< Pango::Layout > layout, int &width, int &height)
 
Time minsec_time_from_display () const
 
void on_realize ()
 
void set_frames (Time, bool)
 
void set_minsec (Time, bool)
 
void set_size_request_to_display_given_text (Gtk::Widget &w, const gchar *text, gint hpadding, gint vpadding)
 
void set_size_requests ()
 
void set_smpte (Time, bool)
 
void setup_events ()
 
void smpte_offset_changed ()
 
void smpte_sanitize_display ()
 
Time smpte_time_from_display () const
 

Private Attributes

Mode _mode
 
string _name
 
Gtk::EventBox audio_frames_ebox
 
Gtk::Label audio_frames_label
 
Gtk::EventBox clock_base
 
Gtk::Frame clock_frame
 
Gtk::Label colon1
 
Gtk::Label colon2
 
Gtk::Label colon3
 
Gtk::Label colon4
 
Gtk::Label colon5
 
double drag_accum
 
double drag_start_y
 
double drag_y
 
bool dragging
 
bool editable
 
Gtk::EventBox frames_ebox
 
Gtk::Label frames_label
 
Gtk::HBox frames_packer
 
Gtk::HBox frames_packer_hbox
 
Gtk::EventBox hours_ebox
 
Gtk::Label hours_label
 
uint key_entry_state
 
int last_frames
 
int last_hrs
 
int last_mins
 
bool last_negative
 
bool last_pdelta
 
bool last_sdelta
 
int last_secs
 
TimeVar last_when
 
Gtk::HBox minsec_packer
 
Gtk::HBox minsec_packer_hbox
 
Gtk::EventBox minutes_ebox
 
Gtk::Label minutes_label
 
Gtk::EventBox ms_hours_ebox
 
Gtk::Label ms_hours_label
 
int ms_last_hrs
 
int ms_last_mins
 
float ms_last_secs
 
Gtk::EventBox ms_minutes_ebox
 
Gtk::Label ms_minutes_label
 
Gtk::EventBox ms_seconds_ebox
 
Gtk::Label ms_seconds_label
 
Gtk::HBox off_hbox
 
Gtk::Menu * ops_menu
 
Gtk::EventBox seconds_ebox
 
Gtk::Label seconds_label
 
Gtk::HBox smpte_packer
 
Gtk::HBox smpte_packer_hbox
 

Static Private Attributes

static bool _has_focus
 
static const uint field_length [(int) VFrames+1]
 

Member Function Documentation

◆ field_focus_gain_event()

bool field_focus_gain_event ( GdkEventFocus *  ,
Field  field 
)
private

audio_frames_ebox.set_flags(Gtk::HAS_FOCUS);

Definition at line 798 of file timecode-widget.cpp.

Member Data Documentation

◆ field_length

const unsigned int field_length
staticprivate
Initial value:
= {
2,
2,
2,
2,
2,
2,
5,
10
}

Definition at line 211 of file timecode-widget.hpp.

+ Inheritance diagram for TimeCode:
+ Collaboration diagram for TimeCode:

The documentation for this class was generated from the following files: