diff options
| author | Carl Hetherington <cth@carlh.net> | 2017-03-15 23:39:25 +0000 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2017-04-19 23:04:32 +0100 |
| commit | fe99d14e3047e9302e94db372923c92291016f1c (patch) | |
| tree | 7a826e545927e576794af532fb403506f33603a7 /src/lib/butler.cc | |
| parent | 81301e260bad6944a75b3d20c1be4f2ff9929db7 (diff) | |
First bits of audio support.
Diffstat (limited to 'src/lib/butler.cc')
| -rw-r--r-- | src/lib/butler.cc | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/src/lib/butler.cc b/src/lib/butler.cc index 1dbad6152..175846d63 100644 --- a/src/lib/butler.cc +++ b/src/lib/butler.cc @@ -34,13 +34,16 @@ using boost::optional; /** Video readahead in frames */ #define VIDEO_READAHEAD 10 -Butler::Butler (weak_ptr<const Film> film, shared_ptr<Player> player) +Butler::Butler (weak_ptr<const Film> film, shared_ptr<Player> player, AudioMapping audio_mapping, int audio_channels) : _film (film) , _player (player) , _pending_seek_accurate (false) , _finished (false) + , _audio_mapping (audio_mapping) + , _audio_channels (audio_channels) { _player_video_connection = _player->Video.connect (bind (&Butler::video, this, _1, _2)); + _player_audio_connection = _player->Audio.connect (bind (&Butler::audio, this, _1, _2)); _player_changed_connection = _player->Changed.connect (bind (&Butler::player_changed, this)); _thread = new boost::thread (bind (&Butler::thread, this)); } @@ -135,6 +138,12 @@ Butler::video (shared_ptr<PlayerVideo> video, DCPTime time) } void +Butler::audio (shared_ptr<AudioBuffers> audio, DCPTime time) +{ + +} + +void Butler::player_changed () { optional<DCPTime> t; @@ -148,3 +157,10 @@ Butler::player_changed () seek (*t, true); } } + +void +Butler::get_audio (float* out, Frame frames) +{ + _audio.get (reinterpret_cast<float*> (out), _audio_channels, frames); + _summon.notify_all (); +} |
