Sequencer - Full titles for overrides

This commit is contained in:
Emmanuel BENOîT 2017-11-30 11:25:20 +01:00
parent 6348cbb18f
commit eb7bd8bcbe
4 changed files with 36 additions and 4 deletions

1
TODO
View file

@ -29,7 +29,6 @@ Sync / inputs:
* Mouse controls for overrides * Mouse controls for overrides
* Zoom level is mostly useless, fix it * Zoom level is mostly useless, fix it
* Save/restore sets of tracks * Save/restore sets of tracks
* Full titles (including sections) for overrides
* Edition buttons in toolbar * Edition buttons in toolbar
* Fix drag-and-drop * Fix drag-and-drop
* Moving tracks * Moving tracks

View file

@ -838,14 +838,41 @@ void T_SyncManager::mergeOverrides(
assert( overrides.overrides.empty( ) ); assert( overrides.overrides.empty( ) );
soRoot_.merge( overrides ); soRoot_.merge( overrides );
T_StringBuilder sb;
T_AutoArray< uint32_t , 16 > sbParts;
soVisitor_.visitor.visit( &soRoot_ , soVisitor_.visitor.visit( &soRoot_ ,
[this]( T_SyncOverrideVisitor::T_Element node , bool exit ) -> bool { [&]( T_SyncOverrideVisitor::T_Element node , bool exit ) -> bool {
if ( exit || node.hasType< T_SyncOverrideSection* >( ) ) { if ( node.hasType< T_SyncOverrideSection* >( ) ) {
T_SyncOverrideSection const& sos{
*node.value< T_SyncOverrideSection* >( )
};
if ( sos.title == "*root*" ) {
return true;
}
if ( exit ) {
sb.truncate( sbParts.last( ) );
sbParts.removeLast( );
} else {
sbParts.add( sb.length( ) );
sb << sos.title << " \u00bb ";
}
return true; return true;
} }
if ( exit ) {
return true;
}
auto& ovr( *node.value< A_SyncOverride* >( ) ); auto& ovr( *node.value< A_SyncOverride* >( ) );
ovr.setup( ); ovr.setup( );
soTable_.add( ovr.id( ) , &ovr ); soTable_.add( ovr.id( ) , &ovr );
const uint32_t sblen{ sb.length( ) };
sb << ovr.title( );
ovr.fullTitle( sb );
sb.truncate( sblen );
return false; return false;
} }
); );

View file

@ -233,6 +233,7 @@ class A_SyncOverride
ebcl::T_Set< T_String > inputs_{ ebcl::T_Set< T_String > inputs_{
ebcl::UseTag< ebcl::ArrayBacked< 8 > >( ) }; ebcl::UseTag< ebcl::ArrayBacked< 8 > >( ) };
T_AutoArray< uint32_t , 8 > inputPos_; T_AutoArray< uint32_t , 8 > inputPos_;
T_String fullTitle_;
A_SyncOverride( char const* type , A_SyncOverride( char const* type ,
T_String const& title ) noexcept; T_String const& title ) noexcept;
@ -264,6 +265,11 @@ class A_SyncOverride
ebcl::T_SRDLocation const& location( ) const noexcept ebcl::T_SRDLocation const& location( ) const noexcept
{ return location_; } { return location_; }
T_String const& fullTitle( ) const noexcept
{ return fullTitle_; }
void fullTitle( T_String ft ) noexcept
{ assert( !fullTitle_ ); fullTitle_ = std::move( ft ); }
// Connect the required inputs to the sync manager. Called once // Connect the required inputs to the sync manager. Called once
// the inputs have been added. // the inputs have been added.
virtual void setup( ) noexcept; virtual void setup( ) noexcept;

View file

@ -1076,7 +1076,7 @@ void T_SyncViewImpl_::sequencerTracks(
stringBuffer.clear( ); stringBuffer.clear( );
if ( id.isOverride ) { if ( id.isOverride ) {
stringBuffer << "[O] " stringBuffer << "[O] "
<< Common::Sync( ).getOverride( id.id )->title( ); << sync.getOverride( id.id )->fullTitle( );
} else { } else {
stringBuffer << "[I] " << id.id; stringBuffer << "[I] " << id.id;
} }