/[svn]/libgig/trunk/src/gig.cpp
ViewVC logotype

Diff of /libgig/trunk/src/gig.cpp

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 3939 by schoenebeck, Thu Jun 17 12:04:54 2021 UTC revision 3941 by schoenebeck, Fri Jun 18 14:06:20 2021 UTC
# Line 5394  namespace { Line 5394  namespace {
5394       * @param dst - destination instrument at which this instrument will be       * @param dst - destination instrument at which this instrument will be
5395       *              moved to, or pass NULL for moving to end of list       *              moved to, or pass NULL for moving to end of list
5396       * @throw gig::Exception if this instrument and target instrument are not       * @throw gig::Exception if this instrument and target instrument are not
5397       *                       part of the same file       *                       part of the same file, as well as on unexpected
5398         *                       internal error
5399       */       */
5400      void Instrument::MoveTo(Instrument* dst) {      void Instrument::MoveTo(Instrument* dst) {
5401          if (dst && GetParent() != dst->GetParent())          if (dst && GetParent() != dst->GetParent())
# Line 5411  namespace { Line 5412  namespace {
5412    
5413              File::InstrumentList::iterator itFrom =              File::InstrumentList::iterator itFrom =
5414                  std::find(list.begin(), list.end(), static_cast<DLS::Instrument*>(this));                  std::find(list.begin(), list.end(), static_cast<DLS::Instrument*>(this));
5415                if (itFrom == list.end())
5416                    throw Exception(
5417                        "gig::Instrument::MoveTo(): unexpected missing membership "
5418                        "of this instrument."
5419                    );
5420                list.erase(itFrom);
5421    
5422              File::InstrumentList::iterator itTo =              File::InstrumentList::iterator itTo =
5423                  std::find(list.begin(), list.end(), static_cast<DLS::Instrument*>(dst));                  std::find(list.begin(), list.end(), static_cast<DLS::Instrument*>(dst));
5424    
5425              list.splice(itTo, list, itFrom);              list.insert(itTo, this);
5426          }          }
5427    
5428          // move the instrument's actual list RIFF chunk appropriately          // move the instrument's actual list RIFF chunk appropriately

Legend:
Removed from v.3939  
changed lines
  Added in v.3941

  ViewVC Help
Powered by ViewVC