13
0

BBT markers: put BBT position in their tooltip

Tooltip will need updating once drag is working correctly
This commit is contained in:
Paul Davis 2022-08-16 15:51:25 -06:00
parent 3259ab2d41
commit 965fe9946b
2 changed files with 20 additions and 6 deletions

View File

@ -24,6 +24,8 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/ */
#include <sstream>
#include <sigc++/bind.h> #include <sigc++/bind.h>
#include "ardour/tempo.h" #include "ardour/tempo.h"
@ -448,16 +450,20 @@ ArdourMarker::set_line_height (double h)
} }
void void
ArdourMarker::set_name (const string& new_name) ArdourMarker::set_name (const string& new_name, const string& tooltip)
{ {
_name = new_name; _name = new_name;
_pcue->set_tooltip(new_name); _pcue->set_tooltip (new_name);
_pmark->set_tooltip(new_name); _pmark->set_tooltip (new_name);
if (_name_flag) { if (_name_flag) {
_name_flag->set_tooltip(new_name); _name_flag->set_tooltip (new_name);
}
if (tooltip.empty()) {
_name_item->set_tooltip (new_name);
} else {
_name_item->set_tooltip (tooltip);
} }
_name_item->set_tooltip(new_name);
setup_name_display (); setup_name_display ();
} }
@ -742,6 +748,14 @@ BBTMarker::BBTMarker (PublicEditor& editor, ArdourCanvas::Item& parent, guint32
: MetricMarker (editor, parent, rgba, p.name(), BBTPosition, p.time(), false) : MetricMarker (editor, parent, rgba, p.name(), BBTPosition, p.time(), false)
, _point (&p) , _point (&p)
{ {
std::stringstream full_tooltip;
full_tooltip << name();
full_tooltip << " (";
full_tooltip << p.bbt();
full_tooltip << ')';
set_name (name(), full_tooltip.str());
group->Event.connect (sigc::bind (sigc::mem_fun (editor, &PublicEditor::canvas_bbt_marker_event), group, this)); group->Event.connect (sigc::bind (sigc::mem_fun (editor, &PublicEditor::canvas_bbt_marker_event), group, this));
} }

View File

@ -89,7 +89,7 @@ public:
void set_line_height (double); void set_line_height (double);
void set_position (Temporal::timepos_t const &); void set_position (Temporal::timepos_t const &);
void set_name (const std::string&); void set_name (const std::string&, const std::string & tooltip = std::string());
void set_points_color (uint32_t rgba); void set_points_color (uint32_t rgba);
void set_color_rgba (uint32_t rgba); void set_color_rgba (uint32_t rgba);
void setup_line (); void setup_line ();