// ---------------------------------------------------------------------------- // void ActorSelectField::init( ActorPtrArray& actors, UIDArray& selected_actor_uids ) { if ( actors.size() == 0 ) return; CString default_value; CString values; std::map<UID,CString> actor_to_id; for ( SceneActor * actor : actors ) { CString label; CString id; if ( actor->isGroup() ) { FixtureGroup* group = m_venue->getFixtureGroup( actor->getActorUID() ); label.Format( "%s", group->getName() ); id.Format( "G%lu", group->getNumber() ); } else { Fixture* pf = m_venue->getFixture( actor->getActorUID() ); label.Format( "%s @ %d", pf->getFullName(), pf->getAddress() ); id.Format( "%lu", pf->getFixtureNumber() ); } m_entries[ id ] = ActorSelectField::entry( id, label, *actor ); actor_to_id[ actor->getActorUID() ] = id; if ( default_value.GetLength() == 0 ) default_value = id; } // Preseve selected actor order for ( UID selected_uid : selected_actor_uids ) { std::map<UID,CString>::iterator it = actor_to_id.find( selected_uid ); if ( it != actor_to_id.end() ) { if ( values.GetLength() != 0 ) values += ","; values.Append( (*it).second ); } } if ( values.GetLength() == 0 ) setValue( default_value ); else setValue( values ); }
// ---------------------------------------------------------------------------- // CString AbstractAnimation::getSynopsis(void) { CString synopsis; synopsis.Format( "Fixtures( " ); for ( UIDArray::iterator it=m_actors.begin(); it != m_actors.end(); ++it ) { Fixture *pf = studio.getVenue()->getFixture( (*it) ); if ( pf != NULL ) synopsis.AppendFormat( "F%lu ", pf->getNumber() ); else { FixtureGroup* group = studio.getVenue()->getFixtureGroup( (*it) ); if ( group != NULL ) synopsis.AppendFormat( "G%lu ", group->getNumber() ); } } synopsis += ")"; return synopsis; }