--- gigedit/trunk/src/gigedit/CombineInstrumentsDialog.cpp 2014/05/24 06:44:39 2579 +++ gigedit/trunk/src/gigedit/CombineInstrumentsDialog.cpp 2016/04/30 14:42:14 2894 @@ -1,5 +1,5 @@ /* - Copyright (c) 2014 Christian Schoenebeck + Copyright (c) 2014-2016 Christian Schoenebeck This file is part of "gigedit" and released under the terms of the GNU General Public License version 2. @@ -20,7 +20,6 @@ #include #include -#include #include #include @@ -97,7 +96,7 @@ * found with a range member point >= iStart */ static int findLowestRegionPoint(std::vector& instruments, int iStart) { - DLS::range_t searchRange = { iStart, 127 }; + DLS::range_t searchRange = { uint16_t(iStart), 127 }; int result = -1; for (uint i = 0; i < instruments.size(); ++i) { gig::Instrument* instr = instruments[i]; @@ -119,7 +118,7 @@ * with a range end >= iStart */ static int findFirstRegionEnd(std::vector& instruments, int iStart) { - DLS::range_t searchRange = { iStart, 127 }; + DLS::range_t searchRange = { uint16_t(iStart), 127 }; int result = -1; for (uint i = 0; i < instruments.size(); ++i) { gig::Instrument* instr = instruments[i]; @@ -195,7 +194,7 @@ iStart = findLowestRegionPoint(instruments, iStart); if (iStart < 0) break; const int iEnd = findFirstRegionEnd(instruments, iStart); - DLS::range_t range = { iStart, iEnd }; + DLS::range_t range = { uint16_t(iStart), uint16_t(iEnd) }; intersections.push_back(range); iStart = iEnd + 1; } @@ -266,7 +265,7 @@ itNums != it->second.end(); ++itNums) { const int iUpperLimit = *itNums; - DLS::range_t range = { iLow, iUpperLimit }; + DLS::range_t range = { uint16_t(iLow), uint16_t(iUpperLimit) }; dims[type].push_back(range); iLow = iUpperLimit + 1; } @@ -383,7 +382,7 @@ gig::DimensionRegion* dimRgn2 = rgn->pDimensionRegions[ (iDimRgn & mask) | ( z << iBaseBits) ]; int iHigh = dimRgn2->DimensionUpperLimits[iDimension]; - DLS::range_t range = { iLow, iHigh}; + DLS::range_t range = { uint16_t(iLow), uint16_t(iHigh) }; #if DEBUG_COMBINE_INSTRUMENTS printf("%d..%d, ", iLow, iHigh); fflush(stdout); @@ -469,7 +468,7 @@ #if DEBUG_COMBINE_INSTRUMENTS printf("dst "); fflush(stdout); #endif - fillDimValues(dstDimValues, dstDimCase, outRgn, true); + fillDimValues(dstDimValues, dstDimCase, outRgn, false); gig::DimensionRegion* srcDimRgn = inRgn->GetDimensionRegionByValue(srcDimValues); gig::DimensionRegion* dstDimRgn = outRgn->GetDimensionRegionByValue(dstDimValues); #if DEBUG_COMBINE_INSTRUMENTS @@ -505,7 +504,7 @@ printf("dst velocity value = %d\n", dstDimCase[gig::dimension_velocity]); printf("dst refilled "); fflush(stdout); #endif - fillDimValues(dstDimValues, dstDimCase, outRgn, true); + fillDimValues(dstDimValues, dstDimCase, outRgn, false); dstDimRgn = outRgn->GetDimensionRegionByValue(dstDimValues); #if DEBUG_COMBINE_INSTRUMENTS printf("reselected dstDimRgn=%lx\n", (uint64_t)dstDimRgn); @@ -660,7 +659,7 @@ iTotalZones += (def) ? def->zones : 1; } #if DEBUG_COMBINE_INSTRUMENTS - printf("Required total zones: %d\n", iTotalZones); + printf("Required total zones: %d, vertical regions: %d\n", iTotalZones, itGroup->second.size()); #endif // create all required dimensions for this output region @@ -722,6 +721,8 @@ #if DEBUG_COMBINE_INSTRUMENTS std::cout << "OK" << std::endl << std::flush; #endif + } else { + dims.erase(mainDimension); } // for the next task we need to have the current RegionGroup to be @@ -803,15 +804,18 @@ // class 'CombineInstrumentsDialog' CombineInstrumentsDialog::CombineInstrumentsDialog(Gtk::Window& parent, gig::File* gig) - : Gtk::Dialog(_("Combine Instruments"), parent, true), + : ManagedDialog(_("Combine Instruments"), parent, true), m_gig(gig), m_fileWasChanged(false), m_newCombinedInstrument(NULL), - m_cancelButton(Gtk::Stock::CANCEL), m_OKButton(Gtk::Stock::OK), + m_cancelButton(_("_Cancel"), true), m_OKButton(_("_OK"), true), m_descriptionLabel(), m_tableDimCombo(2, 2), m_comboDimType(), m_labelDimType(Glib::ustring(_("Combine by Dimension:")) + " ", Gtk::ALIGN_END) { + m_scrolledWindow.add(m_treeView); + m_scrolledWindow.set_policy(Gtk::POLICY_AUTOMATIC, Gtk::POLICY_AUTOMATIC); + get_vbox()->pack_start(m_descriptionLabel, Gtk::PACK_SHRINK); get_vbox()->pack_start(m_tableDimCombo, Gtk::PACK_SHRINK); - get_vbox()->pack_start(m_treeView); + get_vbox()->pack_start(m_scrolledWindow); get_vbox()->pack_start(m_buttonBox, Gtk::PACK_SHRINK); #if GTKMM_MAJOR_VERSION >= 3