diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2019-12-10 09:28:41 -0700 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2019-12-10 09:29:22 -0700 |
commit | c3e3930f149667666a2e5b851d02a4bed1cfb9d9 (patch) | |
tree | 3833506a9e1a9ffe7cd052b34bf95c2897d38c15 /libs/pbd | |
parent | 7457fd2e27b4b10e3d5cd8fa0d5d1d45abbeae48 (diff) |
revert to single buffer for disk playback, and 5.x-style overwrite
Also address issues with MIDI and also atomicity of _pending_overwrite
Diffstat (limited to 'libs/pbd')
-rw-r--r-- | libs/pbd/pbd/playback_buffer.h | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/libs/pbd/pbd/playback_buffer.h b/libs/pbd/pbd/playback_buffer.h index 932f9224b3..1981adcdd8 100644 --- a/libs/pbd/pbd/playback_buffer.h +++ b/libs/pbd/pbd/playback_buffer.h @@ -119,6 +119,13 @@ public: guint write (T const * src, guint cnt); /* write-thead */ guint write_zero (guint cnt); + /* read-thead */ + guint increment_write_ptr (guint cnt) + { + cnt = std::min (cnt, write_space ()); + g_atomic_int_set (&write_idx, (g_atomic_int_get (&write_idx) + cnt) & size_mask); + return cnt; + } /* read-thead */ void read_flush () @@ -171,6 +178,9 @@ public: } } + guint read_ptr() const { return read_idx; } + guint reserved_size() const { return reserved; } + private: T *buf; guint reservation; |