/[svn]/gigedit/trunk/src/gigedit/CombineInstrumentsDialog.cpp
ViewVC logotype

Diff of /gigedit/trunk/src/gigedit/CombineInstrumentsDialog.cpp

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

revision 2549 by schoenebeck, Tue May 13 16:14:33 2014 UTC revision 2894 by schoenebeck, Sat Apr 30 14:42:14 2016 UTC
# Line 1  Line 1 
1  /*  /*
2      Copyright (c) 2014 Christian Schoenebeck      Copyright (c) 2014-2016 Christian Schoenebeck
3            
4      This file is part of "gigedit" and released under the terms of the      This file is part of "gigedit" and released under the terms of the
5      GNU General Public License version 2.      GNU General Public License version 2.
# Line 11  Line 11 
11  #define DEBUG_COMBINE_INSTRUMENTS 0  #define DEBUG_COMBINE_INSTRUMENTS 0
12    
13  #include "global.h"  #include "global.h"
14    #include "compat.h"
15    
16  #include <set>  #include <set>
17  #include <iostream>  #include <iostream>
18  #include <assert.h>  #include <assert.h>
19    #include <stdarg.h>
20    #include <string.h>
21    
22  #include <glibmm/ustring.h>  #include <glibmm/ustring.h>
 #include <gtkmm/stock.h>  
23  #include <gtkmm/messagedialog.h>  #include <gtkmm/messagedialog.h>
24    #include <gtkmm/label.h>
25    
26  Glib::ustring gig_to_utf8(const gig::String& gig_string);  Glib::ustring gig_to_utf8(const gig::String& gig_string);
27    Glib::ustring dimTypeAsString(gig::dimension_t d);
28    
29    typedef std::vector< std::pair<gig::Instrument*, gig::Region*> > OrderedRegionGroup;
30  typedef std::map<gig::Instrument*, gig::Region*> RegionGroup;  typedef std::map<gig::Instrument*, gig::Region*> RegionGroup;
31  typedef std::map<DLS::range_t,RegionGroup> RegionGroups;  typedef std::map<DLS::range_t,RegionGroup> RegionGroups;
32    
# Line 32  typedef std::map<gig::dimension_t,int> D Line 37  typedef std::map<gig::dimension_t,int> D
37    
38  typedef std::map<gig::dimension_t, int> DimensionRegionUpperLimits;  typedef std::map<gig::dimension_t, int> DimensionRegionUpperLimits;
39    
40  typedef std::map<gig::DimensionRegion*, DimensionZones> VelocityZones;  typedef std::set<Glib::ustring> Warnings;
41    
42    ///////////////////////////////////////////////////////////////////////////
43    // private static data
44    
45    static Warnings g_warnings;
46    
47  ///////////////////////////////////////////////////////////////////////////  ///////////////////////////////////////////////////////////////////////////
48  // private functions  // private functions
# Line 49  static void printRanges(const RegionGrou Line 59  static void printRanges(const RegionGrou
59  #endif  #endif
60    
61  /**  /**
62     * Store a warning message that shall be stored and displayed to the user as a
63     * list of warnings after the overall operation has finished. Duplicate warning
64     * messages are automatically eliminated.
65     */
66    inline void addWarning(const char* fmt, ...) {
67        va_list arg;
68        va_start(arg, fmt);
69        const int SZ = 255 + strlen(fmt);
70        char* buf = new char[SZ];
71        vsnprintf(buf, SZ, fmt, arg);
72        Glib::ustring s = buf;
73        delete [] buf;
74        va_end(arg);
75        std::cerr << _("WARNING:") << " " << s << std::endl << std::flush;
76        g_warnings.insert(s);
77    }
78    
79    /**
80   * If the two ranges overlap, then this function returns the smallest point   * If the two ranges overlap, then this function returns the smallest point
81   * within that overlapping zone. If the two ranges do not overlap, then this   * within that overlapping zone. If the two ranges do not overlap, then this
82   * function will return -1 instead.   * function will return -1 instead.
# Line 68  inline int smallestOverlapPoint(const DL Line 96  inline int smallestOverlapPoint(const DL
96   *          found with a range member point >= iStart   *          found with a range member point >= iStart
97   */   */
98  static int findLowestRegionPoint(std::vector<gig::Instrument*>& instruments, int iStart) {  static int findLowestRegionPoint(std::vector<gig::Instrument*>& instruments, int iStart) {
99      DLS::range_t searchRange = { iStart, 127 };      DLS::range_t searchRange = { uint16_t(iStart), 127 };
100      int result = -1;      int result = -1;
101      for (uint i = 0; i < instruments.size(); ++i) {      for (uint i = 0; i < instruments.size(); ++i) {
102          gig::Instrument* instr = instruments[i];          gig::Instrument* instr = instruments[i];
# Line 90  static int findLowestRegionPoint(std::ve Line 118  static int findLowestRegionPoint(std::ve
118   *          with a range end >= iStart   *          with a range end >= iStart
119   */   */
120  static int findFirstRegionEnd(std::vector<gig::Instrument*>& instruments, int iStart) {  static int findFirstRegionEnd(std::vector<gig::Instrument*>& instruments, int iStart) {
121      DLS::range_t searchRange = { iStart, 127 };      DLS::range_t searchRange = { uint16_t(iStart), 127 };
122      int result = -1;      int result = -1;
123      for (uint i = 0; i < instruments.size(); ++i) {      for (uint i = 0; i < instruments.size(); ++i) {
124          gig::Instrument* instr = instruments[i];          gig::Instrument* instr = instruments[i];
# Line 133  static RegionGroup getAllRegionsWhichOve Line 161  static RegionGroup getAllRegionsWhichOve
161          std::vector<gig::Region*> v = getAllRegionsWhichOverlapRange(instr, range);          std::vector<gig::Region*> v = getAllRegionsWhichOverlapRange(instr, range);
162          if (v.empty()) continue;          if (v.empty()) continue;
163          if (v.size() > 1) {          if (v.size() > 1) {
164              std::cerr << "WARNING: More than one region found!" << std::endl;              addWarning("More than one region found!");
165          }          }
166          group[instr] = v[0];          group[instr] = v[0];
167      }      }
# Line 143  static RegionGroup getAllRegionsWhichOve Line 171  static RegionGroup getAllRegionsWhichOve
171  /** @brief Identify required regions.  /** @brief Identify required regions.
172   *   *
173   * Takes a list of @a instruments as argument (which are planned to be combined   * Takes a list of @a instruments as argument (which are planned to be combined
174   * as layers in one single new instrument) and fulfills the following tasks:   * as separate dimension zones of a certain dimension into one single new
175     * instrument) and fulfills the following tasks:
176   *   *
177   * - 1. Identification of total amount of regions required to create a new   * - 1. Identification of total amount of regions required to create a new
178   *      instrument to become a layered version of the given instruments.   *      instrument to become a combined version of the given instruments.
179   * - 2. Precise key range of each of those identified required regions to be   * - 2. Precise key range of each of those identified required regions to be
180   *      created in that new instrument.   *      created in that new instrument.
181   * - 3. Grouping the original source regions of the given original instruments   * - 3. Grouping the original source regions of the given original instruments
# Line 165  static RegionGroups groupByRegionInterse Line 194  static RegionGroups groupByRegionInterse
194          iStart = findLowestRegionPoint(instruments, iStart);          iStart = findLowestRegionPoint(instruments, iStart);
195          if (iStart < 0) break;          if (iStart < 0) break;
196          const int iEnd = findFirstRegionEnd(instruments, iStart);          const int iEnd = findFirstRegionEnd(instruments, iStart);
197          DLS::range_t range = { iStart, iEnd };          DLS::range_t range = { uint16_t(iStart), uint16_t(iEnd) };
198          intersections.push_back(range);          intersections.push_back(range);
199          iStart = iEnd + 1;          iStart = iEnd + 1;
200      }      }
# Line 177  static RegionGroups groupByRegionInterse Line 206  static RegionGroups groupByRegionInterse
206          if (!group.empty())          if (!group.empty())
207              groups[range] = group;              groups[range] = group;
208          else          else
209              std::cerr << "WARNING: empty region group!" << std::endl;              addWarning("Empty region group!");
210      }      }
211    
212      return groups;      return groups;
# Line 236  static Dimensions getDimensionsForRegion Line 265  static Dimensions getDimensionsForRegion
265               itNums != it->second.end(); ++itNums)               itNums != it->second.end(); ++itNums)
266          {          {
267              const int iUpperLimit = *itNums;              const int iUpperLimit = *itNums;
268              DLS::range_t range = { iLow, iUpperLimit };              DLS::range_t range = { uint16_t(iLow), uint16_t(iUpperLimit) };
269              dims[type].push_back(range);              dims[type].push_back(range);
270              iLow = iUpperLimit + 1;              iLow = iUpperLimit + 1;
271          }          }
# Line 253  inline int getDimensionIndex(gig::dimens Line 282  inline int getDimensionIndex(gig::dimens
282  }  }
283    
284  static void fillDimValues(uint* values/*[8]*/, DimensionCase dimCase, gig::Region* rgn, bool bShouldHaveAllDimensionsPassed) {  static void fillDimValues(uint* values/*[8]*/, DimensionCase dimCase, gig::Region* rgn, bool bShouldHaveAllDimensionsPassed) {
285        #if DEBUG_COMBINE_INSTRUMENTS
286        printf("dimvalues = { ");
287        fflush(stdout);
288        #endif
289      for (DimensionCase::iterator it = dimCase.begin(); it != dimCase.end(); ++it) {      for (DimensionCase::iterator it = dimCase.begin(); it != dimCase.end(); ++it) {
290          gig::dimension_t type = it->first;          gig::dimension_t type = it->first;
291          int iDimIndex = getDimensionIndex(type, rgn);          int iDimIndex = getDimensionIndex(type, rgn);
292          if (bShouldHaveAllDimensionsPassed) assert(iDimIndex >= 0);          if (bShouldHaveAllDimensionsPassed) assert(iDimIndex >= 0);
293          else if (iDimIndex < 0) continue;          else if (iDimIndex < 0) continue;
294          values[iDimIndex] = it->second;          values[iDimIndex] = it->second;
295            #if DEBUG_COMBINE_INSTRUMENTS
296            printf("%x=%d, ", type, it->second);
297            #endif
298      }      }
299        #if DEBUG_COMBINE_INSTRUMENTS
300        printf("}\n");
301        #endif
302  }  }
303    
304  static DimensionRegionUpperLimits getDimensionRegionUpperLimits(gig::DimensionRegion* dimRgn) {  static DimensionRegionUpperLimits getDimensionRegionUpperLimits(gig::DimensionRegion* dimRgn) {
# Line 334  static DimensionZones preciseDimensionZo Line 373  static DimensionZones preciseDimensionZo
373      int iBaseBits = baseBits(type, rgn);      int iBaseBits = baseBits(type, rgn);
374      int mask = ~(((1 << def.bits) - 1) << iBaseBits);      int mask = ~(((1 << def.bits) - 1) << iBaseBits);
375    
376        #if DEBUG_COMBINE_INSTRUMENTS
377        printf("velo zones { ");
378        fflush(stdout);
379        #endif
380      int iLow = 0;      int iLow = 0;
381      for (int z = 0; z < def.zones; ++z) {      for (int z = 0; z < def.zones; ++z) {
382          gig::DimensionRegion* dimRgn2 =          gig::DimensionRegion* dimRgn2 =
383              rgn->pDimensionRegions[ (iDimRgn & mask) | ( z << iBaseBits) ];              rgn->pDimensionRegions[ (iDimRgn & mask) | ( z << iBaseBits) ];
384          int iHigh = dimRgn2->DimensionUpperLimits[iDimension];          int iHigh = dimRgn2->DimensionUpperLimits[iDimension];
385          DLS::range_t range = { iLow, iHigh};          DLS::range_t range = { uint16_t(iLow), uint16_t(iHigh) };
386            #if DEBUG_COMBINE_INSTRUMENTS
387            printf("%d..%d, ", iLow, iHigh);
388            fflush(stdout);
389            #endif
390          zones.push_back(range);          zones.push_back(range);
391          iLow = iHigh + 1;          iLow = iHigh + 1;
392      }      }
393        #if DEBUG_COMBINE_INSTRUMENTS
394        printf("}\n");
395        #endif
396      return zones;      return zones;
397  }  }
398    
399  static VelocityZones getVelocityZones(gig::Region* rgn) {  struct CopyAssignSchedEntry {
400      VelocityZones zones;      gig::DimensionRegion* src;
401      for (uint i = 0; i < rgn->DimensionRegions; ++i) {      gig::DimensionRegion* dst;
402          gig::DimensionRegion* dimRgn = rgn->pDimensionRegions[i];      int velocityZone;
403          zones[dimRgn] = preciseDimensionZonesFor(gig::dimension_velocity, dimRgn);      int totalSrcVelocityZones;
404      }  };
405      return zones;  typedef std::vector<CopyAssignSchedEntry> CopyAssignSchedule;
406  }  
407    /** @brief Schedule copying DimensionRegions from source Region to target Region.
408  /** @brief Copy all DimensionRegions from source Region to target Region.   *
409   *   * Schedules copying the entire articulation informations (including sample
410   * Copies the entire articulation informations (including sample reference of   * reference) from all individual DimensionRegions of source Region @a inRgn to
411   * course) from all individual DimensionRegions of source Region @a inRgn to   * target Region @a outRgn. It is expected that the required dimensions (thus
412   * target Region @a outRgn. There are no dimension regions created during this   * the required dimension regions) were already created before calling this
413   * task. It is expected that the required dimensions (thus the required   * function.
414   * dimension regions) were already created before calling this function.   *
415   *   * To be precise, it does the task above only for the dimension zones defined by
416   * To be precise, it does the task above only for the layer selected by   * the three arguments @a mainDim, @a iSrcMainBit, @a iDstMainBit, which reflect
417   * @a iSrcLayer and @a iDstLayer. All dimensions regions of other layers that   * a selection which dimension zones shall be copied. All other dimension zones
418   * may exist, will not be copied by one single call of this function. So if   * will not be scheduled to be copied by a single call of this function. So this
419   * there is a layer dimension, this function needs to be called several times.   * function needs to be called several time in case all dimension regions shall
420     * be copied of the entire region (@a inRgn, @a outRgn).
421   *   *
422   * @param outRgn - where the dimension regions shall be copied to   * @param outRgn - where the dimension regions shall be copied to
423   * @param inRgn - all dimension regions that shall be copied from   * @param inRgn - all dimension regions that shall be copied from
424   * @param dims - dimension definitions of target region   * @param dims - precise dimension definitions of target region
425   * @param iDstLayer - layer number of destination region where the dimension   * @param mainDim - this dimension type, in combination with @a iSrcMainBit and
426   *                    regions shall be copied to   *                  @a iDstMainBit defines a selection which dimension region
427   * @param iSrcLayer - layer number of the source region where the dimension   *                  zones shall be copied by this call of this function
428   *                    regions shall be copied from   * @param iDstMainBit - destination bit of @a mainDim
429   * @param dstVelocityZones - all precise velocity zones for destination region   * @param iSrcMainBit - source bit of @a mainDim
430   *                           (since this information is stored on   * @param schedule - list of all DimensionRegion copy operations which is filled
431   *                           DimensionRegion level and this function is   *                   during the nested loops / recursions of this function call
  *                           modifying target DimensionRegions, this  
  *                           informations thus needs to be retrieved before  
  *                           calling this function)  
432   * @param dimCase - just for internal purpose (function recursion), don't pass   * @param dimCase - just for internal purpose (function recursion), don't pass
433   *                  anything here, this function will call itself recursively   *                  anything here, this function will call itself recursively
434   *                  will fill this container with concrete dimension values for   *                  will fill this container with concrete dimension values for
435   *                  selecting the precise dimension regions during its task   *                  selecting the precise dimension regions during its task
436   */   */
437  static void copyDimensionRegions(gig::Region* outRgn, gig::Region* inRgn, Dimensions dims, int iDstLayer, int iSrcLayer, const VelocityZones& dstVelocityZones, DimensionCase dimCase = DimensionCase()) {  static void scheduleCopyDimensionRegions(gig::Region* outRgn, gig::Region* inRgn,
438      if (dims.empty()) { // finally reached end of function recursion ...                                   Dimensions dims, gig::dimension_t mainDim,
439                                     int iDstMainBit, int iSrcMainBit,
440                                     CopyAssignSchedule* schedule,
441                                     DimensionCase dimCase = DimensionCase())
442    {
443        if (dims.empty()) { // reached deepest level of function recursion ...
444            CopyAssignSchedEntry e;
445    
446          // resolve the respective source & destination DimensionRegion ...                  // resolve the respective source & destination DimensionRegion ...        
447          uint srcDimValues[8] = {};          uint srcDimValues[8] = {};
448          uint dstDimValues[8] = {};          uint dstDimValues[8] = {};
449          DimensionCase srcDimCase = dimCase;          DimensionCase srcDimCase = dimCase;
450          DimensionCase dstDimCase = dimCase;          DimensionCase dstDimCase = dimCase;
451          srcDimCase[gig::dimension_layer] = iSrcLayer;          srcDimCase[mainDim] = iSrcMainBit;
452          dstDimCase[gig::dimension_layer] = iDstLayer;          dstDimCase[mainDim] = iDstMainBit;
453    
454            #if DEBUG_COMBINE_INSTRUMENTS
455            printf("-------------------------------\n");
456            printf("iDstMainBit=%d iSrcMainBit=%d\n", iDstMainBit, iSrcMainBit);
457            #endif
458    
459          // first select source & target dimension region with an arbitrary          // first select source & target dimension region with an arbitrary
460          // velocity split zone, to get access to the precise individual velocity          // velocity split zone, to get access to the precise individual velocity
461          // split zone sizes (if there is actually a velocity dimension at all,          // split zone sizes (if there is actually a velocity dimension at all,
462          // otherwise we already select the desired source & target dimension          // otherwise we already select the desired source & target dimension
463          // region here)          // region here)
464            #if DEBUG_COMBINE_INSTRUMENTS
465            printf("src "); fflush(stdout);
466            #endif
467          fillDimValues(srcDimValues, srcDimCase, inRgn, false);          fillDimValues(srcDimValues, srcDimCase, inRgn, false);
468          fillDimValues(dstDimValues, dstDimCase, outRgn, true);          #if DEBUG_COMBINE_INSTRUMENTS
469            printf("dst "); fflush(stdout);
470            #endif
471            fillDimValues(dstDimValues, dstDimCase, outRgn, false);
472          gig::DimensionRegion* srcDimRgn = inRgn->GetDimensionRegionByValue(srcDimValues);          gig::DimensionRegion* srcDimRgn = inRgn->GetDimensionRegionByValue(srcDimValues);
473          gig::DimensionRegion* dstDimRgn = outRgn->GetDimensionRegionByValue(dstDimValues);          gig::DimensionRegion* dstDimRgn = outRgn->GetDimensionRegionByValue(dstDimValues);
474          #if DEBUG_COMBINE_INSTRUMENTS          #if DEBUG_COMBINE_INSTRUMENTS
475            printf("iDstMainBit=%d iSrcMainBit=%d\n", iDstMainBit, iSrcMainBit);
476          printf("srcDimRgn=%lx dstDimRgn=%lx\n", (uint64_t)srcDimRgn, (uint64_t)dstDimRgn);          printf("srcDimRgn=%lx dstDimRgn=%lx\n", (uint64_t)srcDimRgn, (uint64_t)dstDimRgn);
477            printf("srcSample='%s' dstSample='%s'\n",
478                   (!srcDimRgn->pSample ? "NULL" : srcDimRgn->pSample->pInfo->Name.c_str()),
479                   (!dstDimRgn->pSample ? "NULL" : dstDimRgn->pSample->pInfo->Name.c_str())
480            );
481          #endif          #endif
482    
483            assert(srcDimRgn->GetParent() == inRgn);
484            assert(dstDimRgn->GetParent() == outRgn);
485    
486          // now that we have access to the precise velocity split zone upper          // now that we have access to the precise velocity split zone upper
487          // limits, we can select the actual source & destination dimension          // limits, we can select the actual source & destination dimension
488          // regions we need to copy (assuming that source or target region has          // regions we need to copy (assuming that source or target region has
489          // a velocity dimension)          // a velocity dimension)
490          if (outRgn->GetDimensionDefinition(gig::dimension_velocity)) {          if (outRgn->GetDimensionDefinition(gig::dimension_velocity)) {
491              // re-select target dimension region              // re-select target dimension region (with correct velocity zone)
492              assert(dstVelocityZones.find(dstDimRgn) != dstVelocityZones.end());              DimensionZones dstZones = preciseDimensionZonesFor(gig::dimension_velocity, dstDimRgn);
             DimensionZones dstZones = dstVelocityZones.find(dstDimRgn)->second;  
493              assert(dstZones.size() > 1);              assert(dstZones.size() > 1);
494              int iZoneIndex = dstDimCase[gig::dimension_velocity];              const int iDstZoneIndex =
495                    (mainDim == gig::dimension_velocity)
496                        ? iDstMainBit : dstDimCase[gig::dimension_velocity]; // (mainDim == gig::dimension_velocity) exception case probably unnecessary here
497                e.velocityZone = iDstZoneIndex;
498              #if DEBUG_COMBINE_INSTRUMENTS              #if DEBUG_COMBINE_INSTRUMENTS
499              printf("dst velocity zone: %d/%d\n", iZoneIndex, dstZones.size());              printf("dst velocity zone: %d/%d\n", iDstZoneIndex, (int)dstZones.size());
500              #endif              #endif
501              assert(iZoneIndex < dstZones.size());              assert(uint(iDstZoneIndex) < dstZones.size());
502              dstDimCase[gig::dimension_velocity] = dstZones[iZoneIndex].low; // arbitrary value between low and high              dstDimCase[gig::dimension_velocity] = dstZones[iDstZoneIndex].low; // arbitrary value between low and high
503              #if DEBUG_COMBINE_INSTRUMENTS              #if DEBUG_COMBINE_INSTRUMENTS
504              printf("dst velocity value = %d\n", dstDimCase[gig::dimension_velocity]);              printf("dst velocity value = %d\n", dstDimCase[gig::dimension_velocity]);
505                printf("dst refilled "); fflush(stdout);
506              #endif              #endif
507              fillDimValues(dstDimValues, dstDimCase, outRgn, true);              fillDimValues(dstDimValues, dstDimCase, outRgn, false);
508              dstDimRgn = outRgn->GetDimensionRegionByValue(dstDimValues);              dstDimRgn = outRgn->GetDimensionRegionByValue(dstDimValues);
509              #if DEBUG_COMBINE_INSTRUMENTS              #if DEBUG_COMBINE_INSTRUMENTS
510              printf("reselected dstDimRgn=%lx\n", (uint64_t)dstDimRgn);              printf("reselected dstDimRgn=%lx\n", (uint64_t)dstDimRgn);
511                printf("dstSample='%s'%s\n",
512                    (!dstDimRgn->pSample ? "NULL" : dstDimRgn->pSample->pInfo->Name.c_str()),
513                    (dstDimRgn->pSample ? " <--- ERROR ERROR ERROR !!!!!!!!! " : "")
514                );
515              #endif              #endif
516    
517              // re-select source dimension region              // re-select source dimension region with correct velocity zone
518              // (if it has a velocity dimension)              // (if it has a velocity dimension that is)
519              if (inRgn->GetDimensionDefinition(gig::dimension_velocity)) {              if (inRgn->GetDimensionDefinition(gig::dimension_velocity)) {
520                  DimensionZones srcZones = preciseDimensionZonesFor(gig::dimension_velocity, srcDimRgn);                  DimensionZones srcZones = preciseDimensionZonesFor(gig::dimension_velocity, srcDimRgn);
521                  assert(srcZones.size() > 1);                  e.totalSrcVelocityZones = srcZones.size();
522                  if (iZoneIndex >= srcZones.size())                  assert(srcZones.size() > 0);
523                      iZoneIndex  = srcZones.size();                  if (srcZones.size() <= 1) {
524                  srcDimCase[gig::dimension_velocity] = srcZones[iZoneIndex].low; // same zone as used above for target dimension region (no matter what the precise zone ranges are)                      addWarning("Input region has a velocity dimension with only ONE zone!");
525                    }
526                    int iSrcZoneIndex =
527                        (mainDim == gig::dimension_velocity)
528                            ? iSrcMainBit : iDstZoneIndex;
529                    if (uint(iSrcZoneIndex) >= srcZones.size())
530                        iSrcZoneIndex = srcZones.size() - 1;
531                    srcDimCase[gig::dimension_velocity] = srcZones[iSrcZoneIndex].low; // same zone as used above for target dimension region (no matter what the precise zone ranges are)
532                    #if DEBUG_COMBINE_INSTRUMENTS
533                    printf("src refilled "); fflush(stdout);
534                    #endif
535                  fillDimValues(srcDimValues, srcDimCase, inRgn, false);                  fillDimValues(srcDimValues, srcDimCase, inRgn, false);
536                  srcDimRgn = inRgn->GetDimensionRegionByValue(srcDimValues);                  srcDimRgn = inRgn->GetDimensionRegionByValue(srcDimValues);
537                  #if DEBUG_COMBINE_INSTRUMENTS                  #if DEBUG_COMBINE_INSTRUMENTS
538                  printf("reselected srcDimRgn=%lx\n", (uint64_t)srcDimRgn);                  printf("reselected srcDimRgn=%lx\n", (uint64_t)srcDimRgn);
539                    printf("srcSample='%s'\n",
540                        (!srcDimRgn->pSample ? "NULL" : srcDimRgn->pSample->pInfo->Name.c_str())
541                    );
542                  #endif                  #endif
543              }              }
544          }          }
545    
546          // backup the target DimensionRegion's current dimension zones upper          // Schedule copy operation of source -> target DimensionRegion for the
547          // limits (because the target DimensionRegion's upper limits are already          // time after all nested loops have been traversed. We have to postpone
548          // defined correctly since calling AddDimension(), and the CopyAssign()          // the actual copy operations this way, because otherwise it would
549          // call next, will overwrite those upper limits unfortunately          // overwrite informations inside the destination DimensionRegion object
550          DimensionRegionUpperLimits dstUpperLimits = getDimensionRegionUpperLimits(dstDimRgn);          // that we need to read in the code block above.
551          DimensionRegionUpperLimits srcUpperLimits = getDimensionRegionUpperLimits(srcDimRgn);          e.src = srcDimRgn;
552            e.dst = dstDimRgn;
553          // copy over the selected DimensionRegion          schedule->push_back(e);
         const gig::Region* const origRgn = dstDimRgn->GetParent(); // just for sanity check below  
         dstDimRgn->CopyAssign(srcDimRgn);  
         assert(origRgn == dstDimRgn->GetParent());  
   
         // restore all original dimension zone upper limits except of the  
         // velocity dimension, because the velocity dimension zone sizes are  
         // allowed to differ for individual DimensionRegions in gig v3 format  
         if (srcUpperLimits.count(gig::dimension_velocity)) {  
             assert(dstUpperLimits.count(gig::dimension_velocity));  
             dstUpperLimits[gig::dimension_velocity] = srcUpperLimits[gig::dimension_velocity];  
         }  
         restoreDimensionRegionUpperLimits(dstDimRgn, dstUpperLimits);  
554    
555          return; // end of recursion          return; // returning from deepest level of function recursion
556      }      }
557    
558      // Copying n dimensions requires n nested loops. That's why this function      // Copying n dimensions requires n nested loops. That's why this function
# Line 479  static void copyDimensionRegions(gig::Re Line 561  static void copyDimensionRegions(gig::Re
561      // argument 'dimCase'.      // argument 'dimCase'.
562    
563      Dimensions::iterator itDimension = dims.begin();      Dimensions::iterator itDimension = dims.begin();
   
564      gig::dimension_t type = itDimension->first;      gig::dimension_t type = itDimension->first;
565      DimensionZones  zones = itDimension->second;      DimensionZones  zones = itDimension->second;
   
566      dims.erase(itDimension);      dims.erase(itDimension);
567    
568      int iZone = 0;      int iZone = 0;
# Line 492  static void copyDimensionRegions(gig::Re Line 572  static void copyDimensionRegions(gig::Re
572          DLS::range_t zoneRange = *itZone;          DLS::range_t zoneRange = *itZone;
573          gig::dimension_def_t* def = outRgn->GetDimensionDefinition(type);          gig::dimension_def_t* def = outRgn->GetDimensionDefinition(type);
574          dimCase[type] = (def->split_type == gig::split_type_bit) ? iZone : zoneRange.low;          dimCase[type] = (def->split_type == gig::split_type_bit) ? iZone : zoneRange.low;
575    
576          // recurse until 'dims' is exhausted (and dimCase filled up with concrete value)          // recurse until 'dims' is exhausted (and dimCase filled up with concrete value)
577          copyDimensionRegions(outRgn, inRgn, dims, iDstLayer, iSrcLayer, dstVelocityZones, dimCase);          scheduleCopyDimensionRegions(outRgn, inRgn, dims, mainDim, iDstMainBit, iSrcMainBit, schedule, dimCase);
578      }      }
579  }  }
580    
581    static OrderedRegionGroup sortRegionGroup(const RegionGroup& group, const std::vector<gig::Instrument*>& instruments) {
582        OrderedRegionGroup result;
583        for (std::vector<gig::Instrument*>::const_iterator it = instruments.begin();
584             it != instruments.end(); ++it)
585        {
586            RegionGroup::const_iterator itRgn = group.find(*it);
587            if (itRgn == group.end()) continue;
588            result.push_back(
589                std::pair<gig::Instrument*, gig::Region*>(
590                    itRgn->first, itRgn->second
591                )
592            );
593        }
594        return result;
595    }
596    
597  /** @brief Combine given list of instruments to one instrument.  /** @brief Combine given list of instruments to one instrument.
598   *   *
599   * Takes a list of @a instruments as argument and combines them to one single   * Takes a list of @a instruments as argument and combines them to one single
600   * new @a output instrument. For this task, it will create a 'layer' dimension   * new @a output instrument. For this task, it will create a dimension of type
601   * in the new instrument and copies the source instruments to those layers.   * given by @a mainDimension in the new instrument and copies the source
602     * instruments to those dimension zones.
603   *   *
604   * @param instruments - (input) list of instruments that shall be combined,   * @param instruments - (input) list of instruments that shall be combined,
605   *                      they will only be read, so they will be left untouched   *                      they will only be read, so they will be left untouched
# Line 509  static void copyDimensionRegions(gig::Re Line 607  static void copyDimensionRegions(gig::Re
607   *              be created   *              be created
608   * @param output - (output) on success this pointer will be set to the new   * @param output - (output) on success this pointer will be set to the new
609   *                 instrument being created   *                 instrument being created
610     * @param mainDimension - the dimension that shall be used to combine the
611     *                        instruments
612   * @throw RIFF::Exception on any kinds of errors   * @throw RIFF::Exception on any kinds of errors
613   */   */
614  static void combineInstruments(std::vector<gig::Instrument*>& instruments, gig::File* gig, gig::Instrument*& output) {  static void combineInstruments(std::vector<gig::Instrument*>& instruments, gig::File* gig, gig::Instrument*& output, gig::dimension_t mainDimension) {
615      output = NULL;      output = NULL;
616    
617      // divide the individual regions to (probably even smaller) groups of      // divide the individual regions to (probably even smaller) groups of
# Line 544  static void combineInstruments(std::vect Line 644  static void combineInstruments(std::vect
644      {      {
645          gig::Region* outRgn = outInstr->AddRegion();          gig::Region* outRgn = outInstr->AddRegion();
646          outRgn->SetKeyRange(itGroup->first.low, itGroup->first.high);          outRgn->SetKeyRange(itGroup->first.low, itGroup->first.high);
647            #if DEBUG_COMBINE_INSTRUMENTS
648            printf("---> Start target region %d..%d\n", itGroup->first.low, itGroup->first.high);
649            #endif
650    
651          // detect the total amount of layers required to build up this combi          // detect the total amount of zones required for the given main
652          // for current key range          // dimension to build up this combi for current key range
653          int iTotalLayers = 0;          int iTotalZones = 0;
654          for (RegionGroup::iterator itRgn = itGroup->second.begin();          for (RegionGroup::iterator itRgn = itGroup->second.begin();
655               itRgn != itGroup->second.end(); ++itRgn)               itRgn != itGroup->second.end(); ++itRgn)
656          {          {
657              gig::Region* inRgn = itRgn->second;              gig::Region* inRgn = itRgn->second;
658              iTotalLayers += inRgn->Layers;              gig::dimension_def_t* def = inRgn->GetDimensionDefinition(mainDimension);
659                iTotalZones += (def) ? def->zones : 1;
660          }          }
661            #if DEBUG_COMBINE_INSTRUMENTS
662            printf("Required total zones: %d, vertical regions: %d\n", iTotalZones, itGroup->second.size());
663            #endif
664    
665          // create all required dimensions for this output region          // create all required dimensions for this output region
666          // (except the layer dimension, which we create as next step)          // (except the main dimension used for separating the individual
667            // instruments, we create that particular dimension as next step)
668          Dimensions dims = getDimensionsForRegionGroup(itGroup->second);          Dimensions dims = getDimensionsForRegionGroup(itGroup->second);
669          for (Dimensions::iterator itDim = dims.begin();          // the given main dimension which is used to combine the instruments is
670               itDim != dims.end(); ++itDim)          // created separately after the next code block, and the main dimension
671            // should not be part of dims here, because it also used for iterating
672            // all dimensions zones, which would lead to this dimensions being
673            // iterated twice
674            dims.erase(mainDimension);
675          {          {
676              if (itDim->first == gig::dimension_layer) continue;              std::vector<gig::dimension_t> skipTheseDimensions; // used to prevent a misbehavior (i.e. crash) of the combine algorithm in case one of the source instruments has a dimension with only one zone, which is not standard conform
677    
678              gig::dimension_def_t def;              for (Dimensions::iterator itDim = dims.begin();
679              def.dimension = itDim->first; // dimension type                  itDim != dims.end(); ++itDim)
680              def.zones = itDim->second.size();              {
681              def.bits = zoneCountToBits(def.zones);                  gig::dimension_def_t def;
682              #if DEBUG_COMBINE_INSTRUMENTS                  def.dimension = itDim->first; // dimension type
683              std::cout << "Adding new regular dimension type=" << std::hex << (int)def.dimension << std::dec << ", zones=" << (int)def.zones << ", bits=" << (int)def.bits << " ... " << std::flush;                  def.zones = itDim->second.size();
684              #endif                  def.bits = zoneCountToBits(def.zones);
685              outRgn->AddDimension(&def);                  if (def.zones < 2) {
686              #if DEBUG_COMBINE_INSTRUMENTS                      addWarning(
687              std::cout << "OK" << std::endl << std::flush;                          "Attempt to create dimension with type=0x%x with only "
688              #endif                          "ONE zone (because at least one of the source "
689                            "instruments seems to have such a velocity dimension "
690                            "with only ONE zone, which is odd)! Skipping this "
691                            "dimension for now.",
692                            (int)itDim->first
693                        );
694                        skipTheseDimensions.push_back(itDim->first);
695                        continue;
696                    }
697                    #if DEBUG_COMBINE_INSTRUMENTS
698                    std::cout << "Adding new regular dimension type=" << std::hex << (int)def.dimension << std::dec << ", zones=" << (int)def.zones << ", bits=" << (int)def.bits << " ... " << std::flush;
699                    #endif
700                    outRgn->AddDimension(&def);
701                    #if DEBUG_COMBINE_INSTRUMENTS
702                    std::cout << "OK" << std::endl << std::flush;
703                    #endif
704                }
705                // prevent the following dimensions to be processed further below
706                // (since the respective dimension was not created above)
707                for (int i = 0; i < skipTheseDimensions.size(); ++i)
708                    dims.erase(skipTheseDimensions[i]);
709          }          }
710    
711          // create the layer dimension (if necessary for current key range)          // create the main dimension (if necessary for current key range)
712          if (iTotalLayers > 1) {          if (iTotalZones > 1) {
713              gig::dimension_def_t def;              gig::dimension_def_t def;
714              def.dimension = gig::dimension_layer; // dimension type              def.dimension = mainDimension; // dimension type
715              def.zones = iTotalLayers;              def.zones = iTotalZones;
716              def.bits = zoneCountToBits(def.zones);              def.bits = zoneCountToBits(def.zones);
717              #if DEBUG_COMBINE_INSTRUMENTS              #if DEBUG_COMBINE_INSTRUMENTS
718              std::cout << "Adding new (layer) dimension type=" << std::hex << (int)def.dimension << std::dec << ", zones=" << (int)def.zones << ", bits=" << (int)def.bits << " ... " << std::flush;              std::cout << "Adding new main combi dimension type=" << std::hex << (int)def.dimension << std::dec << ", zones=" << (int)def.zones << ", bits=" << (int)def.bits << " ... " << std::flush;
719              #endif              #endif
720              outRgn->AddDimension(&def);              outRgn->AddDimension(&def);
721              #if DEBUG_COMBINE_INSTRUMENTS              #if DEBUG_COMBINE_INSTRUMENTS
722              std::cout << "OK" << std::endl << std::flush;              std::cout << "OK" << std::endl << std::flush;
723              #endif              #endif
724            } else {
725                dims.erase(mainDimension);
726          }          }
727    
728          // now copy the source dimension regions to the target dimension regions          // for the next task we need to have the current RegionGroup to be
729          int iDstLayer = 0;          // sorted by instrument in the same sequence as the 'instruments' vector
730          for (RegionGroup::iterator itRgn = itGroup->second.begin();          // argument passed to this function (because the std::map behind the
731               itRgn != itGroup->second.end(); ++itRgn) // iterate over 'vertical' / source regions ...          // 'RegionGroup' type sorts by memory address instead, and that would
732            // sometimes lead to the source instruments' region to be sorted into
733            // the wrong target layer)
734            OrderedRegionGroup currentGroup = sortRegionGroup(itGroup->second, instruments);
735    
736            // schedule copying the source dimension regions to the target dimension
737            // regions
738            CopyAssignSchedule schedule;
739            int iDstMainBit = 0;
740            for (OrderedRegionGroup::iterator itRgn = currentGroup.begin();
741                 itRgn != currentGroup.end(); ++itRgn) // iterate over 'vertical' / source regions ...
742          {          {
743              gig::Region* inRgn = itRgn->second;              gig::Region* inRgn = itRgn->second;
744              VelocityZones dstVelocityZones = getVelocityZones(outRgn);              #if DEBUG_COMBINE_INSTRUMENTS
745              for (uint iSrcLayer = 0; iSrcLayer < inRgn->Layers; ++iSrcLayer, ++iDstLayer) {              printf("[source region of '%s']\n", inRgn->GetParent()->pInfo->Name.c_str());
746                  copyDimensionRegions(outRgn, inRgn, dims, iDstLayer, iSrcLayer, dstVelocityZones);              #endif
747    
748                // determine how many main dimension zones this input region requires
749                gig::dimension_def_t* def = inRgn->GetDimensionDefinition(mainDimension);
750                const int inRgnMainZones = (def) ? def->zones : 1;
751    
752                for (uint iSrcMainBit = 0; iSrcMainBit < inRgnMainZones; ++iSrcMainBit, ++iDstMainBit) {
753                    scheduleCopyDimensionRegions(
754                        outRgn, inRgn, dims, mainDimension,
755                        iDstMainBit, iSrcMainBit, &schedule
756                    );
757              }              }
758          }          }
759    
760            // finally copy the scheduled source -> target dimension regions
761            for (uint i = 0; i < schedule.size(); ++i) {
762                CopyAssignSchedEntry& e = schedule[i];
763    
764                // backup the target DimensionRegion's current dimension zones upper
765                // limits (because the target DimensionRegion's upper limits are
766                // already defined correctly since calling AddDimension(), and the
767                // CopyAssign() call next, will overwrite those upper limits
768                // unfortunately
769                DimensionRegionUpperLimits dstUpperLimits = getDimensionRegionUpperLimits(e.dst);
770                DimensionRegionUpperLimits srcUpperLimits = getDimensionRegionUpperLimits(e.src);
771    
772                // now actually copy over the current DimensionRegion
773                const gig::Region* const origRgn = e.dst->GetParent(); // just for sanity check below
774                e.dst->CopyAssign(e.src);
775                assert(origRgn == e.dst->GetParent()); // if gigedit is crashing here, then you must update libgig (to at least SVN r2547, v3.3.0.svn10)
776    
777                // restore all original dimension zone upper limits except of the
778                // velocity dimension, because the velocity dimension zone sizes are
779                // allowed to differ for individual DimensionRegions in gig v3
780                // format
781                //
782                // if the main dinension is the 'velocity' dimension, then skip
783                // restoring the source's original velocity zone limits, because
784                // dealing with merging that is not implemented yet
785                // TODO: merge custom velocity splits if main dimension is the velocity dimension (for now equal sized velocity zones are used if mainDim is 'velocity')
786                if (srcUpperLimits.count(gig::dimension_velocity) && mainDimension != gig::dimension_velocity) {
787                    if (!dstUpperLimits.count(gig::dimension_velocity)) {
788                        addWarning("Source instrument seems to have a velocity dimension whereas new target instrument doesn't!");
789                    } else {
790                        dstUpperLimits[gig::dimension_velocity] =
791                            (e.velocityZone >= e.totalSrcVelocityZones)
792                                ? 127 : srcUpperLimits[gig::dimension_velocity];
793                    }
794                }
795                restoreDimensionRegionUpperLimits(e.dst, dstUpperLimits);
796            }
797      }      }
798    
799      // success      // success
# Line 612  static void combineInstruments(std::vect Line 804  static void combineInstruments(std::vect
804  // class 'CombineInstrumentsDialog'  // class 'CombineInstrumentsDialog'
805    
806  CombineInstrumentsDialog::CombineInstrumentsDialog(Gtk::Window& parent, gig::File* gig)  CombineInstrumentsDialog::CombineInstrumentsDialog(Gtk::Window& parent, gig::File* gig)
807      : Gtk::Dialog(_("Combine Instruments"), parent, true),      : ManagedDialog(_("Combine Instruments"), parent, true),
808        m_gig(gig), m_fileWasChanged(false), m_newCombinedInstrument(NULL),        m_gig(gig), m_fileWasChanged(false), m_newCombinedInstrument(NULL),
809        m_cancelButton(Gtk::Stock::CANCEL), m_OKButton(Gtk::Stock::OK),        m_cancelButton(_("_Cancel"), true), m_OKButton(_("_OK"), true),
810        m_descriptionLabel()        m_descriptionLabel(), m_tableDimCombo(2, 2), m_comboDimType(),
811          m_labelDimType(Glib::ustring(_("Combine by Dimension:")) + "  ", Gtk::ALIGN_END)
812  {  {
813        m_scrolledWindow.add(m_treeView);
814        m_scrolledWindow.set_policy(Gtk::POLICY_AUTOMATIC, Gtk::POLICY_AUTOMATIC);
815    
816      get_vbox()->pack_start(m_descriptionLabel, Gtk::PACK_SHRINK);      get_vbox()->pack_start(m_descriptionLabel, Gtk::PACK_SHRINK);
817      get_vbox()->pack_start(m_treeView);      get_vbox()->pack_start(m_tableDimCombo, Gtk::PACK_SHRINK);
818        get_vbox()->pack_start(m_scrolledWindow);
819      get_vbox()->pack_start(m_buttonBox, Gtk::PACK_SHRINK);      get_vbox()->pack_start(m_buttonBox, Gtk::PACK_SHRINK);
820    
821  #if GTKMM_MAJOR_VERSION >= 3  #if GTKMM_MAJOR_VERSION >= 3
822      description.set_line_wrap();      m_descriptionLabel.set_line_wrap();
823  #endif  #endif
824      m_descriptionLabel.set_text(_(      m_descriptionLabel.set_text(_(
825          "Select at least two instruments below that shall be combined  "          "Select at least two instruments below that shall be combined (as "
826          "as layers (using a \"Layer\" dimension) to a new instrument. The "          "separate dimension zones of the selected dimension type) as a new "
827          "original instruments remain untouched.")          "instrument. The original instruments remain untouched.\n\n"
828      );          "You may use this tool for example to combine solo instruments into "
829            "a combi sound arrangement by selecting the 'layer' dimension, or you "
830            "might combine similar sounding solo sounds into separate velocity "
831            "split layers by using the 'velocity' dimension, and so on."
832        ));
833    
834        // add dimension type combo box
835        {
836            int iLayerDimIndex = -1;
837            Glib::RefPtr<Gtk::ListStore> refComboModel = Gtk::ListStore::create(m_comboDimsModel);
838            for (int i = 0x01, iRow = 0; i < 0xff; i++) {
839                Glib::ustring sType =
840                    dimTypeAsString(static_cast<gig::dimension_t>(i));
841                if (sType.find("Unknown") != 0) {
842                    Gtk::TreeModel::Row row = *(refComboModel->append());
843                    row[m_comboDimsModel.m_type_id]   = i;
844                    row[m_comboDimsModel.m_type_name] = sType;
845                    if (i == gig::dimension_layer) iLayerDimIndex = iRow;
846                    iRow++;
847                }
848            }
849            m_comboDimType.set_model(refComboModel);
850            m_comboDimType.pack_start(m_comboDimsModel.m_type_id);
851            m_comboDimType.pack_start(m_comboDimsModel.m_type_name);
852            m_tableDimCombo.attach(m_labelDimType, 0, 1, 0, 1);
853            m_tableDimCombo.attach(m_comboDimType, 1, 2, 0, 1);
854            m_comboDimType.set_active(iLayerDimIndex); // preselect "layer" dimension
855        }
856    
857      m_refTreeModel = Gtk::ListStore::create(m_columns);      m_refTreeModel = Gtk::ListStore::create(m_columns);
858      m_treeView.set_model(m_refTreeModel);      m_treeView.set_model(m_refTreeModel);
859      //m_treeView.set_tooltip_text(_("asdf"));      m_treeView.set_tooltip_text(_(
860            "Use SHIFT + left click or CTRL + left click to select the instruments "
861            "you want to combine."
862        ));
863      m_treeView.append_column("Instrument", m_columns.m_col_name);      m_treeView.append_column("Instrument", m_columns.m_col_name);
864      m_treeView.set_headers_visible(false);      m_treeView.set_headers_visible(false);
865      m_treeView.get_selection()->set_mode(Gtk::SELECTION_MULTIPLE);      m_treeView.get_selection()->set_mode(Gtk::SELECTION_MULTIPLE);
# Line 682  CombineInstrumentsDialog::CombineInstrum Line 909  CombineInstrumentsDialog::CombineInstrum
909      );      );
910    
911      show_all_children();      show_all_children();
912    
913        // show a warning to user if he uses a .gig in v2 format
914        if (gig->pVersion->major < 3) {
915            Glib::ustring txt = _(
916                "You are currently using a .gig file in old v2 format. The current "
917                "combine algorithm will most probably fail trying to combine "
918                "instruments in this old format. So better save the file in new v3 "
919                "format before trying to combine your instruments."
920            );
921            Gtk::MessageDialog msg(*this, txt, false, Gtk::MESSAGE_WARNING);
922            msg.run();
923        }
924  }  }
925    
926  void CombineInstrumentsDialog::combineSelectedInstruments() {  void CombineInstrumentsDialog::combineSelectedInstruments() {
# Line 698  void CombineInstrumentsDialog::combineSe Line 937  void CombineInstrumentsDialog::combineSe
937          instruments.push_back(instrument);          instruments.push_back(instrument);
938      }      }
939    
940        g_warnings.clear();
941    
942      try {      try {
943          combineInstruments(instruments, m_gig, m_newCombinedInstrument);          // which main dimension was selected in the combo box?
944            gig::dimension_t mainDimension;
945            {
946                Gtk::TreeModel::iterator iterType = m_comboDimType.get_active();
947                if (!iterType) throw gig::Exception("No dimension selected");
948                Gtk::TreeModel::Row rowType = *iterType;
949                if (!rowType) throw gig::Exception("Something is wrong regarding dimension selection");
950                int iTypeID = rowType[m_comboDimsModel.m_type_id];
951                mainDimension = static_cast<gig::dimension_t>(iTypeID);
952            }
953    
954            // now start the actual cobination task ...
955            combineInstruments(instruments, m_gig, m_newCombinedInstrument, mainDimension);
956      } catch (RIFF::Exception e) {;      } catch (RIFF::Exception e) {;
957          Gtk::MessageDialog msg(*this, e.Message, false, Gtk::MESSAGE_ERROR);          Gtk::MessageDialog msg(*this, e.Message, false, Gtk::MESSAGE_ERROR);
958          msg.run();          msg.run();
959          return;          return;
960        } catch (...) {
961            Glib::ustring txt = _("An unknown exception occurred!");
962            Gtk::MessageDialog msg(*this, txt, false, Gtk::MESSAGE_ERROR);
963            msg.run();
964            return;
965        }
966    
967        if (!g_warnings.empty()) {
968            Glib::ustring txt = _(
969                "Combined instrument was created successfully, but there were warnings:"
970            );
971            txt += "\n\n";
972            for (Warnings::const_iterator itWarn = g_warnings.begin();
973                 itWarn != g_warnings.end(); ++itWarn)
974            {
975                txt += "-> " + *itWarn + "\n";
976            }
977            txt += "\n";
978            txt += _(
979                "You might also want to check the console for further warnings and "
980                "error messages."
981            );
982            Gtk::MessageDialog msg(*this, txt, false, Gtk::MESSAGE_WARNING);
983            msg.run();
984      }      }
985    
986      // no error occurred      // no error occurred

Legend:
Removed from v.2549  
changed lines
  Added in v.2894

  ViewVC Help
Powered by ViewVC