/[svn]/linuxsampler/tags/singlechannel/src/modulationsystem.h
ViewVC logotype

Diff of /linuxsampler/tags/singlechannel/src/modulationsystem.h

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 32 by schoenebeck, Tue Feb 3 13:21:19 2004 UTC revision 37 by schoenebeck, Wed Mar 10 22:01:36 2004 UTC
# Line 35  class ModulationSystem { Line 35  class ModulationSystem {
35          enum destination_t {          enum destination_t {
36              destination_vca,   ///< Volume level              destination_vca,   ///< Volume level
37              destination_vco,   ///< Pitch depth              destination_vco,   ///< Pitch depth
38              destination_count  ///< Total number of modulation sources (this has to stay the last element in the enum)              destination_count  ///< Total number of modulation destinations (this has to stay the last element in the enum)
39          };          };
40          typedef uint32_t real_time_t; ///< We read the processor's cycle count register as an reference for the real time. These are of course only abstract values with arbitrary time entity, but that's not a problem as we calculate relatively.          typedef uint32_t real_time_t; ///< We read the processor's cycle count register as a reference for the real time. These are of course only abstract values with arbitrary time entity, but that's not a problem as we calculate relatively.
41          enum event_type_t {          enum event_type_t {
42              event_type_note_on,              event_type_note_on,
43              event_type_note_off,              event_type_note_off,
44              event_type_pitchbend,              event_type_pitchbend,
45              event_type_control_change              event_type_control_change,
46                event_type_cancel_release,  ///< transformed either from a note-on or sustain-pedal-down event
47                event_type_release          ///< transformed either from a note-off or sustain-pedal-up event
48          };          };
49          class Event {          class Event {
50              public:              public:
# Line 60  class ModulationSystem { Line 62  class ModulationSystem {
62                  Event() {                  Event() {
63                      TimeStamp = ModulationSystem::CreateTimeStamp();                      TimeStamp = ModulationSystem::CreateTimeStamp();
64                      iFragmentPos = -1;                      iFragmentPos = -1;
65                  };                  }
66                  uint FragmentPos() {                  inline uint FragmentPos() {
67                      if (iFragmentPos >= 0) return (uint) iFragmentPos;                      if (iFragmentPos >= 0) return (uint) iFragmentPos;
68                      return (uint) (iFragmentPos = ModulationSystem::ToFragmentPos(TimeStamp));                      return (uint) (iFragmentPos = ModulationSystem::ToFragmentPos(TimeStamp));
69                  };                  }
70              private:              private:
71                  real_time_t TimeStamp;    ///< Time stamp of the event's occurence.                  real_time_t TimeStamp;    ///< Time stamp of the event's occurence.
72                  int         iFragmentPos; ///< Position in the current fragment this event refers to.                  int         iFragmentPos; ///< Position in the current fragment this event refers to.
# Line 77  class ModulationSystem { Line 79  class ModulationSystem {
79          static        void  ResetDestinationParameter(ModulationSystem::destination_t dst, float val);          static        void  ResetDestinationParameter(ModulationSystem::destination_t dst, float val);
80          static        void  UpdateFragmentTime();          static        void  UpdateFragmentTime();
81          static real_time_t  CreateTimeStamp();          static real_time_t  CreateTimeStamp();
82          static inline uint  MaxSamplesPerCycle()                  { return uiMaxSamplesPerCycle; };          static inline uint  MaxSamplesPerCycle()                  { return uiMaxSamplesPerCycle; }
83          static inline uint  SampleRate()                          { return uiSampleRate;         };          static inline uint  SampleRate()                          { return uiSampleRate;         }
84          static inline uint  ToFragmentPos(real_time_t time_stamp) {          static inline uint  ToFragmentPos(real_time_t time_stamp) {
85              return uint ((time_stamp - FragmentTime.begin) * FragmentTime.sample_ratio);              return uint ((time_stamp - FragmentTime.begin) * FragmentTime.sample_ratio);
86          };          }
87      protected:      protected:
88          static uint uiMaxSamplesPerCycle;          static uint uiMaxSamplesPerCycle;
89          static uint uiSampleRate;          static uint uiSampleRate;

Legend:
Removed from v.32  
changed lines
  Added in v.37

  ViewVC Help
Powered by ViewVC