root/branches/libfreebob-2.0/src/libstreaming/PortManager.h

Revision 227, 2.0 kB (checked in by pieterpalmers, 16 years ago)

- another day of good progress comes to and end...
- compiles and runs, only the midi stuff and the xrun handling remain.

I'll also have to rework the C API somewhat.

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