NAP
Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
SequenceTrackView Class Referenceabstract

#include <sequencetrackview.h>

Public Member Functions

 SequenceTrackView (SequenceEditorGUIView &view, SequenceEditorGUIState &state)
 
virtual ~SequenceTrackView ()=default
 
virtual void handleActions ()
 
virtual void showInspector (const SequenceTrack &track)
 
virtual void showTrack (const SequenceTrack &track)
 

Static Public Member Functions

static bool Combo (const char *label, int *currIndex, std::vector< std::string > &values)
 
static bool ListBox (const char *label, int *currIndex, std::vector< std::string > &values)
 
static std::string formatTimeString (double time)
 

Protected Member Functions

void handleTrackOptionsPopup ()
 
virtual void showInspectorContent (const SequenceTrack &track)=0
 
virtual void showTrackContent (const SequenceTrack &track, const ImVec2 &trackTopLeft)=0
 
void registerActionHandler (const rttr::type &type, const std::function< void()> &handler)
 
const SequencePlayergetPlayer ()
 
SequenceEditorgetEditor ()
 

Protected Attributes

SequenceEditorGUIViewmView
 
SequenceEditorGUIStatemState
 
std::unordered_map< rttr::type, std::function< void()> > mActionHandlers
 
SequenceGUIServicemService
 

Description

Base class of track views Responsible for drawing a track of a specific type Needs to be extended for each track type. F.E. SequenceCurveTrackView is responsible for drawing curve tracks

Inheritance diagram for SequenceTrackView:
[legend]
Collaboration diagram for SequenceTrackView:
[legend]

Constructor & Destructor Documentation

◆ SequenceTrackView()

Constructor

Parameters
viewreference to view
stateobject that contains the active gui state

◆ ~SequenceTrackView()

virtual ~SequenceTrackView ( )
virtualdefault

Destructor

Member Function Documentation

◆ Combo()

static bool Combo ( const char *  label,
int *  currIndex,
std::vector< std::string > &  values 
)
static

Combobox that takes std::vector as input

Parameters
labellabel of box
currIndexcurrent index of combo box
valuesvector of string values
Returns
true if something is selected

◆ formatTimeString()

static std::string formatTimeString ( double  time)
static

formats time ( seconds ) to human readable time

Parameters
timetime
Returns
string with readable time

◆ getEditor()

SequenceEditor& getEditor ( )
protected

◆ getPlayer()

const SequencePlayer& getPlayer ( )
protected

◆ handleActions()

virtual void handleActions ( )
virtual

handles any actions that are created upon show this might be useful when certain actions in tracks are overlapping and/ or when we create an action that needs to do something in the next frame update

Reimplemented in SequenceCurveTrackView.

◆ handleTrackOptionsPopup()

void handleTrackOptionsPopup ( )
protected

◆ ListBox()

static bool ListBox ( const char *  label,
int *  currIndex,
std::vector< std::string > &  values 
)
static

ListBox that takes std::vector as input

Parameters
labellabel of box
currIndexcurrent index of combo box
valuesvector of string values
Returns
true if something is selected

◆ registerActionHandler()

void registerActionHandler ( const rttr::type &  type,
const std::function< void()> &  handler 
)
protected

registers an action handler for a certain action

Parameters
typeaction type info
handlerhandler function

◆ showInspector()

virtual void showInspector ( const SequenceTrack track)
virtual

shows inspector block

Parameters
trackreference to track

◆ showInspectorContent()

virtual void showInspectorContent ( const SequenceTrack track)
protectedpure virtual

this methods needs to be overloaded, contents for the inspector of a specific track type can be drawn in this function

Parameters
trackreference to track

Implemented in SequenceCurveTrackView, SequenceEventTrackView, and SequenceAudioTrackView.

◆ showTrack()

virtual void showTrack ( const SequenceTrack track)
virtual

shows track contents

Parameters
trackreference to track

◆ showTrackContent()

virtual void showTrackContent ( const SequenceTrack track,
const ImVec2 &  trackTopLeft 
)
protectedpure virtual

this method needs to be overloaded, contents for the track can be drawn in this function

Parameters
trackreference to track
trackTopLeftorientation for drawing stuff in track window

Implemented in SequenceCurveTrackView, SequenceEventTrackView, and SequenceAudioTrackView.

Member Data Documentation

◆ mActionHandlers

std::unordered_map<rttr::type, std::function<void()> > mActionHandlers
protected

◆ mService

SequenceGUIService& mService
protected

◆ mState

SequenceEditorGUIState& mState
protected

◆ mView

SequenceEditorGUIView& mView
protected