/[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 2617 by schoenebeck, Tue Jun 10 22:49:45 2014 UTC revision 2845 by persson, Sun Sep 20 10:18:22 2015 UTC
# Line 1  Line 1 
1  /*  /*
2      Copyright (c) 2014 Christian Schoenebeck      Copyright (c) 2014-2015 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 20  Line 20 
20  #include <string.h>  #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>  #include <gtkmm/label.h>
25    
# Line 97  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 119  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 195  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 266  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 383  static DimensionZones preciseDimensionZo Line 382  static DimensionZones preciseDimensionZo
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          #if DEBUG_COMBINE_INSTRUMENTS
387          printf("%d..%d, ", iLow, iHigh);          printf("%d..%d, ", iLow, iHigh);
388          fflush(stdout);          fflush(stdout);
# Line 807  static void combineInstruments(std::vect Line 806  static void combineInstruments(std::vect
806  CombineInstrumentsDialog::CombineInstrumentsDialog(Gtk::Window& parent, gig::File* gig)  CombineInstrumentsDialog::CombineInstrumentsDialog(Gtk::Window& parent, gig::File* gig)
807      : Gtk::Dialog(_("Combine Instruments"), parent, true),      : Gtk::Dialog(_("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_tableDimCombo(2, 2), m_comboDimType(),        m_descriptionLabel(), m_tableDimCombo(2, 2), m_comboDimType(),
811        m_labelDimType(Glib::ustring(_("Combine by Dimension:")) + "  ", Gtk::ALIGN_END)        m_labelDimType(Glib::ustring(_("Combine by Dimension:")) + "  ", Gtk::ALIGN_END)
812  {  {

Legend:
Removed from v.2617  
changed lines
  Added in v.2845

  ViewVC Help
Powered by ViewVC