Inheritance diagram for EWFFILE:
Public Member Functions | |
Public functions | |
EWFFILE (const std::string &name="") | |
Reimplemented functions from ECA_OBJECT | |
virtual std::string | name (void) const |
Object name used to identify the object type. | |
virtual std::string | description (void) const |
Object description. | |
Reimplemented functions from DYNAMIC_OBJECT<string> | |
virtual EWFFILE * | clone (void) const |
Virtual method that clones the current object and returns a pointer to it. | |
virtual EWFFILE * | new_expr (void) const |
Virtual method that creates a new object of current type. | |
Reimplemented functions from ECA_AUDIO_POSITION | |
virtual void | seek_position (void) |
Reimplemented functions from AUDIO_IO | |
virtual bool | locked_audio_format (void) const |
Whether audio format is locked. | |
virtual bool | supports_seeking (void) const |
Whether device supports non-blocking I/O mode. | |
virtual bool | finite_length_stream (void) const |
Whether audio stream has a distinct length. | |
virtual bool | finished (void) const |
Whether all data has been processed? If opened in mode 'io_read', this means that end of stream has been reached. | |
virtual void | read_buffer (SAMPLE_BUFFER *sbuf) |
virtual void | write_buffer (SAMPLE_BUFFER *sbuf) |
Writes all data from sample buffer pointed by 'sbuf' to this object. | |
virtual void | open (void) throw (AUDIO_IO::SETUP_ERROR&) |
Opens the audio object (possibly in exclusive mode). | |
virtual void | close (void) |
Closes audio object. | |
New functions | |
void | child_offset (const ECA_AUDIO_TIME &v) |
Set start offset for child object. | |
void | child_start_position (const ECA_AUDIO_TIME &v) |
Set start position inside child object. | |
void | child_length (const ECA_AUDIO_TIME &v) |
Set child length. | |
void | toggle_looping (bool v) |
Toggle whether child object data is looped. |
When writing .ewf files, it's possible to seek beyond end position. When first write_buffer() call is issued, current sample offset is stored into the .ewf file and corresponding child object is opened for writing. Read_buffer() calls return silent buffers until sample_offset is reached. After that, audio object is processed normally. Similarly .ewf supports audio relocation, looping, etc...
Related design patterns:
|
Set child length. If not set, defaults to the total length. |
|
Virtual method that clones the current object and returns a pointer to it. This must be implemented by all subclasses! Reimplemented from AUDIO_IO_PROXY. |
|
Closes audio object. After calling this routine, all resources (for instance files and devices) must be freed so that they can be used by other processes.
Reimplemented from AUDIO_IO. |
|
Object description. Description should be short, informative and unformatted. Reimplemented from AUDIO_IO_PROXY. |
|
Whether all data has been processed? If opened in mode 'io_read', this means that end of stream has been reached. If opened in 'io_write' or 'io_readwrite' modes, finished status usually means that an error has occured (no space left, etc). After finished() has returned 'true', further calls to read_buffer() and/or write_buffer() won't process any data. For output for which 'finite_length_stream()' is true, when 'finished()' returns true, that means an error has occured. Otherwise 'finished()' just tells that further attempts to do i/o will fail. Reimplemented from AUDIO_IO_PROXY. |
|
Whether audio stream has a distinct length. It's important to note the difference between this attribute and 'supports_seeking()'. For example, a file read through a pipe mechanism is not seekable and its length is not known until 'finished()´ becomes true, but still, it is of finite length. A sine oscillator on the other hand can go on producing a signal forever, and is thus infinite. This attributes directly affects how 'finished()' should to be interpreted.
Reimplemented from AUDIO_IO_PROXY. |
|
Whether audio format is locked. If this is true, audio object has a known audio format, and doesn't allow overriding it. By default, audio format is not locked. Reimplemented from AUDIO_IO_PROXY. |
|
Object name used to identify the object type. In most cases, object name is same for all class instances. Must be implemented in all subclasses. Reimplemented from AUDIO_IO_PROXY. |
|
Virtual method that creates a new object of current type. This must be implemented by all subclasses! Reimplemented from AUDIO_IO_PROXY. |
|
Opens the audio object (possibly in exclusive mode). This routine is used for initializing external connections (opening files or devices, loading shared libraries, opening IPC connections). As it's impossible to know in advance what might happen, open() may throw an exception. This way it becomes possible to provide more verbose information about the problem that caused open() to fail. At this point the various audio parameters are used for the first time. Unless locked_audio_format() is 'true', object tries to use the audio format parameters set prior to this call. If object doesn't support the given parameter combination, it can either try adjust them to closest matching, or in the worst case, throw an SETUP_ERROR exception (see above).
Reimplemented from AUDIO_IO. |
|
implementation notes: position: the current global position child offset: global position when child is activated child start position: position inside the child-object where input is started (data between child beginning and child_start_pos is not used) child length: amount child data that is used beginning from child's start position child looping: when child end is reaches, whether to jump back to start position? note! all cases (if-else blocks) end to setting a new position_in_samples value Reimplemented from AUDIO_IO_PROXY. |
|
Whether device supports non-blocking I/O mode. By default, seeking is supported. Reimplemented from AUDIO_IO_PROXY. |
|
Writes all data from sample buffer pointed by 'sbuf' to this object. Notes concerning read_buffer() also apply to this routine. Note! The implementations should call set_position_in_samples() or change_position_in_samples() in ECA_AUDIO_POSITION.
Reimplemented from AUDIO_IO_PROXY. |