- PanControllable _control;
-
- void add_state (XMLNode&);
- virtual void update () = 0;
-};
-
-class BaseStereoPanner : public StreamPanner
-{
- public:
- BaseStereoPanner (Panner&);
- ~BaseStereoPanner ();
-
- /* this class just leaves the pan law itself to be defined
- by the update(), distribute_automated()
- methods. derived classes also need a factory method
- and a type name. See EqualPowerStereoPanner as an example.
- */
-
- void distribute (Sample* src, Sample** obufs, gain_t gain_coeff, nframes_t nframes);
-
- int load (istream&, string path, uint32_t&);
- int save (ostream&) const;
- void snapshot (nframes_t now);
- void transport_stopped (nframes_t frame);
- void set_automation_state (AutoState);
- void set_automation_style (AutoStyle);
-
- Curve& automation() { return _automation; }
-
- protected:
- float left;
- float right;
- float desired_left;
- float desired_right;
- float left_interp;
- float right_interp;
-
- Curve _automation;
-};
-
-class EqualPowerStereoPanner : public BaseStereoPanner
-{
- public:
- EqualPowerStereoPanner (Panner&);
- ~EqualPowerStereoPanner ();
-
- void distribute_automated (Sample* src, Sample** obufs,
- nframes_t start, nframes_t end, nframes_t nframes, pan_t** buffers);
-
- void get_current_coefficients (pan_t*) const;
- void get_desired_coefficients (pan_t*) const;
-
- static StreamPanner* factory (Panner&);
- static string name;
-
- XMLNode& state (bool full_state);
- XMLNode& get_state (void);
- int set_state (const XMLNode&);
-
- private:
- void update ();
-};
-
-class Multi2dPanner : public StreamPanner
-{
- public:
- Multi2dPanner (Panner& parent);
- ~Multi2dPanner ();
-
- void snapshot (nframes_t now);
- void transport_stopped (nframes_t frame);
- void set_automation_state (AutoState);
- void set_automation_style (AutoStyle);
-
- /* XXX this is wrong. for multi-dimensional panners, there
- must surely be more than 1 automation curve.
- */
-
- Curve& automation() { return _automation; }
-
- void distribute (Sample* src, Sample** obufs, gain_t gain_coeff, nframes_t nframes);
- void distribute_automated (Sample* src, Sample** obufs,
- nframes_t start, nframes_t end, nframes_t nframes, pan_t** buffers);
-
- int load (istream&, string path, uint32_t&);
- int save (ostream&) const;
-
- static StreamPanner* factory (Panner&);
- static string name;