added cd marker ruler, which displays and allows quick addition of cd track markers/ranges when visible, otherwise the cd markers are shown in the normal mark/range rulers.
git-svn-id: svn://localhost/ardour2/branches/2.0-ongoing@2711 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
parent
8af8f2ee27
commit
90a5607604
|
@ -41,11 +41,13 @@
|
|||
<Option name="verbose canvas cursor" value="f4f214bc"/>
|
||||
<Option name="marker label" value="000000ff"/>
|
||||
<Option name="marker bar separator" value="30303088"/>
|
||||
<Option name="meterbar" value="666672ff"/>
|
||||
<Option name="meterbar" value="666672ff"/>
|
||||
<Option name="tempo bar" value="72727fff"/>
|
||||
<Option name="rangemarker bar" value="7f7f8cff"/>
|
||||
<Option name="rangemarker bar" value="7f7f8cff"/>
|
||||
<Option name="TransportMarkerBar" value="8c8c96ff"/>
|
||||
<Option name="markerbar" value="9898a3ff"/>
|
||||
<Option name="cdmarkerbar" value="9090a3ff"/>
|
||||
<Option name="markerbar" value="9898a3ff"/>
|
||||
|
||||
<Option name="RangeDragBarRect" value="969696c6"/>
|
||||
<Option name="RangeDragRect" value="82c696c6"/>
|
||||
<Option name="TransportDragRect" value="969696c6"/>
|
||||
|
|
|
@ -41,6 +41,7 @@ CANVAS_VARIABLE(canvasvar_MarkerBarSeparator, "marker bar separator")
|
|||
CANVAS_VARIABLE(canvasvar_TempoBar, "tempo bar")
|
||||
CANVAS_VARIABLE(canvasvar_MeterBar, "meterbar")
|
||||
CANVAS_VARIABLE(canvasvar_MarkerBar, "markerbar")
|
||||
CANVAS_VARIABLE(canvasvar_CDMarkerBar, "cdmarkerbar")
|
||||
CANVAS_VARIABLE(canvasvar_RangeMarkerBar, "rangemarker bar")
|
||||
CANVAS_VARIABLE(canvasvar_TransportMarkerBar, "TransportMarkerBar")
|
||||
CANVAS_VARIABLE(canvasvar_RangeDragBarRect, "RangeDragBarRect")
|
||||
|
|
|
@ -183,6 +183,7 @@ Editor::Editor ()
|
|||
mark_label (_("Location Markers")),
|
||||
range_mark_label (_("Range Markers")),
|
||||
transport_mark_label (_("Loop/Punch Ranges")),
|
||||
cd_mark_label (_("CD Markers")),
|
||||
|
||||
edit_packer (3, 3, true),
|
||||
|
||||
|
@ -414,6 +415,10 @@ Editor::Editor ()
|
|||
mark_label.set_size_request (-1, (int)timebar_height);
|
||||
mark_label.set_alignment (1.0, 0.5);
|
||||
mark_label.set_padding (5,0);
|
||||
cd_mark_label.set_name ("EditorTimeButton");
|
||||
cd_mark_label.set_size_request (-1, (int)timebar_height);
|
||||
cd_mark_label.set_alignment (1.0, 0.5);
|
||||
cd_mark_label.set_padding (5,0);
|
||||
range_mark_label.set_name ("EditorTimeButton");
|
||||
range_mark_label.set_size_request (-1, (int)timebar_height);
|
||||
range_mark_label.set_alignment (1.0, 0.5);
|
||||
|
|
|
@ -429,7 +429,9 @@ class Editor : public PublicEditor
|
|||
|
||||
void hide_marker (ArdourCanvas::Item*, GdkEvent*);
|
||||
void clear_marker_display ();
|
||||
void mouse_add_new_marker (nframes_t where);
|
||||
void mouse_add_new_marker (nframes_t where, bool is_cd=false);
|
||||
void update_cd_marker_display ();
|
||||
void ensure_cd_marker_updated (LocationMarkers * lam, ARDOUR::Location * location);
|
||||
|
||||
TimeAxisView* clicked_trackview;
|
||||
AudioTimeAxisView* clicked_audio_trackview;
|
||||
|
@ -537,6 +539,7 @@ class Editor : public PublicEditor
|
|||
ArdourCanvas::Group* marker_group;
|
||||
ArdourCanvas::Group* range_marker_group;
|
||||
ArdourCanvas::Group* transport_marker_group;
|
||||
ArdourCanvas::Group* cd_marker_group;
|
||||
|
||||
enum {
|
||||
ruler_metric_smpte = 0,
|
||||
|
@ -549,10 +552,11 @@ class Editor : public PublicEditor
|
|||
ruler_time_marker = 6,
|
||||
ruler_time_range_marker = 7,
|
||||
ruler_time_transport_marker = 8,
|
||||
ruler_time_cd_marker = 9,
|
||||
};
|
||||
|
||||
static GtkCustomMetric ruler_metrics[4];
|
||||
bool ruler_shown[9];
|
||||
bool ruler_shown[10];
|
||||
bool no_ruler_shown_update;
|
||||
|
||||
gint ruler_button_press (GdkEventButton*);
|
||||
|
@ -603,6 +607,7 @@ class Editor : public PublicEditor
|
|||
ArdourCanvas::SimpleRect* marker_bar;
|
||||
ArdourCanvas::SimpleRect* range_marker_bar;
|
||||
ArdourCanvas::SimpleRect* transport_marker_bar;
|
||||
ArdourCanvas::SimpleRect* cd_marker_bar;
|
||||
|
||||
|
||||
ArdourCanvas::SimpleLine* tempo_line;
|
||||
|
@ -610,6 +615,7 @@ class Editor : public PublicEditor
|
|||
ArdourCanvas::SimpleLine* marker_line;
|
||||
ArdourCanvas::SimpleLine* range_marker_line;
|
||||
ArdourCanvas::SimpleLine* transport_marker_line;
|
||||
ArdourCanvas::SimpleLine* cd_marker_line;
|
||||
|
||||
Gtk::Label minsec_label;
|
||||
Gtk::Label bbt_label;
|
||||
|
@ -620,6 +626,7 @@ class Editor : public PublicEditor
|
|||
Gtk::Label mark_label;
|
||||
Gtk::Label range_mark_label;
|
||||
Gtk::Label transport_mark_label;
|
||||
Gtk::Label cd_mark_label;
|
||||
|
||||
|
||||
Gtk::VBox time_button_vbox;
|
||||
|
@ -1221,6 +1228,7 @@ class Editor : public PublicEditor
|
|||
bool canvas_marker_bar_event (GdkEvent* event, ArdourCanvas::Item*);
|
||||
bool canvas_range_marker_bar_event (GdkEvent* event, ArdourCanvas::Item*);
|
||||
bool canvas_transport_marker_bar_event (GdkEvent* event, ArdourCanvas::Item*);
|
||||
bool canvas_cd_marker_bar_event (GdkEvent* event, ArdourCanvas::Item*);
|
||||
|
||||
bool canvas_imageframe_item_view_event(GdkEvent* event, ArdourCanvas::Item*,ImageFrameView*);
|
||||
bool canvas_imageframe_view_event(GdkEvent* event, ArdourCanvas::Item*,ImageFrameTimeAxis*);
|
||||
|
@ -1328,6 +1336,7 @@ class Editor : public PublicEditor
|
|||
Gtk::Menu* range_marker_menu;
|
||||
Gtk::Menu* transport_marker_menu;
|
||||
Gtk::Menu* new_transport_marker_menu;
|
||||
Gtk::Menu* cd_marker_menu;
|
||||
ArdourCanvas::Item* marker_menu_item;
|
||||
|
||||
typedef list<Marker*> Marks;
|
||||
|
@ -1462,7 +1471,8 @@ class Editor : public PublicEditor
|
|||
/* transport range select process */
|
||||
enum RangeMarkerOp {
|
||||
CreateRangeMarker,
|
||||
CreateTransportMarker
|
||||
CreateTransportMarker,
|
||||
CreateCDMarker
|
||||
} range_marker_op;
|
||||
|
||||
void start_range_markerbar_op (ArdourCanvas::Item* item, GdkEvent* event, RangeMarkerOp);
|
||||
|
|
|
@ -161,6 +161,7 @@ Editor::initialize_canvas ()
|
|||
range_marker_group = new ArdourCanvas::Group (*time_canvas.root(), 0.0, timebar_height * 2.0);
|
||||
transport_marker_group = new ArdourCanvas::Group (*time_canvas.root(), 0.0, timebar_height * 3.0);
|
||||
marker_group = new ArdourCanvas::Group (*time_canvas.root(), 0.0, timebar_height * 4.0);
|
||||
cd_marker_group = new ArdourCanvas::Group (*time_canvas.root(), 0.0, timebar_height * 5.0);
|
||||
|
||||
tempo_bar = new ArdourCanvas::SimpleRect (*tempo_group, 0.0, 0.0, max_canvas_coordinate, timebar_height-1.0);
|
||||
tempo_bar->property_outline_pixels() = 0;
|
||||
|
@ -170,6 +171,9 @@ Editor::initialize_canvas ()
|
|||
|
||||
marker_bar = new ArdourCanvas::SimpleRect (*marker_group, 0.0, 0.0, max_canvas_coordinate, timebar_height-1.0);
|
||||
marker_bar->property_outline_pixels() = 0;
|
||||
|
||||
cd_marker_bar = new ArdourCanvas::SimpleRect (*cd_marker_group, 0.0, 0.0, max_canvas_coordinate, timebar_height-1.0);
|
||||
cd_marker_bar->property_outline_pixels() = 0;
|
||||
|
||||
range_marker_bar = new ArdourCanvas::SimpleRect (*range_marker_group, 0.0, 0.0, max_canvas_coordinate, timebar_height-1.0);
|
||||
range_marker_bar->property_outline_pixels() = 0;
|
||||
|
@ -235,6 +239,7 @@ Editor::initialize_canvas ()
|
|||
tempo_bar->signal_event().connect (bind (mem_fun (*this, &Editor::canvas_tempo_bar_event), tempo_bar));
|
||||
meter_bar->signal_event().connect (bind (mem_fun (*this, &Editor::canvas_meter_bar_event), meter_bar));
|
||||
marker_bar->signal_event().connect (bind (mem_fun (*this, &Editor::canvas_marker_bar_event), marker_bar));
|
||||
cd_marker_bar->signal_event().connect (bind (mem_fun (*this, &Editor::canvas_cd_marker_bar_event), cd_marker_bar));
|
||||
range_marker_bar->signal_event().connect (bind (mem_fun (*this, &Editor::canvas_range_marker_bar_event), range_marker_bar));
|
||||
transport_marker_bar->signal_event().connect (bind (mem_fun (*this, &Editor::canvas_transport_marker_bar_event), transport_marker_bar));
|
||||
|
||||
|
@ -724,6 +729,9 @@ Editor::color_handler()
|
|||
marker_bar->property_fill_color_rgba() = ARDOUR_UI::config()->canvasvar_MarkerBar.get();
|
||||
marker_bar->property_outline_color_rgba() = ARDOUR_UI::config()->canvasvar_MarkerBarSeparator.get();
|
||||
|
||||
cd_marker_bar->property_fill_color_rgba() = ARDOUR_UI::config()->canvasvar_CDMarkerBar.get();
|
||||
cd_marker_bar->property_outline_color_rgba() = ARDOUR_UI::config()->canvasvar_MarkerBarSeparator.get();
|
||||
|
||||
range_marker_bar->property_fill_color_rgba() = ARDOUR_UI::config()->canvasvar_RangeMarkerBar.get();
|
||||
range_marker_bar->property_outline_color_rgba() = ARDOUR_UI::config()->canvasvar_MarkerBarSeparator.get();
|
||||
|
||||
|
|
|
@ -824,6 +824,12 @@ Editor::canvas_transport_marker_bar_event (GdkEvent *event, ArdourCanvas::Item*
|
|||
return typed_event (item, event, TransportMarkerBarItem);
|
||||
}
|
||||
|
||||
bool
|
||||
Editor::canvas_cd_marker_bar_event (GdkEvent *event, ArdourCanvas::Item* item)
|
||||
{
|
||||
return typed_event (item, event, CdMarkerBarItem);
|
||||
}
|
||||
|
||||
bool
|
||||
Editor::canvas_tempo_marker_event (GdkEvent *event, ArdourCanvas::Item* item, TempoMarker* marker)
|
||||
{
|
||||
|
|
|
@ -27,6 +27,7 @@ enum ItemType {
|
|||
MarkerItem,
|
||||
MarkerBarItem,
|
||||
RangeMarkerBarItem,
|
||||
CdMarkerBarItem,
|
||||
TransportMarkerBarItem,
|
||||
SelectionItem,
|
||||
GainControlPointItem,
|
||||
|
|
|
@ -77,9 +77,15 @@ Editor::add_new_location (Location *location)
|
|||
}
|
||||
|
||||
if (location->is_mark()) {
|
||||
lam->start = new Marker (*this, *marker_group, color, location->name(), Marker::Mark, location->start());
|
||||
lam->end = 0;
|
||||
|
||||
if (location->is_cd_marker() && ruler_shown[ruler_time_cd_marker]) {
|
||||
lam->start = new Marker (*this, *cd_marker_group, color, location->name(), Marker::Mark, location->start());
|
||||
}
|
||||
else {
|
||||
lam->start = new Marker (*this, *marker_group, color, location->name(), Marker::Mark, location->start());
|
||||
}
|
||||
lam->end = 0;
|
||||
|
||||
} else if (location->is_auto_loop()) {
|
||||
// transport marker
|
||||
lam->start = new Marker (*this, *transport_marker_group, color,
|
||||
|
@ -95,12 +101,20 @@ Editor::add_new_location (Location *location)
|
|||
location->name(), Marker::PunchOut, location->end());
|
||||
|
||||
} else {
|
||||
|
||||
// range marker
|
||||
lam->start = new Marker (*this, *range_marker_group, color,
|
||||
location->name(), Marker::Start, location->start());
|
||||
lam->end = new Marker (*this, *range_marker_group, color,
|
||||
location->name(), Marker::End, location->end());
|
||||
if (location->is_cd_marker() && ruler_shown[ruler_time_cd_marker]) {
|
||||
lam->start = new Marker (*this, *cd_marker_group, color,
|
||||
location->name(), Marker::Start, location->start());
|
||||
lam->end = new Marker (*this, *cd_marker_group, color,
|
||||
location->name(), Marker::End, location->end());
|
||||
}
|
||||
else {
|
||||
|
||||
lam->start = new Marker (*this, *range_marker_group, color,
|
||||
location->name(), Marker::Start, location->start());
|
||||
lam->end = new Marker (*this, *range_marker_group, color,
|
||||
location->name(), Marker::End, location->end());
|
||||
}
|
||||
}
|
||||
|
||||
if (location->is_hidden ()) {
|
||||
|
@ -157,6 +171,9 @@ Editor::location_flags_changed (Location *location, void *src)
|
|||
return;
|
||||
}
|
||||
|
||||
// move cd markers to/from cd marker bar as appropriate
|
||||
ensure_cd_marker_updated (lam, location);
|
||||
|
||||
if (location->is_cd_marker()) {
|
||||
lam->set_color_rgba (location_cd_marker_color);
|
||||
} else if (location->is_mark()) {
|
||||
|
@ -176,6 +193,52 @@ Editor::location_flags_changed (Location *location, void *src)
|
|||
}
|
||||
}
|
||||
|
||||
void Editor::update_cd_marker_display ()
|
||||
{
|
||||
for (LocationMarkerMap::iterator i = location_markers.begin(); i != location_markers.end(); ++i) {
|
||||
LocationMarkers * lam = i->second;
|
||||
Location * location = i->first;
|
||||
|
||||
ensure_cd_marker_updated (lam, location);
|
||||
}
|
||||
}
|
||||
|
||||
void Editor::ensure_cd_marker_updated (LocationMarkers * lam, Location * location)
|
||||
{
|
||||
if (location->is_cd_marker()
|
||||
&& (ruler_shown[ruler_time_cd_marker] && lam->start->get_parent() != cd_marker_group))
|
||||
{
|
||||
//cerr << "reparenting non-cd marker so it can be relocated: " << location->name() << endl;
|
||||
if (lam->start) {
|
||||
lam->start->reparent (*cd_marker_group);
|
||||
}
|
||||
if (lam->end) {
|
||||
lam->end->reparent (*cd_marker_group);
|
||||
}
|
||||
}
|
||||
else if ( (!location->is_cd_marker() || !ruler_shown[ruler_time_cd_marker])
|
||||
&& (lam->start->get_parent() == cd_marker_group))
|
||||
{
|
||||
//cerr << "reparenting non-cd marker so it can be relocated: " << location->name() << endl;
|
||||
if (location->is_mark()) {
|
||||
if (lam->start) {
|
||||
lam->start->reparent (*marker_group);
|
||||
}
|
||||
if (lam->end) {
|
||||
lam->end->reparent (*marker_group);
|
||||
}
|
||||
}
|
||||
else {
|
||||
if (lam->start) {
|
||||
lam->start->reparent (*range_marker_group);
|
||||
}
|
||||
if (lam->end) {
|
||||
lam->end->reparent (*range_marker_group);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Editor::LocationMarkers::~LocationMarkers ()
|
||||
{
|
||||
if (start) {
|
||||
|
@ -319,12 +382,14 @@ Editor::LocationMarkers::set_color_rgba (uint32_t rgba)
|
|||
}
|
||||
|
||||
void
|
||||
Editor::mouse_add_new_marker (nframes_t where)
|
||||
Editor::mouse_add_new_marker (nframes_t where, bool is_cd)
|
||||
{
|
||||
string markername;
|
||||
int flags = (is_cd ? Location::IsCDMarker|Location::IsMark : Location::IsMark);
|
||||
|
||||
if (session) {
|
||||
session->locations()->next_available_name(markername,"mark");
|
||||
Location *location = new Location (where, where, markername, Location::IsMark);
|
||||
Location *location = new Location (where, where, markername, (Location::Flags) flags);
|
||||
session->begin_reversible_command (_("add marker"));
|
||||
XMLNode &before = session->locations()->get_state();
|
||||
session->locations()->add (location, true);
|
||||
|
|
|
@ -496,6 +496,11 @@ Editor::button_press_handler (ArdourCanvas::Item* item, GdkEvent* event, ItemTyp
|
|||
return true;
|
||||
break;
|
||||
|
||||
case CdMarkerBarItem:
|
||||
start_range_markerbar_op (item, event, CreateCDMarker);
|
||||
return true;
|
||||
break;
|
||||
|
||||
case TransportMarkerBarItem:
|
||||
start_range_markerbar_op (item, event, CreateTransportMarker);
|
||||
return true;
|
||||
|
@ -880,7 +885,8 @@ Editor::button_release_handler (ArdourCanvas::Item* item, GdkEvent* event, ItemT
|
|||
|
||||
case MarkerBarItem:
|
||||
case RangeMarkerBarItem:
|
||||
case TransportMarkerBarItem:
|
||||
case TransportMarkerBarItem:
|
||||
case CdMarkerBarItem:
|
||||
case TempoBarItem:
|
||||
case MeterBarItem:
|
||||
popup_ruler_menu (pixel_to_frame(event->button.x), item_type);
|
||||
|
@ -989,6 +995,14 @@ Editor::button_release_handler (ArdourCanvas::Item* item, GdkEvent* event, ItemT
|
|||
mouse_add_new_marker (where);
|
||||
return true;
|
||||
|
||||
case CdMarkerBarItem:
|
||||
// if we get here then a dragged range wasn't done
|
||||
if (!Keyboard::modifier_state_contains (event->button.state, Keyboard::snap_modifier())) {
|
||||
snap_to (where, 0, true);
|
||||
}
|
||||
mouse_add_new_marker (where, true);
|
||||
return true;
|
||||
|
||||
case TempoBarItem:
|
||||
if (!Keyboard::modifier_state_contains (event->button.state, Keyboard::snap_modifier())) {
|
||||
snap_to (where);
|
||||
|
@ -1263,6 +1277,7 @@ Editor::enter_handler (ArdourCanvas::Item* item, GdkEvent* event, ItemType item_
|
|||
case MarkerBarItem:
|
||||
case RangeMarkerBarItem:
|
||||
case TransportMarkerBarItem:
|
||||
case CdMarkerBarItem:
|
||||
case MeterBarItem:
|
||||
case TempoBarItem:
|
||||
if (is_drawable()) {
|
||||
|
@ -1396,6 +1411,7 @@ Editor::leave_handler (ArdourCanvas::Item* item, GdkEvent* event, ItemType item_
|
|||
|
||||
case RangeMarkerBarItem:
|
||||
case TransportMarkerBarItem:
|
||||
case CdMarkerBarItem:
|
||||
case MeterBarItem:
|
||||
case TempoBarItem:
|
||||
case MarkerBarItem:
|
||||
|
@ -4609,7 +4625,8 @@ Editor::start_range_markerbar_op (ArdourCanvas::Item* item, GdkEvent* event, Ran
|
|||
switch (op) {
|
||||
case CreateRangeMarker:
|
||||
case CreateTransportMarker:
|
||||
|
||||
case CreateCDMarker:
|
||||
|
||||
if (Keyboard::modifier_state_equals (event->button.state, Keyboard::Shift)) {
|
||||
drag_info.copy = true;
|
||||
} else {
|
||||
|
@ -4643,6 +4660,7 @@ Editor::drag_range_markerbar_op (ArdourCanvas::Item* item, GdkEvent* event)
|
|||
switch (range_marker_op) {
|
||||
case CreateRangeMarker:
|
||||
case CreateTransportMarker:
|
||||
case CreateCDMarker:
|
||||
if (drag_info.first_move) {
|
||||
snap_to (drag_info.grab_frame);
|
||||
}
|
||||
|
@ -4700,17 +4718,25 @@ Editor::end_range_markerbar_op (ArdourCanvas::Item* item, GdkEvent* event)
|
|||
{
|
||||
Location * newloc = 0;
|
||||
string rangename;
|
||||
int flags;
|
||||
|
||||
if (!drag_info.first_move) {
|
||||
drag_range_markerbar_op (item, event);
|
||||
|
||||
switch (range_marker_op) {
|
||||
case CreateRangeMarker:
|
||||
case CreateCDMarker:
|
||||
{
|
||||
begin_reversible_command (_("new range marker"));
|
||||
XMLNode &before = session->locations()->get_state();
|
||||
session->locations()->next_available_name(rangename,"unnamed");
|
||||
newloc = new Location(temp_location->start(), temp_location->end(), rangename, Location::IsRangeMarker);
|
||||
if (range_marker_op == CreateCDMarker) {
|
||||
flags = Location::IsRangeMarker|Location::IsCDMarker;
|
||||
}
|
||||
else {
|
||||
flags = Location::IsRangeMarker;
|
||||
}
|
||||
newloc = new Location(temp_location->start(), temp_location->end(), rangename, (Location::Flags) flags);
|
||||
session->locations()->add (newloc, true);
|
||||
XMLNode &after = session->locations()->get_state();
|
||||
session->add_command(new MementoCommand<Locations>(*(session->locations()), &before, &after));
|
||||
|
@ -4730,7 +4756,7 @@ Editor::end_range_markerbar_op (ArdourCanvas::Item* item, GdkEvent* event)
|
|||
} else {
|
||||
/* just a click, no pointer movement. remember that context menu stuff was handled elsewhere */
|
||||
|
||||
if (Keyboard::no_modifier_keys_pressed (&event->button)) {
|
||||
if (Keyboard::no_modifier_keys_pressed (&event->button) && range_marker_op != CreateCDMarker) {
|
||||
|
||||
nframes_t start;
|
||||
nframes_t end;
|
||||
|
|
|
@ -90,6 +90,7 @@ Editor::initialize_rulers ()
|
|||
ruler_shown[ruler_time_marker] = true;
|
||||
ruler_shown[ruler_time_range_marker] = true;
|
||||
ruler_shown[ruler_time_transport_marker] = true;
|
||||
ruler_shown[ruler_time_cd_marker] = true;
|
||||
ruler_shown[ruler_metric_frames] = false;
|
||||
ruler_shown[ruler_metric_minsec] = false;
|
||||
|
||||
|
@ -331,7 +332,7 @@ Editor::popup_ruler_menu (nframes_t where, ItemType t)
|
|||
|
||||
switch (t) {
|
||||
case MarkerBarItem:
|
||||
ruler_items.push_back (MenuElem (_("New location marker"), bind ( mem_fun(*this, &Editor::mouse_add_new_marker), where)));
|
||||
ruler_items.push_back (MenuElem (_("New location marker"), bind ( mem_fun(*this, &Editor::mouse_add_new_marker), where, false)));
|
||||
ruler_items.push_back (MenuElem (_("Clear all locations"), mem_fun(*this, &Editor::clear_markers)));
|
||||
ruler_items.push_back (MenuElem (_("Unhide locations"), mem_fun(*this, &Editor::unhide_markers)));
|
||||
ruler_items.push_back (SeparatorElem ());
|
||||
|
@ -346,7 +347,13 @@ Editor::popup_ruler_menu (nframes_t where, ItemType t)
|
|||
case TransportMarkerBarItem:
|
||||
|
||||
break;
|
||||
|
||||
case CdMarkerBarItem:
|
||||
// TODO
|
||||
ruler_items.push_back (MenuElem (_("New CD track marker"), bind ( mem_fun(*this, &Editor::mouse_add_new_marker), where, true)));
|
||||
break;
|
||||
|
||||
|
||||
case TempoBarItem:
|
||||
ruler_items.push_back (MenuElem (_("New Tempo"), bind ( mem_fun(*this, &Editor::mouse_add_new_tempo_event), where)));
|
||||
ruler_items.push_back (MenuElem (_("Clear tempo")));
|
||||
|
@ -413,6 +420,12 @@ Editor::popup_ruler_menu (nframes_t where, ItemType t)
|
|||
mitem->set_active(true);
|
||||
}
|
||||
|
||||
ruler_items.push_back (CheckMenuElem (_("CD Markers"), bind (mem_fun(*this, &Editor::ruler_toggled), (int)ruler_time_cd_marker)));
|
||||
mitem = (CheckMenuItem *) &ruler_items.back();
|
||||
if (ruler_shown[ruler_time_cd_marker]) {
|
||||
mitem->set_active(true);
|
||||
}
|
||||
|
||||
ruler_items.push_back (CheckMenuElem (_("Loop/Punch Ranges"), bind (mem_fun(*this, &Editor::ruler_toggled), (int)ruler_time_transport_marker)));
|
||||
mitem = (CheckMenuItem *) &ruler_items.back();
|
||||
if (ruler_shown[ruler_time_transport_marker]) {
|
||||
|
@ -461,6 +474,7 @@ Editor::store_ruler_visibility ()
|
|||
node->add_property (X_("marker"), ruler_shown[ruler_time_marker] ? "yes": "no");
|
||||
node->add_property (X_("rangemarker"), ruler_shown[ruler_time_range_marker] ? "yes": "no");
|
||||
node->add_property (X_("transportmarker"), ruler_shown[ruler_time_transport_marker] ? "yes": "no");
|
||||
node->add_property (X_("cdmarker"), ruler_shown[ruler_time_cd_marker] ? "yes": "no");
|
||||
|
||||
session->add_extra_xml (*node);
|
||||
session->set_dirty ();
|
||||
|
@ -528,6 +542,26 @@ Editor::restore_ruler_visibility ()
|
|||
ruler_shown[ruler_time_transport_marker] = false;
|
||||
}
|
||||
|
||||
if ((prop = node->property ("cdmarker")) != 0) {
|
||||
if (prop->value() == "yes")
|
||||
ruler_shown[ruler_time_cd_marker] = true;
|
||||
else
|
||||
ruler_shown[ruler_time_cd_marker] = false;
|
||||
}
|
||||
else {
|
||||
// this session doesn't yet know about the cdmarker ruler
|
||||
// as a benefit to the user who doesn't know the feature exists, show the ruler if
|
||||
// any cd marks exist
|
||||
ruler_shown[ruler_time_cd_marker] = false;
|
||||
const Locations::LocationList & locs = session->locations()->list();
|
||||
for (Locations::LocationList::const_iterator i = locs.begin(); i != locs.end(); ++i) {
|
||||
if ((*i)->is_cd_marker()) {
|
||||
ruler_shown[ruler_time_cd_marker] = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
update_ruler_visibility ();
|
||||
|
@ -682,6 +716,24 @@ Editor::update_ruler_visibility ()
|
|||
else {
|
||||
transport_marker_group->hide();
|
||||
}
|
||||
|
||||
if (ruler_shown[ruler_time_cd_marker]) {
|
||||
lab_children.push_back (Element(cd_mark_label, PACK_SHRINK, PACK_START));
|
||||
old_unit_pos = cd_marker_group->property_y();
|
||||
if (tbpos != old_unit_pos) {
|
||||
cd_marker_group->move (0.0, tbpos - old_unit_pos);
|
||||
}
|
||||
cd_marker_group->show();
|
||||
tbpos += timebar_height;
|
||||
visible_timebars++;
|
||||
// make sure all cd markers show up in their respective places
|
||||
update_cd_marker_display();
|
||||
}
|
||||
else {
|
||||
cd_marker_group->hide();
|
||||
// make sure all cd markers show up in their respective places
|
||||
update_cd_marker_display();
|
||||
}
|
||||
|
||||
if (ruler_shown[ruler_time_marker]) {
|
||||
lab_children.push_back (Element(mark_label, PACK_SHRINK, PACK_START));
|
||||
|
|
|
@ -678,6 +678,11 @@ LocationUI::~LocationUI()
|
|||
{
|
||||
}
|
||||
|
||||
void LocationUI::on_show()
|
||||
{
|
||||
ArdourDialog::on_show();
|
||||
refresh_location_list();
|
||||
}
|
||||
|
||||
|
||||
gint LocationUI::do_location_remove (ARDOUR::Location *loc)
|
||||
|
@ -856,6 +861,9 @@ LocationUI::refresh_location_list ()
|
|||
ENSURE_GUI_THREAD(mem_fun(*this, &LocationUI::refresh_location_list));
|
||||
using namespace Box_Helpers;
|
||||
|
||||
// this is just too expensive to do when window is not shown
|
||||
if (!is_visible()) return;
|
||||
|
||||
BoxList & loc_children = location_rows.children();
|
||||
BoxList & range_children = range_rows.children();
|
||||
|
||||
|
|
|
@ -145,6 +145,8 @@ class LocationUI : public ArdourDialog
|
|||
|
||||
void set_session (ARDOUR::Session *);
|
||||
|
||||
void on_show();
|
||||
|
||||
private:
|
||||
ARDOUR::LocationStack* locations;
|
||||
|
||||
|
|
|
@ -31,7 +31,7 @@
|
|||
Marker::Marker (PublicEditor& ed, ArdourCanvas::Group& parent, guint32 rgba, const string& annotation,
|
||||
Type type, nframes_t frame, bool handle_events)
|
||||
|
||||
: editor (ed), _type(type)
|
||||
: editor (ed), _parent(&parent), _type(type)
|
||||
{
|
||||
double label_offset = 0;
|
||||
bool annotate_left = false;
|
||||
|
@ -271,6 +271,7 @@ Marker::Marker (PublicEditor& ed, ArdourCanvas::Group& parent, guint32 rgba, con
|
|||
|
||||
}
|
||||
|
||||
|
||||
Marker::~Marker ()
|
||||
{
|
||||
drop_references ();
|
||||
|
@ -286,6 +287,12 @@ Marker::~Marker ()
|
|||
}
|
||||
}
|
||||
|
||||
void Marker::reparent(ArdourCanvas::Group & parent)
|
||||
{
|
||||
group->reparent(parent);
|
||||
_parent = &parent;
|
||||
}
|
||||
|
||||
void
|
||||
Marker::add_line (ArdourCanvas::Group* group, double initial_height)
|
||||
{
|
||||
|
@ -381,6 +388,7 @@ void
|
|||
Marker::set_color_rgba (uint32_t color)
|
||||
{
|
||||
mark->property_fill_color_rgba() = color;
|
||||
mark->property_outline_color_rgba() = color;
|
||||
}
|
||||
|
||||
/***********************************************************************/
|
||||
|
|
|
@ -67,14 +67,18 @@ class Marker : public PBD::Destructible
|
|||
|
||||
nframes64_t position() const { return frame_position; }
|
||||
|
||||
ArdourCanvas::Group * get_parent() { return _parent; }
|
||||
void reparent (ArdourCanvas::Group & parent);
|
||||
|
||||
void hide ();
|
||||
void show ();
|
||||
|
||||
Type type () { return _type; }
|
||||
|
||||
|
||||
protected:
|
||||
PublicEditor& editor;
|
||||
|
||||
ArdourCanvas::Group * _parent;
|
||||
ArdourCanvas::Group *group;
|
||||
ArdourCanvas::Polygon *mark;
|
||||
ArdourCanvas::Text *text;
|
||||
|
|
Loading…
Reference in New Issue