/* tool bar related */
- , edit_point_clock (X_("editpoint"), false, X_("EditPointClock"), true)
, zoom_range_clock (X_("zoomrange"), false, X_("ZoomRangeClock"), true, true)
, toolbar_selection_clock_table (2,3)
build_cursors ();
- edit_point_clock.ValueChanged.connect (mem_fun(*this, &Editor::edit_point_clock_changed));
-
ArdourCanvas::Canvas* time_pad = manage(new ArdourCanvas::Canvas());
ArdourCanvas::SimpleLine* pad_line_1 = manage(new ArdourCanvas::SimpleLine(*time_pad->root(),
0.0, 1.0, 100.0, 1.0));
the_notebook.set_show_tabs (true);
the_notebook.set_scrollable (true);
- the_notebook.popup_enable ();
+ the_notebook.popup_disable ();
the_notebook.set_tab_pos (Gtk::POS_RIGHT);
the_notebook.show_all ();
-
+
post_maximal_editor_width = 0;
post_maximal_pane_position = 0;
}
}
-void
-Editor::edit_point_clock_changed()
-{
- if (_dragging_edit_point) {
- return;
- }
-
- if (selection->markers.empty()) {
- return;
- }
-
- bool ignored;
- Location* loc = find_location_from_marker (selection->markers.front(), ignored);
-
- if (!loc) {
- return;
- }
-
- loc->move_to (edit_point_clock.current_time());
-}
-
void
Editor::zoom_adjustment_changed ()
{
session_connections.push_back (session->Located.connect (mem_fun (*this, &Editor::located)));
session_connections.push_back (session->config.ParameterChanged.connect (mem_fun (*this, &Editor::parameter_changed)));
- edit_point_clock.set_mode(AudioClock::BBT);
- edit_point_clock.set_session (session);
zoom_range_clock.set_session (session);
_playlist_selector->set_session (session);
nudge_clock.set_session (session);
zoom_box.set_border_width (0);
zoom_in_button.set_name ("EditorTimeButton");
- zoom_in_button.add (*(manage (new Image (::get_icon("zoom_in")))));
+ zoom_in_button.set_image (*(manage (new Image (Stock::ZOOM_IN, Gtk::ICON_SIZE_BUTTON))));
zoom_in_button.signal_clicked().connect (bind (mem_fun(*this, &Editor::temporal_zoom_step), false));
ARDOUR_UI::instance()->tooltips().set_tip (zoom_in_button, _("Zoom In"));
zoom_out_button.set_name ("EditorTimeButton");
- zoom_out_button.add (*(manage (new Image (::get_icon("zoom_out")))));
+ zoom_out_button.set_image (*(manage (new Image (Stock::ZOOM_OUT, Gtk::ICON_SIZE_BUTTON))));
zoom_out_button.signal_clicked().connect (bind (mem_fun(*this, &Editor::temporal_zoom_step), true));
ARDOUR_UI::instance()->tooltips().set_tip (zoom_out_button, _("Zoom Out"));
zoom_out_full_button.set_name ("EditorTimeButton");
- zoom_out_full_button.add (*(manage (new Image (::get_icon("zoom_full")))));
+ zoom_out_full_button.set_image (*(manage (new Image (Stock::ZOOM_100, Gtk::ICON_SIZE_BUTTON))));
zoom_out_full_button.signal_clicked().connect (mem_fun(*this, &Editor::temporal_zoom_session));
ARDOUR_UI::instance()->tooltips().set_tip (zoom_out_full_button, _("Zoom to Session"));
edit_point_selector.signal_changed().connect (mem_fun(*this, &Editor::edit_point_selection_done));
ARDOUR_UI::instance()->tooltips().set_tip (edit_point_selector, _("Edit point"));
- snap_box.pack_start (edit_point_clock, false, false);
snap_box.pack_start (snap_mode_selector, false, false);
snap_box.pack_start (snap_type_selector, false, false);
snap_box.pack_start (edit_point_selector, false, false);
LocationEditRow::LocationEditRow(Session * sess, Location * loc, int32_t num)
: location(0), session(0),
- item_table (1, 7, false),
- start_set_button (_("Use PH")),
- start_go_button (_("Go")),
+ item_table (1, 6, false),
start_clock (X_("locationstart"), true, X_("LocationEditRowClock"), true),
- end_set_button (_("Use PH")),
- end_go_button (_("Go")),
end_clock (X_("locationend"), true, X_("LocationEditRowClock"), true),
length_clock (X_("locationlength"), true, X_("LocationEditRowClock"), true, true),
cd_check_button (_("CD")),
- hide_check_button (_("Hidden")),
- remove_button (_("Remove")),
+ hide_check_button (_("Hide")),
scms_check_button (_("SCMS")),
preemph_check_button (_("Pre-Emphasis"))
{
-
i_am_the_modifier = 0;
+ start_go_button.set_image (*manage (new Image (Stock::JUMP_TO, Gtk::ICON_SIZE_SMALL_TOOLBAR)));
+ end_go_button.set_image (*manage (new Image (Stock::JUMP_TO, Gtk::ICON_SIZE_SMALL_TOOLBAR)));
+ remove_button.set_image (*manage (new Image (Stock::REMOVE, Gtk::ICON_SIZE_SMALL_TOOLBAR)));
+
number_label.set_name ("LocationEditNumberLabel");
name_label.set_name ("LocationEditNameLabel");
name_entry.set_name ("LocationEditNameEntry");
- start_set_button.set_name ("LocationEditSetButton");
start_go_button.set_name ("LocationEditGoButton");
- end_set_button.set_name ("LocationEditSetButton");
end_go_button.set_name ("LocationEditGoButton");
cd_check_button.set_name ("LocationEditCdButton");
hide_check_button.set_name ("LocationEditHideButton");
composer_label.set_name ("LocationEditNumberLabel");
composer_entry.set_name ("LocationEditNameEntry");
- ARDOUR_UI::instance()->tooltips().set_tip(start_set_button, _("Set value to Playhead"));
- ARDOUR_UI::instance()->tooltips().set_tip(end_set_button, _("Set value to Playhead"));
-
isrc_label.set_text ("ISRC: ");
isrc_label.set_size_request (30, -1);
performer_label.set_text ("Performer: ");
scms_check_button.signal_toggled().connect(mem_fun(*this, &LocationEditRow::scms_toggled));
preemph_check_button.signal_toggled().connect(mem_fun(*this, &LocationEditRow::preemph_toggled));
-
set_session (sess);
-
- item_table.attach (number_label, 0, 1, 0, 1, FILL, FILL, 3, 0);
-
- start_hbox.pack_start (start_go_button, false, false);
+ // start_hbox.pack_start (start_go_button, false, false);
start_hbox.pack_start (start_clock, false, false);
- start_hbox.pack_start (start_set_button, false, false);
- item_table.attach (start_hbox, 2, 3, 0, 1, FILL, FILL, 4, 0);
+ /* this is always in this location, no matter what the location is */
+ item_table.attach (start_hbox, 1, 2, 0, 1, FILL, FILL, 4, 0);
- start_set_button.signal_clicked().connect(bind (mem_fun (*this, &LocationEditRow::set_button_pressed), LocStart));
start_go_button.signal_clicked().connect(bind (mem_fun (*this, &LocationEditRow::go_button_pressed), LocStart));
start_clock.ValueChanged.connect (bind (mem_fun (*this, &LocationEditRow::clock_changed), LocStart));
start_clock.ChangeAborted.connect (bind (mem_fun (*this, &LocationEditRow::change_aborted), LocStart));
-
- end_hbox.pack_start (end_go_button, false, false);
+ // end_hbox.pack_start (end_go_button, false, false);
end_hbox.pack_start (end_clock, false, false);
- end_hbox.pack_start (end_set_button, false, false);
- //item_table.attach (end_hbox, 2, 3, 0, 1, 0, 0, 4, 0);
-
- end_set_button.signal_clicked().connect(bind (mem_fun (*this, &LocationEditRow::set_button_pressed), LocEnd));
end_go_button.signal_clicked().connect(bind (mem_fun (*this, &LocationEditRow::go_button_pressed), LocEnd));
end_clock.ValueChanged.connect (bind (mem_fun (*this, &LocationEditRow::clock_changed), LocEnd));
end_clock.ChangeAborted.connect (bind (mem_fun (*this, &LocationEditRow::change_aborted), LocEnd));
-// item_table.attach (length_clock, 3, 4, 0, 1, 0, 0, 4, 0);
length_clock.ValueChanged.connect (bind ( mem_fun(*this, &LocationEditRow::clock_changed), LocLength));
length_clock.ChangeAborted.connect (bind (mem_fun (*this, &LocationEditRow::change_aborted), LocLength));
-// item_table.attach (cd_check_button, 4, 5, 0, 1, 0, Gtk::FILL, 4, 0);
-// item_table.attach (hide_check_button, 5, 6, 0, 1, 0, Gtk::FILL, 4, 0);
-// item_table.attach (remove_button, 7, 8, 0, 1, 0, Gtk::FILL, 4, 0);
-
cd_check_button.signal_toggled().connect(mem_fun(*this, &LocationEditRow::cd_toggled));
hide_check_button.signal_toggled().connect(mem_fun(*this, &LocationEditRow::hide_toggled));
if (!location) return;
if (!hide_check_button.get_parent()) {
- item_table.attach (hide_check_button, 6, 7, 0, 1, FILL, Gtk::FILL, 4, 0);
+ item_table.attach (hide_check_button, 5, 6, 0, 1, FILL, Gtk::FILL, 4, 0);
}
hide_check_button.set_active (location->is_hidden());
name_label.set_size_request (80, -1);
if (!name_label.get_parent()) {
- item_table.attach (name_label, 1, 2, 0, 1, FILL, FILL, 4, 0);
+ item_table.attach (name_label, 0, 1, 0, 1, FILL, FILL, 4, 0);
}
name_label.show();
name_entry.signal_changed().connect (mem_fun(*this, &LocationEditRow::name_entry_changed));
if (!name_entry.get_parent()) {
- item_table.attach (name_entry, 1, 2, 0, 1, FILL | EXPAND, FILL, 4, 0);
+ item_table.attach (name_entry, 0, 1, 0, 1, FILL | EXPAND, FILL, 4, 0);
}
name_entry.show();
if (!cd_check_button.get_parent()) {
- item_table.attach (cd_check_button, 5, 6, 0, 1, FILL, FILL, 4, 0);
+ item_table.attach (cd_check_button, 4, 5, 0, 1, FILL, FILL, 4, 0);
}
if (!remove_button.get_parent()) {
- item_table.attach (remove_button, 7, 8, 0, 1, FILL, FILL, 4, 0);
+ item_table.attach (remove_button, 6, 7, 0, 1, FILL, FILL, 4, 0);
}
- /* XXX i can't find a way to hide the button without messing up
- the row spacing, so make it insensitive (paul).
- */
-
if (location->is_end() || location->is_start()) {
remove_button.set_sensitive (false);
}
if (!location->is_mark()) {
if (!end_hbox.get_parent()) {
- item_table.attach (end_hbox, 3, 4, 0, 1, FILL, FILL, 4, 0);
+ item_table.attach (end_hbox, 2, 3, 0, 1, FILL, FILL, 4, 0);
}
if (!length_clock.get_parent()) {
- item_table.attach (length_clock, 4, 5, 0, 1, FILL, FILL, 4, 0);
+ item_table.attach (length_clock, 3, 4, 0, 1, FILL, FILL, 4, 0);
}
end_clock.set (location->end(), true);
length_clock.set (location->length(), true);
- end_set_button.show();
end_go_button.show();
end_clock.show();
length_clock.show();
+ ARDOUR_UI::instance()->tooltips().set_tip (end_go_button, _("Jump to the end of this range"));
+ ARDOUR_UI::instance()->tooltips().set_tip (start_go_button, _("Jump to the start of this range"));
+ ARDOUR_UI::instance()->tooltips().set_tip (remove_button, _("Forget this range"));
+ ARDOUR_UI::instance()->tooltips().set_tip (start_clock, _("Start time"));
+ ARDOUR_UI::instance()->tooltips().set_tip (end_clock, _("End time"));
+ ARDOUR_UI::instance()->tooltips().set_tip (length_clock, _("Length"));
+
} else {
- end_set_button.hide();
+ ARDOUR_UI::instance()->tooltips().set_tip (start_go_button, _("Jump to this marker"));
+ ARDOUR_UI::instance()->tooltips().set_tip (remove_button, _("Forget this marker"));
+ ARDOUR_UI::instance()->tooltips().set_tip (start_clock, _("Position"));
+
end_go_button.hide();
end_clock.hide();
length_clock.hide();
-
}
start_clock.set_sensitive (!location->locked());
}
-void
-LocationEditRow::set_button_pressed (LocationPart part)
-{
- if (!location) return;
-
- switch (part) {
- case LocStart:
- location->set_start (session->transport_frame ());
- break;
- case LocEnd:
- location->set_end (session->transport_frame ());
- break;
- default:
- break;
- }
-}
-
void
LocationEditRow::go_button_pressed (LocationPart part)
{
}
if (!cd_track_details_hbox.get_parent()) {
- item_table.attach (cd_track_details_hbox, 1, 8, 1, 2, FILL | EXPAND, FILL, 4, 0);
+ item_table.attach (cd_track_details_hbox, 0, 7, 1, 2, FILL | EXPAND, FILL, 4, 0);
}
// item_table.resize(2, 7);
cd_track_details_hbox.show_all();
LocationUI::LocationUI ()
: session (0)
- , add_location_button (_("Add New Location"))
- , add_range_button (_("Add New Range"))
+ , add_location_button (_("New Location"))
+ , add_range_button (_("New Range"))
{
i_am_the_modifier = 0;
location_vpacker.set_spacing (5);
+ add_location_button.set_image (*Gtk::manage (new Gtk::Image (Gtk::Stock::ADD, Gtk::ICON_SIZE_BUTTON)));
+ add_range_button.set_image (*Gtk::manage (new Gtk::Image (Gtk::Stock::ADD, Gtk::ICON_SIZE_BUTTON)));
+
location_vpacker.pack_start (loop_edit_row, false, false);
location_vpacker.pack_start (punch_edit_row, false, false);
loc_frame_box.pack_start (location_rows_scroller, true, true);
add_location_button.set_name ("LocationAddLocationButton");
- loc_frame_box.pack_start (add_location_button, false, false);
+
+ HBox* add_button_box = manage (new HBox);
+
+ // loc_frame_box.pack_start (add_location_button, false, false);
+ add_button_box->pack_start (add_location_button, true, true);
loc_frame.set_name ("LocationLocEditorFrame");
- loc_frame.set_label (_("Location (CD index) markers"));
+ loc_frame.set_label (_("Markers (including CD index)"));
loc_frame.add (loc_frame_box);
loc_range_panes.pack1(loc_frame, true, false);
range_frame_box.pack_start (range_rows_scroller, true, true);
add_range_button.set_name ("LocationAddRangeButton");
- range_frame_box.pack_start (add_range_button, false, false);
+ //range_frame_box.pack_start (add_range_button, false, false);
+
+ add_button_box->pack_start (add_range_button, true, true);
range_frame.set_name ("LocationRangeEditorFrame");
- range_frame.set_label (_("Range (CD track) markers"));
+ range_frame.set_label (_("Ranges (including CD track ranges)"));
range_frame.add (range_frame_box);
loc_range_panes.pack2(range_frame, true, false);
location_vpacker.pack_start (loc_range_panes, true, true);
+ location_vpacker.pack_start (*add_button_box, false, false);
pack_start (location_vpacker, true, true);
loc_children.clear();
range_children.clear();
- cerr << "about to map locations with session = " << session << endl;
-
if (session) {
session->locations()->apply (*this, &LocationUI::map_locations);
}
void
LocationUIWindow::on_show()
{
- cerr << "Show loc list\n";
_ui.refresh_location_list();
ArdourDialog::on_show();
}
void
LocationUIWindow::set_session (Session *s)
{
- cerr << "Setting session in LUW, with s = " << s << "\n";
-
ArdourDialog::set_session (s);
_ui.set_session (s);
const double TimeAxisViewItem::NAME_X_OFFSET = 15.0;
const double TimeAxisViewItem::GRAB_HANDLE_LENGTH = 6 ;
+int TimeAxisViewItem::NAME_HEIGHT;
double TimeAxisViewItem::NAME_Y_OFFSET;
double TimeAxisViewItem::NAME_HIGHLIGHT_SIZE;
double TimeAxisViewItem::NAME_HIGHLIGHT_THRESH;
layout->set_font_description (*NAME_FONT);
Gtkmm2ext::get_ink_pixel_size (layout, width, height);
+ NAME_HEIGHT = height;
NAME_Y_OFFSET = height + 3;
NAME_HIGHLIGHT_SIZE = height + 2;
NAME_HIGHLIGHT_THRESH = NAME_HIGHLIGHT_SIZE * 3;
show_vestigial = true;
visibility = vis;
_sensitive = true;
+ name_pixbuf_width = 0;
+ last_item_width = 0;
if (duration == 0) {
warning << "Time Axis Item Duration == 0" << endl ;
void
TimeAxisViewItem::set_name_text(const ustring& new_name)
{
- uint32_t pb_width, it_width;
- double font_size;
-
- font_size = NAME_FONT->get_size() / Pango::SCALE;
- it_width = trackview.editor().frame_to_pixel(item_duration);
- pb_width = new_name.length() * font_size;
-
- if (pb_width > it_width - NAME_X_OFFSET) {
- pb_width = it_width - NAME_X_OFFSET;
- }
-
- if (pb_width <= 0 || it_width < NAME_X_OFFSET) {
- if (name_pixbuf) {
- name_pixbuf->hide();
- }
+ if (!name_pixbuf) {
return;
- } else {
- name_pixbuf->show();
}
- Glib::RefPtr<Gdk::Pixbuf> buf = Gdk::Pixbuf::create(Gdk::COLORSPACE_RGB, true, 8, pb_width, NAME_HIGHLIGHT_SIZE);
-
- cairo_surface_t* surface = cairo_image_surface_create(CAIRO_FORMAT_ARGB32, pb_width, NAME_HIGHLIGHT_SIZE );
- cairo_t *cr = cairo_create (surface);
- cairo_text_extents_t te;
- cairo_set_source_rgba (cr, 0.2, 0.2, 0.2, 1.0);
- cairo_select_font_face (cr, NAME_FONT->get_family().c_str(),
- CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_NORMAL);
- cairo_set_font_size (cr, 10);
- cairo_text_extents (cr, new_name.c_str(), &te);
-
- cairo_move_to (cr, 0.5,
- 0.5 - te.height / 2 - te.y_bearing + NAME_HIGHLIGHT_SIZE / 2);
- cairo_show_text (cr, new_name.c_str());
-
- unsigned char* src = cairo_image_surface_get_data (surface);
- convert_bgra_to_rgba(src, buf->get_pixels(), pb_width, NAME_HIGHLIGHT_SIZE);
-
- cairo_destroy(cr);
- name_pixbuf->property_pixbuf() = buf;
+ last_item_width = trackview.editor().frame_to_pixel(item_duration);
+ name_pixbuf_width = pixel_width (new_name, *NAME_FONT) + 2;
+ name_pixbuf->property_pixbuf() = pixbuf_from_ustring(new_name, NAME_FONT, name_pixbuf_width, NAME_HEIGHT);
}
+
/**
* Set the height of this item
*
void
TimeAxisViewItem::reset_name_width (double /*pixel_width*/)
{
- set_name_text (item_name);
+ uint32_t it_width;
+ int pb_width;
+ bool pixbuf_holds_full_name;
+
+ if (!name_pixbuf) {
+ return;
+ }
+
+ it_width = trackview.editor().frame_to_pixel(item_duration);
+ pb_width = name_pixbuf_width;
+
+ pixbuf_holds_full_name = last_item_width > pb_width + NAME_X_OFFSET;
+ last_item_width = it_width;
+
+ if (pixbuf_holds_full_name && (it_width >= pb_width + NAME_X_OFFSET)) {
+ /*
+ we've previously had the full name length showing
+ and its still showing.
+ */
+ return;
+ }
+
+ if (pb_width > it_width - NAME_X_OFFSET) {
+ pb_width = it_width - NAME_X_OFFSET;
+ }
+
+ if (pb_width <= 0 || it_width <= NAME_X_OFFSET) {
+ name_pixbuf->hide();
+ return;
+ } else {
+ name_pixbuf->show();
+ }
+
+ name_pixbuf->property_pixbuf() = pixbuf_from_ustring(item_name, NAME_FONT, pb_width, NAME_HEIGHT);
}