~ubuntu-branches/ubuntu/vivid/soundscaperenderer/vivid

« back to all changes in this revision

Viewing changes to apf/examples/jack_simpleprocessor.cpp

  • Committer: Package Import Robot
  • Author(s): IOhannes m zmölnig (Debian/GNU)
  • Date: 2014-05-08 16:58:09 UTC
  • Revision ID: package-import@ubuntu.com-20140508165809-7tz9dhu5pvo5wy25
Tags: upstream-0.4.1~dfsg
Import upstream version 0.4.1~dfsg

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
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           *
 
5
 *                                                                            *
 
6
 * This file is part of the Audio Processing Framework (APF).                 *
 
7
 *                                                                            *
 
8
 * The APF 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.                                                         *
 
12
 *                                                                            *
 
13
 * The APF 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.                       *
 
17
 *                                                                            *
 
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/>.            *
 
20
 *                                                                            *
 
21
 *                                 http://AudioProcessingFramework.github.com *
 
22
 ******************************************************************************/
 
23
 
 
24
// Usage example for the MimoProcessor with JACK.
 
25
 
 
26
#include <iostream>
 
27
 
 
28
#include "apf/stringtools.h"
 
29
 
 
30
// First the policies ...
 
31
#include "apf/jack_policy.h"
 
32
#include "apf/posix_thread_policy.h"
 
33
// ... then the SimpleProcessor.
 
34
#include "simpleprocessor.h"
 
35
 
 
36
using apf::str::S2A;
 
37
using apf::str::A2S;
 
38
 
 
39
int main(int argc, char *argv[])
 
40
{
 
41
  if (argc < 4)
 
42
  {
 
43
    std::cerr << "Error: too few arguments!" << std::endl;
 
44
    std::cout << "Usage: " << argv[0]
 
45
      << " inchannels inportprefix outchannels [outportprefix]" << std::endl;
 
46
    return 42;
 
47
  }
 
48
 
 
49
  apf::parameter_map e;
 
50
  e.set("name", "my_engine");
 
51
  e.set("threads", 2);
 
52
 
 
53
  e.set("in_channels", argv[1]);
 
54
  e.set("in_port_prefix", argv[2]);
 
55
  e.set("out_channels", argv[3]);
 
56
  if (argc > 4) e.set("out_port_prefix", argv[4]);
 
57
  else          e.set("out_port_prefix", "system:playback_");
 
58
 
 
59
  SimpleProcessor engine(e);
 
60
 
 
61
  sleep(2);
 
62
 
 
63
  SimpleProcessor::Input::Params p3;
 
64
  p3.set("port_name", "another_port_just_for_fun");
 
65
  engine.add(p3);
 
66
 
 
67
  sleep(60);
 
68
}
 
69
 
 
70
// Settings for Vim (http://www.vim.org/), please do not remove:
 
71
// vim:softtabstop=2:shiftwidth=2:expandtab:textwidth=80:cindent