1 |
/* |
---|
2 |
* Copyright (C) 2005-2009 by Pieter Palmers |
---|
3 |
* |
---|
4 |
* This file is part of FFADO |
---|
5 |
* FFADO = Free Firewire (pro-)audio drivers for linux |
---|
6 |
* |
---|
7 |
* FFADO is based upon FreeBoB |
---|
8 |
* |
---|
9 |
* This program is free software: you can redistribute it and/or modify |
---|
10 |
* it under the terms of the GNU General Public License as published by |
---|
11 |
* the Free Software Foundation, either version 2 of the License, or |
---|
12 |
* (at your option) version 3 of the License. |
---|
13 |
* |
---|
14 |
* This program is distributed in the hope that it will be useful, |
---|
15 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
---|
16 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
---|
17 |
* GNU General Public License for more details. |
---|
18 |
* |
---|
19 |
* You should have received a copy of the GNU General Public License |
---|
20 |
* along with this program. If not, see <http://www.gnu.org/licenses/>. |
---|
21 |
* |
---|
22 |
*/ |
---|
23 |
|
---|
24 |
#ifndef CONTROL_CROSSBAR_ROUTER_H |
---|
25 |
#define CONTROL_CROSSBAR_ROUTER_H |
---|
26 |
|
---|
27 |
#include "debugmodule/debugmodule.h" |
---|
28 |
|
---|
29 |
#include "Element.h" |
---|
30 |
|
---|
31 |
#include <vector> |
---|
32 |
#include <string> |
---|
33 |
|
---|
34 |
namespace Control { |
---|
35 |
|
---|
36 |
/*! |
---|
37 |
@brief Abstract Base class for Crossbar router elements |
---|
38 |
|
---|
39 |
*/ |
---|
40 |
class CrossbarRouter : public Element |
---|
41 |
{ |
---|
42 |
public: |
---|
43 |
CrossbarRouter(Element *p) : Element(p) {}; |
---|
44 |
CrossbarRouter(Element *p, std::string n) : Element(p, n) {}; |
---|
45 |
virtual ~CrossbarRouter() {}; |
---|
46 |
|
---|
47 |
virtual void show() = 0; |
---|
48 |
|
---|
49 |
typedef std::vector<std::string> NameVector; |
---|
50 |
typedef std::vector<std::string>::iterator NameVectorIterator; |
---|
51 |
typedef std::vector<int> IntVector; |
---|
52 |
typedef std::vector<int>::iterator IntVectorIterator; |
---|
53 |
|
---|
54 |
virtual std::string getSourceName(const int) = 0; |
---|
55 |
virtual std::string getDestinationName(const int) = 0; |
---|
56 |
virtual int getSourceIndex(std::string) = 0; |
---|
57 |
virtual int getDestinationIndex(std::string) = 0; |
---|
58 |
|
---|
59 |
virtual NameVector getSourceNames() = 0; |
---|
60 |
virtual NameVector getDestinationNames() = 0; |
---|
61 |
|
---|
62 |
virtual IntVector getDestinationsForSource(const int) = 0; |
---|
63 |
virtual int getSourceForDestination(const int) = 0; |
---|
64 |
|
---|
65 |
virtual bool canConnect(const int source, const int dest) = 0; |
---|
66 |
virtual bool setConnectionState(const int source, const int dest, const bool enable) = 0; |
---|
67 |
virtual bool getConnectionState(const int source, const int dest) = 0; |
---|
68 |
|
---|
69 |
virtual bool canConnect(std::string, std::string) = 0; |
---|
70 |
virtual bool setConnectionState(std::string, std::string, const bool enable) = 0; |
---|
71 |
virtual bool getConnectionState(std::string, std::string) = 0; |
---|
72 |
|
---|
73 |
virtual bool clearAllConnections() = 0; |
---|
74 |
|
---|
75 |
virtual int getNbSources() = 0; |
---|
76 |
virtual int getNbDestinations() = 0; |
---|
77 |
|
---|
78 |
// functions to access the entire routing map at once |
---|
79 |
// idea is that the row/col nodes that are 1 get a routing entry |
---|
80 |
virtual bool getConnectionMap(int *) = 0; |
---|
81 |
virtual bool setConnectionMap(int *) = 0; |
---|
82 |
|
---|
83 |
// peak metering |
---|
84 |
virtual bool hasPeakMetering() = 0; |
---|
85 |
virtual double getPeakValue(const int source, const int dest) = 0; |
---|
86 |
virtual bool getPeakValues(double &) = 0; |
---|
87 |
|
---|
88 |
protected: |
---|
89 |
|
---|
90 |
}; |
---|
91 |
|
---|
92 |
|
---|
93 |
}; // namespace Control |
---|
94 |
|
---|
95 |
#endif // CONTROL_CROSSBAR_ROUTER_H |
---|