Zrythm v2.0.0-DEV
a highly automated and intuitive digital audio workstation
Loading...
Searching...
No Matches
zrythm::dsp::FileAudioSourceWriter Class Reference

Handles all file I/O operations for FileAudioSource. More...

#include <src/dsp/file_audio_source.h>

Inheritance diagram for zrythm::dsp::FileAudioSourceWriter:
Collaboration diagram for zrythm::dsp::FileAudioSourceWriter:

Public Member Functions

 FileAudioSourceWriter (const FileAudioSource &source, fs::path path, bool parts)
 Writes the given audio clip data to a file.
void write_to_file ()
 Write the file either in parts or whole (depending on constructor param).
void finalize_buffered_write ()
 To be called after the file has been written via write_file_buffered().
bool enough_time_elapsed_since_last_write () const
 Returns whether enough time has elapsed since the last write to file.

Detailed Description

Handles all file I/O operations for FileAudioSource.

Definition at line 247 of file file_audio_source.h.

Constructor & Destructor Documentation

◆ FileAudioSourceWriter()

zrythm::dsp::FileAudioSourceWriter::FileAudioSourceWriter ( const FileAudioSource & source,
fs::path path,
bool parts )
explicit

Writes the given audio clip data to a file.

Parameters
partsIf true, only write new data.
See also
FileAudioSource.frames_written.
Exceptions
ZrythmExceptionon error.

Member Function Documentation

◆ enough_time_elapsed_since_last_write()

bool zrythm::dsp::FileAudioSourceWriter::enough_time_elapsed_since_last_write ( ) const

Returns whether enough time has elapsed since the last write to file.

This is used so that writing to file is done in chunks.

◆ write_to_file()

void zrythm::dsp::FileAudioSourceWriter::write_to_file ( )

Write the file either in parts or whole (depending on constructor param).

If parts, this should be called periodically while the source is expanding in memory to write any unwritten data to the file.


The documentation for this class was generated from the following file: