/[svn]/libgig/trunk/src/helper.h
ViewVC logotype

Diff of /libgig/trunk/src/helper.h

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

revision 3476 by schoenebeck, Wed Feb 20 19:12:49 2019 UTC revision 3481 by schoenebeck, Fri Feb 22 12:12:50 2019 UTC
# Line 306  inline void __divide_progress(RIFF::prog Line 306  inline void __divide_progress(RIFF::prog
306      }      }
307  }  }
308    
309    // private helper function to divide a progress into subprogresses
310    inline void __divide_progress(RIFF::progress_t* pParentProgress, RIFF::progress_t* pSubProgress, float total, float lo, float hi) {
311        if (pParentProgress && pParentProgress->callback) {
312            const float totalrange    = pParentProgress->__range_max - pParentProgress->__range_min;
313            pSubProgress->callback    = pParentProgress->callback;
314            pSubProgress->custom      = pParentProgress->custom;
315            pSubProgress->abort       = pParentProgress->abort;
316            pSubProgress->__range_min = pParentProgress->__range_min + totalrange * (lo / total);
317            pSubProgress->__range_max = pSubProgress->__range_min + totalrange * ((hi-lo) / total);
318        }
319    }
320    
321  #ifdef _WIN32  #ifdef _WIN32
322  # define NATIVE_PATH_SEPARATOR '\\'  # define NATIVE_PATH_SEPARATOR '\\'
323  #else  #else

Legend:
Removed from v.3476  
changed lines
  Added in v.3481

  ViewVC Help
Powered by ViewVC