mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-10 16:46:35 +01:00
Streamview: NO-OP, consolidate code
This commit is contained in:
parent
1e8a1f29c4
commit
1feb9b5e89
4 changed files with 38 additions and 73 deletions
|
|
@ -276,40 +276,7 @@ AudioStreamView::setup_rec_box ()
|
|||
|
||||
// cerr << "\tNOT rolling, rec_rects = " << rec_rects.size() << " rec_regions = " << rec_regions.size() << endl;
|
||||
|
||||
if (!rec_rects.empty() || !rec_regions.empty()) {
|
||||
|
||||
/* disconnect rapid update */
|
||||
screen_update_connection.disconnect();
|
||||
rec_data_ready_connections.drop_connections ();
|
||||
rec_updating = false;
|
||||
rec_active = false;
|
||||
|
||||
/* remove temp regions */
|
||||
|
||||
for (list<pair<std::shared_ptr<Region>,RegionView*> >::iterator iter = rec_regions.begin(); iter != rec_regions.end(); ) {
|
||||
list<pair<std::shared_ptr<Region>,RegionView*> >::iterator tmp;
|
||||
|
||||
tmp = iter;
|
||||
++tmp;
|
||||
|
||||
(*iter).first->drop_references ();
|
||||
|
||||
iter = tmp;
|
||||
}
|
||||
|
||||
rec_regions.clear();
|
||||
|
||||
// cerr << "\tclear " << rec_rects.size() << " rec rects\n";
|
||||
|
||||
/* transport stopped, clear boxes */
|
||||
for (vector<RecBoxInfo>::iterator iter=rec_rects.begin(); iter != rec_rects.end(); ++iter) {
|
||||
RecBoxInfo &rect = (*iter);
|
||||
delete rect.rectangle;
|
||||
}
|
||||
|
||||
rec_rects.clear();
|
||||
|
||||
}
|
||||
cleanup_rec_box ();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -554,41 +554,8 @@ MidiStreamView::setup_rec_box ()
|
|||
} else {
|
||||
|
||||
// cerr << "\tNOT rolling, rec_rects = " << rec_rects.size() << " rec_regions = " << rec_regions.size() << endl;
|
||||
cleanup_rec_box ();
|
||||
|
||||
if (!rec_rects.empty() || !rec_regions.empty()) {
|
||||
|
||||
/* disconnect rapid update */
|
||||
screen_update_connection.disconnect();
|
||||
rec_data_ready_connections.drop_connections ();
|
||||
rec_updating = false;
|
||||
rec_active = false;
|
||||
|
||||
/* remove temp regions */
|
||||
|
||||
for (list<pair<std::shared_ptr<Region>,RegionView*> >::iterator iter = rec_regions.begin(); iter != rec_regions.end();) {
|
||||
list<pair<std::shared_ptr<Region>,RegionView*> >::iterator tmp;
|
||||
|
||||
tmp = iter;
|
||||
++tmp;
|
||||
|
||||
(*iter).first->drop_references ();
|
||||
|
||||
iter = tmp;
|
||||
}
|
||||
|
||||
rec_regions.clear();
|
||||
|
||||
// cerr << "\tclear " << rec_rects.size() << " rec rects\n";
|
||||
|
||||
/* transport stopped, clear boxes */
|
||||
for (vector<RecBoxInfo>::iterator iter=rec_rects.begin(); iter != rec_rects.end(); ++iter) {
|
||||
RecBoxInfo &rect = (*iter);
|
||||
delete rect.rectangle;
|
||||
}
|
||||
|
||||
rec_rects.clear();
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -463,6 +463,35 @@ StreamView::update_rec_box ()
|
|||
}
|
||||
}
|
||||
|
||||
void
|
||||
StreamView::cleanup_rec_box ()
|
||||
{
|
||||
if (rec_rects.empty() && rec_regions.empty()) {
|
||||
return;
|
||||
}
|
||||
|
||||
/* disconnect rapid update */
|
||||
screen_update_connection.disconnect();
|
||||
rec_data_ready_connections.drop_connections ();
|
||||
rec_updating = false;
|
||||
rec_active = false;
|
||||
|
||||
/* remove temp regions */
|
||||
for (auto const& i : rec_regions) {
|
||||
i.first->drop_references ();
|
||||
}
|
||||
|
||||
rec_regions.clear();
|
||||
|
||||
// cerr << "\tclear " << rec_rects.size() << " rec rects\n";
|
||||
|
||||
/* transport stopped, clear boxes */
|
||||
for (auto const& i : rec_rects) {
|
||||
delete i.rectangle;
|
||||
}
|
||||
rec_rects.clear();
|
||||
}
|
||||
|
||||
RegionView*
|
||||
StreamView::find_view (std::shared_ptr<const Region> region)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -142,6 +142,8 @@ protected:
|
|||
void rec_enable_changed();
|
||||
void sess_rec_enable_changed();
|
||||
void create_rec_box(samplepos_t sample_pos, double width);
|
||||
void cleanup_rec_box ();
|
||||
|
||||
virtual void setup_rec_box () = 0;
|
||||
virtual void update_rec_box ();
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue