1
/******************************************************************************
2
* Copyright © 2012-2014 Institut für Nachrichtentechnik, Universität Rostock *
3
* Copyright © 2006-2012 Quality & Usability Lab, *
4
* Telekom Innovation Laboratories, TU Berlin *
6
* This file is part of the SoundScape Renderer (SSR). *
8
* The SSR is free software: you can redistribute it and/or modify it under *
9
* the terms of the GNU General Public License as published by the Free *
10
* Software Foundation, either version 3 of the License, or (at your option) *
11
* any later version. *
13
* The SSR is distributed in the hope that it will be useful, but WITHOUT ANY *
14
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS *
15
* FOR A PARTICULAR PURPOSE. *
16
* See the GNU General Public License for more details. *
18
* You should have received a copy of the GNU General Public License along *
19
* with this program. If not, see <http://www.gnu.org/licenses/>. *
21
* The SSR is a tool for real-time spatial audio reproduction providing a *
22
* variety of rendering algorithms. *
24
* http://spatialaudio.net/ssr ssr@spatialaudio.net *
25
******************************************************************************/
28
/// Audio recorder using ecasound (definition).
30
#ifndef SSR_AUDIORECORDER_H
31
#define SSR_AUDIORECORDER_H
33
#include <eca-control-interface.h>
36
#include <stdexcept> // for std::runtime_error
39
* Writes a (multichannel) soundfile using ecasound and JACK transport.
44
using ptr_t = std::unique_ptr<AudioRecorder>; ///< auto_ptr to AudioRecorder
46
/// exception to be thrown by ctor.
47
struct audiorecorder_error : public std::runtime_error
49
audiorecorder_error(const std::string& s): std::runtime_error(s) {}
54
AudioRecorder(const std::string& audio_file_name,
55
const std::string& format_string, const std::string& record_source,
56
const std::string& client_name = "recorder",
57
const std::string& input_prefix = "channel") throw(audiorecorder_error);
59
bool enable(); ///< enable recording as soon as transport is started
60
bool disable(); ///< disable recording
62
const std::string client_name; ///< name of JACK client used by ecasound
63
const std::string input_prefix; ///< prefix used for channels
66
ECA_CONTROL_INTERFACE _eca; ///< interface to ecasound
71
// Settings for Vim (http://www.vim.org/), please do not remove:
72
// vim:softtabstop=2:shiftwidth=2:expandtab:textwidth=80:cindent
73
// vim:fdm=expr:foldexpr=getline(v\:lnum)=~'/\\*\\*'&&getline(v\:lnum)!~'\\*\\*/'?'a1'\:getline(v\:lnum)=~'\\*\\*/'&&getline(v\:lnum)!~'/\\*\\*'?'s1'\:'='