bbt markers: all the basics of dragging, editing, removing
This commit is contained in:
parent
025dfa6062
commit
fc6ad8ebd9
|
@ -33,11 +33,27 @@ BBTMarkerDialog::BBTMarkerDialog (timepos_t const & pos)
|
|||
: ArdourDialog (_("New Music Time"))
|
||||
, _point (0)
|
||||
, _position (pos)
|
||||
, entry_label (_("Position"))
|
||||
, entry_label (_("BBT"))
|
||||
, name_label (_("Name"))
|
||||
|
||||
{
|
||||
BBT_Time bbt = TempoMap::use()->bbt_at (pos).round_to_beat ();
|
||||
init (true);
|
||||
}
|
||||
|
||||
BBTMarkerDialog::BBTMarkerDialog (MusicTimePoint& p)
|
||||
: ArdourDialog (_("Edit Music Time"))
|
||||
, _point (&p)
|
||||
, _position (timepos_t::from_superclock (p.sclock()))
|
||||
, entry_label (_("BBT"))
|
||||
, name_label (_("Name"))
|
||||
{
|
||||
init (false);
|
||||
}
|
||||
|
||||
void
|
||||
BBTMarkerDialog::init (bool add)
|
||||
{
|
||||
BBT_Time bbt = TempoMap::use()->bbt_at (_position).round_to_beat ();
|
||||
|
||||
bar_entry.set_range (1, 9999);
|
||||
beat_entry.set_range (1, 9999);
|
||||
|
@ -54,6 +70,10 @@ BBTMarkerDialog::BBTMarkerDialog (timepos_t const & pos)
|
|||
name_box.pack_start (name_label);
|
||||
name_box.pack_start (name_entry);
|
||||
|
||||
if (_point) {
|
||||
name_entry.set_text (_point->name());
|
||||
}
|
||||
|
||||
name_entry.signal_activate().connect (sigc::bind (sigc::mem_fun (*this, &BBTMarkerDialog::response), Gtk::RESPONSE_OK));
|
||||
|
||||
get_vbox()->pack_start (name_box);
|
||||
|
@ -63,7 +83,12 @@ BBTMarkerDialog::BBTMarkerDialog (timepos_t const & pos)
|
|||
name_box.show_all ();
|
||||
|
||||
add_button (Stock::CANCEL, RESPONSE_CANCEL);
|
||||
add_button (_("Add Marker"), RESPONSE_OK);
|
||||
|
||||
if (add) {
|
||||
add_button (_("Add Marker"), RESPONSE_OK);
|
||||
} else {
|
||||
add_button (_("Save Changes"), RESPONSE_OK);
|
||||
}
|
||||
|
||||
get_vbox()->set_border_width (12);
|
||||
get_vbox()->set_spacing (12);
|
||||
|
|
|
@ -33,15 +33,15 @@
|
|||
class BBTMarkerDialog : public ArdourDialog
|
||||
{
|
||||
public:
|
||||
BBTMarkerDialog (Temporal::timepos_t const & );
|
||||
BBTMarkerDialog (Temporal::MusicTimePoint&, const std::string & action);
|
||||
BBTMarkerDialog (Temporal::timepos_t const &);
|
||||
BBTMarkerDialog (Temporal::MusicTimePoint&);
|
||||
|
||||
Temporal::timepos_t position() const;
|
||||
Temporal::BBT_Time bbt_value () const;
|
||||
std::string name() const;
|
||||
|
||||
private:
|
||||
void init ();
|
||||
void init (bool add);
|
||||
Temporal::MusicTimePoint* _point;
|
||||
Temporal::timepos_t _position;
|
||||
|
||||
|
|
|
@ -399,6 +399,7 @@ Editor::Editor ()
|
|||
, time_line_group (0)
|
||||
, tempo_marker_menu (0)
|
||||
, meter_marker_menu (0)
|
||||
, bbt_marker_menu (0)
|
||||
, marker_menu (0)
|
||||
, range_marker_menu (0)
|
||||
, new_transport_marker_menu (0)
|
||||
|
|
|
@ -598,6 +598,7 @@ public:
|
|||
void mouse_add_new_meter_event (Temporal::timepos_t where);
|
||||
void edit_tempo_section (Temporal::TempoPoint&);
|
||||
void edit_meter_section (Temporal::MeterPoint&);
|
||||
void edit_bbt (Temporal::MusicTimePoint&);
|
||||
|
||||
bool should_ripple () const;
|
||||
bool should_ripple_all () const; /* RippleAll will ripple all similar regions and the timeline markers */
|
||||
|
@ -1798,11 +1799,14 @@ private:
|
|||
|
||||
void remove_tempo_marker (ArdourCanvas::Item*);
|
||||
void remove_meter_marker (ArdourCanvas::Item*);
|
||||
void remove_bbt_marker (ArdourCanvas::Item*);
|
||||
gint real_remove_tempo_marker (Temporal::TempoPoint const *);
|
||||
gint real_remove_meter_marker (Temporal::MeterPoint const *);
|
||||
gint real_remove_bbt_marker (Temporal::MusicTimePoint const *);
|
||||
|
||||
void edit_tempo_marker (TempoMarker&);
|
||||
void edit_meter_marker (MeterMarker&);
|
||||
void edit_bbt_marker (BBTMarker&);
|
||||
void edit_control_point (ArdourCanvas::Item*);
|
||||
void edit_notes (MidiRegionView*);
|
||||
void edit_region (RegionView*);
|
||||
|
@ -1839,18 +1843,20 @@ private:
|
|||
void update_punch_range_view ();
|
||||
void new_transport_marker_menu_popdown ();
|
||||
void marker_context_menu (GdkEventButton*, ArdourCanvas::Item*);
|
||||
void tempo_or_meter_marker_context_menu (GdkEventButton*, ArdourCanvas::Item*);
|
||||
void tempo_map_marker_context_menu (GdkEventButton*, ArdourCanvas::Item*);
|
||||
void new_transport_marker_context_menu (GdkEventButton*, ArdourCanvas::Item*);
|
||||
void build_range_marker_menu (ARDOUR::Location*, bool, bool);
|
||||
void build_marker_menu (ARDOUR::Location*);
|
||||
void build_tempo_marker_menu (TempoMarker*, bool);
|
||||
void build_meter_marker_menu (MeterMarker*, bool);
|
||||
void build_bbt_marker_menu (BBTMarker*);
|
||||
void build_new_transport_marker_menu ();
|
||||
|
||||
void dynamic_cast_marker_object (void*, MeterMarker**, TempoMarker**) const;
|
||||
void dynamic_cast_marker_object (void*, MeterMarker**, TempoMarker**, BBTMarker**) const;
|
||||
|
||||
Gtk::Menu* tempo_marker_menu;
|
||||
Gtk::Menu* meter_marker_menu;
|
||||
Gtk::Menu* bbt_marker_menu;
|
||||
Gtk::Menu* marker_menu;
|
||||
Gtk::Menu* range_marker_menu;
|
||||
Gtk::Menu* new_transport_marker_menu;
|
||||
|
|
|
@ -3372,7 +3372,7 @@ TempoMarkerDrag::aborted (bool moved)
|
|||
// _point->end_float ();
|
||||
_marker->set_position (timepos_t (_marker->tempo().beats()));
|
||||
|
||||
if (moved) { |