Sequencer - Preparing for curve display

This commit is contained in:
Emmanuel BENOîT 2017-11-22 20:28:12 +01:00
parent 9eb719d0aa
commit eab7b5f670
3 changed files with 38 additions and 0 deletions

View file

@ -615,6 +615,12 @@ void T_SyncManager::removeCurve(
}
}
T_SyncCurve const* T_SyncManager::getCurve(
T_String const& name ) const noexcept
{
return curves_.curves.get( name );
}
void T_SyncManager::curvesChanged_( )
{
if ( modified_ ) {

View file

@ -346,6 +346,8 @@ struct T_SyncManager : public virtual A_MouseCtrl
void clearCurves( );
void setCurve( T_SyncCurve curve );
void removeCurve( T_String const& curve ) noexcept;
T_SyncCurve const* getCurve(
T_String const& name ) const noexcept;
T_Array< T_SyncCurve > const& curves( ) const noexcept
{ return curves_.curves.values( ); }

View file

@ -166,6 +166,8 @@ struct T_SyncViewImpl_
void sequencerWidget( ) noexcept;
void sequencerHeader( ImRect const& bb ) noexcept;
void sequencerBody( ImRect const& bb ) noexcept;
void sequencerCurves( ) noexcept;
void sequencerCurve( T_SyncCurve const& curve ) noexcept;
void displayCurveSelectorWindow( ) noexcept;
void displayCurveSelector( ) noexcept;
@ -575,6 +577,14 @@ void T_SyncViewImpl_::sequencerBody(
bar ++;
}
// Display the curve / override controls
if ( sCurves.size( ) != 0 ) {
BeginGroup( );
// TODO: display overrides
sequencerCurves( );
EndGroup( );
}
if ( cursorPos >= 0 && cursorPos <= inner.GetWidth( ) ) {
auto* const dl( GetWindowDrawList( ) );
dl->AddLine( inner.Min + ImVec2{ cursorPos , -1 } ,
@ -583,6 +593,26 @@ void T_SyncViewImpl_::sequencerBody(
}
}
void T_SyncViewImpl_::sequencerCurves( ) noexcept
{
auto& sync{ Globals::Sync( ) };
const auto nc{ sCurves.size( ) };
for ( auto i = 0u ; i < nc ; i ++ ) {
if ( sCurves.values( )[ i ] ) {
continue;
}
auto* const curve{ sync.getCurve( sCurves.keys( )[ i ] ) };
assert( curve );
sequencerCurve( *curve );
}
}
void T_SyncViewImpl_::sequencerCurve(
T_SyncCurve const& curve ) noexcept
{
#warning implement the fuck
}
/*----------------------------------------------------------------------------*/
void T_SyncViewImpl_::displayCurveSelectorWindow( ) noexcept