File: WvIn.h

package info (click to toggle)
stk 4.6.2%2Bdfsg-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 5,756 kB
  • sloc: cpp: 32,341; ansic: 3,216; sh: 2,900; tcl: 2,444; perl: 114; objc: 60; makefile: 44
file content (46 lines) | stat: -rw-r--r-- 1,210 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
#ifndef STK_WVIN_H
#define STK_WVIN_H

#include "Stk.h"

namespace stk {

/***************************************************/
/*! \class WvIn
    \brief STK audio input abstract base class.

    This class provides common functionality for a variety of audio
    data input subclasses.

    by Perry R. Cook and Gary P. Scavone, 1995--2021.
*/
/***************************************************/

class WvIn : public Stk
{
public:
  //! Return the number of audio channels in the data or stream.
  unsigned int channelsOut( void ) const { return data_.channels(); };

  //! Return an StkFrames reference to the last computed sample frame.
  /*!
    If no file data is loaded, an empty container is returned.
   */
  const StkFrames& lastFrame( void ) const { return lastFrame_; };

  //! Compute one sample frame and return the specified \c channel value.
  virtual StkFloat tick( unsigned int channel = 0 ) = 0;

  //! Fill the StkFrames object with computed sample frames, starting at the specified channel and return the same reference.
  virtual StkFrames& tick( StkFrames& frames, unsigned int channel = 0 ) = 0;

protected:

  StkFrames data_;
  StkFrames lastFrame_;

};

} // stk namespace

#endif