Loading...
Searching...
No Matches

Classes

struct  box
 

Public Types

using clock = std::chrono::steady_clock
 

Public Member Functions

void watch (const auto &exported)
 
bool live () const noexcept
 
bool waiting () const noexcept
 A take asked for is still awaited from a looper that runs.
 
void receive (const view_message &m) noexcept
 
std::pair< int, int > lane_passes (int lane) const noexcept
 
bool take_has_layers () const noexcept
 The last take has the passes as they are, each in a file.
 
std::vector< std::string > lane_files (int lane) const
 
void request_part (int lane)
 Asks for the files of a lane's passes, unless they are being asked for.
 
bool preparing (int lane) const noexcept
 
bool has_take () const noexcept
 
bool placeable () const noexcept
 The last take can go in the timeline.
 
bool taking_in () const noexcept
 A pass is being taken in: the last take does not have it.
 
bool saving () const noexcept
 
bool take_has_export () const noexcept
 
bool needs_take () const noexcept
 
std::vector< std::string > send_files () const
 
void request_take ()
 Asks for a take of the loop as it is now, unless one was asked already.
 
void send ()
 The take in one box named after it, a slot per file, the mix first.
 
void send_now ()
 
void paint (auto ctx)
 
void paint_preparing (auto &ctx)
 The lane whose files are being written for a drag.
 
const char * speed_name () const noexcept
 The speed the loop plays at, empty at x1.
 
int lane_count () const noexcept
 
double lane_height () const noexcept
 
int pass_of_lane (int lane) const noexcept
 The pass a lane shows alone, -1 for a lane of several passes or none.
 
box erase_box (int lane) const noexcept
 The erase button of a lane, at its right edge.
 
box mute_box (int lane) const noexcept
 The mute button of a lane, left of its erase button.
 
bool lane_muted (int lane) const noexcept
 
int selected_lane () const noexcept
 The lane of the pass Layer says, when it has one of its own, else -1.
 
rgba lane_background (int lane) const noexcept
 
void outline_selected (auto &ctx, double top, double lh) const
 
int erase_lane_at (double x, double y) const noexcept
 The lane whose erase button is at (x, y), -1 for none.
 
int mute_lane_at (double x, double y) const noexcept
 The lane whose mute button is at (x, y), -1 for none.
 
void paint_erase_boxes (auto &ctx)
 
void paint_lanes (auto &ctx, double top, double)
 
void paint_notes (auto &ctx, double top, double)
 
void paint_values (auto &ctx, double top, double)
 
bool in_send (double x, double y) const noexcept
 
int lane_at (double x, double y) const noexcept
 The lane at (x, y), -1 for none.
 
bool mouse_press (double x, double y)
 
void mouse_move (double, double)
 
void mouse_release (double x, double y)
 
halp::drag_payload drag_payload (double x, double y) const
 

Static Public Member Functions

static constexpr double width ()
 
static constexpr double height ()
 
static rgba mode_color (int mode, bool empty) noexcept
 
static const char * mode_name (int mode) noexcept
 
static rgba dimmed (rgba c) noexcept
 What is not heard: a third of its colour over the background.
 
static rgba lane_color (int lane, int lanes) noexcept
 
static double lanes_height () noexcept
 
static double lanes_width () noexcept
 

Public Attributes

view_message state {}
 
bool has_state {}
 
std::function< void()> update
 
std::function< void(halp::timeline_clip)> send_to_timeline
 Set by the host when it can place clips in the timeline.
 
std::function< void(erase_request)> erase
 
int m_requests {}
 
int m_waiting {}
 
bool m_send_waiting {}
 
TakeFiles m_export {TakeFiles::Mix}
 
uint64_t m_stopped_looper {}
 
int m_stopped_stops {-1}
 
clock::time_point m_last_message {}
 
int m_part_waiting {}
 
int m_part_lane {-1}
 
int m_part_first {-1}
 
int m_part_last {-1}
 
std::vector< std::string > m_part_files
 
bool m_part_placeable {}
 
halp::clip_stretch m_part_stretch {}
 
bool m_button_pressed {}
 
bool m_dragged {}
 

Static Public Attributes

static constexpr double header = 26.
 
static constexpr double send_w = 56.
 
static constexpr auto silent_after = std::chrono::milliseconds(300)
 
static constexpr double lanes_top = header
 
static constexpr double lanes_x = 4.
 
static constexpr double max_lane_height = 72.
 
static constexpr double min_lane_height = 6.
 
static constexpr rgba lane_bg {34, 34, 38, 255}
 The selected lane: a lighter background, and an outline.
 
static constexpr rgba selected_bg {46, 46, 54, 255}
 

Member Typedef Documentation

◆ clock

using Nodes::Looper::looper_view::clock = std::chrono::steady_clock

A running looper sends some thirty messages a second. One that has sent none for longer is paused or gone with the score's stop: what it showed last is not being taken in any more, and a take asked of it may never come, so the last take is the one there is.

Member Function Documentation

◆ height()

static constexpr double Nodes::Looper::looper_view::height ( )
inlinestaticconstexpr

As tall as the looper's settings next to it. The size does not change with the lanes: they share the room under the header.

◆ lane_files()

std::vector< std::string > Nodes::Looper::looper_view::lane_files ( int  lane) const
inline

The files a lane drags as it is now: empty while they are to be asked for or being written.

◆ lane_passes()

std::pair< int, int > Nodes::Looper::looper_view::lane_passes ( int  lane) const
inlinenoexcept

The passes of a lane, from the oldest: the oldest passes share the first lane when there are more passes than lanes.

◆ needs_take()

bool Nodes::Looper::looper_view::needs_take ( ) const
inlinenoexcept

Send places a take the looper is asked for: one of the loop as it is now, a pass being taken in, or one with the files Export says. A looper that does not run is asked nothing: the take its stop left has them all.

◆ paint_notes()

void Nodes::Looper::looper_view::paint_notes ( auto &  ctx,
double  top,
double   
)
inline

One small piano roll per lane, over the pitches of that lane. Notes that are not heard are dimmed.

◆ paint_values()

void Nodes::Looper::looper_view::paint_values ( auto &  ctx,
double  top,
double   
)
inline

One lane per pass: the numbers it holds as steps, over the numbers the lane holds; what is not a number as a line across the lane's middle; impulses and the start of values that are not numbers as ticks. What is not heard is dimmed.

◆ send_files()

std::vector< std::string > Nodes::Looper::looper_view::send_files ( ) const
inline

The files of the last take Send places, the mix first: the ones Export says, or all it has when it has none of them.

◆ take_has_export()

bool Nodes::Looper::looper_view::take_has_export ( ) const
inlinenoexcept

The last take has the files Export says, a take asked for having all of them.

Member Data Documentation

◆ erase

std::function<void(erase_request)> Nodes::Looper::looper_view::erase

Set by the looper's UI bus: asks the looper to erase a pass, or for a take.

◆ m_button_pressed

bool Nodes::Looper::looper_view::m_button_pressed {}

A press on the header's button: a click sends the take, a drag from it drags all of its files.

◆ m_export

TakeFiles Nodes::Looper::looper_view::m_export {TakeFiles::Mix}

The files Send and the Send grip place, as the Export control says. The view follows the control itself: it is changed while the looper does not run as well.

◆ m_part_waiting

int Nodes::Looper::looper_view::m_part_waiting {}

A lane's own drag: the files of its passes alone. The last take has them when it has a file per pass and the passes did not change since; else the view asks for them, the lane shows it is preparing them, and the drag starts with the next move once they are there.

◆ m_requests

int Nodes::Looper::looper_view::m_requests {}

While a pass is taken in, the last take lacks it, and it may lack the files Export says: a drag or a Send asks for a take of the loop as it is now, and waits for it. A drag starts with the next move of the mouse once it is there, if the button is still held; else the take is the one the next drag or Send gives.

◆ m_stopped_looper

uint64_t Nodes::Looper::looper_view::m_stopped_looper {}

The looper that stopped last, and how many times it had: what it sent before is older than what its stop left.

◆ max_lane_height

constexpr double Nodes::Looper::looper_view::max_lane_height = 72.
staticconstexpr

A lane is not taller than this, so that a few lanes stay a size a lane reads at, and not shorter than that, which max_lanes lanes fit in.


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