*/
#include "pbd/enumwriter.h"
+#include "pbd/i18n.h"
#include "temporal/time.h"
#include "gtkmm2ext/gui_thread.h"
#include "ardour_ui.h"
+#include "floating_text_entry.h"
#include "transport_masters_dialog.h"
-#include "pbd/i18n.h"
using namespace std;
using namespace Gtk;
col_title[11].set_markup (string_compose ("<span weight=\"bold\">%1</span>", _("Clock\nSynced")));
col_title[12].set_markup (string_compose ("<span weight=\"bold\">%1</span>", _("29.97/30")));
-#if 0
set_tooltip (col_title[12], _("<b>When enabled</b> the external timecode source is assumed to use 29.97 fps instead of 30000/1001.\n"
"SMPTE 12M-1999 specifies 29.97df as 30000/1001. The spec further mentions that "
"drop-sample timecode has an accumulated error of -86ms over a 24-hour period.\n"
set_tooltip (col_title[11], string_compose (_("<b>When enabled</b> the external timecode source is assumed to be sample-clock synced to the audio interface\n"
"being used by %1."), PROGRAM_NAME));
-#endif
table.set_spacings (6);
int col = 0;
+ r->label_box.add (r->label);
+
table.attach (r->use_button, col, col+1, n, n+1); ++col;
+ table.attach (r->label_box, col, col+1, n, n+1); ++col;
table.attach (r->type, col, col+1, n, n+1); ++col;
- table.attach (r->label, col, col+1, n, n+1); ++col;
table.attach (r->format, col, col+1, n, n+1); ++col;
table.attach (r->current, col, col+1, n, n+1); ++col;
table.attach (r->last, col, col+1, n, n+1); ++col;
r->fr2997_button.signal_toggled().connect (sigc::mem_fun (*r, &TransportMastersWidget::Row::fr2997_button_toggled));
}
+ r->label_box.set_events (Gdk::BUTTON_PRESS_MASK|Gdk::BUTTON_RELEASE_MASK);
+ r->label_box.signal_button_press_event().connect (sigc::mem_fun (*r, &TransportMastersWidget::Row::name_press));
r->port_combo.signal_changed().connect (sigc::mem_fun (*r, &TransportMastersWidget::Row::port_choice_changed));
r->use_button.signal_toggled().connect (sigc::mem_fun (*r, &TransportMastersWidget::Row::use_button_toggled));
r->collect_button.signal_toggled().connect (sigc::mem_fun (*r, &TransportMastersWidget::Row::collect_button_toggled));
TransportMastersWidget::Row::Row ()
: request_option_menu (0)
+ , name_editor (0)
, ignore_active_change (false)
{
}
+bool
+TransportMastersWidget::Row::name_press (GdkEventButton* ev)
+{
+ if (ev->type == GDK_2BUTTON_PRESS && ev->button == 1) {
+ Gtk::Window* toplevel = dynamic_cast<Gtk::Window*> (label.get_toplevel());
+ if (!toplevel) {
+ return false;
+ }
+ name_editor = new FloatingTextEntry (toplevel, tm->name());
+ name_editor->use_text.connect (sigc::mem_fun (*this, &TransportMastersWidget::Row::name_edited));
+ name_editor->show ();
+ return true;
+ }
+ return false;
+}
+
+void
+TransportMastersWidget::Row::name_edited (string str, int ignored)
+{
+ tm->set_name (str);
+ /* floating text entry deletes itself */
+ name_editor = 0;
+}
+
void
TransportMastersWidget::Row::prop_change (PropertyChange what_changed)
{
#include <string>
#include <gtkmm/button.h>
+#include <gtkmm/eventbox.h>
#include <gtkmm/radiobutton.h>
#include <gtkmm/label.h>
#include <gtkmm/table.h>
class TransportMaster;
}
+class FloatingTextEntry;
+
class TransportMastersWidget : public Gtk::VBox, public ARDOUR::SessionHandlePtr
{
public:
private:
struct Row : sigc::trackable, PBD::ScopedConnectionList {
+ Gtk::EventBox label_box;
Gtk::Label label;
Gtk::Label type;
Gtk::Label format;
Gtk::CheckButton fr2997_button;
Gtk::Button request_options;
Gtk::Menu* request_option_menu;
+ FloatingTextEntry* name_editor;
void build_request_options();
bool request_option_press (GdkEventButton*);
void prop_change (PBD::PropertyChange);
+ bool name_press (GdkEventButton*);
+ void name_edited (std::string, int);
+
PBD::ScopedConnection property_change_connection;
bool ignore_active_change;
};