Re: [LAD] memory leak assistance

From: James Warden <warjamy@email-addr-hidden>
Date: Wed Dec 30 2009 - 19:11:42 EET

Hello Patrick et al,

I ported the ardour "fast meters" from C++ to C. Look into guitarix's code (GtkFastMeter class). It is a direct translation from gtkmm2ext. I picked it up because it is very CPU friendly, the algorithm focusing only on the "deltas" from one event to the next. Hermann took care of the layout and that's what he was talking about when he mentioned something about the box_expose function.

Paul, I mentioned your name and ardour in the guitarix header file. I hope this is fine.

J.

--- On Wed, 12/30/09, Patrick Shirkey <pshirkey@email-addr-hidden> wrote:

> From: Patrick Shirkey <pshirkey@email-addr-hidden>
> Subject: Re: [LAD] memory leak assistance
> To: "Linux Audio Developers" <linux-audio-dev@email-addr-hidden>
> Date: Wednesday, December 30, 2009, 8:39 AM
>
> On 12/30/2009 11:57 PM, Paul Davis wrote:
> > On Wed, Dec 30, 2009 at 7:47 AM, hermann<brummer-@web.de> 
> wrote:
> >
> >   
> >> We use also level meters in guitarix and jcgui,
> what we do to create the
> >> notch scale is, move it to a background box, a
> simple hbox, witch we
> >> connect with a expose call. This way the values
> and scale only redraw
> >> when needed. This is the call we use:
> >>     
> > ardour's Gtkmm2ext::FastMeter optimizes even more. we
> compute the
> > difference between the last drawn instance of the
> meter and the new
> > appearance and only draw that the delta. this means
> that we often get
> > away with drawing just a single row of pixels.
> >
> > http://subversion.ardour.org/svn/ardour2/branches/2.0-ongoing/libs/gtkmm2ext/fastmeter.cc
> >
> > see the vertical_expose() and horizontal_expose()
> methods. Note that
> > we are also using precomputed pixbufs and just
> blitting them.
> >   
>
> Thanks for the advice. It's a very cool approach to use
> except I'm
> working with C. I'm not sure I'm up for porting from c++ to
> c right now.
>
> I am taking a slightly different approach to the visual
> aspect as I have
> added a glassy bubble overlay and the notches sit on top of
> the overlay.
> The meters are redrawing under the overlay to give the
> effect of being
> inside a glassy tube.
>
> So basically I have to redraw the whole thing each time
> unless I change
> the code to use the above method.
>
> The meters by themselves don't add any noticeable load.
>
> Do you think this memory leak can be fixed without having
> to completely
> redo the class to use precomputed bixbufs while porting
> from c++ to c?
>
>
>
>
>
> Patrick Shirkey
> Boost Hardware Ltd
>
>
>
>
> _______________________________________________
> Linux-audio-dev mailing list
> Linux-audio-dev@email-addr-hidden
> http://lists.linuxaudio.org/listinfo/linux-audio-dev
>

      
_______________________________________________
Linux-audio-dev mailing list
Linux-audio-dev@email-addr-hidden
http://lists.linuxaudio.org/listinfo/linux-audio-dev
Received on Wed Dec 30 20:15:04 2009

This archive was generated by hypermail 2.1.8 : Wed Dec 30 2009 - 20:15:06 EET