#include <string>
#include <climits>
-#include <libgnomecanvasmm/libgnomecanvasmm.h>
+#include <libgnomecanvasmm.h>
#include <pbd/error.h>
#include <ardour/session.h>
#include <ardour/tempo.h>
#include <gtkmm2ext/doi.h>
+#include <gtkmm2ext/utils.h>
#include "editor.h"
#include "marker.h"
#include "tempo_dialog.h"
#include "rgb_macros.h"
#include "gui_thread.h"
+#include "color.h"
#include "i18n.h"
using namespace std;
using namespace sigc;
using namespace ARDOUR;
+using namespace PBD;
using namespace Gtk;
+using namespace Gtkmm2ext;
using namespace Editing;
void
if (free_measure_lines.empty()) {
line = new ArdourCanvas::SimpleLine (*time_line_group);
- // cerr << "measure line @ " << line << endl;
used_measure_lines.push_back (line);
} else {
line = free_measure_lines.front();
break;
case TempoMap::Beat:
- xpos = p.frame / (gdouble) frames_per_unit;
+ xpos = frame_to_unit (p.frame);
if (last_beat < xpos) {
beat_spacing = xpos - last_beat;
}
}
}
+ double x1, x2, y1, y2;
+ track_canvas.get_scroll_region (x1, y1, x2, y2);
+
for (i = all_bbt_points->begin(); i != all_bbt_points->end(); ++i) {
TempoMap::BBTPoint& p = (*i);
break;
case TempoMap::Beat:
- xpos = p.frame / (gdouble) frames_per_unit;
-
+ xpos = frame_to_unit (p.frame);
+
if (p.beat == 1) {
color = color_map[cMeasureLineBeat];
} else {
break;
}
}
-
+
if (cnt == 0 || xpos - last_xpos > 4.0) {
line = get_time_line ();
line->property_x1() = xpos;
line->property_x2() = xpos;
- line->property_y2() = canvas_height;
+ line->property_y2() = y2;
line->property_color_rgba() = color;
line->raise_to_top();
line->show();
TempoDialog tempo_dialog (map, frame, _("add"));
tempo_dialog.set_position (Gtk::WIN_POS_MOUSE);
- // GTK2FIX
- // tempo_dialog.realize ();
- // tempo_dialog.get_window()->set_decorations (Gdk::WMDecoration (Gdk::DECOR_BORDER|Gdk::DECOR_RESIZEH));
+ tempo_dialog.signal_realize().connect (bind (sigc::ptr_fun (set_decoration), &tempo_dialog, Gdk::WMDecoration (Gdk::DECOR_BORDER|Gdk::DECOR_RESIZEH)));
ensure_float (tempo_dialog);
MeterDialog meter_dialog (map, frame, _("add"));
meter_dialog.set_position (Gtk::WIN_POS_MOUSE);
- // GTK2FIX
- // meter_dialog.realize ();
- // meter_dialog.get_window()->set_decorations (Gdk::WMDecoration (Gdk::DECOR_BORDER|Gdk::DECOR_RESIZEH));
+ meter_dialog.signal_realize().connect (bind (sigc::ptr_fun (set_decoration), &meter_dialog, Gdk::WMDecoration (Gdk::DECOR_BORDER|Gdk::DECOR_RESIZEH)));
ensure_float (meter_dialog);
MeterDialog meter_dialog (*section, _("done"));
meter_dialog.set_position (Gtk::WIN_POS_MOUSE);
- // GTK2FIX
- // meter_dialog.realize ();
- // meter_dialog.get_window()->set_decorations (Gdk::WMDecoration (Gdk::DECOR_BORDER|Gdk::DECOR_RESIZEH));
ensure_float (meter_dialog);
TempoDialog tempo_dialog (*section, _("done"));
tempo_dialog.set_position (Gtk::WIN_POS_MOUSE);
- // GTK2FIX
- // tempo_dialog.realize ();
- // tempo_dialog.get_window()->set_decorations (Gdk::WMDecoration (Gdk::DECOR_BORDER|Gdk::DECOR_RESIZEH));
ensure_float (tempo_dialog);