projects
/
ardour.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Move playback_distance up to AudioDiskstream from Diskstream since it is only used...
[ardour.git]
/
libs
/
ardour
/
ardour
/
audio_port.h
diff --git
a/libs/ardour/ardour/audio_port.h
b/libs/ardour/ardour/audio_port.h
index 0e85e0e01b101c29933db2a2d55f8227c63989ca..748ef8263baf8c3a8c1ad49f84c1cffcc23c5b65 100644
(file)
--- 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
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,83
+21,53
@@
#ifndef __ardour_audio_port_h__
#define __ardour_audio_port_h__
#ifndef __ardour_audio_port_h__
#define __ardour_audio_port_h__
-#include <sigc++/signal.h>
-#include <pbd/failed_constructor.h>
-#include <ardour/ardour.h>
-#include <jack/jack.h>
-#include <ardour/port.h>
-#include <ardour/buffer.h>
+#include "ardour/port.h"
+#include "ardour/audio_buffer.h"
namespace ARDOUR {
namespace ARDOUR {
-class AudioEngine;
-
-class AudioPort : public Port {
+class AudioPort : public Port
+{
public:
public:
- virtual ~AudioPort() {
- free (_port);
- }
+ ~AudioPort ();
-
void cycle_start(nframes_t nframes)
{
-
_buffer.set_data ((Sample*) jack_port_get_buffer (_port, nframes), nframes)
;
+
DataType type () const
{
+
return DataType::AUDIO
;
}
}
- void cycle_end() {}
+ void cycle_start (pframes_t);
+ void cycle_end (pframes_t);
+ void cycle_split ();
- DataType type() const { return DataType(DataType::AUDIO); }
+ size_t raw_buffer_size (pframes_t nframes) const;
- Buffer& get_buffer () {
- return _buffer;
- }
-
- AudioBuffer& get_audio_buffer() {
- return _buffer;
+ Buffer& get_buffer (framecnt_t nframes, framecnt_t offset = 0) {
+ return get_audio_buffer (nframes, offset);
}
}
- void reset_overs () {
- _short_overs = 0;
- _long_overs = 0;
- _overlen = 0;
- }
+ AudioBuffer& get_audio_buffer (framecnt_t nframes, framecnt_t offset = 0);
+
+ static framecnt_t port_offset() { return _port_offset; }
-
void reset_peak_meter (
) {
- _p
eak = 0
;
+
static void set_port_offset (framecnt_t off
) {
+ _p
ort_offset = off
;
}
}
- void reset_meters () {
- reset_peak_meter ();
- reset_overs ();
+ static void increment_port_offset (framecnt_t n) {
+ _port_offset += n;
}
}
-
- float peak_db() const { return _peak_db; }
- jack_default_audio_sample_t peak() const { return _peak; }
-
- 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);
-
protected:
friend class AudioEngine;
protected:
friend class AudioEngine;
- AudioPort (jack_port_t *port);
- void reset ();
-
- /* engine isn't supposed to access below here */
+ AudioPort (std::string const &, Flags);
- AudioBuffer _buffer;
+ private:
+ AudioBuffer* _buffer;
- nframes_t _overlen;
- jack_default_audio_sample_t _peak;
- float _peak_db;
- uint32_t _short_overs;
- uint32_t _long_overs;
-
- static nframes_t _long_over_length;
- static nframes_t _short_over_length;
+ static framecnt_t _port_offset;
};
};
-
+
} // namespace ARDOUR
#endif /* __ardour_audio_port_h__ */
} // namespace ARDOUR
#endif /* __ardour_audio_port_h__ */