projects
/
ardour.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Trim dependence on evoral types.hpp and Beats.hpp
[ardour.git]
/
libs
/
ardour
/
audio_port.cc
diff --git
a/libs/ardour/audio_port.cc
b/libs/ardour/audio_port.cc
index 240224ea5e5b33112ae3e72f5e6c21ca5851eac8..e2bb20dbe958c20753422e202e0d74cf8a911fa8 100644
(file)
--- a/
libs/ardour/audio_port.cc
+++ b/
libs/ardour/audio_port.cc
@@
-21,13
+21,17
@@
#include "pbd/stacktrace.h"
#include "ardour/audio_buffer.h"
#include "pbd/stacktrace.h"
#include "ardour/audio_buffer.h"
+#include "ardour/audioengine.h"
#include "ardour/audio_port.h"
#include "ardour/data_type.h"
#include "ardour/audio_port.h"
#include "ardour/data_type.h"
+#include "ardour/port_engine.h"
using namespace ARDOUR;
using namespace std;
using namespace ARDOUR;
using namespace std;
-AudioPort::AudioPort (const std::string& name, Flags flags)
+#define port_engine AudioEngine::instance()->port_engine()
+
+AudioPort::AudioPort (const std::string& name, PortFlags flags)
: Port (name, DataType::AUDIO, flags)
, _buffer (new AudioBuffer (0))
{
: Port (name, DataType::AUDIO, flags)
, _buffer (new AudioBuffer (0))
{
@@
-52,14
+56,11
@@
AudioPort::cycle_start (pframes_t nframes)
}
void
}
void
-AudioPort::cycle_end (pframes_t)
+AudioPort::cycle_end (pframes_t
nframes
)
{
if (sends_output() && !_buffer->written()) {
{
if (sends_output() && !_buffer->written()) {
- /* we can't use nframes here because the current buffer capacity may
- be shorter than the full buffer size if we split the cycle.
- */
- if (_buffer->capacity () > 0) {
- _buffer->silence (_buffer->capacity());
+ if (_buffer->capacity() >= nframes) {
+ _buffer->silence (nframes);
}
}
}
}
}
}
@@
-73,16
+74,16
@@
AudioBuffer&
AudioPort::get_audio_buffer (pframes_t nframes)
{
/* caller must hold process lock */
AudioPort::get_audio_buffer (pframes_t nframes)
{
/* caller must hold process lock */
- _buffer->set_data ((Sample *)
jack_port_get_buffer (_jack_port
, _cycle_nframes) +
+ _buffer->set_data ((Sample *)
port_engine.get_buffer (_port_handle
, _cycle_nframes) +
_global_port_buffer_offset + _port_buffer_offset, nframes);
return *_buffer;
}
_global_port_buffer_offset + _port_buffer_offset, nframes);
return *_buffer;
}
-Sample*
+Sample*
AudioPort::engine_get_whole_audio_buffer ()
{
/* caller must hold process lock */
AudioPort::engine_get_whole_audio_buffer ()
{
/* caller must hold process lock */
- return (Sample *)
jack_port_get_buffer (_jack_port
, _cycle_nframes);
+ return (Sample *)
port_engine.get_buffer (_port_handle
, _cycle_nframes);
}
}