diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2013-07-11 14:35:26 -0400 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2013-07-11 14:35:26 -0400 |
commit | 0f1ed673d055205569513d372f9ae35a447a485f (patch) | |
tree | 1d1d3beb51e543c630d68033728f8223a2f30bf8 /libs/ardour/butler.cc | |
parent | 6a8901eb8d5feadf9ff9e3adac7197d3dd5ca464 (diff) |
Move request pipe setup into separate function
Diffstat (limited to 'libs/ardour/butler.cc')
-rw-r--r-- | libs/ardour/butler.cc | 41 |
1 files changed, 24 insertions, 17 deletions
diff --git a/libs/ardour/butler.cc b/libs/ardour/butler.cc index db1b316368..38ffef6fbc 100644 --- a/libs/ardour/butler.cc +++ b/libs/ardour/butler.cc @@ -69,24 +69,8 @@ Butler::config_changed (std::string p) } int -Butler::start_thread() +Butler::setup_request_pipe () { - const float rate = (float)_session.frame_rate(); - - /* size is in Samples, not bytes */ - audio_dstream_capture_buffer_size = (uint32_t) floor (Config->get_audio_capture_buffer_seconds() * rate); - audio_dstream_playback_buffer_size = (uint32_t) floor (Config->get_audio_playback_buffer_seconds() * rate); - - /* size is in bytes - * XXX: Jack needs to tell us the MIDI buffer size - * (i.e. how many MIDI bytes we might see in a cycle) - */ - midi_dstream_buffer_size = (uint32_t) floor (Config->get_midi_track_buffer_seconds() * rate); - - MidiDiskstream::set_readahead_frames ((framecnt_t) (Config->get_midi_readahead() * rate)); - - should_run = false; - if (pipe (request_pipe)) { error << string_compose(_("Cannot create transport request signal pipe (%1)"), strerror (errno)) << endmsg; @@ -104,6 +88,29 @@ Butler::start_thread() strerror (errno)) << endmsg; return -1; } + return 0; +} + +int +Butler::start_thread() +{ + const float rate = (float)_session.frame_rate(); + + /* size is in Samples, not bytes */ + audio_dstream_capture_buffer_size = (uint32_t) floor (Config->get_audio_capture_buffer_seconds() * rate); + audio_dstream_playback_buffer_size = (uint32_t) floor (Config->get_audio_playback_buffer_seconds() * rate); + + /* size is in bytes + * XXX: Jack needs to tell us the MIDI buffer size + * (i.e. how many MIDI bytes we might see in a cycle) + */ + midi_dstream_buffer_size = (uint32_t) floor (Config->get_midi_track_buffer_seconds() * rate); + + MidiDiskstream::set_readahead_frames ((framecnt_t) (Config->get_midi_readahead() * rate)); + + should_run = false; + + if (setup_request_pipe() != 0) return -1; if (pthread_create_and_store ("disk butler", &thread, _thread_work, this)) { error << _("Session: could not create butler thread") << endmsg; |