all new implementation of audio clocks, with entirely new editing model. not entirely finished, but lookable, and usable

git-svn-id: svn://localhost/ardour2/branches/3.0@10662 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
Paul Davis 2011-11-17 22:49:13 +00:00
parent f07c92530c
commit b25fbc8a95
29 changed files with 997 additions and 1261 deletions

View File

@ -1159,11 +1159,6 @@ style "location_row_button" = "default_button"
font_name = "%FONT_NORMAL%"
}
style "location_rows_clock" = "default_clock_display"
{
font_name = "%FONT_BIG%"
}
style "pan_slider"
{
font_name = "%FONT_NORMAL%"
@ -1341,15 +1336,6 @@ widget "*AudioClockSMPTEUpperInfo" style:highest "tempo_meter_clock_display"
widget "*AudioClockSMPTELowerInfo" style:highest "tempo_meter_clock_display"
widget "*AudioClockBBTUpperInfo" style:highest "tempo_meter_clock_display"
widget "*AudioClockBBTLowerInfo" style:highest "tempo_meter_clock_display"
widget "*SelectionStartClock" style:highest "default_clock_display"
widget "*SelectionEndClock" style:highest "default_clock_display"
widget "*EditPointClock" style:highest "default_clock_display"
widget "*PreRollClock" style:highest "default_clock_display"
widget "*PostRollClock" style:highest "default_clock_display"
widget "*NudgeClock" style:highest "default_clock_display"
widget "*InsertTimeClock" style:highest "default_clock_display"
widget "*ZoomRangeClock" style:highest "default_clock_display"
widget "*SMPTEOffsetClock" style:highest "default_clock_display"
widget "*TransportLabel" style:highest "small_bold_text"
widget "*TakeLabel" style:highest "small_bold_text"
widget "*LocationLabel" style:highest "small_bold_text"

View File

@ -55,6 +55,11 @@ style "larger_text"
font_name = "@FONT_LARGE@"
}
style "massive_text"
{
font_name = "@FONT_MASSIVE@"
}
style "larger_bold_text"
{
font_name = "bold @FONT_LARGE@"

View File

@ -60,15 +60,6 @@ style "very_small_red_active_and_selected_button" = "very_small_button"
bg[SELECTED] = @@COLPREFIX@_bright_indicator
}
style "punch_button" = "very_small_red_active_and_selected_button"
{
font_name = "@FONT_SMALLER@"
fg[ACTIVE] = @@COLPREFIX@_darkest
bg[ACTIVE] = @@COLPREFIX@_bright_indicator
bg[SELECTED] = @@COLPREFIX@_bright_indicator
}
style "small_red_active_and_selected_button" = "small_button"
{
fg[ACTIVE] = @@COLPREFIX@_darkest
@ -648,99 +639,6 @@ style "small_red_on_black_entry" = "small_bold_text"
bg[ACTIVE] = @@COLPREFIX@_base
}
#
# Clocks: "text" is the clock digits; "base" is the bg
#
style "non_recording_big_clock_display" = "medium_entry"
{
font_name = "@FONT_MASSIVE@"
text[NORMAL] = @@COLPREFIX@_control_text
text[ACTIVE] = @@COLPREFIX@_bright_indicator
text[SELECTED] = @@COLPREFIX@_bright_indicator
text[PRELIGHT] = @@COLPREFIX@_bright_indicator
text[INSENSITIVE] = @@COLPREFIX@_bright_indicator
base[NORMAL] = @@COLPREFIX@_control_base
base[ACTIVE] = shade(0.5,@@COLPREFIX@_bright_indicator)
}
style "recording_big_clock_display" = "non_recording_big_clock_display"
{
text[NORMAL] = darker(@@COLPREFIX@_arm)
}
style "transport_clock_display"
{
font_name = "@FONT_BOLD_BIG@"
text[NORMAL] = darker (@@COLPREFIX@_contrasting_indicator)
text[ACTIVE] = darker (@@COLPREFIX@_bright_indicator)
text[SELECTED] = darker(@@COLPREFIX@_bright_indicator)
text[PRELIGHT] = darker(@@COLPREFIX@_bright_indicator)
text[INSENSITIVE] = darker(@@COLPREFIX@_bright_indicator)
base[NORMAL] = @@COLPREFIX@_darkest
base[ACTIVE] = @@COLPREFIX@_darkest
bg[NORMAL] = @@COLPREFIX@_darkest
bg[ACTIVE] = @@COLPREFIX@_darkest
}
style "transport_clock_display_delta" = "transport_clock_display"
{
text[NORMAL] = @@COLPREFIX@_bright_color
}
style "tempo_meter_clock_display" = "very_small_text"
{
text[NORMAL] = @@COLPREFIX@_fg
text[ACTIVE] = @@COLPREFIX@_somewhat_bright_indicator
text[SELECTED] = @@COLPREFIX@_bright_indicator
base[NORMAL] = @@COLPREFIX@_base
base[ACTIVE] = @@COLPREFIX@_contrasting_indicator
}
style "default_clock_display" = "medium_text"
{
text[NORMAL] = @@COLPREFIX@_contrasting_indicator
text[ACTIVE] = @@COLPREFIX@_bright_indicator
text[SELECTED] = @@COLPREFIX@_bright_indicator
base[NORMAL] = @@COLPREFIX@_darkest
base[ACTIVE] = @@COLPREFIX@_darkest
}
style "selection_clock_display"
{
font_name = "@FONT_SMALLER@"
text[NORMAL] = @@COLPREFIX@_contrasting_indicator
text[ACTIVE] = @@COLPREFIX@_bright_indicator
text[SELECTED] = @@COLPREFIX@_bright_indicator
base[NORMAL] = @@COLPREFIX@_darkest
base[ACTIVE] = @@COLPREFIX@_darkest
}
style "punch_clock_display" = "very_small_text"
{
font_name = "@FONT_SMALLER@"
text[NORMAL] = @@COLPREFIX@_contrasting_indicator
text[ACTIVE] = @@COLPREFIX@_bright_indicator
text[SELECTED] = @@COLPREFIX@_bright_indicator
base[NORMAL] = @@COLPREFIX@_darkest
base[ACTIVE] = @@COLPREFIX@_darkest
}
style "white_on_black_clock_display" = "medium_text"
{
text[NORMAL] = @@COLPREFIX@_fg
text[ACTIVE] = @@COLPREFIX@_bright_indicator
base[SELECTED] = @@COLPREFIX@_bright_indicator
base[NORMAL] = @@COLPREFIX@_darkest
base[ACTIVE] = @@COLPREFIX@_darkest
}
style "editor_time_ruler" = "small_text"
{
fg[NORMAL] = @@COLPREFIX@_fg
@ -1019,10 +917,6 @@ style "location_row_button" = "default_button"
font_name = "@FONT_NORMAL@"
}
style "location_rows_clock" = "default_clock_display"
{
font_name = "@FONT_NORMAL@"
}
style "ardour_button" ="default_button"
{

View File

@ -639,5 +639,36 @@
<Option name="route button: text" value="c7c7d8ff"/>
<Option name="route button: text active" value="c8c8d9ff"/>
<Option name="route button: text mid" value="000000ff"/>
<Option name="transport clock: text" value="6bb620ff"/>
<Option name="transport clock: background" value="000000ff"/>
<Option name="transport clock: edited text" value="ff0000ff"/>
<Option name="secondary clock: text" value="6bb620ff"/>
<Option name="secondary clock: background" value="000000ff"/>
<Option name="secondary clock: edited text" value="ff0000ff"/>
<Option name="big clock: text" value="f0f0f0ff"/>
<Option name="big clock: background" value="020202ff"/>
<Option name="big clock: edited text" value="0073a3ff"/>
<Option name="big clock active: text" value="020202ff"/>
<Option name="big clock active: background" value="f11000ff"/>
<Option name="big clock active: edited text" value="0073a3ff"/>
<Option name="transport delta clock: text" value="0009f3ff"/>
<Option name="transport delta clock: background" value="000000ff"/>
<Option name="transport delta clock: edited text" value="ff0000ff"/>
<Option name="secondary delta clock: text" value="0009f3ff"/>
<Option name="secondary delta clock: background" value="000000ff"/>
<Option name="secondary delta clock: edited text" value="ff0000ff"/>
<Option name="punch clock: text" value="6bb620ff"/>
<Option name="punch clock: background" value="000000ff"/>
<Option name="punch clock: edited text" value="ff0000ff"/>
<Option name="nudge clock: text" value="6bb620ff"/>
<Option name="nudge clock: background" value="000000ff"/>
<Option name="nudge clock: edited text" value="ff0000ff"/>
<Option name="selection clock: text" value="6bb620ff"/>
<Option name="selection clock: background" value="000000ff"/>
<Option name="selection clock: edited text" value="ff0000ff"/>
<Option name="clock: text" value="6bb620ff"/>
<Option name="clock: background" value="000000ff"/>
<Option name="clock: edited text" value="ff0000ff"/>
</Canvas>
</Ardour>

View File

@ -125,24 +125,21 @@ widget "*ErrorMessage" style:highest "error_message"
widget "*FatalMessage" style:highest "fatal_message"
widget "*InfoMessage" style:highest "info_message"
widget "*WarningMessage" style:highest "warning_message"
widget "*BigClockNonRecording" style:highest "non_recording_big_clock_display"
widget "*BigClockRecording" style:highest "recording_big_clock_display"
widget "*SelectionClockDisplay" style:highest "selection_clock_display"
widget "*PunchClockDisplay" style:highest "punch_clock_display"
widget "*TransportClockDisplay" style:highest "transport_clock_display"
widget "*SecondaryClockDisplay" style:highest "transport_clock_display"
widget "*TransportClockDisplayDelta" style:highest "transport_clock_display_delta"
widget "*SecondaryClockDisplayDelta" style:highest "transport_clock_display_delta"
widget "*SelectionStartClock" style:highest "default_clock_display"
widget "*SelectionEndClock" style:highest "default_clock_display"
widget "*SilenceDurationClock" style:highest "white_on_black_clock_display"
widget "*EditPointClock" style:highest "default_clock_display"
widget "*PreRollClock" style:highest "default_clock_display"
widget "*PostRollClock" style:highest "default_clock_display"
widget "*NudgeClock" style:highest "default_clock_display"
widget "*MenuBarClock" style:highest "default_clock_display"
widget "*ZoomRangeClock" style:highest "default_clock_display"
widget "*TimecodeOffsetClock" style:highest "default_clock_display"
widget "*big clock" style:highest "massive_text"
widget "*selection clock" style:highest "small_text"
widget "*punch clock" style:highest "small_text"
widget "*transport clock" style:highest "large_bold_text"
widget "*secondary clock" style:highest "large_bold_text"
widget "*transport delta clock" style:highest "large_bold_text"
widget "*secondary delta clock" style:highest "large_bold_text"
widget "*silence duration clock" style:highest "medium_text"
widget "*edit point clock" style:highest "medium_text"
widget "*nudge clock" style:highest "medium_text"
widget "*menubar clock" style:highest "medium_text"
widget "*zoomrange clock" style:highest "medium_text"
widget "*timecodeoffset clock" style:highest "medium_text"
widget "*TransportLabel" style:highest "small_bold_text"
widget "*TakeLabel" style:highest "small_bold_text"
widget "*LocationLabel" style:highest "small_bold_text"
@ -250,7 +247,6 @@ widget "*MixerGroupList" style:highest "treeview_display"
widget "*RegionEditorLabel" style:highest "medium_text"
widget "*RegionEditorSmallLabel" style:highest "small_text"
widget "*RegionEditorEntry" style:highest "medium_entry"
widget "*RegionEditorClock" style:highest "default_clock_display"
widget "*RegionEditorToggleButton" style:highest "paler_bright_when_active"
widget "*RegionEditorToggleButton*" style:highest "paler_bright_when_active"
widget "*MixerStripSpeedBase" style:highest "small_entry"
@ -330,7 +326,7 @@ widget "*NewSessionChannelChoice" style:highest "medium_bold_entry"
widget "*NewSessionMainButton" style:highest "large_bold_text"
widget "*NewSessionMainButton*" style:highest "large_bold_text"
widget "*NewSessionMainLabel" style:highest "large_bold_text"
widget "*LocationEditRowClock" style:highest "location_rows_clock"
widget "*location edit row clock" style:highest "medium_text"
widget "*LocationEditNameLabel" style:highest "medium_text"
widget "*LocationEditSetButton" style:highest "location_row_button"
widget "*LocationEditSetButton*" style:highest "location_row_button"
@ -365,15 +361,13 @@ widget "*solo safe" style:highest "solo_safe"
widget "*ContrastingPopup" style:highest "contrasting_popup"
widget "*ContrastingPopup*" style:highest "contrasting_popup"
widget "*MidiChannelSelectorButton" style:highest "midi_channel_selector_button"
widget "*TimeInfoSelectionTitle" style:highest "very_small_bright_when_active"
widget "*TimeInfoSelectionLabel" style:highest "very_small_bright_when_active"
widget "*TimeInfoPunchTitle" style:highest "very_small_bright_when_active"
widget "*TimeInfoPunchLabel" style:highest "very_small_bright_when_active"
widget "*TimeInfoPunchButton" style:highest "punch_button"
widget "*TimeInfoSelectionTitle" style:highest "very_small_text"
widget "*TimeInfoSelectionLabel" style:highest "very_small_text"
widget "*TimeInfoPunchTitle" style:highest "very_small_text"
widget "*TimeInfoPunchButton" style:highest "very_small_text"
widget "*RouteNameEditorEntry" style:highest "text_cell_entry"
widget "*RegionNameEditorEntry" style:highest "text_cell_entry"
widget "*MixerMidiInputEnableButton" style:highest "mouse_mode_button"
widget "*InsertTimeClock" style:highest "default_clock_display"
widget "*EditorRouteGroupsAllGroupButton" style:highest "default_toggle_button"
widget "*MidiSoundNotesButton" style:highest "default_toggle_button"
widget "*MeasureLatencyButton" style:highest "default_toggle_button"

View File

@ -627,20 +627,6 @@ ArdourButton::set_image (const RefPtr<Gdk::Pixbuf>& img)
queue_draw ();
}
void
ArdourButton::set_active (bool yn)
{
/* this is an API simplification for buttons
that only use the Active and Normal states.
*/
if (yn) {
set_active_state (Gtkmm2ext::Active);
} else {
unset_active_state ();
}
}
void
ArdourButton::set_active_state (Gtkmm2ext::ActiveState s)
{

View File

@ -59,12 +59,6 @@ class ArdourButton : public CairoWidget
void set_active_state (Gtkmm2ext::ActiveState);
void set_visual_state (Gtkmm2ext::VisualState);
/* this is an API simplification for buttons
that only use the Active and Normal active states.
*/
void set_active (bool);
bool get_active () { return active_state() != Gtkmm2ext::ActiveState (0); }
void set_elements (Element);
Element elements() const { return _elements; }

View File

@ -137,12 +137,12 @@ ARDOUR_UI::ARDOUR_UI (int *argcp, char **argvp[])
: Gtkmm2ext::UI (PROGRAM_NAME, argcp, argvp)
, gui_object_state (new GUIObjectState)
, primary_clock (new AudioClock (X_("primary"), false, X_("TransportClockDisplay"), true, true, false, true))
, secondary_clock (new AudioClock (X_("secondary"), false, X_("SecondaryClockDisplay"), true, true, false, true))
, primary_clock (new AudioClock (X_("primary"), false, X_("transport"), true, true, false, true))
, secondary_clock (new AudioClock (X_("secondary"), false, X_("secondary"), true, true, false, true))
/* big clock */
, big_clock (new AudioClock (X_("bigclock"), false, "BigClockNonRecording", true, true, false, false))
, big_clock (new AudioClock (X_("bigclock"), false, "big", true, true, false, false))
/* transport */
@ -3638,13 +3638,10 @@ ARDOUR_UI::record_state_changed ()
return;
}
Session::RecordState const r = _session->record_status ();
bool const h = _session->have_rec_enabled_track ();
if (r == Session::Recording && h) {
big_clock->set_widget_name ("BigClockRecording");
if (_session->record_status () == Session::Recording && _session->have_rec_enabled_track ()) {
big_clock->set_active (true);
} else {
big_clock->set_widget_name ("BigClockNonRecording");
big_clock->set_active (false);
}
}

View File

@ -371,6 +371,7 @@ ARDOUR_UI::setup_transport ()
tbox->pack_start (rec_button, false, false, 6);
HBox* clock_box = manage (new HBox);
primary_clock->set_border_width (2);
clock_box->pack_start (*primary_clock, false, false);
if (!ARDOUR::Profile->get_small_screen()) {
@ -378,7 +379,6 @@ ARDOUR_UI::setup_transport ()
clock_box->pack_start (*secondary_clock, false, false);
}
shuttle_box = new ShuttleControl;
shuttle_box->show ();

View File

@ -637,6 +637,7 @@ ARDOUR_UI::setup_clock ()
big_clock_window->set (new Window (WINDOW_TOPLEVEL), false);
big_clock_window->get()->set_resizable (true);
big_clock_window->get()->set_keep_above (true);
big_clock_window->get()->set_border_width (0);
big_clock_window->get()->add (*big_clock);
@ -684,7 +685,7 @@ ARDOUR_UI::float_big_clock (Gtk::Window* parent)
}
void
ARDOUR_UI::big_clock_size_allocate (Gtk::Allocation&)
ARDOUR_UI::big_clock_size_allocate (Gtk::Allocation& alloc)
{
if (!big_clock_resize_in_progress) {
Glib::signal_idle().connect (sigc::bind (sigc::mem_fun (*this, &ARDOUR_UI::idle_big_clock_text_resizer), 0, 0));

File diff suppressed because it is too large Load Diff

View File

@ -21,6 +21,9 @@
#define __audio_clock_h__
#include <map>
#include <vector>
#include <pangomm.h>
#include <gtkmm/alignment.h>
#include <gtkmm/box.h>
@ -30,15 +33,13 @@
#include "ardour/ardour.h"
#include "ardour/session_handle.h"
class CairoEditableText;
class CairoCell;
class CairoTextCell;
#include "cairo_widget.h"
namespace ARDOUR {
class Session;
}
class AudioClock : public Gtk::VBox, public ARDOUR::SessionHandlePtr
class AudioClock : public CairoWidget, public ARDOUR::SessionHandlePtr
{
public:
enum Mode {
@ -55,6 +56,8 @@ class AudioClock : public Gtk::VBox, public ARDOUR::SessionHandlePtr
Mode mode() const { return _mode; }
void set_off (bool yn);
bool off() const { return _off; }
void set_widget_name (const std::string& name);
void set_active_state (Gtkmm2ext::ActiveState s);
void focus ();
@ -64,8 +67,7 @@ class AudioClock : public Gtk::VBox, public ARDOUR::SessionHandlePtr
void set_mode (Mode);
void set_bbt_reference (framepos_t);
void set_is_duration (bool);
void set_widget_name (const std::string&);
void set_draw_background (bool yn);
std::string name() const { return _name; }
@ -80,15 +82,11 @@ class AudioClock : public Gtk::VBox, public ARDOUR::SessionHandlePtr
static sigc::signal<void> ModeChanged;
static std::vector<AudioClock*> clocks;
static bool has_focus() { return _has_focus; }
CairoEditableText& main_display () const { return *display; }
CairoEditableText* supplemental_left_display () const { return supplemental_left; }
CairoEditableText* supplemental_right_display () const { return supplemental_right; }
protected:
void render (cairo_t*);
private:
Mode _mode;
uint32_t key_entry_state;
std::string _name;
bool is_transient;
bool is_duration;
@ -96,13 +94,31 @@ class AudioClock : public Gtk::VBox, public ARDOUR::SessionHandlePtr
/** true if this clock follows the playhead, meaning that certain operations are redundant */
bool _follows_playhead;
bool _off;
bool _need_bg;
Gtk::Menu *ops_menu;
CairoEditableText* display;
Glib::RefPtr<Pango::Layout> _layout;
Glib::RefPtr<Pango::Layout> _left_layout;
Glib::RefPtr<Pango::Layout> _right_layout;
Pango::AttrColor* editing_attr;
Pango::AttrColor* background_attr;
Pango::AttrColor* foreground_attr;
Pango::AttrList normal_attributes;
Pango::AttrList editing_attributes;
Pango::AttrList info_attributes;
int layout_height;
int layout_width;
int info_height;
int upper_height;
double mode_based_info_ratio;
static const double info_font_scale_factor;
static const double separator_height;
enum Field {
Timecode_Sign,
Timecode_Hours,
Timecode_Minutes,
Timecode_Seconds,
@ -115,54 +131,26 @@ class AudioClock : public Gtk::VBox, public ARDOUR::SessionHandlePtr
Beats,
Ticks,
AudioFrames,
Colon1,
Colon2,
Colon3,
Bar1,
Bar2,
LowerLeft1,
LowerLeft2,
LowerRight1,
LowerRight2,
};
/** CairoCells of various kinds for each of our non-text Fields */
std::map<Field,CairoCell*> _fixed_cells;
/** CairoTextCells for each of our text Fields */
std::map<Field, CairoTextCell*> _text_cells;
CairoTextCell* label (Field) const;
Field index_to_field (int index) const;
Gtk::HBox off_hbox;
CairoEditableText* supplemental_left;
CairoEditableText* supplemental_right;
Gtk::HBox top;
Gtk::HBox bottom;
Field editing_field;
bool editing;
std::string edit_string;
std::string pre_edit_string;
std::string input_string;
std::string::size_type insert_max;
framepos_t bbt_reference_time;
framepos_t last_when;
bool last_pdelta;
bool last_sdelta;
uint32_t last_hrs;
uint32_t last_mins;
uint32_t last_secs;
uint32_t last_frames;
bool last_negative;
long ms_last_hrs;
long ms_last_mins;
int ms_last_secs;
int ms_last_millisecs;
bool dragging;
double drag_start_y;
double drag_y;
double drag_accum;
Field drag_field;
/** true if the time of this clock is the one displayed in its widgets.
* if false, the time in the widgets is an approximation of _canonical_time,
@ -172,32 +160,26 @@ class AudioClock : public Gtk::VBox, public ARDOUR::SessionHandlePtr
framepos_t _canonical_time;
void on_realize ();
bool key_press (GdkEventKey *);
bool key_release (GdkEventKey *);
/* proxied from CairoEditableText */
bool scroll (GdkEventScroll *ev, CairoCell*);
bool button_press (GdkEventButton *ev, CairoCell*);
bool button_release (GdkEventButton *ev, CairoCell*);
sigc::connection scroll_connection;
sigc::connection button_press_connection;
sigc::connection button_release_connection;
bool field_motion_notify_event (GdkEventMotion *ev, Field);
bool field_focus_in_event (GdkEventFocus *, Field);
bool field_focus_out_event (GdkEventFocus *, Field);
bool drop_focus_handler (GdkEventFocus*);
bool on_key_press_event (GdkEventKey *);
bool on_key_release_event (GdkEventKey *);
bool on_scroll_event (GdkEventScroll *ev);
bool on_button_press_event (GdkEventButton *ev);
bool on_button_release_event(GdkEventButton *ev);
void on_style_changed (const Glib::RefPtr<Gtk::Style>&);
void on_size_request (Gtk::Requisition* req);
bool on_motion_notify_event (GdkEventMotion *ev);
void on_size_allocate (Gtk::Allocation&);
void set_timecode (framepos_t, bool);
void set_bbt (framepos_t, bool);
void set_minsec (framepos_t, bool);
void set_frames (framepos_t, bool);
framepos_t get_frames (Field, framepos_t pos = 0, int dir = 1);
framepos_t get_frame_step (Field, framepos_t pos = 0, int dir = 1);
bool timecode_validate_edit (const std::string&);
bool bbt_validate_edit (const std::string&);
void timecode_sanitize_display();
framepos_t timecode_frame_from_display () const;
framepos_t bbt_frame_from_display (framepos_t) const;
framepos_t bbt_frame_duration_from_display (framepos_t) const;
@ -208,20 +190,19 @@ class AudioClock : public Gtk::VBox, public ARDOUR::SessionHandlePtr
void session_configuration_changed (std::string);
static uint32_t field_length[];
static bool _has_focus;
Field index_to_field () const;
void on_style_changed (const Glib::RefPtr<Gtk::Style>&);
bool on_key_press_event (GdkEventKey*);
bool on_key_release_event (GdkEventKey*);
void end_edit ();
void start_edit ();
void end_edit (bool);
void edit_next_field ();
void connect_signals ();
void disconnect_signals ();
void set_font ();
void set_colors ();
void show_edit_status (int length);
void set_theme ();
void timecode_tester ();
double bg_r, bg_g, bg_b, bg_a;
};
#endif /* __audio_clock_h__ */

View File

@ -106,6 +106,20 @@ CairoWidget::set_visual_state (Gtkmm2ext::VisualState s)
}
}
void
CairoWidget::set_active (bool yn)
{
/* this is an API simplification for buttons
that only use the Active and Normal states.
*/
if (yn) {
set_active_state (Gtkmm2ext::Active);
} else {
unset_active_state ();
}
}
void
CairoWidget::on_state_changed (Gtk::StateType)
{

View File

@ -36,10 +36,22 @@ public:
Gtkmm2ext::ActiveState active_state() const { return _active_state; }
Gtkmm2ext::VisualState visual_state() const { return _visual_state; }
/* derived widgets can override these two to catch
changes in active & visual state
*/
virtual void set_active_state (Gtkmm2ext::ActiveState);
virtual void set_visual_state (Gtkmm2ext::VisualState);
virtual void unset_active_state () { set_active_state (Gtkmm2ext::ActiveState (0)); }
virtual void unset_visual_state () { set_visual_state (Gtkmm2ext::VisualState (0)); }
void unset_active_state () { set_active_state (Gtkmm2ext::ActiveState (0)); }
void unset_visual_state () { set_visual_state (Gtkmm2ext::VisualState (0)); }
/* this is an API simplification for widgets
that only use the Active and Normal active states.
*/
void set_active (bool);
bool get_active () { return active_state() != Gtkmm2ext::ActiveState (0); }
sigc::signal<void> StateChanged;

View File

@ -188,3 +188,19 @@ BUTTON_VARS(MouseModeButton, "mouse mode button")
BUTTON_VARS(ZoomButton, "zoom button")
BUTTON_VARS(RouteButton, "route button")
#define CLOCK_VARS(root,name) \
CANVAS_VARIABLE(canvasvar_ ## root ## Background, name ": background") \
CANVAS_VARIABLE(canvasvar_ ## root ## Text, name ": text") \
CANVAS_VARIABLE(canvasvar_ ## root ## EditedText, name ": edited text") \
CANVAS_VARIABLE(canvasvar_ ## root ## Cursor, name ": cursor")
CLOCK_VARS(TransportClock, "transport clock")
CLOCK_VARS(SecondaryClock, "secondary clock")
CLOCK_VARS(TransportDeltaClock, "transport delta clock")
CLOCK_VARS(SecondaryDeltaClock, "secondary delta clock")
CLOCK_VARS(BigClock, "big clock")
CLOCK_VARS(BigClockActive, "big clock active")
CLOCK_VARS(PunchClock, "punch clock")
CLOCK_VARS(SelectionClock, "selection clock")
CLOCK_VARS(NudgeClock, "nudge clock")
CLOCK_VARS(GenericClock, "clock")

View File

@ -38,8 +38,8 @@ EditNoteDialog::EditNoteDialog (MidiRegionView* rv, Gnome::Canvas::CanvasNoteEve
: ArdourDialog (_("Note"))
, _region_view (rv)
, _event (ev)
, _time_clock (X_("notetime"), true, X_("NoteTimeClock"), true, false)
, _length_clock (X_("notelength"), true, X_("NoteLengthClock"), true, false, true)
, _time_clock (X_("notetime"), true, "", true, false)
, _length_clock (X_("notelength"), true, "", true, false, true)
{
Table* table = manage (new Table (4, 2));
table->set_spacings (6);

View File

@ -262,7 +262,7 @@ Editor::Editor ()
/* tool bar related */
, zoom_range_clock (new AudioClock (X_("zoomrange"), false, X_("ZoomRangeClock"), true, false, true))
, zoom_range_clock (new AudioClock (X_("zoomrange"), false, X_("zoom range"), true, false, true))
, toolbar_selection_clock_table (2,3)
@ -276,7 +276,7 @@ Editor::Editor ()
/* nudge */
, nudge_clock (new AudioClock (X_("nudge"), false, X_("NudgeClock"), true, false, true))
, nudge_clock (new AudioClock (X_("nudge"), false, X_("nudge"), true, false, true))
, meters_running(false)
, _pending_locate_request (false)
, _pending_initial_locate (false)

View File

@ -44,11 +44,11 @@ ExportFormatDialog::ExportFormatDialog (FormatPtr format, bool new_dialog) :
silence_table (2, 4),
trim_start_checkbox (_("Trim silence at start")),
silence_start_checkbox (_("Add silence at start:")),
silence_start_clock ("silence_start", true, "PreRollClock", true, false, true),
silence_start_clock ("silence_start", true, "", true, false, true),
trim_end_checkbox (_("Trim silence at end")),
silence_end_checkbox (_("Add silence at end:")),
silence_end_clock ("silence_end", true, "PreRollClock", true, false, true),
silence_end_clock ("silence_end", true, "", true, false, true),
format_table (3, 4),
compatibility_label (_("Compatibility"), Gtk::ALIGN_LEFT),

View File

@ -31,7 +31,7 @@ using namespace Editing;
InsertTimeDialog::InsertTimeDialog (PublicEditor& e)
: ArdourDialog (_("Insert Time"))
, _editor (e)
, _clock ("insertTimeClock", true, X_("InsertTimeClock"), true, false, true, false)
, _clock ("insertTimeClock", true, "", true, false, true, false)
{
set_session (_editor.session ());

View File

@ -47,9 +47,9 @@ LocationEditRow::LocationEditRow(Session * sess, Location * loc, int32_t num)
: SessionHandlePtr (0) /* explicitly set below */
, location(0)
, item_table (1, 6, false)
, start_clock (X_("locationstart"), true, X_("LocationEditRowClock"), true, false)
, end_clock (X_("locationend"), true, X_("LocationEditRowClock"), true, false)
, length_clock (X_("locationlength"), true, X_("LocationEditRowClock"), true, false, true)
, start_clock (X_("locationstart"), true, "", true, false)
, end_clock (X_("locationend"), true, "", true, false)
, length_clock (X_("locationlength"), true, "", true, false, true)
, cd_check_button (_("CD"))
, hide_check_button (_("Hide"))
, lock_check_button (_("Lock"))
@ -136,7 +136,6 @@ LocationEditRow::LocationEditRow(Session * sess, Location * loc, int32_t num)
start_go_button.signal_clicked().connect(sigc::bind (sigc::mem_fun (*this, &LocationEditRow::go_button_pressed), LocStart));
start_to_playhead_button->signal_clicked().connect (sigc::bind (sigc::mem_fun (*this, &LocationEditRow::to_playhead_button_pressed), LocStart));
start_clock.ValueChanged.connect (sigc::bind (sigc::mem_fun (*this, &LocationEditRow::clock_changed), LocStart));
start_clock.ChangeAborted.connect (sigc::bind (sigc::mem_fun (*this, &LocationEditRow::change_aborted), LocStart));
end_hbox.pack_start (end_go_button, false, false);
end_hbox.pack_start (end_clock, false, false);
@ -145,10 +144,8 @@ LocationEditRow::LocationEditRow(Session * sess, Location * loc, int32_t num)
end_go_button.signal_clicked().connect(sigc::bind (sigc::mem_fun (*this, &LocationEditRow::go_button_pressed), LocEnd));
end_to_playhead_button->signal_clicked().connect (sigc::bind (sigc::mem_fun (*this, &LocationEditRow::to_playhead_button_pressed), LocEnd));
end_clock.ValueChanged.connect (sigc::bind (sigc::mem_fun (*this, &LocationEditRow::clock_changed), LocEnd));
end_clock.ChangeAborted.connect (sigc::bind (sigc::mem_fun (*this, &LocationEditRow::change_aborted), LocEnd));
length_clock.ValueChanged.connect (sigc::bind ( sigc::mem_fun(*this, &LocationEditRow::clock_changed), LocLength));
length_clock.ChangeAborted.connect (sigc::bind (sigc::mem_fun (*this, &LocationEditRow::change_aborted), LocLength));
cd_check_button.signal_toggled().connect(sigc::mem_fun(*this, &LocationEditRow::cd_toggled));
hide_check_button.signal_toggled().connect(sigc::mem_fun(*this, &LocationEditRow::hide_toggled));
@ -456,14 +453,6 @@ LocationEditRow::clock_changed (LocationPart part)
}
}
void
LocationEditRow::change_aborted (LocationPart /*part*/)
{
if (i_am_the_modifier || !location) return;
set_location(location);
}
void
LocationEditRow::cd_toggled ()
{

View File

@ -119,7 +119,6 @@ class LocationEditRow : public Gtk::HBox, public ARDOUR::SessionHandlePtr
void go_button_pressed (LocationPart part);
void clock_changed (LocationPart part);
void change_aborted (LocationPart part);
void cd_toggled ();
void hide_toggled ();

View File

@ -195,7 +195,7 @@ FaderOption::add_to_page (OptionEditorPage* p)
ClockOption::ClockOption (string const & i, string const & n, sigc::slot<framecnt_t> g, sigc::slot<bool, framecnt_t> s)
: Option (i, n)
, _clock (X_("timecode-offset"), false, X_("TimecodeOffsetClock"), true, false, true, false)
, _clock (X_("timecode-offset"), false, X_(""), true, false, true, false)
, _get (g)
, _set (s)
{

View File

@ -35,7 +35,7 @@ PatchChangeDialog::PatchChangeDialog (
)
: ArdourDialog (_("Patch Change"), true)
, _time_converter (tc)
, _time (X_("patchchangetime"), true, X_("PatchChangeTimeClock"), true, false)
, _time (X_("patchchangetime"), true, "", true, false)
, _channel (*manage (new Adjustment (1, 1, 16, 1, 4)))
, _program (*manage (new Adjustment (1, 1, 128, 1, 16)))
, _bank (*manage (new Adjustment (1, 1, 16384, 1, 64)))

View File

@ -51,13 +51,13 @@ RegionEditor::RegionEditor (Session* s, boost::shared_ptr<Region> r)
, name_label (_("Name:"))
, audition_button (_("Play"))
, _clock_group (new ClockGroup)
, position_clock (X_("regionposition"), true, X_("RegionEditorClock"), true, false)
, end_clock (X_("regionend"), true, X_("RegionEditorClock"), true, false)
, length_clock (X_("regionlength"), true, X_("RegionEditorClock"), true, false, true)
, sync_offset_relative_clock (X_("regionsyncoffsetrelative"), true, X_("RegionEditorClock"), true, false)
, sync_offset_absolute_clock (X_("regionsyncoffsetabsolute"), true, X_("RegionEditorClock"), true, false)
, position_clock (X_("regionposition"), true, "", true, false)
, end_clock (X_("regionend"), true, "", true, false)
, length_clock (X_("regionlength"), true, "", true, false, true)
, sync_offset_relative_clock (X_("regionsyncoffsetrelative"), true, "", true, false)
, sync_offset_absolute_clock (X_("regionsyncoffsetabsolute"), true, "", true, false)
/* XXX cannot file start yet */
, start_clock (X_("regionstart"), true, X_("RegionEditorClock"), false, false)
, start_clock (X_("regionstart"), true, "", false, false)
, _sources (1)
{
set_session (s);

View File

@ -23,7 +23,7 @@ RegionLayeringOrderEditor::RegionLayeringOrderEditor (PublicEditor& pe)
, layering_order_columns ()
, layering_order_model (Gtk::ListStore::create (layering_order_columns))
, layering_order_display ()
, clock ("layer dialog", true, "RegionLayeringOrderEditorClock", false, false, false)
, clock ("layer dialog", true, "clock", false, false, false)
, scroller ()
, editor (pe)
{

View File

@ -118,8 +118,8 @@ importmode2string (ImportMode mode)
SoundFileBox::SoundFileBox (bool persistent)
: table (6, 2),
length_clock ("sfboxLengthClock", !persistent, "EditCursorClock", false, false, true, false),
timecode_clock ("sfboxTimecodeClock", !persistent, "EditCursorClock", false, false, false, false),
length_clock ("sfboxLengthClock", !persistent, "", false, false, true, false),
timecode_clock ("sfboxTimecodeClock", !persistent, "", false, false, false, false),
main_box (false, 6),
autoplay_btn (_("Auto-play"))

View File

@ -49,8 +49,8 @@ using namespace ArdourCanvas;
StripSilenceDialog::StripSilenceDialog (Session* s, list<RegionView*> const & v)
: ArdourDialog (_("Strip Silence"))
, ProgressReporter ()
, _minimum_length (new AudioClock (X_("silence duration"), true, "SilenceDurationClock", true, false, true, false))
, _fade_length (new AudioClock (X_("silence duration"), true, "SilenceDurationClock", true, false, true, false))
, _minimum_length (new AudioClock (X_("silence duration"), true, "", true, false, true, false))
, _fade_length (new AudioClock (X_("silence duration"), true, "", true, false, true, false))
, _peaks_ready_connection (0)
, _destroying (false)
{

View File

@ -46,27 +46,18 @@ TimeInfoBox::TimeInfoBox ()
, syncing_selection (false)
, syncing_punch (false)
{
selection_start = new AudioClock ("selection-start", false, "SelectionClockDisplay", false, false, false, false);
selection_end = new AudioClock ("selection-end", false, "SelectionClockDisplay", false, false, false, false);
selection_length = new AudioClock ("selection-length", false, "SelectionClockDisplay", false, false, true, false);
selection_start = new AudioClock ("selection-start", false, "selection", false, false, false, false);
selection_end = new AudioClock ("selection-end", false, "selection", false, false, false, false);
selection_length = new AudioClock ("selection-length", false, "selection", false, false, true, false);
punch_start = new AudioClock ("punch-start", false, "PunchClockDisplay", false, false, false, false);
punch_end = new AudioClock ("punch-end", false, "PunchClockDisplay", false, false, false, false);
punch_start = new AudioClock ("punch-start", false, "punch", false, false, false, false);
punch_end = new AudioClock ("punch-end", false, "punch", false, false, false, false);
CairoEditableText& ss (selection_start->main_display());
ss.set_corner_radius (0);
CairoEditableText& se (selection_end->main_display());
se.set_corner_radius (0);
CairoEditableText& sl (selection_length->main_display());
sl.set_corner_radius (0);
CairoEditableText& ps (punch_start->main_display());
ps.set_corner_radius (0);
CairoEditableText& pe (punch_end->main_display());
pe.set_corner_radius (0);
selection_start->set_draw_background (false);
selection_end->set_draw_background (false);
selection_length->set_draw_background (false);
punch_start->set_draw_background (false);
punch_end->set_draw_background (false);
selection_title.set_text (_("Selection"));
punch_title.set_text (_("Punch"));
@ -88,7 +79,6 @@ TimeInfoBox::TimeInfoBox ()
right.set_border_width (2);
right.set_col_spacings (2);
Gtk::Label* l;
selection_title.set_name ("TimeInfoSelectionTitle");

View File

@ -391,14 +391,6 @@ Gtkmm2ext::container_clear (Gtk::Container& c)
void
Gtkmm2ext::rounded_rectangle (Cairo::RefPtr<Cairo::Context> context, double x, double y, double w, double h, double r)
{
/* renders small shapes better than most others */
/* A****BQ
H C
* *
G D
F****E
*/
rounded_rectangle (context->cobj(), x, y, w, h, r);
}