#include "ardour/midi_track.h"
#include "ardour/region_factory.h"
#include "ardour/smf_source.h"
+#include "ardour/session.h"
#include "ardour_ui.h"
#include "canvas-simplerect.h"
_note_lines->property_x2() = trackview().editor().frame_to_pixel (max_frames);
_note_lines->property_y2() = 0;
- _note_lines->signal_event().connect(bind(
- mem_fun(_trackview.editor(), &PublicEditor::canvas_stream_view_event),
+ _note_lines->signal_event().connect(sigc::bind(
+ sigc::mem_fun(_trackview.editor(), &PublicEditor::canvas_stream_view_event),
_note_lines, &_trackview));
_note_lines->lower_to_bottom();
- ColorsChanged.connect(mem_fun(*this, &MidiStreamView::draw_note_lines));
+ ColorsChanged.connect(sigc::mem_fun(*this, &MidiStreamView::draw_note_lines));
note_range_adjustment.set_page_size(_highest_note - _lowest_note);
note_range_adjustment.set_value(_lowest_note);
note_range_adjustment.signal_value_changed().connect(
- mem_fun(*this, &MidiStreamView::note_range_adjustment_changed));
+ sigc::mem_fun(*this, &MidiStreamView::note_range_adjustment_changed));
}
MidiStreamView::~MidiStreamView ()
display_region (region_view, wfd);
/* catch regionview going away */
- region->GoingAway.connect (bind (mem_fun (*this, &MidiStreamView::remove_region_view), region));
+ region->GoingAway.connect (*this, boost::bind (&MidiStreamView::remove_region_view, this, region), gui_context());
RegionViewAdded (region_view);
{
// cerr << _trackview.name() << " streamview SRB\n";
- if (_trackview.session().transport_rolling()) {
+ if (_trackview.session()->transport_rolling()) {
if (!rec_active &&
- _trackview.session().record_status() == Session::Recording &&
+ _trackview.session()->record_status() == Session::Recording &&
_trackview.get_diskstream()->record_enabled()) {
if (use_rec_regions && rec_regions.size() == rec_rects.size()) {
MidiRegion::SourceList sources;
- for (list<sigc::connection>::iterator prc = rec_data_ready_connections.begin();
- prc != rec_data_ready_connections.end(); ++prc) {
- (*prc).disconnect();
- }
- rec_data_ready_connections.clear();
+ rec_data_ready_connections.drop_connections ();
boost::shared_ptr<MidiDiskstream> mds = _trackview.midi_track()->midi_diskstream();
sources.push_back(mds->write_source());
- rec_data_ready_connections.push_back (mds->write_source()->ViewDataRangeReady.connect (bind (
- mem_fun (*this, &MidiStreamView::rec_data_range_ready),
- boost::weak_ptr<Source>(mds->write_source()))));
+ mds->write_source()->ViewDataRangeReady.connect
+ (rec_data_ready_connections,
+ ui_bind (&MidiStreamView::rec_data_range_ready, this, _1, _2, boost::weak_ptr<Source>(mds->write_source())),
+ gui_context());
// handle multi
assert(region);
region->block_property_changes ();
- region->set_position (_trackview.session().transport_frame(), this);
+ region->set_position (_trackview.session()->transport_frame(), this);
rec_regions.push_back (make_pair(region, (RegionView*)0));
// rec regions are destroyed in setup_rec_box
RecBoxInfo recbox;
recbox.rectangle = rec_rect;
- recbox.start = _trackview.session().transport_frame();
+ recbox.start = _trackview.session()->transport_frame();
recbox.length = 0;
rec_rects.push_back (recbox);
screen_update_connection.disconnect();
screen_update_connection = ARDOUR_UI::instance()->SuperRapidScreenUpdate.connect (
- mem_fun (*this, &MidiStreamView::update_rec_box));
+ sigc::mem_fun (*this, &MidiStreamView::update_rec_box));
rec_updating = true;
rec_active = true;
} else if (rec_active &&
- (_trackview.session().record_status() != Session::Recording ||
+ (_trackview.session()->record_status() != Session::Recording ||
!_trackview.get_diskstream()->record_enabled())) {
screen_update_connection.disconnect();
rec_active = false;
/* disconnect rapid update */
screen_update_connection.disconnect();
-
- for (list<sigc::connection>::iterator prc = rec_data_ready_connections.begin();
- prc != rec_data_ready_connections.end(); ++prc) {
- (*prc).disconnect();
- }
- rec_data_ready_connections.clear();
+ rec_data_ready_connections.drop_connections ();
rec_updating = false;
rec_active = false;
void
MidiStreamView::update_rec_regions (boost::shared_ptr<MidiModel> data, nframes_t start, nframes_t dur)
{
- ENSURE_GUI_THREAD (bind (mem_fun (*this, &MidiStreamView::update_rec_regions), data, start, dur));
+ ENSURE_GUI_THREAD (*this, &MidiStreamView::update_rec_regions, data, start, dur)
if (use_rec_regions) {
gdouble xend = _trackview.editor().frame_to_pixel (region->position() + region->length());
rect->property_x2() = xend;
- ARDOUR::BeatsFramesConverter tconv(_trackview.session(), region->position());
+ ARDOUR::BeatsFramesConverter tconv(_trackview.session()->tempo_map(), region->position());
const MidiModel::TimeType start_beats = tconv.from(start);
/* draw events */
{
// this is called from the butler thread for now
- ENSURE_GUI_THREAD(bind (mem_fun (*this, &MidiStreamView::rec_data_range_ready), start, cnt, weak_src));
+ ENSURE_GUI_THREAD (*this, &MidiStreamView::rec_data_range_ready, start, cnt, weak_src)
boost::shared_ptr<SMFSource> src (boost::dynamic_pointer_cast<SMFSource>(weak_src.lock()));