assert(rtv);
double unit_position = _region->position () / samples_per_pixel;
- AudioGhostRegion* ghost = new AudioGhostRegion (tv, trackview, unit_position);
+ AudioGhostRegion* ghost = new AudioGhostRegion (*this, tv, trackview, unit_position);
uint32_t nchans;
nchans = rtv->track()->n_channels().n_audio();
#include "ghostregion.h"
#include "midi_streamview.h"
#include "midi_time_axis.h"
+#include "region_view.h"
#include "rgb_macros.h"
#include "note.h"
#include "hit.h"
using namespace ArdourCanvas;
using namespace ARDOUR;
-PBD::Signal1<void,GhostRegion*> GhostRegion::CatchDeletion;
-
-GhostRegion::GhostRegion (ArdourCanvas::Container* parent, TimeAxisView& tv, TimeAxisView& source_tv, double initial_pos)
- : trackview (tv)
- , source_trackview (source_tv)
+GhostRegion::GhostRegion(RegionView& rv,
+ ArdourCanvas::Container* parent,
+ TimeAxisView& tv,
+ TimeAxisView& source_tv,
+ double initial_pos)
+ : parent_rv(rv)
+ , trackview(tv)
+ , source_trackview(source_tv)
{
group = new ArdourCanvas::Container (parent);
CANVAS_DEBUG_NAME (group, "ghost region");
GhostRegion::~GhostRegion ()
{
- CatchDeletion (this);
+ parent_rv.remove_ghost(this);
+ trackview.erase_ghost(this);
delete base_rect;
delete group;
}
return (dynamic_cast<AutomationTimeAxisView*>(&trackview)) != 0;
}
-AudioGhostRegion::AudioGhostRegion(TimeAxisView& tv, TimeAxisView& source_tv, double initial_unit_pos)
- : GhostRegion(tv.ghost_group(), tv, source_tv, initial_unit_pos)
+AudioGhostRegion::AudioGhostRegion(RegionView& rv,
+ TimeAxisView& tv,
+ TimeAxisView& source_tv,
+ double initial_unit_pos)
+ : GhostRegion(rv, tv.ghost_group(), tv, source_tv, initial_unit_pos)
{
}
/** The general constructor; called when the destination timeaxisview doesn't have
* a midistreamview.
*
+ * @param rv The parent RegionView that is being ghosted.
* @param tv TimeAxisView that this ghost region is on.
* @param source_tv TimeAxisView that we are the ghost for.
*/
-MidiGhostRegion::MidiGhostRegion(TimeAxisView& tv, TimeAxisView& source_tv, double initial_unit_pos)
- : GhostRegion(tv.ghost_group(), tv, source_tv, initial_unit_pos)
- , _optimization_iterator (events.end ())
+MidiGhostRegion::MidiGhostRegion(RegionView& rv,
+ TimeAxisView& tv,
+ TimeAxisView& source_tv,
+ double initial_unit_pos)
+ : GhostRegion(rv, tv.ghost_group(), tv, source_tv, initial_unit_pos)
+ , _optimization_iterator(events.end())
{
base_rect->lower_to_bottom();
update_range ();
}
/**
+ * @param rv The parent RegionView being ghosted.
* @param msv MidiStreamView that this ghost region is on.
* @param source_tv TimeAxisView that we are the ghost for.
*/
-MidiGhostRegion::MidiGhostRegion(MidiStreamView& msv, TimeAxisView& source_tv, double initial_unit_pos)
- : GhostRegion(msv.midi_underlay_group, msv.trackview(), source_tv, initial_unit_pos)
- , _optimization_iterator (events.end ())
+MidiGhostRegion::MidiGhostRegion(RegionView& rv,
+ MidiStreamView& msv,
+ TimeAxisView& source_tv,
+ double initial_unit_pos)
+ : GhostRegion(rv,
+ msv.midi_underlay_group,
+ msv.trackview(),
+ source_tv,
+ initial_unit_pos)
+ , _optimization_iterator(events.end())
{
base_rect->lower_to_bottom();
update_range ();
class Hit;
class MidiStreamView;
class TimeAxisView;
+class RegionView;
class GhostRegion : public sigc::trackable
{
public:
- GhostRegion(ArdourCanvas::Container* parent, TimeAxisView& tv, TimeAxisView& source_tv, double initial_unit_pos);
+ GhostRegion(RegionView& rv,
+ ArdourCanvas::Container* parent,
+ TimeAxisView& tv,
+ TimeAxisView& source_tv,
+ double initial_unit_pos);
+
virtual ~GhostRegion();
virtual void set_samples_per_pixel (double) = 0;
guint source_track_color(unsigned char alpha = 0xff);
bool is_automation_ghost();
+ RegionView& parent_rv;
/** TimeAxisView that is the AutomationTimeAxisView that we are on */
TimeAxisView& trackview;
/** TimeAxisView that we are a ghost for */
TimeAxisView& source_trackview;
ArdourCanvas::Container* group;
ArdourCanvas::Rectangle* base_rect;
-
- static PBD::Signal1<void,GhostRegion*> CatchDeletion;
};
class AudioGhostRegion : public GhostRegion {
public:
- AudioGhostRegion(TimeAxisView& tv, TimeAxisView& source_tv, double initial_unit_pos);
+ AudioGhostRegion(RegionView& rv,
+ TimeAxisView& tv,
+ TimeAxisView& source_tv,
+ double initial_unit_pos);
void set_samples_per_pixel (double);
void set_height();
ArdourCanvas::Item* item;
};
- MidiGhostRegion(TimeAxisView& tv, TimeAxisView& source_tv, double initial_unit_pos);
- MidiGhostRegion(MidiStreamView& msv, TimeAxisView& source_tv, double initial_unit_pos);
+ MidiGhostRegion(RegionView& rv,
+ TimeAxisView& tv,
+ TimeAxisView& source_tv,
+ double initial_unit_pos);
+
+ MidiGhostRegion(RegionView& rv,
+ MidiStreamView& msv,
+ TimeAxisView& source_tv,
+ double initial_unit_pos);
+
~MidiGhostRegion();
MidiStreamView* midi_view();
/* if ghost is inserted into midi track, use a dedicated midi ghost canvas group
to allow having midi notes on top of note lines and waveforms.
*/
- ghost = new MidiGhostRegion (*mtv->midi_view(), trackview, unit_position);
+ ghost = new MidiGhostRegion (*this, *mtv->midi_view(), trackview, unit_position);
} else {
- ghost = new MidiGhostRegion (tv, trackview, unit_position);
+ ghost = new MidiGhostRegion (*this, tv, trackview, unit_position);
}
for (Events::iterator i = _events.begin(); i != _events.end(); ++i) {
ghost->set_duration (_region->length() / samples_per_pixel);
ghosts.push_back (ghost);
- GhostRegion::CatchDeletion.connect (*this, invalidator (*this), boost::bind (&RegionView::remove_ghost, this, _1), gui_context());
-
return ghost;
}
, wait_for_data(false)
, _silence_text (0)
{
- GhostRegion::CatchDeletion.connect (*this, invalidator (*this), boost::bind (&RegionView::remove_ghost, this, _1), gui_context());
}
RegionView::RegionView (const RegionView& other)
current_visible_sync_position = other.current_visible_sync_position;
valid = false;
_pixel_width = other._pixel_width;
-
- GhostRegion::CatchDeletion.connect (*this, invalidator (*this), boost::bind (&RegionView::remove_ghost, this, _1), gui_context());
}
RegionView::RegionView (const RegionView& other, boost::shared_ptr<Region> other_region)
current_visible_sync_position = other.current_visible_sync_position;
valid = false;
_pixel_width = other._pixel_width;
-
- GhostRegion::CatchDeletion.connect (*this, invalidator (*this), boost::bind (&RegionView::remove_ghost, this, _1), gui_context());
}
RegionView::RegionView (ArdourCanvas::Container* parent,
top_hbox.pack_start (scroomer_placeholder, false, false); // OR pack_end to move after meters ?
UIConfiguration::instance().ColorsChanged.connect (sigc::mem_fun (*this, &TimeAxisView::color_handler));
-
- GhostRegion::CatchDeletion.connect (*this, invalidator (*this), boost::bind (&TimeAxisView::erase_ghost, this, _1), gui_context());
}
TimeAxisView::~TimeAxisView()