Пример #1
0
const CtrlVal CtrlList::cvalue(int frame)/*{{{*/
{
    if (empty())
    {
        return CtrlVal(-1, -1);
    }
    ciCtrl i = upper_bound(frame);
    if (i == end())
    {
        ciCtrl i = end();
        --i;
        const CtrlVal& val = i->second;
        return val;
    }
    else if (_mode == DISCRETE)
    {
        if (i == begin())
        {
            const CtrlVal& val = i->second;
            return val;
        }
        else
        {
            --i;
            const CtrlVal& val = i->second;
            return val;
        }
    }
    // printf("autoVal %d %f\n", frame, _curVal);
    return CtrlVal(-1, -1);
}/*}}}*/
Пример #2
0
void CtrlList::add(int frame, double val)
{
    iCtrl e = find(frame);
    if (e != end())
    {
        e->second.val = val;
    }
    else
        insert(std::pair<const int, CtrlVal > (frame, CtrlVal(frame, val)));
}
Пример #3
0
void CtrlList::add(int frame, double val)
      {
      iCtrl e = find(frame);
      if (e != end())
      {
            bool upd = (val != e->second.val);
            e->second.val = val;
#ifdef _CTRL_DEBUG_
            printf("CtrlList::add frame:%d val:%f\n", frame, val);  
#endif
            if(upd)
              _guiUpdatePending = true;
      }
      else
            insert(std::pair<const int, CtrlVal> (frame, CtrlVal(frame, val)));
      }