13
0

Truly atomic port mixdown function setting.

git-svn-id: svn://localhost/ardour2/trunk@2581 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
David Robillard 2007-10-31 20:05:49 +00:00
parent 1059b3f48e
commit 0051f92a4c
2 changed files with 4 additions and 14 deletions

View File

@ -52,13 +52,6 @@ const nframes_t frames_per_peak = 256;
AudioSource (Session&, const XMLNode&);
virtual ~AudioSource ();
/* one could argue that this should belong to Source, but other data types
generally do not come with a model of "offset along an audio timeline"
so its here in AudioSource for now.
*/
virtual nframes_t natural_position() const { return 0; }
/* returns the number of items in this `audio_source' */
virtual nframes_t available_peaks (double zoom) const;
@ -116,8 +109,8 @@ const nframes_t frames_per_peak = 256;
bool _peaks_built;
mutable Glib::Mutex _lock;
mutable Glib::Mutex _peaks_ready_lock;
Glib::ustring peakpath;
Glib::ustring _captured_for;
Glib::ustring peakpath;
Glib::ustring _captured_for;
mutable uint32_t _read_data_count; // modified in read()
mutable uint32_t _write_data_count; // modified in write()

View File

@ -17,6 +17,7 @@
*/
#include <cassert>
#include <glib.h>
#include <ardour/base_audio_port.h>
#include <ardour/audioengine.h>
#include <ardour/data_type.h>
@ -75,11 +76,7 @@ BaseAudioPort::default_mixdown (const set<Port*>& ports, AudioBuffer* dest, nfra
void
BaseAudioPort::set_mixdown_function (void (*func)(const set<Port*>&, AudioBuffer*, nframes_t, nframes_t, bool))
{
/* caller should (but not must) hold process lock since this is an atomic operation on most platforms
and even if its not, it doesn't really matter.
*/
_mixdown = func;
g_atomic_pointer_set(&_mixdown, func);
}