本文整理汇总了C++中AutomationPattern::addObject方法的典型用法代码示例。如果您正苦于以下问题:C++ AutomationPattern::addObject方法的具体用法?C++ AutomationPattern::addObject怎么用?C++ AutomationPattern::addObject使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AutomationPattern
的用法示例。
在下文中一共展示了AutomationPattern::addObject方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: resolveAllIDs
void AutomationPattern::resolveAllIDs()
{
TrackContainer::TrackList l = Engine::getSong()->tracks() +
Engine::getBBTrackContainer()->tracks();
l += Engine::getSong()->globalAutomationTrack();
for( TrackContainer::TrackList::iterator it = l.begin();
it != l.end(); ++it )
{
if( ( *it )->type() == Track::AutomationTrack ||
( *it )->type() == Track::HiddenAutomationTrack )
{
Track::tcoVector v = ( *it )->getTCOs();
for( Track::tcoVector::iterator j = v.begin();
j != v.end(); ++j )
{
AutomationPattern * a = dynamic_cast<AutomationPattern *>( *j );
if( a )
{
for( QVector<jo_id_t>::Iterator k = a->m_idsToResolve.begin();
k != a->m_idsToResolve.end(); ++k )
{
JournallingObject * o = Engine::projectJournal()->
journallingObject( *k );
if( o && dynamic_cast<AutomatableModel *>( o ) )
{
a->addObject( dynamic_cast<AutomatableModel *>( o ), false );
}
}
a->m_idsToResolve.clear();
a->dataChanged();
}
}
}
}
}
示例2: AutomationPattern
AutomationPattern * AutomationPattern::globalAutomationPattern(
AutomatableModel * _m )
{
AutomationTrack * t = Engine::getSong()->globalAutomationTrack();
Track::tcoVector v = t->getTCOs();
for( Track::tcoVector::const_iterator j = v.begin(); j != v.end(); ++j )
{
AutomationPattern * a = dynamic_cast<AutomationPattern *>( *j );
if( a )
{
for( objectVector::const_iterator k = a->m_objects.begin();
k != a->m_objects.end(); ++k )
{
if( *k == _m )
{
return a;
}
}
}
}
AutomationPattern * a = new AutomationPattern( t );
a->addObject( _m, false );
return a;
}
示例3: dropEvent
void AutomationTrackView::dropEvent( QDropEvent * _de )
{
QString type = StringPairDrag::decodeKey( _de );
QString val = StringPairDrag::decodeValue( _de );
if( type == "automatable_model" )
{
AutomatableModel * mod = dynamic_cast<AutomatableModel *>(
Engine::projectJournal()->
journallingObject( val.toInt() ) );
if( mod != NULL )
{
MidiTime pos = MidiTime( trackContainerView()->
currentPosition() +
( _de->pos().x() -
getTrackContentWidget()->x() ) *
MidiTime::ticksPerTact() /
static_cast<int>( trackContainerView()->pixelsPerTact() ) )
.toAbsoluteTact();
if( pos.getTicks() < 0 )
{
pos.setTicks( 0 );
}
TrackContentObject * tco = getTrack()->createTCO( pos );
AutomationPattern * pat = dynamic_cast<AutomationPattern *>( tco );
pat->addObject( mod );
pat->movePosition( pos );
}
}
update();
}
示例4: putValue
smfMidiCC & putValue( MidiTime time, AutomatableModel * objModel, float value )
{
if( !ap || time > lastPos + DefaultTicksPerTact )
{
MidiTime pPos = MidiTime( time.getTact(), 0 );
ap = dynamic_cast<AutomationPattern*>(
at->createTCO(0) );
ap->movePosition( pPos );
ap->addObject( objModel );
}
lastPos = time;
time = time - ap->startPosition();
ap->putValue( time, value, false );
ap->changeLength( MidiTime( time.getTact() + 1, 0 ) );
return *this;
}