~ubuntu-branches/ubuntu/raring/lmms/raring-proposed

« back to all changes in this revision

Viewing changes to plugins/ladspa_effect/caps/dsp/RMS.h

  • Committer: Charlie Smotherman
  • Date: 2012-12-05 22:08:38 UTC
  • mfrom: (33.1.7 lmms_0.4.13)
  • Revision ID: cjsmo@cableone.net-20121205220838-09pjfzew9m5023hr
* New  Upstream release.
  - Minor tweaking to ZynAddSubFX, CALF, SWH plugins  and Stefan Fendt's RC
    filters.
  - Added UI fixes: Magnentic effect of knobs and Piano-roll fixes
  - Updated German localization and copyright year
* debian/lmms-common.install:
  - added /usr/share/applications so the lmms.desktop file will correctly
    install (LP: #863366)
  - This should also fix the Software Center not displaying lmms in sound
    and video (LP: #824231)

Show diffs side-by-side

added added

removed removed

Lines of Context:
33
33
class RMS
34
34
{
35
35
        protected:
36
 
                d_sample buffer[64];
 
36
                sample_t buffer[64];
37
37
                int write;
38
38
 
39
39
        public:
52
52
                        }
53
53
 
54
54
                /* caution: pass in the *squared* sample value */
55
 
                void store (d_sample x)
 
55
                void store (sample_t x)
56
56
                        {
57
57
                                sum -= buffer[write];
58
58
                                sum += (buffer[write] = x);
59
59
                                write = (write + 1) & 63;
60
60
                        }
61
61
 
62
 
                d_sample process (d_sample x)
 
62
                sample_t process (sample_t x)
63
63
                        {
64
64
                                store (x);
65
65
                                return rms();
66
66
                        }
67
67
 
68
 
                d_sample rms()
 
68
                sample_t rms()
69
69
                        {
70
70
                                /* fabs it before sqrt, just in case ... */
71
71
                                return sqrt (fabs (sum) / 64);