reduce calls to fit_to_pixels(); flip back to old fix for rec regions botch; executable stack fix; avoid delete this in MementoCommand lifetime management

git-svn-id: svn://localhost/ardour2/trunk@988 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
Paul Davis 2006-10-17 20:40:39 +00:00
parent fe7c3976c9
commit 0ef71e47de
13 changed files with 47 additions and 31 deletions

View File

@ -1,3 +1,4 @@
#!/bin/sh
. ardev_common.sh
export ARDOUR_RUNNING_UNDER_VALGRIND=TRUE
exec valgrind --num-callers=50 --tool=memcheck gtk2_ardour/ardour.bin --novst $*

View File

@ -161,8 +161,6 @@ AudioRegionView::init (Gdk::Color& basic_color, bool wfd)
gain_line->show ();
}
reset_width_dependent_items ((double) _region->length() / samples_per_unit);
gain_line->reset ();
set_height (trackview.height);

View File

@ -126,7 +126,7 @@ AudioStreamView::set_amplitude_above_axis (gdouble app)
}
void
AudioStreamView::add_region_view_internal (boost::shared_ptr<Region> r, bool wait_for_waves, bool watch_death)
AudioStreamView::add_region_view_internal (boost::shared_ptr<Region> r, bool wait_for_waves)
{
AudioRegionView *region_view;
@ -167,10 +167,8 @@ AudioStreamView::add_region_view_internal (boost::shared_ptr<Region> r, bool wai
region_view->set_waveform_visible(_trackview.editor.show_waveforms());
if (watch_death) {
/* catch regionview going away */
region->GoingAway.connect (bind (mem_fun (*this, &AudioStreamView::remove_region_view), boost::weak_ptr<Region> (r)));
}
/* catch regionview going away */
region->GoingAway.connect (bind (mem_fun (*this, &AudioStreamView::remove_region_view), boost::weak_ptr<Region> (r)));
RegionViewAdded (region_view);
}
@ -510,8 +508,15 @@ AudioStreamView::setup_rec_box ()
/* remove temp regions */
for (list<boost::shared_ptr<Region> >::iterator iter = rec_regions.begin(); iter != rec_regions.end(); ++iter) {
for (list<boost::shared_ptr<Region> >::iterator iter = rec_regions.begin(); iter != rec_regions.end(); ) {
list<boost::shared_ptr<Region> >::iterator tmp;
tmp = iter;
++tmp;
(*iter)->drop_references ();
iter = tmp;
}
rec_regions.clear();
@ -605,7 +610,7 @@ AudioStreamView::update_rec_regions ()
if (origlen == 1) {
/* our special initial length */
add_region_view_internal (region, false, false);
add_region_view_internal (region, false);
}
/* also update rect */
@ -630,7 +635,7 @@ AudioStreamView::update_rec_regions ()
if (origlen == 1) {
/* our special initial length */
add_region_view_internal (region, false, false);
add_region_view_internal (region, false);
}
/* also hide rect */

View File

@ -81,7 +81,7 @@ class AudioStreamView : public StreamView
void rec_peak_range_ready (nframes_t start, nframes_t cnt, boost::weak_ptr<ARDOUR::Source> src);
void update_rec_regions ();
void add_region_view_internal (boost::shared_ptr<ARDOUR::Region>, bool wait_for_waves, bool watch_death);
void add_region_view_internal (boost::shared_ptr<ARDOUR::Region>, bool wait_for_waves);
void remove_region_view (boost::weak_ptr<ARDOUR::Region> );
void remove_audio_region_view (boost::shared_ptr<ARDOUR::AudioRegion> );

View File

@ -133,11 +133,6 @@ RegionView::init (Gdk::Color& basic_color, bool wfd)
set_height (trackview.height);
region_muted ();
region_sync_changed ();
region_resized (BoundsChanged);
region_locked ();
_region->StateChanged.connect (mem_fun(*this, &RegionView::region_changed));
group->signal_event().connect (bind (mem_fun (PublicEditor::instance(), &PublicEditor::canvas_region_view_event), group, this));
@ -236,8 +231,6 @@ RegionView::region_resized (Change what_changed)
unit_length = _region->length() / samples_per_unit;
reset_width_dependent_items (unit_length);
for (vector<GhostRegion*>::iterator i = ghosts.begin(); i != ghosts.end(); ++i) {
(*i)->set_duration (unit_length);

View File

@ -160,7 +160,7 @@ StreamView::set_samples_per_unit (gdouble spp)
void
StreamView::add_region_view (boost::shared_ptr<Region> r)
{
add_region_view_internal (r, true, true);
add_region_view_internal (r, true);
}
void

View File

@ -107,7 +107,7 @@ protected:
void update_rec_box ();
virtual void update_rec_regions () = 0;
virtual void add_region_view_internal (boost::shared_ptr<ARDOUR::Region>, bool wait_for_waves, bool watch_death) = 0;
virtual void add_region_view_internal (boost::shared_ptr<ARDOUR::Region>, bool wait_for_waves) = 0;
virtual void remove_region_view (boost::weak_ptr<ARDOUR::Region> );
//void remove_rec_region (boost::shared_ptr<ARDOUR::Region>); (unused)

View File

@ -310,9 +310,7 @@ TimeAxisViewItem::set_duration (nframes_t dur, void* src)
item_duration = dur;
double pixel_width = trackview.editor.frame_to_pixel (dur);
reset_width_dependent_items (pixel_width);
reset_width_dependent_items (trackview.editor.frame_to_pixel (dur));
DurationChanged (dur, src) ; /* EMIT_SIGNAL */
return true;
@ -851,7 +849,7 @@ TimeAxisViewItem::reset_width_dependent_items (double pixel_width)
}
} else {
name_highlight->show();
if (name_text) {
if (name_text && !get_item_name().empty()) {
name_text->show();
reset_name_width (pixel_width);
}

View File

@ -1291,6 +1291,13 @@ Session::XMLRegionFactory (const XMLNode& node, bool full)
nchans = atoi (prop->value().c_str());
}
if ((prop = node.property ("name")) == 0) {
cerr << "no name for this region\n";
abort ();
}
cerr << "name of this region = " << prop->value() << endl;
if ((prop = node.property (X_("source-0"))) == 0) {
if ((prop = node.property ("source")) == 0) {

View File

@ -26,6 +26,7 @@
#include <ardour/timestamps.h>
#include <pbd/error.h>
#include <pbd/stacktrace.h>
#include <ardour/ardour.h>
#include <ardour/configuration.h>

View File

@ -524,6 +524,8 @@ x86_sse_compute_peak:
.size x86_sse_compute_peak, .-x86_sse_compute_peak
#; end proc
#ifdef __ELF__
.section .note.GNU-stack,"",%progbits
#endif

View File

@ -253,7 +253,11 @@ static bool idle_quit ()
void
UI::do_quit ()
{
Glib::signal_idle().connect (sigc::ptr_fun (idle_quit));
if (getenv ("ARDOUR_RUNNING_UNDER_VALGRIND")) {
Main::quit ();
} else {
Glib::signal_idle().connect (sigc::ptr_fun (idle_quit));
}
}
void

View File

@ -30,10 +30,20 @@ using std::endl;
#include <sigc++/slot.h>
#include <typeinfo>
/* grrr, strict C++ says that static member functions are not C functions, but we also want
to be able to pack this into a sigc::ptr_fun and not sigc::mem_fun, so we have to make
it a genuine function rather than a member.
*/
static void object_death (Command* mc) {
delete mc;
}
/** This command class is initialized with before and after mementos
* (from Stateful::get_state()), so undo becomes restoring the before
* memento, and redo is restoring the after memento.
*/
template <class obj_T>
class MementoCommand : public Command
{
@ -43,8 +53,9 @@ class MementoCommand : public Command
XMLNode *after
)
: obj(object), before(before), after(after) {
obj.GoingAway.connect (sigc::mem_fun (*this, &MementoCommand<obj_T>::object_death));
obj.GoingAway.connect (sigc::bind (sigc::ptr_fun (object_death), static_cast<Command*>(this)));
}
~MementoCommand () {
GoingAway();
if (before) {
@ -91,10 +102,6 @@ class MementoCommand : public Command
protected:
obj_T &obj;
XMLNode *before, *after;
void object_death () {
delete this;
}
};
#endif // __lib_pbd_memento_h__