Jack2  1.9.9
JackFFADODriver.h
1 /*
2 Copyright (C) 2001 Paul Davis
3 Copyright (C) 2004 Grame
4 Copyright (C) 2007 Pieter Palmers
5 Copyright (C) 2012 Adrian Knoth
6 
7 This program is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation; either version 2 of the License, or
10 (at your option) any later version.
11 
12 This program is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
16 
17 You should have received a copy of the GNU General Public License
18 along with this program; if not, write to the Free Software
19 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
20 
21 */
22 
23 #ifndef __JackFFADODriver__
24 #define __JackFFADODriver__
25 
26 #include "JackAudioDriver.h"
27 #include "JackThreadedDriver.h"
28 #include "JackTime.h"
29 
30 #include "ffado_driver.h"
31 
32 namespace Jack
33 {
34 
40 {
41 
42  private:
43 
44  // enable verbose messages
45  int g_verbose;
46 
47  jack_driver_t* fDriver;
48  int ffado_driver_attach (ffado_driver_t *driver);
49  int ffado_driver_detach (ffado_driver_t *driver);
50  int ffado_driver_read (ffado_driver_t * driver, jack_nframes_t nframes);
51  int ffado_driver_write (ffado_driver_t * driver, jack_nframes_t nframes);
52  jack_nframes_t ffado_driver_wait (ffado_driver_t *driver,
53  int extra_fd, int *status,
54  float *delayed_usecs);
55  int ffado_driver_start (ffado_driver_t *driver);
56  int ffado_driver_stop (ffado_driver_t *driver);
57  int ffado_driver_restart (ffado_driver_t *driver);
58  ffado_driver_t *ffado_driver_new (const char *name, ffado_jack_settings_t *params);
59  void ffado_driver_delete (ffado_driver_t *driver);
60 
61  void jack_driver_init (jack_driver_t *driver);
62  void jack_driver_nt_init (jack_driver_nt_t * driver);
63  void UpdateLatencies();
64 
65  public:
66 
67  JackFFADODriver(const char* name, const char* alias, JackLockedEngine* engine, JackSynchro* table)
68  : JackAudioDriver(name, alias,engine, table)
69  {}
70  virtual ~JackFFADODriver()
71  {}
72 
73  int Open(ffado_jack_settings_t *cmlparams);
74 
75  int Close();
76  int Attach();
77  int Detach();
78 
79  int Start();
80  int Stop();
81 
82  int Read();
83  int Write();
84 
85  // BufferSize can be changed
86  bool IsFixedBufferSize()
87  {
88  return false;
89  }
90 
91  int SetBufferSize(jack_nframes_t nframes);
92 };
93 
94 } // end of namespace
95 
96 #endif
Inter process synchronization using using Mach semaphore.
Locked Engine, access to methods is serialized using a mutex.
The base class for audio drivers: drivers with audio ports.
The FFADO driver.