X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=gtk2_ardour%2Fghostregion.cc;h=5f07f1388f26baa9fed8ef4e07f540350e4664d2;hb=fddb3778120e25b3b8e8134084e260dac07c1365;hp=4e06ece82fe7e1caa3a147aeefb331662bb96a52;hpb=6d319e2132270b89efc47820e707840eb49a2cfe;p=ardour.git diff --git a/gtk2_ardour/ghostregion.cc b/gtk2_ardour/ghostregion.cc index 4e06ece82f..5f07f1388f 100644 --- a/gtk2_ardour/ghostregion.cc +++ b/gtk2_ardour/ghostregion.cc @@ -1,5 +1,5 @@ /* - Copyright (C) 2000-2007 Paul Davis + Copyright (C) 2000-2007 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 @@ -17,21 +17,25 @@ */ -#include "simplerect.h" -#include "waveview.h" -#include "ghostregion.h" -#include "midi_time_axis.h" -#include "automation_time_axis.h" -#include "midi_streamview.h" -#include "rgb_macros.h" +#include "evoral/Note.hpp" #include "ardour_ui.h" +#include "automation_time_axis.h" #include "canvas-hit.h" #include "canvas-note.h" +#include "ghostregion.h" +#include "midi_streamview.h" +#include "midi_time_axis.h" +#include "rgb_macros.h" +#include "simplerect.h" +#include "waveview.h" +using namespace std; using namespace Editing; using namespace ArdourCanvas; using namespace ARDOUR; +PBD::Signal1 GhostRegion::CatchDeletion; + GhostRegion::GhostRegion (ArdourCanvas::Group* parent, TimeAxisView& tv, TimeAxisView& source_tv, double initial_pos) : trackview (tv) , source_trackview (source_tv) @@ -43,7 +47,7 @@ GhostRegion::GhostRegion (ArdourCanvas::Group* parent, TimeAxisView& tv, TimeAxi base_rect = new ArdourCanvas::SimpleRect (*group); base_rect->property_x1() = (double) 0.0; base_rect->property_y1() = (double) 0.0; - base_rect->property_y2() = (double) trackview.height; + base_rect->property_y2() = (double) trackview.current_height(); base_rect->property_outline_what() = (guint32) 0; if (!is_automation_ghost()) { @@ -59,9 +63,9 @@ GhostRegion::GhostRegion (ArdourCanvas::Group* parent, TimeAxisView& tv, TimeAxi GhostRegion::~GhostRegion () { - /*GoingAway (this); + CatchDeletion (this); delete base_rect; - delete group;*/ + delete group; } void @@ -73,7 +77,7 @@ GhostRegion::set_duration (double units) void GhostRegion::set_height () { - base_rect->property_y2() = (double) trackview.height; + base_rect->property_y2() = (double) trackview.current_height(); } void @@ -101,7 +105,7 @@ GhostRegion::is_automation_ghost() { } AudioGhostRegion::AudioGhostRegion(TimeAxisView& tv, TimeAxisView& source_tv, double initial_unit_pos) - : GhostRegion(tv.ghost_group, tv, source_tv, initial_unit_pos) { + : GhostRegion(tv.ghost_group(), tv, source_tv, initial_unit_pos) { } void @@ -109,7 +113,7 @@ AudioGhostRegion::set_samples_per_unit (double spu) { for (vector::iterator i = waves.begin(); i != waves.end(); ++i) { (*i)->property_samples_per_unit() = spu; - } + } } void @@ -121,8 +125,8 @@ AudioGhostRegion::set_height () GhostRegion::set_height(); - ht = ((trackview.height) / (double) waves.size()); - + ht = ((trackview.current_height()) / (double) waves.size()); + for (n = 0, i = waves.begin(); i != waves.end(); ++i, ++n) { gdouble yoff = n * ht; (*i)->property_height() = ht; @@ -157,7 +161,7 @@ AudioGhostRegion::set_colors () * no range controller in these tracks. maybe show the whole range. */ MidiGhostRegion::MidiGhostRegion(TimeAxisView& tv, TimeAxisView& source_tv, double initial_unit_pos) - : GhostRegion(tv.ghost_group, tv, source_tv, initial_unit_pos) + : GhostRegion(tv.ghost_group(), tv, source_tv, initial_unit_pos) { base_rect->lower_to_bottom(); @@ -166,7 +170,7 @@ MidiGhostRegion::MidiGhostRegion(TimeAxisView& tv, TimeAxisView& source_tv, doub MidiGhostRegion::MidiGhostRegion(MidiStreamView& msv, TimeAxisView& source_tv, double initial_unit_pos) : GhostRegion(msv.midi_underlay_group, msv.trackview(), source_tv, initial_unit_pos) { - base_rect->lower_to_bottom(); + base_rect->lower_to_bottom(); } MidiGhostRegion::~MidiGhostRegion() @@ -213,7 +217,7 @@ MidiGhostRegion::Hit::x_changed() } void -MidiGhostRegion::set_samples_per_unit (double spu) +MidiGhostRegion::set_samples_per_unit (double /*spu*/) { } @@ -265,7 +269,7 @@ MidiGhostRegion::update_range() MidiGhostRegion::Note* note; uint8_t note_num; double y; - + for (EventList::iterator it = events.begin(); it != events.end(); ++it) { if ((note = dynamic_cast(*it)) != 0) { note_num = note->event->note()->note(); @@ -308,7 +312,7 @@ MidiGhostRegion::add_note(ArdourCanvas::CanvasNote* n) } void -MidiGhostRegion::add_hit(ArdourCanvas::CanvasHit* h) +MidiGhostRegion::add_hit(ArdourCanvas::CanvasHit* /*h*/) { //events.push_back(new Hit(h, group)); }