2006-07-31 23:23:35 -04:00
|
|
|
/*
|
|
|
|
Copyright (C) 2001, 2006 Paul Davis
|
|
|
|
|
|
|
|
This program is free software; you can redistribute it and/or modify
|
|
|
|
it under the terms of the GNU General Public License as published by
|
|
|
|
the Free Software Foundation; either version 2 of the License, or
|
|
|
|
(at your option) any later version.
|
|
|
|
|
|
|
|
This program is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
GNU General Public License for more details.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
|
|
along with this program; if not, write to the Free Software
|
|
|
|
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
|
|
|
*/
|
|
|
|
|
2005-09-25 14:42:24 -04:00
|
|
|
#include <cmath>
|
|
|
|
|
2005-09-25 16:33:00 -04:00
|
|
|
#include <gtkmm.h>
|
2005-09-25 14:42:24 -04:00
|
|
|
|
2005-09-25 16:33:00 -04:00
|
|
|
#include <gtkmm2ext/gtk_ui.h>
|
2005-09-25 14:42:24 -04:00
|
|
|
|
2006-07-31 23:23:35 -04:00
|
|
|
#include <ardour/playlist.h>
|
|
|
|
#include <ardour/region.h>
|
2005-09-25 14:42:24 -04:00
|
|
|
#include <ardour/source.h>
|
2006-07-31 23:23:35 -04:00
|
|
|
#include <ardour/diskstream.h>
|
|
|
|
#include <ardour/track.h>
|
2005-09-25 14:42:24 -04:00
|
|
|
|
|
|
|
#include "streamview.h"
|
2006-07-31 23:23:35 -04:00
|
|
|
#include "region_view.h"
|
|
|
|
#include "route_time_axis.h"
|
2005-09-25 14:42:24 -04:00
|
|
|
#include "canvas-waveview.h"
|
|
|
|
#include "canvas-simplerect.h"
|
|
|
|
#include "region_selection.h"
|
|
|
|
#include "selection.h"
|
|
|
|
#include "public_editor.h"
|
|
|
|
#include "ardour_ui.h"
|
|
|
|
#include "rgb_macros.h"
|
|
|
|
#include "gui_thread.h"
|
2005-11-28 17:36:26 -05:00
|
|
|
#include "utils.h"
|
2006-02-14 12:19:58 -05:00
|
|
|
#include "color.h"
|
2005-09-25 14:42:24 -04:00
|
|
|
|
|
|
|
using namespace ARDOUR;
|
2006-06-21 19:01:03 -04:00
|
|
|
using namespace PBD;
|
2005-09-25 14:42:24 -04:00
|
|
|
using namespace Editing;
|
|
|
|
|
2006-07-31 23:23:35 -04:00
|
|
|
StreamView::StreamView (RouteTimeAxisView& tv)
|
2005-09-25 14:42:24 -04:00
|
|
|
: _trackview (tv)
|
|
|
|
{
|
|
|
|
region_color = _trackview.color();
|
|
|
|
|
|
|
|
/* set_position() will position the group */
|
2005-11-12 22:53:51 -05:00
|
|
|
|
2005-11-23 12:21:12 -05:00
|
|
|
canvas_group = new ArdourCanvas::Group(*_trackview.canvas_display);
|
2005-11-12 22:53:51 -05:00
|
|
|
|
2005-11-23 12:21:12 -05:00
|
|
|
canvas_rect = new ArdourCanvas::SimpleRect (*canvas_group);
|
2005-11-27 17:35:04 -05:00
|
|
|
canvas_rect->property_x1() = 0.0;
|
|
|
|
canvas_rect->property_y1() = 0.0;
|
|
|
|
canvas_rect->property_x2() = 1000000.0;
|
|
|
|
canvas_rect->property_y2() = (double) tv.height;
|
2006-02-10 21:34:03 -05:00
|
|
|
canvas_rect->property_outline_what() = (guint32) (0x1|0x2|0x8); // outline ends and bottom
|
2005-11-27 17:35:04 -05:00
|
|
|
canvas_rect->property_fill_color_rgba() = stream_base_color;
|
2005-09-25 14:42:24 -04:00
|
|
|
|
2005-11-25 19:06:46 -05:00
|
|
|
canvas_rect->signal_event().connect (bind (mem_fun (_trackview.editor, &PublicEditor::canvas_stream_view_event), canvas_rect, &_trackview));
|
2005-09-25 14:42:24 -04:00
|
|
|
|
|
|
|
_samples_per_unit = _trackview.editor.get_current_zoom();
|
|
|
|
|
2006-07-31 23:23:35 -04:00
|
|
|
if (_trackview.is_track()) {
|
|
|
|
_trackview.track()->DiskstreamChanged.connect (mem_fun (*this, &StreamView::diskstream_changed));
|
2005-09-25 17:19:23 -04:00
|
|
|
_trackview.session().TransportStateChange.connect (mem_fun (*this, &StreamView::transport_changed));
|
2006-07-31 23:23:35 -04:00
|
|
|
_trackview.get_diskstream()->RecordEnableChanged.connect (mem_fun (*this, &StreamView::rec_enable_changed));
|
2006-01-18 19:03:55 -05:00
|
|
|
_trackview.session().RecordStateChanged.connect (mem_fun (*this, &StreamView::sess_rec_enable_changed));
|
2005-09-25 14:42:24 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
rec_updating = false;
|
|
|
|
rec_active = false;
|
|
|
|
use_rec_regions = tv.editor.show_waveforms_recording ();
|
2006-02-14 12:19:58 -05:00
|
|
|
|
|
|
|
ColorChanged.connect (mem_fun (*this, &StreamView::color_handler));
|
2005-09-25 14:42:24 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
StreamView::~StreamView ()
|
|
|
|
{
|
|
|
|
undisplay_diskstream ();
|
2005-11-28 17:36:26 -05:00
|
|
|
delete canvas_group;
|
2005-09-25 14:42:24 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
StreamView::attach ()
|
|
|
|
{
|
2006-07-31 23:23:35 -04:00
|
|
|
if (_trackview.is_track()) {
|
2005-09-25 14:42:24 -04:00
|
|
|
display_diskstream (_trackview.get_diskstream());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
int
|
|
|
|
StreamView::set_position (gdouble x, gdouble y)
|
|
|
|
|
|
|
|
{
|
2005-11-27 17:35:04 -05:00
|
|
|
canvas_group->property_x() = x;
|
|
|
|
canvas_group->property_y() = y;
|
2005-09-25 14:42:24 -04:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
int
|
|
|
|
StreamView::set_height (gdouble h)
|
|
|
|
{
|
|
|
|
/* limit the values to something sane-ish */
|
|
|
|
|
|
|
|
if (h < 10.0 || h > 1000.0) {
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
|
2005-11-28 17:36:26 -05:00
|
|
|
canvas_rect->property_y2() = h;
|
2005-09-25 14:42:24 -04:00
|
|
|
|
2006-07-31 23:23:35 -04:00
|
|
|
for (RegionViewList::iterator i = region_views.begin(); i != region_views.end(); ++i) {
|
2005-09-25 14:42:24 -04:00
|
|
|
(*i)->set_height (h);
|
|
|
|
}
|
|
|
|
|
2006-07-31 23:23:35 -04:00
|
|
|
/*for (CrossfadeViewList::iterator i = crossfade_views.begin(); i != crossfade_views.end(); ++i) {
|
2005-09-25 14:42:24 -04:00
|
|
|
(*i)->set_height (h);
|
2006-07-31 23:23:35 -04:00
|
|
|
}*/
|
2005-09-25 14:42:24 -04:00
|
|
|
|
|
|
|
for (vector<RecBoxInfo>::iterator i = rec_rects.begin(); i != rec_rects.end(); ++i) {
|
|
|
|
RecBoxInfo &recbox = (*i);
|
2005-11-28 17:36:26 -05:00
|
|
|
recbox.rectangle->property_y2() = h - 1.0;
|
2005-09-25 14:42:24 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
int
|
|
|
|
StreamView::set_samples_per_unit (gdouble spp)
|
|
|
|
{
|
2006-07-31 23:23:35 -04:00
|
|
|
RegionViewList::iterator i;
|
2005-09-25 14:42:24 -04:00
|
|
|
|
|
|
|
if (spp < 1.0) {
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
|
|
|
|
_samples_per_unit = spp;
|
|
|
|
|
|
|
|
for (i = region_views.begin(); i != region_views.end(); ++i) {
|
|
|
|
(*i)->set_samples_per_unit (spp);
|
|
|
|
}
|
|
|
|
|
|
|
|
for (vector<RecBoxInfo>::iterator xi = rec_rects.begin(); xi != rec_rects.end(); ++xi) {
|
|
|
|
RecBoxInfo &recbox = (*xi);
|
|
|
|
|
|
|
|
gdouble xstart = _trackview.editor.frame_to_pixel ( recbox.start );
|
|
|
|
gdouble xend = _trackview.editor.frame_to_pixel ( recbox.start + recbox.length );
|
|
|
|
|
2005-11-27 17:35:04 -05:00
|
|
|
recbox.rectangle->property_x1() = xstart;
|
|
|
|
recbox.rectangle->property_x2() = xend;
|
2005-09-25 14:42:24 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
StreamView::add_region_view (Region *r)
|
|
|
|
{
|
|
|
|
add_region_view_internal (r, true);
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
StreamView::remove_region_view (Region *r)
|
|
|
|
{
|
2005-09-25 17:19:23 -04:00
|
|
|
ENSURE_GUI_THREAD (bind (mem_fun (*this, &StreamView::remove_region_view), r));
|
2005-09-25 14:42:24 -04:00
|
|
|
|
2006-07-31 23:23:35 -04:00
|
|
|
for (list<RegionView *>::iterator i = region_views.begin(); i != region_views.end(); ++i) {
|
|
|
|
if (&((*i)->region()) == r) {
|
2005-09-25 14:42:24 -04:00
|
|
|
delete *i;
|
|
|
|
region_views.erase (i);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
StreamView::remove_rec_region (Region *r)
|
|
|
|
{
|
2005-09-25 17:19:23 -04:00
|
|
|
ENSURE_GUI_THREAD(bind (mem_fun (*this, &StreamView::remove_rec_region), r));
|
2005-09-25 14:42:24 -04:00
|
|
|
|
2006-04-24 18:45:19 -04:00
|
|
|
if (!Gtkmm2ext::UI::instance()->caller_is_ui_thread()) {
|
2005-09-25 14:42:24 -04:00
|
|
|
fatal << "region deleted from non-GUI thread!" << endmsg;
|
|
|
|
/*NOTREACHED*/
|
|
|
|
}
|
|
|
|
|
2006-07-31 23:23:35 -04:00
|
|
|
for (list<Region *>::iterator i = rec_regions.begin(); i != rec_regions.end(); ++i) {
|
|
|
|
if (*i == r) {
|
2005-09-25 14:42:24 -04:00
|
|
|
rec_regions.erase (i);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
StreamView::undisplay_diskstream ()
|
|
|
|
{
|
2006-07-31 23:23:35 -04:00
|
|
|
for (RegionViewList::iterator i = region_views.begin(); i != region_views.end(); ++i) {
|
2005-09-25 14:42:24 -04:00
|
|
|
delete *i;
|
|
|
|
}
|
|
|
|
|
|
|
|
region_views.clear();
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
2006-07-31 23:23:35 -04:00
|
|
|
StreamView::display_diskstream (Diskstream *ds)
|
2005-09-25 14:42:24 -04:00
|
|
|
{
|
|
|
|
playlist_change_connection.disconnect();
|
|
|
|
playlist_changed (ds);
|
2005-09-25 17:19:23 -04:00
|
|
|
playlist_change_connection = ds->PlaylistChanged.connect (bind (mem_fun (*this, &StreamView::playlist_changed), ds));
|
2005-09-25 14:42:24 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
StreamView::playlist_modified ()
|
|
|
|
{
|
2005-09-25 17:19:23 -04:00
|
|
|
ENSURE_GUI_THREAD (mem_fun (*this, &StreamView::playlist_modified));
|
2005-09-25 14:42:24 -04:00
|
|
|
|
2006-07-31 23:23:35 -04:00
|
|
|
for (RegionViewList::iterator i = region_views.begin(); i != region_views.end(); ++i) {
|
2005-09-25 14:42:24 -04:00
|
|
|
region_layered (*i);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
2006-07-31 23:23:35 -04:00
|
|
|
StreamView::playlist_changed (Diskstream *ds)
|
2005-09-25 14:42:24 -04:00
|
|
|
{
|
2005-09-25 17:19:23 -04:00
|
|
|
ENSURE_GUI_THREAD (bind (mem_fun (*this, &StreamView::playlist_changed), ds));
|
2005-09-25 14:42:24 -04:00
|
|
|
|
|
|
|
/* disconnect from old playlist */
|
|
|
|
|
2005-09-25 16:33:00 -04:00
|
|
|
for (vector<sigc::connection>::iterator i = playlist_connections.begin(); i != playlist_connections.end(); ++i) {
|
2005-09-25 14:42:24 -04:00
|
|
|
(*i).disconnect();
|
|
|
|
}
|
|
|
|
|
|
|
|
playlist_connections.clear();
|
|
|
|
undisplay_diskstream ();
|
|
|
|
|
|
|
|
/* draw it */
|
|
|
|
|
|
|
|
redisplay_diskstream ();
|
|
|
|
|
|
|
|
/* catch changes */
|
|
|
|
|
2005-09-25 17:19:23 -04:00
|
|
|
playlist_connections.push_back (ds->playlist()->RegionAdded.connect (mem_fun (*this, &StreamView::add_region_view)));
|
|
|
|
playlist_connections.push_back (ds->playlist()->RegionRemoved.connect (mem_fun (*this, &StreamView::remove_region_view)));
|
|
|
|
playlist_connections.push_back (ds->playlist()->StateChanged.connect (mem_fun (*this, &StreamView::playlist_state_changed)));
|
|
|
|
playlist_connections.push_back (ds->playlist()->Modified.connect (mem_fun (*this, &StreamView::playlist_modified)));
|
2005-09-25 14:42:24 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
StreamView::playlist_state_changed (Change ignored)
|
|
|
|
{
|
2005-09-25 17:19:23 -04:00
|
|
|
ENSURE_GUI_THREAD (bind (mem_fun (*this, &StreamView::playlist_state_changed), ignored));
|
2005-09-25 14:42:24 -04:00
|
|
|
|
|
|
|
redisplay_diskstream ();
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
2006-07-31 23:23:35 -04:00
|
|
|
StreamView::diskstream_changed ()
|
2005-09-25 14:42:24 -04:00
|
|
|
{
|
2006-07-31 23:23:35 -04:00
|
|
|
Track *t;
|
2005-09-25 14:42:24 -04:00
|
|
|
|
2006-07-31 23:23:35 -04:00
|
|
|
if ((t = _trackview.track()) != 0) {
|
|
|
|
Diskstream& ds = t->diskstream();
|
2005-09-25 14:42:24 -04:00
|
|
|
/* XXX grrr: when will SigC++ allow me to bind references? */
|
2005-09-25 17:19:23 -04:00
|
|
|
Gtkmm2ext::UI::instance()->call_slot (bind (mem_fun (*this, &StreamView::display_diskstream), &ds));
|
2005-09-25 14:42:24 -04:00
|
|
|
} else {
|
2005-09-25 17:19:23 -04:00
|
|
|
Gtkmm2ext::UI::instance()->call_slot (mem_fun (*this, &StreamView::undisplay_diskstream));
|
2005-09-25 14:42:24 -04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
2005-10-06 00:59:20 -04:00
|
|
|
StreamView::apply_color (Gdk::Color& color, ColorTarget target)
|
2005-09-25 14:42:24 -04:00
|
|
|
|
|
|
|
{
|
2006-07-31 23:23:35 -04:00
|
|
|
list<RegionView *>::iterator i;
|
2005-09-25 14:42:24 -04:00
|
|
|
|
|
|
|
switch (target) {
|
|
|
|
case RegionColor:
|
|
|
|
region_color = color;
|
|
|
|
for (i = region_views.begin(); i != region_views.end(); ++i) {
|
|
|
|
(*i)->set_color (region_color);
|
|
|
|
}
|
|
|
|
// stream_base_color = RGBA_TO_UINT (color.red/256, color.green/256, color.blue/256, 255);
|
2005-09-25 18:26:56 -04:00
|
|
|
// gnome_canvas_item_set (canvas_rect, "fill_color_rgba", stream_base_color, NULL);
|
2005-09-25 14:42:24 -04:00
|
|
|
break;
|
|
|
|
|
|
|
|
case StreamBaseColor:
|
|
|
|
// stream_base_color = RGBA_TO_UINT (color.red/256, color.green/256, color.blue/256, 255);
|
2005-09-25 18:26:56 -04:00
|
|
|
// gnome_canvas_item_set (canvas_rect, "fill_color_rgba", stream_base_color, NULL);
|
2005-09-25 14:42:24 -04:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
2006-07-31 23:23:35 -04:00
|
|
|
StreamView::region_layered (RegionView* rv)
|
2005-09-25 14:42:24 -04:00
|
|
|
{
|
2005-11-12 22:53:51 -05:00
|
|
|
rv->get_canvas_group()->lower_to_bottom();
|
2005-09-25 14:42:24 -04:00
|
|
|
|
|
|
|
/* don't ever leave it at the bottom, since then it doesn't
|
|
|
|
get events - the parent group does instead ...
|
|
|
|
*/
|
|
|
|
|
2006-07-31 23:23:35 -04:00
|
|
|
rv->get_canvas_group()->raise (rv->region().layer() + 1);
|
2005-09-25 14:42:24 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
2006-07-31 23:23:35 -04:00
|
|
|
StreamView::rec_enable_changed ()
|
2005-09-25 14:42:24 -04:00
|
|
|
{
|
2005-09-25 17:19:23 -04:00
|
|
|
Gtkmm2ext::UI::instance()->call_slot (mem_fun (*this, &StreamView::setup_rec_box));
|
2005-09-25 14:42:24 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
StreamView::sess_rec_enable_changed ()
|
|
|
|
{
|
2005-09-25 17:19:23 -04:00
|
|
|
Gtkmm2ext::UI::instance()->call_slot (mem_fun (*this, &StreamView::setup_rec_box));
|
2005-09-25 14:42:24 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
StreamView::transport_changed()
|
|
|
|
{
|
2005-09-25 17:19:23 -04:00
|
|
|
Gtkmm2ext::UI::instance()->call_slot (mem_fun (*this, &StreamView::setup_rec_box));
|
2005-09-25 14:42:24 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
StreamView::update_rec_box ()
|
|
|
|
{
|
|
|
|
if (rec_active && rec_rects.size() > 0) {
|
2006-03-13 22:43:54 -05:00
|
|
|
/* only update the last box */
|
2005-09-25 14:42:24 -04:00
|
|
|
RecBoxInfo & rect = rec_rects.back();
|
|
|
|
jack_nframes_t at = _trackview.get_diskstream()->current_capture_end();
|
2006-03-13 22:43:54 -05:00
|
|
|
double xstart;
|
|
|
|
double xend;
|
|
|
|
|
2006-07-31 23:23:35 -04:00
|
|
|
switch (_trackview.track()->mode()) {
|
2006-03-13 22:43:54 -05:00
|
|
|
case Normal:
|
|
|
|
rect.length = at - rect.start;
|
|
|
|
xstart = _trackview.editor.frame_to_pixel (rect.start);
|
|
|
|
xend = _trackview.editor.frame_to_pixel (at);
|
|
|
|
break;
|
|
|
|
|
|
|
|
case Destructive:
|
|
|
|
rect.length = 2;
|
2006-03-17 15:24:26 -05:00
|
|
|
xstart = _trackview.editor.frame_to_pixel (_trackview.get_diskstream()->current_capture_start());
|
|
|
|
xend = _trackview.editor.frame_to_pixel (at);
|
2006-03-13 22:43:54 -05:00
|
|
|
break;
|
|
|
|
}
|
2005-09-25 14:42:24 -04:00
|
|
|
|
2005-11-27 17:35:04 -05:00
|
|
|
rect.rectangle->property_x1() = xstart;
|
|
|
|
rect.rectangle->property_x2() = xend;
|
2005-09-25 14:42:24 -04:00
|
|
|
}
|
|
|
|
}
|
2006-03-13 22:43:54 -05:00
|
|
|
|
2006-07-31 23:23:35 -04:00
|
|
|
RegionView*
|
|
|
|
StreamView::find_view (const Region& region)
|
2005-09-25 14:42:24 -04:00
|
|
|
{
|
2006-07-31 23:23:35 -04:00
|
|
|
for (list<RegionView*>::iterator i = region_views.begin(); i != region_views.end(); ++i) {
|
2005-09-25 14:42:24 -04:00
|
|
|
|
2006-07-31 23:23:35 -04:00
|
|
|
if (&(*i)->region() == ®ion) {
|
2005-09-25 14:42:24 -04:00
|
|
|
return *i;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
2006-07-31 23:23:35 -04:00
|
|
|
StreamView::foreach_regionview (sigc::slot<void,RegionView*> slot)
|
2005-09-25 14:42:24 -04:00
|
|
|
{
|
2006-07-31 23:23:35 -04:00
|
|
|
for (list<RegionView*>::iterator i = region_views.begin(); i != region_views.end(); ++i) {
|
2005-09-25 14:42:24 -04:00
|
|
|
slot (*i);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
2006-07-31 23:23:35 -04:00
|
|
|
StreamView::set_selected_regionviews (RegionSelection& regions)
|
2005-09-25 14:42:24 -04:00
|
|
|
{
|
2006-07-31 23:23:35 -04:00
|
|
|
bool selected;
|
2005-09-25 14:42:24 -04:00
|
|
|
|
2006-07-31 23:23:35 -04:00
|
|
|
// cerr << _trackview.name() << " (selected = " << regions.size() << ")" << endl;
|
|
|
|
for (list<RegionView*>::iterator i = region_views.begin(); i != region_views.end(); ++i) {
|
|
|
|
|
|
|
|
selected = false;
|
|
|
|
|
|
|
|
for (RegionSelection::iterator ii = regions.begin(); ii != regions.end(); ++ii) {
|
|
|
|
if (*i == *ii) {
|
|
|
|
selected = true;
|
2005-09-25 14:42:24 -04:00
|
|
|
}
|
|
|
|
}
|
2006-07-31 23:23:35 -04:00
|
|
|
|
|
|
|
// cerr << "\tregion " << (*i)->region().name() << " selected = " << selected << endl;
|
|
|
|
(*i)->set_selected (selected);
|
2005-09-25 14:42:24 -04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
2006-07-31 23:23:35 -04:00
|
|
|
StreamView::get_selectables (jack_nframes_t start, jack_nframes_t end, list<Selectable*>& results)
|
2005-09-25 14:42:24 -04:00
|
|
|
{
|
2006-07-31 23:23:35 -04:00
|
|
|
for (list<RegionView*>::iterator i = region_views.begin(); i != region_views.end(); ++i) {
|
|
|
|
if ((*i)->region().coverage(start, end) != OverlapNone) {
|
|
|
|
results.push_back (*i);
|
2005-09-25 14:42:24 -04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
2006-07-31 23:23:35 -04:00
|
|
|
StreamView::get_inverted_selectables (Selection& sel, list<Selectable*>& results)
|
2005-09-25 14:42:24 -04:00
|
|
|
{
|
2006-07-31 23:23:35 -04:00
|
|
|
for (list<RegionView*>::iterator i = region_views.begin(); i != region_views.end(); ++i) {
|
|
|
|
if (!sel.regions.contains (*i)) {
|
|
|
|
results.push_back (*i);
|
2005-09-25 14:42:24 -04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2006-02-14 12:19:58 -05:00
|
|
|
|