1 #ifndef AudioBufferSource_hxx
2 #define AudioBufferSource_hxx
33 typedef std::vector<Port>
Ports;
49 void LoadFrom(
Storage & storage)
52 if (not HasNSources())
78 for (
unsigned port = 0; port < _ports.size(); ++port)
79 delete _ports[port].mPort;
84 CLAM_ASSERT(index < _ports.size(),
"AudioOutPort index out of range");
85 Port& port = _ports[index];
86 port.mPort->SetSize(1);
87 port.mPort->SetHop(1);
107 unsigned sources = _config.GetNSources();
109 ResizePorts(sources);
118 std::string
const Portname(
unsigned port)
const
120 std::ostringstream os;
125 void ResizePorts(
unsigned sources)
127 if (sources == _ports.size())
130 for (
unsigned port = sources; port < _ports.size(); ++port)
131 delete _ports[port].mPort;
133 unsigned oldSize = _ports.size();
134 _ports.resize(sources);
136 for (
unsigned port = oldSize; port < sources; ++port)
137 _ports[port] = Port(
new OutPort<Audio>(Portname(port),
this));