Table of Contents

Interface IProfileEditorService

Namespace
Artemis.UI.Shared.Services.ProfileEditor
Assembly
Artemis.UI.Shared.dll

Provides access the the profile editor back-end logic.

public interface IProfileEditorService : IArtemisSharedUIService

Properties

FocusMode

Gets an observable of the suspended keybindings state.

IObservable<ProfileEditorFocusMode> FocusMode { get; }

Property Value

IObservable<ProfileEditorFocusMode>

History

Gets an observable of the current editor history.

IObservable<ProfileEditorHistory?> History { get; }

Property Value

IObservable<ProfileEditorHistory>

LayerProperty

Gets an observable of the currently selected layer property.

IObservable<ILayerProperty?> LayerProperty { get; }

Property Value

IObservable<ILayerProperty>

PixelsPerSecond

Gets an observable of the zoom level.

IObservable<int> PixelsPerSecond { get; }

Property Value

IObservable<int>

Playing

Gets an observable of the profile preview playing state.

IObservable<bool> Playing { get; }

Property Value

IObservable<bool>

ProfileConfiguration

Gets an observable of the currently selected profile configuration.

IObservable<ProfileConfiguration?> ProfileConfiguration { get; }

Property Value

IObservable<ProfileConfiguration>

ProfileElement

Gets an observable of the currently selected profile element.

IObservable<RenderProfileElement?> ProfileElement { get; }

Property Value

IObservable<RenderProfileElement>

SelectedKeyframes

Gets an observable read only collection of selected keyframes.

ReadOnlyObservableCollection<ILayerPropertyKeyframe> SelectedKeyframes { get; }

Property Value

ReadOnlyObservableCollection<ILayerPropertyKeyframe>

SuspendedEditing

Gets an observable of the suspended state.

IObservable<bool> SuspendedEditing { get; }

Property Value

IObservable<bool>

Time

Gets an observable of the profile preview playback time.

IObservable<TimeSpan> Time { get; }

Property Value

IObservable<TimeSpan>

Methods

ChangeCurrentLayerProperty(ILayerProperty?)

Change the selected layer property.

void ChangeCurrentLayerProperty(ILayerProperty? layerProperty)

Parameters

layerProperty ILayerProperty

The layer property to select.

ChangeCurrentProfileConfiguration(ProfileConfiguration?)

Changes the selected profile by its ProfileConfiguration.

Task ChangeCurrentProfileConfiguration(ProfileConfiguration? profileConfiguration)

Parameters

profileConfiguration ProfileConfiguration

The profile configuration of the profile to select.

Returns

Task

ChangeCurrentProfileElement(RenderProfileElement?)

Changes the selected profile element.

void ChangeCurrentProfileElement(RenderProfileElement? renderProfileElement)

Parameters

renderProfileElement RenderProfileElement

The profile element to select.

ChangeFocusMode(ProfileEditorFocusMode)

Changes the current focus mode.

void ChangeFocusMode(ProfileEditorFocusMode focusMode)

Parameters

focusMode ProfileEditorFocusMode

The new focus mode.

ChangePixelsPerSecond(int)

Changes the current pixels per second

void ChangePixelsPerSecond(int pixelsPerSecond)

Parameters

pixelsPerSecond int

The new pixels per second.

ChangeSuspendedEditing(bool)

Changes the current suspended state.

void ChangeSuspendedEditing(bool suspend)

Parameters

suspend bool

The new suspended state.

ChangeTime(TimeSpan)

Changes the current profile preview playback time.

void ChangeTime(TimeSpan time)

Parameters

time TimeSpan

The new time.

CreateAndAddFolder(ProfileElement)

Creates a new folder as a sibling or child of the given target.

Folder CreateAndAddFolder(ProfileElement target)

Parameters

target ProfileElement

The target, if this is a layer the new layer will become a sibling, otherwise a child.

Returns

Folder

The resulting folder.

CreateAndAddLayer(ProfileElement)

Creates a new layer with the default brush and all current LEDs as a sibling or child of the given target.

Layer CreateAndAddLayer(ProfileElement target)

Parameters

target ProfileElement

The target, if this is a layer the new layer will become a sibling, otherwise a child.

Returns

Layer

The resulting layer.

CreateCommandScope(string)

Creates a new command scope which can be used to group undo/redo actions of multiple commands.

ProfileEditorCommandScope CreateCommandScope(string name)

Parameters

name string

The name of the command scope.

Returns

ProfileEditorCommandScope

The command scope that will group any commands until disposed.

ExecuteCommand(IProfileEditorCommand)

Executes the provided command and adds it to the history.

void ExecuteCommand(IProfileEditorCommand command)

Parameters

command IProfileEditorCommand

The command to execute.

Pause()

Pauses profile preview playback.

void Pause()

Play()

Resumes profile preview playback.

void Play()

RoundTime(TimeSpan)

Rounds the given time to something appropriate for the current zoom level.

TimeSpan RoundTime(TimeSpan time)

Parameters

time TimeSpan

The time to round

Returns

TimeSpan

The rounded time.

SaveProfileAsync()

Asynchronously saves the current profile.

Task SaveProfileAsync()

Returns

Task

A task representing the save action.

SelectKeyframe(ILayerPropertyKeyframe?, bool, bool)

Selects the provided keyframe.

void SelectKeyframe(ILayerPropertyKeyframe? keyframe, bool expand, bool toggle)

Parameters

keyframe ILayerPropertyKeyframe

The keyframe to select.

expand bool

If true expands the current selection; otherwise replaces it with only the provided keyframe.

toggle bool

If true toggles the selection and only for the provided keyframe.

SelectKeyframes(IEnumerable<ILayerPropertyKeyframe>, bool)

Selects the provided keyframes.

void SelectKeyframes(IEnumerable<ILayerPropertyKeyframe> keyframes, bool expand)

Parameters

keyframes IEnumerable<ILayerPropertyKeyframe>

The keyframes to select.

expand bool

If true expands the current selection; otherwise replaces it with only the provided keyframes.

SnapToTimeline(TimeSpan, TimeSpan, bool, bool, List<TimeSpan>?)

Snaps the given time to the closest relevant element in the timeline, this can be the cursor, a keyframe or a segment end.

TimeSpan SnapToTimeline(TimeSpan time, TimeSpan tolerance, bool snapToSegments, bool snapToCurrentTime, List<TimeSpan>? snapTimes = null)

Parameters

time TimeSpan

The time to snap.

tolerance TimeSpan

How close the time must be to snap.

snapToSegments bool

Enable snapping to timeline segments.

snapToCurrentTime bool

Enable snapping to the current time of the editor.

snapTimes List<TimeSpan>

An optional extra list of times to snap to.

Returns

TimeSpan

The snapped time.