Jack2  1.9.9
JackNetAdapter.h
1 /*
2 Copyright (C) 2008-2011 Romain Moret at Grame
3 
4 This program is free software; you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation; either version 2 of the License, or
7 (at your option) any later version.
8 
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
13 
14 You should have received a copy of the GNU General Public License
15 along with this program; if not, write to the Free Software
16 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
17 
18 */
19 
20 #ifndef __JackNetAdapter__
21 #define __JackNetAdapter__
22 
23 #include "JackAudioAdapterInterface.h"
24 #include "JackNetInterface.h"
25 
26 namespace Jack
27 {
28 
34  public JackNetSlaveInterface,
36  {
37 
38  private:
39 
40  //jack data
41  jack_client_t* fClient;
42 
43  //transport data
44  int fLastTransportState;
45  int fLastTimebaseMaster;
46 
47  //sample buffers
48  sample_t** fSoftCaptureBuffer;
49  sample_t** fSoftPlaybackBuffer;
50 
51  //adapter thread
52  JackThread fThread;
53 
54  //transport
55  void EncodeTransportData();
56  void DecodeTransportData();
57 
58  public:
59 
60  JackNetAdapter(jack_client_t* jack_client, jack_nframes_t buffer_size, jack_nframes_t sample_rate, const JSList* params);
61  ~JackNetAdapter();
62 
63  int Open();
64  int Close();
65 
66  int SetBufferSize(jack_nframes_t buffer_size);
67 
68  bool Init();
69  bool Execute();
70 
71  int Read();
72  int Write();
73 
74  int Process();
75  };
76 }
77 
78 #endif
The base class for runnable objects, that have an Init and Execute method to be called in a threa...
Definition: JackThread.h:34
Base class for audio adapters.
Darwin threads. Real-time threads are actually "time constraint" threads.