Skip to main content

Store

Struct Store 

Source
pub struct Store {
Show 18 fields pub recording: Option<Recording>, pub loaded: Vec<Recording>, pub inspected: Option<(PathBuf, String)>, pub timeline: TimelineState, pub workspace: Workspace, pub session: Session, pub opening: Option<String>, pub status: String, pub render_info: String, pub pyramids: HashMap<String, (u64, u64)>, pub doc: SessionDoc, pub picked_channel: Option<usize>, pub picked_op: Option<String>, pub job: Option<RunningJob>, pub device: Option<DeviceInfo>, pub last_failed: Option<(String, String)>, pub node_status: HashMap<String, NodeRun>, pub floating: Vec<Floating>, /* private fields */
}

Fields§

§recording: Option<Recording>

The active recording (what Explore draws and Processing edits).

§loaded: Vec<Recording>

Other recordings loaded this session (each file once): switching to one is instant.

§inspected: Option<(PathBuf, String)>

A recording’s source the Inspector shows (picked under Recordings; a view’s focus clears it).

§timeline: TimelineState§workspace: Workspace§session: Session§opening: Option<String>

What is being opened, while a file opens.

§status: String§render_info: String

Render time and density of the latest frame (status bar).

§pyramids: HashMap<String, (u64, u64)>

Pyramid progress per source id being built: (samples built, of all).

§doc: SessionDoc

The session document: views, their op chains, display and linked sortings.

§picked_channel: Option<usize>

The channel the Processing panel is about, and the op selected in it.

§picked_op: Option<String>§job: Option<RunningJob>§device: Option<DeviceInfo>

The compute device processing runs on (named once at start, off the UI thread).

§last_failed: Option<(String, String)>

The last job that failed: its label and why (cleared when the next job starts).

§node_status: HashMap<String, NodeRun>§floating: Vec<Floating>

Floating windows, front last.

Implementations§

Source§

impl Store

Source

pub fn new(session: Session, session_path: Option<PathBuf>) -> Self

Source

pub fn attach_document(&mut self, path: PathBuf, cx: &mut Context<'_, Self>)

Loads the session document at path (an unreadable one is reported and replaced by an empty one when first saved) and follows the file: edits made outside the app (an agent) are applied as they land.

Source

pub fn execute( &mut self, cmd: SessionCommand, cx: &mut Context<'_, Self>, ) -> Result<Changed, CommandError>

Runs a command on the session document, saves it and emits what changed.

Source

pub fn undo(&mut self, redo: bool, cx: &mut Context<'_, Self>)

Back to the document before the last change (redo: forward again).

Source

pub fn events_of(&self, set: &EventSetDoc) -> Option<Arc<Vec<Event>>>

The events of set, once its table is read (Self::add_event_set, or on opening the recording).

Source

pub fn add_event_set(&mut self, set: EventSetDoc, cx: &mut Context<'_, Self>)

Reads set’s table (again) and adds the set to the session, or updates it.

Source

pub fn epochs_from_events(&mut self, id: &str, cx: &mut Context<'_, Self>)

Every event of set id that has an offset becomes an epoch of type response, named after the set (one change: one undo step).

Source

pub fn next_event( &mut self, id: &str, cx: &mut Context<'_, Self>, ) -> Option<f64>

Moves the window to the first event of set id after the window’s centre (wrapping to the first), and returns its onset.

Source

pub fn read_event_tables(&mut self)

Reads the tables of the session’s event sets not read yet (a session opened from a file).

Source

pub fn open_floating(&mut self, f: Floating, cx: &mut Context<'_, Self>)

Opens a floating window (one of each kind and target).

Source

pub fn close_floating(&mut self, index: usize, cx: &mut Context<'_, Self>)

Source

pub fn active_view(&self) -> Option<&ViewDoc>

The active view of the session document.

Source

pub fn view_source(&self, view: &ViewDoc) -> String

Source id (of the open recording) a view reads.

Source

pub fn signal_for(&self, source: &str) -> Option<Arc<dyn SignalBackend>>

What views of source draw: the active view’s processed preview when it reads source, shows processed and has enabled ops; else None (the raw recording).

Source

pub fn view_for_source( &mut self, source: &str, cx: &mut Context<'_, Self>, ) -> Option<String>

The session view showing source of the open recording with all its channels (made when none does; it becomes the active view then); None for a recording without a file.

Source

pub fn close_view_if_untouched(&mut self, id: &str, cx: &mut Context<'_, Self>)

Closes session view id when it holds no work: no ops (its source feeds it directly), all channels, its default name, no plugin data. Views with work stay (the Pipeline shows them).

Source

pub fn preview_of(&self, view: &str) -> Option<Arc<dyn SignalBackend>>

What session view view draws when it shows its processed preview (it has enabled ops and Show::Processed); None: the recording as stored.

Source

pub fn preview_covers(&self, source: &str, samples: u64) -> Option<bool>

Whether the visible window of samples samples is previewed processed (else raw).

Source

pub fn view_plan(&self, v: &ViewDoc, total: usize) -> Result<ViewPlan, String>

How view v is previewed, as the pipeline runs it: group, the channels it reads (its subset, or all total, through the remaps that open its chain: they fold into the read and may drop); steps, its processing on the device with each step’s key (a remap between processing steps reorders there and keeps every channel); shown, the channels it ends with (through the remaps after the last processing step: they may drop). Resampling is not previewed.

Source

pub fn view_channels( &self, v: &ViewDoc, total: usize, ) -> Result<Vec<usize>, String>

The channels view v shows, in order (see Self::view_plan).

Source

pub fn redraw(&mut self, cx: &mut Context<'_, Self>)

Views redraw (a plugin’s overlay changed).

Source

pub fn pick_channel( &mut self, channel: Option<usize>, cx: &mut Context<'_, Self>, )

The channel the Processing panel is about (None: none).

Source

pub fn pick_op(&mut self, op: Option<String>, cx: &mut Context<'_, Self>)

The op of the active view selected in the Processing panel.

Source

pub fn start_job_on( &mut self, nodes: impl IntoIterator<Item = String>, label: impl Into<String>, start: impl FnOnce(Box<dyn Fn(JobMessage) + Send + Sync>) -> Cancel, done: impl FnOnce(&mut Self, PathBuf, &mut Context<'_, Self>) + 'static, cx: &mut Context<'_, Self>, ) -> bool

Starts a job: start gets the sender of its messages and returns its cancel handle; done runs on the UI thread with the file it wrote. Starts a job (Self::start_job) that works on graph nodes nodes: they show running on the Pipeline canvas until it ends, then done or failed. false (nothing marked) when another job is running.

Source

pub fn start_job( &mut self, label: impl Into<String>, start: impl FnOnce(Box<dyn Fn(JobMessage) + Send + Sync>) -> Cancel, done: impl FnOnce(&mut Self, PathBuf, &mut Context<'_, Self>) + 'static, cx: &mut Context<'_, Self>, ) -> bool

Source

pub fn cancel_job(&mut self, cx: &mut Context<'_, Self>)

Source

pub fn write_node(&mut self, id: &str, cx: &mut Context<'_, Self>)

Writes the chain of graph node id (a write or view node) to <recording>.<id>.processed.zarr next to its recording.

Source

pub fn writes_of(&self, id: &str) -> Vec<String>

The write nodes fed by source node id (with their chains).

Source

pub fn write_source(&mut self, id: &str, cx: &mut Context<'_, Self>)

Writes every output of source node id in one read of its recording.

Source

pub fn show_view(&mut self, id: &str, cx: &mut Context<'_, Self>)

Shows view id in Explore, opening its recording when another one is open.

Source

pub fn saved_events_of(&self, view: &ViewDoc) -> Option<&EventSetDoc>

The event set a Write of view’s chain saved (the same recording and ops), if any.

Source

pub fn write_active_view(&mut self, cx: &mut Context<'_, Self>)

Writes the active view (its recording through its enabled ops) to <recording>.<view>.processed.zarr next to the recording.

Source

pub fn palette(&self) -> Palette

Plot colours: dark with the dark theme, or when the user keeps plots dark.

Source

pub fn is_dark(&self) -> bool

Whether the app is drawn dark now (the user’s choice or the system’s).

Source

pub fn set_dark(&mut self, dark: bool, cx: &mut Context<'_, Self>)

The theme the app is drawn with now.

Source

pub fn set_theme_choice( &mut self, dark: Option<bool>, cx: &mut Context<'_, Self>, )

The user’s theme choice (None: follow the system), saved.

Source

pub fn set_accent(&mut self, accent: Option<Rgb>, cx: &mut Context<'_, Self>)

The accent the user picked (None: lime), saved. The caller applies the look (DspApp::apply_theme).

Source

pub fn set_servers( &mut self, servers: Vec<ServerProfile>, cx: &mut Context<'_, Self>, )

The servers the user works with (Settings), saved.

Source

pub fn set_results_dir( &mut self, dir: Option<PathBuf>, cx: &mut Context<'_, Self>, )

Where results fetched from servers go (None: the default), saved.

Source

pub fn set_reopen_last(&mut self, on: bool, cx: &mut Context<'_, Self>)

Whether the last recording opens at start, saved.

Source

pub fn forget_recent(&mut self, path: Option<&Path>, cx: &mut Context<'_, Self>)

Forgets path from the recent lists (None: all of them), saved. The files stay.

Source

pub fn set_runtime( &mut self, runtime: Option<String>, cx: &mut Context<'_, Self>, )

The compute runtime for the next start (None: the first compiled in), saved.

Source

pub fn set_dark_plots(&mut self, on: bool, cx: &mut Context<'_, Self>)

Source

pub fn sources(&self) -> Option<&Arc<SourceSet>>

Source

pub fn suggest_tuning_once(&mut self, cx: &mut Context<'_, Self>)

At the first launch, says how to avoid the slow first run.

Source

pub fn set_pipeline_dock(&mut self, on: bool)

Remembers whether Explore shows the Pipeline docked.

Source

pub fn set_explore_docks(&mut self, left: bool, right: bool, bottom: bool)

Source

pub fn panel_width(&self, key: &str, default: f32) -> f32

The panel shown on the right side bar (saved). A resizable panel’s size (default until the user drags it).

Source

pub fn panel_open(&self, key: &str) -> bool

Whether a side panel shows (true until the user hides it).

Source

pub fn set_panel_open( &mut self, key: &str, open: bool, cx: &mut Context<'_, Self>, )

Source

pub fn set_panel_width( &mut self, key: &str, width: f32, cx: &mut Context<'_, Self>, )

Source

pub fn set_explore_right(&mut self, key: &str)

Source

pub fn plugin_changed(&mut self, cx: &mut Context<'_, Self>)

A plugin’s own state changed (its panels redraw; views do not).

Source

pub fn set_explore_views(&mut self, views: Vec<SavedTimeView>)

Source

pub fn push_recent_sorting(&mut self, path: &Path)

Source

pub fn set_events( &mut self, events: Arc<SpikeEventStore>, cx: &mut Context<'_, Self>, )

Source

pub fn set_device(&mut self, device: DeviceInfo, cx: &mut Context<'_, Self>)

Records the compute device found at start (the status bar and Settings › Compute show it).

Source

pub fn set_status( &mut self, text: impl Into<String>, cx: &mut Context<'_, Self>, )

Source

pub fn set_render_info(&mut self, text: String, cx: &mut Context<'_, Self>)

Latest frame’s numbers (no event: the status bar observes the store).

Source

pub fn open(&mut self, path: PathBuf, cx: &mut Context<'_, Self>)

Lists and opens path’s sources on a background thread.

Source

pub fn load_beside(&mut self, path: PathBuf, cx: &mut Context<'_, Self>)

Loads the recording at path beside the open one (it stays the active one), for views of both; AppEvent::RecordingLoaded when it is ready (at once when already loaded).

Source

pub fn sources_of(&self, path: &Path) -> Option<&Arc<SourceSet>>

The sources of the loaded recording at path (the open one, or one loaded beside it).

Source

pub fn time_offset_of(&self, path: &Path) -> f64

Seconds to add to the open recording’s time to get path’s: the difference of their placements on the session’s time (0 when either is not placed).

Source

pub fn open_remote( &mut self, profile: ServerProfile, path: String, cx: &mut Context<'_, Self>, )

Opens the recording at path on a server (a dspk:// path: drawn from the server’s pyramid, read there, nothing copied whole), like any recording: a view, recent files.

Source

pub fn open_synthetic( &mut self, channels: usize, sample_rate: f64, duration_sec: f64, cx: &mut Context<'_, Self>, )

Opens a procedural recording (noise, hum, drifting units) computed on demand.

Source

pub fn install(&mut self, recording: Recording, cx: &mut Context<'_, Self>)

Installs a recording directly (tests, command line).

Source

pub fn inspect( &mut self, what: Option<(PathBuf, String)>, cx: &mut Context<'_, Self>, )

Shows source of the recording at path in the Inspector (None: back to the view).

Source

pub fn recordings(&self) -> impl Iterator<Item = &Recording>

Every loaded recording, the active one first.

Source

pub fn close_recording( &mut self, path: Option<&Path>, cx: &mut Context<'_, Self>, )

Unloads the recording at path (None: the active one). Its views stay in the session document; closing the active one switches to the last loaded, or to no recording.

Source

pub fn set_workspace( &mut self, workspace: Workspace, cx: &mut Context<'_, Self>, )

Source

pub fn focus_pyramid( &mut self, source: &str, focus_sec: f64, cx: &mut Context<'_, Self>, )

Views of source look at focus_sec: its backend builds the min/max pyramid there first (the build starts on the first call; later calls move the focus). Progress is followed once per source and emitted as AppEvent::PyramidProgress.

Source

pub fn pyramid_label(&self) -> Option<String>

Building overview 12 / 45 s while the default source’s pyramid builds.

Source

pub fn selection(&self, source: &str) -> &[usize]

Channels of source shown, in display order.

Source

pub fn set_selection( &mut self, source: &str, channels: impl IntoIterator<Item = usize>, cx: &mut Context<'_, Self>, )

Replaces the selection (duplicates and out-of-range channels dropped, order kept).

Source

pub fn toggle_channel( &mut self, source: &str, channel: usize, cx: &mut Context<'_, Self>, )

Adds or removes one channel (added channels keep ascending order).

Source

pub fn select_all(&mut self, source: &str, cx: &mut Context<'_, Self>)

Source

pub fn select_none(&mut self, source: &str, cx: &mut Context<'_, Self>)

Source

pub fn select_invert(&mut self, source: &str, cx: &mut Context<'_, Self>)

Source

pub fn select_ranges( &mut self, source: &str, text: &str, cx: &mut Context<'_, Self>, ) -> Result<(), String>

Applies a range expression (0-31, 40); the error message to show otherwise.

Source

pub fn pan_time(&mut self, dt: f64, cx: &mut Context<'_, Self>)

Moves the window by dt seconds (the playhead stays).

Source

pub fn pan_fraction(&mut self, fraction: f64, cx: &mut Context<'_, Self>)

Moves the window by a fraction of its length.

Source

pub fn zoom_at(&mut self, factor: f64, anchor: f64, cx: &mut Context<'_, Self>)

Scales the window by factor, keeping the time at anchor (0 = start, 1 = end) in place.

Source

pub fn set_window(&mut self, start: f64, end: f64, cx: &mut Context<'_, Self>)

Sets the window to [start, end] seconds.

Source

pub fn scrub_to(&mut self, t: f64, cx: &mut Context<'_, Self>)

Puts the playhead at t seconds (the window follows it).

Source

pub fn jump_to_start(&mut self, cx: &mut Context<'_, Self>)

Source

pub fn jump_to_end(&mut self, cx: &mut Context<'_, Self>)

Source

pub fn step(&mut self, forward: bool, cx: &mut Context<'_, Self>)

Steps the playhead by a tenth of the window.

Source

pub fn toggle_loop(&mut self, cx: &mut Context<'_, Self>)

Source

pub fn set_speed(&mut self, speed: f64, cx: &mut Context<'_, Self>)

Source

pub fn toggle_play(&mut self, cx: &mut Context<'_, Self>)

Trait Implementations§

Auto Trait Implementations§

§

impl !RefUnwindSafe for Store

§

impl !UnwindSafe for Store

§

impl Forget for Store

§

impl Freeze for Store

§

impl Move for Store

§

impl Send for Store

§

impl Sync for Store

§

impl Unpin for Store

§

impl UnsafeUnpin for Store

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> Downcast for T
where T: Any,

Source§

fn into_any(self: Box<T>) -> Box<dyn Any>

Convert Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.
Source§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

Convert Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be further downcast into Rc<ConcreteType> where ConcreteType implements Trait.
Source§

fn as_any(&self) -> &(dyn Any + 'static)

Convert &Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &Any’s vtable from &Trait’s.
Source§

fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)

Convert &mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &mut Any’s vtable from &mut Trait’s.
Source§

impl<T> Downcast for T
where T: Any,

Source§

fn into_any(self: Box<T>) -> Box<dyn Any>

Converts Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>, which can then be downcast into Box<dyn ConcreteType> where ConcreteType implements Trait.
Source§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

Converts Rc<Trait> (where Trait: Downcast) to Rc<Any>, which can then be further downcast into Rc<ConcreteType> where ConcreteType implements Trait.
Source§

fn as_any(&self) -> &(dyn Any + 'static)

Converts &Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &Any’s vtable from &Trait’s.
Source§

fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)

Converts &mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &mut Any’s vtable from &mut Trait’s.
Source§

impl<T> Downcast<T> for T

Source§

fn downcast(&self) -> &T

Source§

impl<T> DowncastSend for T
where T: Any + Send,

Source§

fn into_any_send(self: Box<T>) -> Box<dyn Any + Send>

Converts Box<Trait> (where Trait: DowncastSend) to Box<dyn Any + Send>, which can then be downcast into Box<ConcreteType> where ConcreteType implements Trait.
Source§

impl<T> DowncastSync for T
where T: Any + Send + Sync,

Source§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Send + Sync> ⓘ

Convert Arc<Trait> (where Trait: Downcast) to Arc<Any>. Arc<Any> can then be further downcast into Arc<ConcreteType> where ConcreteType implements Trait.
Source§

impl<T> DowncastSync for T
where T: Any + Send + Sync,

Source§

fn into_any_sync(self: Box<T>) -> Box<dyn Any + Send + Sync>

Converts Box<Trait> (where Trait: DowncastSync) to Box<dyn Any + Send + Sync>, which can then be downcast into Box<ConcreteType> where ConcreteType implements Trait.
Source§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Send + Sync> ⓘ

Converts Arc<Trait> (where Trait: DowncastSync) to Arc<Any>, which can then be downcast into Arc<ConcreteType> where ConcreteType implements Trait.
Source§

impl<T> ErasedDestructor for T
where T: 'static,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoComptime for T

Source§

fn comptime(self) -> Self

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> Upcast<T> for T

Source§

fn upcast(&self) -> Option<&T>

Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WasmNotSend for T
where T: Send,

Source§

impl<T> WasmNotSendSync for T

Source§

impl<T> WasmNotSync for T
where T: Sync,

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more