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#include <QMutexLocker>
48
49#include <jack/jack.h>
50
51using namespace std;
52
53const int Indent = 2;
54
55//-------------------------------------------------------------------------------
63//-------------------------------------------------------------------------------
64class JMess {
65
66public:
67 JMess();
68 virtual ~JMess();
69
70 void disconnectAll();
71 void writeOutput(QString xmlOutFile);
72 void connectPorts(QString xmlInFile);
73 void setConnectedPorts();
75 void connectSpawnedPorts(int nChans, int hubPatch);
76 void connectTUB(int nChans);
77
78private:
79 int parseXML(QString xmlInFile);
80
81 jack_client_t *mClient; //Class client
82 jack_status_t mStatus; //Class client status
83
84 //Vectors of Connected Ports and Ports to connects
85 //This are a matrix (Nx2) of string like this:
86 //OuputPort1 InputPort1
87 // ...
88 //OuputPortN InputPortN
89 QVector<QVector<QString> > mConnectedPorts;
90 QVector<QVector<QString> > mPortsToConnect;
91 static QMutex sJMessMutex;
92};
93#endif
const int Indent
Definition: JMess.h:53
Class to save and load all jack client connections.
Definition: JMess.h:64
void disconnectAll()
Disconnect all the clients.
Definition: JMess.cpp:363
JMess()
Constructs a JMess object that has a jack client.
Definition: JMess.cpp:46
void writeOutput(QString xmlOutFile)
Write an XML file with the name specified at xmlOutFile.
Definition: JMess.cpp:81
virtual ~JMess()
Distructor closes the jmess jack audio client.
Definition: JMess.cpp:69
void connectTUB(int nChans)
Definition: JMess.cpp:313
void connectSpawnedPorts(int nChans, int hubPatch)
Cross connect ports between net combs, -l LAIR mode.
Definition: JMess.cpp:171
void connectPorts(QString xmlInFile)
Connect ports specified in input XML file xmlInFile.
Definition: JMess.cpp:457
void setConnectedPorts()
Set list of ouput ports that have connections.
Definition: JMess.cpp:145