/[svn]/linuxsampler/trunk/src/engines/common/Event.h
ViewVC logotype

Diff of /linuxsampler/trunk/src/engines/common/Event.h

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

revision 293 by schoenebeck, Mon Oct 25 15:14:27 2004 UTC revision 328 by schoenebeck, Sat Dec 25 21:58:58 2004 UTC
# Line 24  Line 24 
24  #define __LS_EVENT_H__  #define __LS_EVENT_H__
25    
26  #include "../../common/global.h"  #include "../../common/global.h"
27    #include "../../common/RTMath.h"
28    
29  namespace LinuxSampler {  namespace LinuxSampler {
30    
# Line 40  namespace LinuxSampler { Line 41  namespace LinuxSampler {
41              void UpdateFragmentTime(uint SamplesToProcess);              void UpdateFragmentTime(uint SamplesToProcess);
42              Event CreateEvent();              Event CreateEvent();
43          protected:          protected:
44              typedef uint32_t time_stamp_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.              typedef RTMath::time_stamp_t time_stamp_t;
45              inline int32_t ToFragmentPos(time_stamp_t TimeStamp) {              inline int32_t ToFragmentPos(time_stamp_t TimeStamp) {
46                  return int32_t (int32_t(TimeStamp - FragmentTime.begin) * FragmentTime.sample_ratio);                  return int32_t (int32_t(TimeStamp - FragmentTime.begin) * FragmentTime.sample_ratio);
47              }              }
# Line 53  namespace LinuxSampler { Line 54  namespace LinuxSampler {
54                  time_stamp_t end;          ///< Real time stamp of the end of this audio fragment cycle.                  time_stamp_t end;          ///< Real time stamp of the end of this audio fragment cycle.
55                  float        sample_ratio; ///< (Samples per cycle) / (Real time duration of cycle)                  float        sample_ratio; ///< (Samples per cycle) / (Real time duration of cycle)
56              } FragmentTime;              } FragmentTime;
             time_stamp_t CreateTimeStamp();  
57      };      };
58    
59      /**      /**

Legend:
Removed from v.293  
changed lines
  Added in v.328

  ViewVC Help
Powered by ViewVC