Loading...
Searching...
No Matches

Detailed Description

Where a looper's takes go, and the names they get.

A saved document keeps them next to it, in a "Takes" folder, which goes along with the document when it is copied. An unsaved one keeps them in the application's data folder, in a folder of its own; nothing deletes them there, so a crash loses nothing.

Every take gets a name of its own: a sound file is cached by its path, and a take written over an earlier one would play the earlier one's audio.

Public Member Functions

QString base (int number) const
 
QString file (int number, int layer) const
 
const std::string & next_path (int slot, int &number, int layer)
 
const std::string & take_base (int slot) const noexcept
 The path of a take's files without the layer and the extension.
 
const std::string & path (int slot) const noexcept
 

Static Public Member Functions

static QString folder_for (const score::DocumentContext &ctx)
 
static std::shared_ptr< take_writer > make (const score::DocumentContext &ctx, std::string_view prefix, std::string_view extension)
 Main thread only.
 

Public Attributes

QString folder
 
QString prefix
 
QString extension
 
std::array< std::string, slots > paths
 
std::array< std::string, slots > bases
 
std::function< void(const view_message &)> tell_views
 

Static Public Attributes

static constexpr int slots = 4
 

Member Function Documentation

◆ next_path()

const std::string & Nodes::Looper::take_writer::next_path ( int  slot,
int &  number,
int  layer 
)
inline

Worker thread: the file of a take, the mix when layer is -1, else one of its layers. A take has one number for all its files; 0 asks for the first number free in the folder, which is then set.

Member Data Documentation

◆ slots

constexpr int Nodes::Looper::take_writer::slots = 4
staticconstexpr

Takes in flight at once: a slot's path is written by the worker and read by the processing thread once the worker's result has reached it.

◆ tell_views

std::function<void(const view_message&)> Nodes::Looper::take_writer::tell_views

Set on the main thread before any take is written. Called by a worker, the looper maybe gone: tells the looper's views what it left when it stopped.


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