Skip to content

Commit

Permalink
SamplePlayer: add phase getter
Browse files Browse the repository at this point in the history
  • Loading branch information
LancePutnam committed Jun 18, 2019
1 parent c502e3b commit 8628305
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions Gamma/SamplePlayer.h
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,7 @@ class SamplePlayer: public DomainObserver, public Array<T>{
double length() const; ///< Get total length (in seconds) of frame data
double pos() const { return mPos; } ///< Get playback position, in frames
double posInInterval(double frac) const;///< Get position from fraction within interval
double phase() const; ///< Get playback position, in [0, 1)
double rate() const { return mRate; } ///< Get playback rate


Expand Down Expand Up @@ -334,6 +335,8 @@ PRE inline double CLS::posInInterval(double frac) const {
return min() + (max() - min()) * frac;
}

PRE inline double CLS::phase() const { return mPos/frames(); }

#undef PRE
#undef CLS

Expand Down

0 comments on commit 8628305

Please sign in to comment.