Logo Search packages:      
Sourcecode: ecamegapedal version File versions  Download package

void QEObjectMap::update_object ( int  index  )  [private, slot]

Update object matching 'index'

require: index >= 0 ensure: object_rep != 0

Definition at line 95 of file qeobjectmap.cpp.

References QEInput::changed().

Referenced by init_layout().

                                         {
  // --------
  DBC_REQUIRE(index >= 0);
  // --------

  object_rep = 0;

#if ECA_LIBECASOUND_VERSION > 7
  const list<string>& omap = omap_rep->registered_objects();
  list<string>::const_iterator p = omap.begin();
#else
  const map<string,string>& omap = omap_rep->registered_objects();
  map<string,string>::const_iterator p = omap.begin();
#endif
  if (index > 0) { /* the first object is always null */
    int counter = 1;
    while(p != omap.end()) {
      if (counter == index) {
#if ECA_LIBECASOUND_VERSION > 7
      object_rep = dynamic_cast<const ECA_OBJECT*>(omap_rep->object(*p));
#else
      object_rep = dynamic_cast<const ECA_OBJECT*>(omap_rep->object(p->first, false));
#endif
      if (object_rep == 0) {
        //  std::cerr << "(qeobjectmap) creation failed; " << *p << ".\n";
        empty_rep = true;
      }
      emit changed();
      }
      ++p;
      ++counter;
    }
  }
  else {
    object_rep = 0;
    empty_rep = true;
    emit changed();
  }

  // --------
  DBC_ENSURE(object_rep != 0 || empty_rep == true);
  // --------
}


Generated by  Doxygen 1.6.0   Back to index