/[svn]/linuxsampler/trunk/src/engines/gig/EGDecay.cpp
ViewVC logotype

Annotation of /linuxsampler/trunk/src/engines/gig/EGDecay.cpp

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1424 - (hide annotations) (download)
Sun Oct 14 22:00:17 2007 UTC (16 years, 8 months ago) by schoenebeck
File size: 2233 byte(s)
* code cleanup:
- global.h now only covers global definitions that are needed for the C++
  API header files, all implementation internal global definitions are now
  in global_private.h
- atomic.h is not exposed to the C++ API anymore (replaced the references
  in SynchronizedConfig.h for this with local definitions)
- no need to include config.h anymore for using LS's API header files
- DB instruments classes are not exposed to the C++ API
- POSIX callback functions of Thread.h are hidden
- the (optional) gig Engine benchmark compiles again
- updated Doxyfile.in
- fixed warnings in API doc generation
* preparations for release 0.5.0

1 schoenebeck 53 /***************************************************************************
2     * *
3     * LinuxSampler - modular, streaming capable sampler *
4     * *
5 schoenebeck 56 * Copyright (C) 2003, 2004 by Benno Senoner and Christian Schoenebeck *
6 schoenebeck 1149 * Copyright (C) 2005, 2007 Christian Schoenebeck *
7 schoenebeck 53 * *
8 schoenebeck 738 * This library is free software; you can redistribute it and/or modify *
9 schoenebeck 53 * it under the terms of the GNU General Public License as published by *
10     * the Free Software Foundation; either version 2 of the License, or *
11     * (at your option) any later version. *
12     * *
13 schoenebeck 738 * This library is distributed in the hope that it will be useful, *
14 schoenebeck 53 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
15     * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
16     * GNU General Public License for more details. *
17     * *
18     * You should have received a copy of the GNU General Public License *
19 schoenebeck 738 * along with this library; if not, write to the Free Software *
20 schoenebeck 53 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, *
21     * MA 02111-1307 USA *
22     ***************************************************************************/
23    
24     #include "EGDecay.h"
25    
26 schoenebeck 1424 #include "../../common/global_private.h"
27    
28 schoenebeck 53 namespace LinuxSampler { namespace gig {
29    
30 schoenebeck 738 EGDecay::EGDecay() {
31 schoenebeck 53 }
32    
33 schoenebeck 738 void EGDecay::trigger(float Depth, float DecayTime, unsigned int SampleRate) {
34     this->Level = Depth;
35 schoenebeck 53
36     // calculate decay parameters (lin. curve)
37 schoenebeck 738 StepsLeft = (int) (DecayTime * SampleRate);
38 schoenebeck 1149 Coeff = (StepsLeft) ? (1.0f - Depth) / (float) StepsLeft : 0.0f;
39 schoenebeck 53
40     dmsg(4,("Depth=%d, DecayTime=%f\n", Depth, DecayTime));
41     }
42    
43     }} // namespace LinuxSampler::gig

  ViewVC Help
Powered by ViewVC