public BassStreamPool(int capacity, Form baseForm)
 {
     m_capacity = capacity;
     for (int i = 0; i < capacity; i++) {
         BassStream stream = new BassStream(i, baseForm);
         m_freeStreams.Add(i, stream);
         m_freeStreamStack.Push(stream);
     }
 }
 public void Free(BassStream stream)
 {
     lock (this) { // [?Thread] ensure local invariants when altering pool contents
         HoloDebug.Assert(!m_freeStreams.ContainsKey(stream.IdUniqueWithinPool));
         HoloDebug.Assert(m_reservedStreams.ContainsKey(stream.IdUniqueWithinPool));
         m_reservedStreams.Remove(stream.IdUniqueWithinPool);
         // BUGBUG: failure to re-add existing stream here
         m_freeStreams.Add(stream.IdUniqueWithinPool, stream);
         m_freeStreamStack.Push(stream);
     }
 }
 public void StreamPoolFree(BassStream bs)
 {
     m_asio.StreamPool.Free(bs);
 }
 public void Free(BassStream bassStream)
 {
     m_asio.StreamPool.Free(bassStream);
 }