X-Git-Url: https://git.carlh.net/gitweb/?a=blobdiff_plain;f=libs%2Fardour%2Fardour%2Faudio_port.h;h=f87b134e9e4644019a319803be75c7bf56072411;hb=848e75aaeaa04a81883ed30bcd04abd862f9d1fd;hp=ce544aa7bc4d9d40e41b21f14e59006de8524a0a;hpb=f53f2e8e3306a56c99cc1c034f8aecee4325ec88;p=ardour.git diff --git a/libs/ardour/ardour/audio_port.h b/libs/ardour/ardour/audio_port.h index ce544aa7bc..f87b134e9e 100644 --- a/libs/ardour/ardour/audio_port.h +++ b/libs/ardour/ardour/audio_port.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002 Paul Davis + Copyright (C) 2002-2009 Paul Davis This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -21,71 +21,42 @@ #ifndef __ardour_audio_port_h__ #define __ardour_audio_port_h__ -#include -#include -#include -#include -#include +#include "ardour/port.h" +#include "ardour/audio_buffer.h" namespace ARDOUR { -class AudioEngine; - -class AudioPort : public virtual Port { +class AudioPort : public Port +{ public: - virtual Buffer& get_buffer () { - return _buffer; - } - - virtual AudioBuffer& get_audio_buffer() { - return _buffer; - } + ~AudioPort (); - void reset_overs () { - _short_overs = 0; - _long_overs = 0; - _overlen = 0; + DataType type () const { + return DataType::AUDIO; } - void reset_peak_meter () { - _peak = 0; - } - - void reset_meters () { - reset_peak_meter (); - reset_overs (); - } + void cycle_start (pframes_t); + void cycle_end (pframes_t); + void cycle_split (); - float peak_db() const { return _peak_db; } - Sample peak() const { return _peak; } + Buffer& get_buffer (pframes_t nframes) { + return get_audio_buffer (nframes); + } - uint32_t short_overs () const { return _short_overs; } - uint32_t long_overs () const { return _long_overs; } - - static void set_short_over_length (nframes_t); - static void set_long_over_length (nframes_t); + AudioBuffer& get_audio_buffer (pframes_t nframes); protected: - friend class AudioEngine; - - AudioPort (Flags); // data buffer comes from elsewhere (e.g. JACK) - AudioPort (Flags, nframes_t); // data buffer owned by ardour - void reset (); - - /* engine isn't supposed to access below here */ - - AudioBuffer _buffer; - - nframes_t _overlen; - Sample _peak; - float _peak_db; - uint32_t _short_overs; - uint32_t _long_overs; - - static nframes_t _long_over_length; - static nframes_t _short_over_length; + friend class PortManager; + AudioPort (std::string const &, PortFlags); + + /* special access for PortManager only (hah, C++) */ + Sample* engine_get_whole_audio_buffer (); + + private: + AudioBuffer* _buffer; + bool _buf_valid; }; - + } // namespace ARDOUR #endif /* __ardour_audio_port_h__ */