root/branches/ppalmers-streaming/src/libstreaming/generic/PortManager.h

Revision 705, 2.0 kB (checked in by ppalmers, 13 years ago)

restructure the streaming directory

Line 
1 /*
2  * Copyright (C) 2005-2007 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 library is free software; you can redistribute it and/or
10  * modify it under the terms of the GNU Lesser General Public
11  * License version 2.1, as published by the Free Software Foundation;
12  *
13  * This library is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
16  * Lesser General Public License for more details.
17  *
18  * You should have received a copy of the GNU Lesser General Public
19  * License along with this library; if not, write to the Free Software
20  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
21  * MA 02110-1301 USA
22  */
23
24 #ifndef __FFADO_PORTMANAGER__
25 #define __FFADO_PORTMANAGER__
26
27 #include "Port.h"
28
29 #include "debugmodule/debugmodule.h"
30
31 #include <vector>
32
33 namespace Streaming {
34
35 class Port;
36 typedef std::vector<Port *> PortVector;
37 typedef std::vector<Port *>::iterator PortVectorIterator;
38 /*!
39 \brief The Base Class for any class that maintains a collection of ports.
40
41  Contains helper classes that allow the easy maintaining of Port collections.
42
43 */
44 class PortManager {
45
46 public:
47
48     PortManager();
49     virtual ~PortManager();
50
51     virtual bool makeNameUnique(Port *port);
52     virtual bool addPort(Port *port);
53     virtual bool deletePort(Port *port);
54     virtual void deleteAllPorts();
55
56     int getPortCount(enum Port::E_PortType);
57     int getPortCount();
58
59 //     virtual bool setPortBuffersize(unsigned int newsize);
60
61     Port *getPortAtIdx(unsigned int index);
62
63     virtual bool resetPorts();
64     virtual bool initPorts();
65     virtual bool preparePorts();
66
67      virtual void setVerboseLevel(int l);
68
69 protected:
70     PortVector m_Ports;
71     PortVector m_PacketPorts;
72     PortVector m_PeriodPorts;
73 //     PortVector m_SamplePorts;
74
75     DECLARE_DEBUG_MODULE;
76
77 };
78
79 }
80
81 #endif /* __FFADO_PORTMANAGER__ */
82
83
Note: See TracBrowser for help on using the browser.