Gnash  0.8.11dev
InputStream.h
Go to the documentation of this file.
1 // sound/InputStream.h -- Audio input stream interface
2 //
3 // Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012
4 // Free Software Foundation, Inc
5 //
6 // This program is free software; you can redistribute it and/or modify
7 // it under the terms of the GNU General Public License as published by
8 // the Free Software Foundation; either version 3 of the License, or
9 // (at your option) any later version.
10 //
11 // This program is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 // GNU General Public License for more details.
15 //
16 // You should have received a copy of the GNU General Public License
17 // along with this program; if not, write to the Free Software
18 // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
19 
20 
21 #ifndef SOUND_INPUTSTREAM_H
22 #define SOUND_INPUTSTREAM_H
23 
24 #include <cstdint> // For C99 int types
25 
26 namespace gnash {
27 namespace sound {
28 
30 //
47 class InputStream {
48 
49 public:
50 
52  //
71  virtual unsigned int fetchSamples(std::int16_t* to, unsigned int nSamples)=0;
72 
74  //
80  virtual unsigned int samplesFetched() const=0;
81 
83  virtual bool eof() const=0;
84 
85  virtual ~InputStream() {}
86 
87 };
88 
89 
90 } // gnash.sound namespace
91 } // namespace gnash
92 
93 #endif // SOUND_INPUTSTREAM_H
A sound input stream.
Definition: InputStream.h:47
virtual bool eof() const =0
Return true if there&#39;ll be no more data to fetch.
virtual unsigned int fetchSamples(std::int16_t *to, unsigned int nSamples)=0
Fetch the given amount of samples, non-blocking and thread-safe.
Anonymous namespace for callbacks, local functions, event handlers etc.
Definition: dbus_ext.cpp:40
virtual ~InputStream()
Definition: InputStream.h:85
virtual unsigned int samplesFetched() const =0
Return number of samples fetched from this stream.