JackTrip
JMess.h
Go to the documentation of this file.
1 /*
2  JMess: A simple utility so save your jack-audio mess.
3 
4  Copyright (C) 2007-2010 Juan-Pablo Caceres.
5 
6  Permission is hereby granted, free of charge, to any person
7  obtaining a copy of this software and associated documentation
8  files (the "Software"), to deal in the Software without
9  restriction, including without limitation the rights to use,
10  copy, modify, merge, publish, distribute, sublicense, and/or sell
11  copies of the Software, and to permit persons to whom the
12  Software is furnished to do so, subject to the following
13  conditions:
14 
15  The above copyright notice and this permission notice shall be
16  included in all copies or substantial portions of the Software.
17 
18  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
19  EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
20  OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
21  NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
22  HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
23  WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
24  FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
25  OTHER DEALINGS IN THE SOFTWARE.
26 */
27 
28 
29 /*
30  * JMess.h
31  */
32 
33 #ifndef __JMESS_H
34 #define __JMESS_H
35 
36 #include <iostream>
37 #include <string>
38 #include <errno.h>
39 
40 #include <QIODevice>
41 #include <QString>
42 #include <QVector>
43 //#include <QtXml>
44 //#include <QXmlSimpleReader>
45 //#include <QXmlInputSource>
46 //#include <QXmlContentHandler>
47 
48 #include <jack/jack.h>
49 
50 using namespace std;
51 
52 const int Indent = 2;
53 
54 //-------------------------------------------------------------------------------
62 //-------------------------------------------------------------------------------
63 class JMess {
64 
65 public:
66  JMess();
67  virtual ~JMess();
68 
69  void disconnectAll();
70  void writeOutput(QString xmlOutFile);
71  void connectPorts(QString xmlInFile);
72  void setConnectedPorts();
74  void connectSpawnedPorts(int nChans, int hubPatch);
75  void connectTUB(int nChans);
76 
77 private:
78  int parseXML(QString xmlInFile);
79 
80  jack_client_t *mClient; //Class client
81  jack_status_t mStatus; //Class client status
82 
83  //Vectors of Connected Ports and Ports to connects
84  //This are a matrix (Nx2) of string like this:
85  //OuputPort1 InputPort1
86  // ...
87  //OuputPortN InputPortN
88  QVector<QVector<QString> > mConnectedPorts;
89  QVector<QVector<QString> > mPortsToConnect;
90 };
91 #endif
Indent
const int Indent
Definition: JMess.h:52
JMess
Class to save and load all jack client connections.
Definition: JMess.h:63