2 /*******************************************************************************/
3 /* Copyright (C) 2008 Jonathan Moore Liles */
5 /* This program is free software; you can redistribute it and/or modify it */
6 /* under the terms of the GNU General Public License as published by the */
7 /* Free Software Foundation; either version 2 of the License, or (at your */
8 /* option) any later version. */
10 /* This program is distributed in the hope that it will be useful, but WITHOUT */
11 /* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or */
12 /* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for */
15 /* You should have received a copy of the GNU General Public License along */
16 /* with This program; see the file COPYING. If not,write to the Free Software */
17 /* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
18 /*******************************************************************************/
22 // #include <jack/jack.h>
32 JACK::Client *_client;
34 /* FIXME: reference count? */
36 /* /\* not permitted *\/ */
37 /* Port ( const Port &rhs ); */
38 /* Port & operator= ( const Port &rhs ); */
42 bool operator < ( const Port & rhs ) const;
44 enum type_e { Output, Input };
46 static int max_name ( void );
48 Port ( JACK::Client *client, jack_port_t *port );
49 Port ( JACK::Client *client, const char *name, type_e dir );
50 Port ( JACK::Client *client, type_e dir, const char *base, int n, const char *type=0 );
51 Port ( JACK::Client *client, type_e dir, int n, const char *type=0 );
56 Port ( const Port & rhs );
59 bool valid ( void ) const { return _port; }
60 bool connected ( void ) const { return jack_port_connected( _port ); }
61 type_e type ( void ) const;
62 const char * name ( void ) const { return _name; }
63 bool name ( const char *name );
64 bool name ( const char *base, int n, const char *type=0 );
66 nframes_t total_latency ( void ) const;
67 nframes_t latency ( void ) const;
68 void latency ( nframes_t frames );
70 bool activate ( void );
71 void shutdown ( void );
72 void write ( sample_t *buf, nframes_t nframes );
73 void read ( sample_t *buf, nframes_t nframes );
74 void *buffer ( nframes_t nframes );
75 void silence ( nframes_t nframes );
78 const char ** connections ( void );
79 bool connections ( const char **port_names );
87 bool activate ( const char *name, type_e dir );
89 /* holds all we need to know about a jack port to recreate it on a
93 const char **connections;
116 freeze_state *_freezer;