32 |
|
|
33 |
progress_t::progress_t() { |
progress_t::progress_t() { |
34 |
callback = NULL; |
callback = NULL; |
35 |
|
custom = NULL; |
36 |
__range_min = 0.0f; |
__range_min = 0.0f; |
37 |
__range_max = 1.0f; |
__range_max = 1.0f; |
38 |
} |
} |
42 |
if (pProgress && pProgress->callback) { |
if (pProgress && pProgress->callback) { |
43 |
const float totalrange = pProgress->__range_max - pProgress->__range_min; |
const float totalrange = pProgress->__range_max - pProgress->__range_min; |
44 |
const float totalprogress = pProgress->__range_min + subprogress * totalrange; |
const float totalprogress = pProgress->__range_min + subprogress * totalrange; |
45 |
pProgress->callback(totalprogress); // now actually notify about the progress |
pProgress->factor = totalprogress; |
46 |
|
pProgress->callback(pProgress); // now actually notify about the progress |
47 |
} |
} |
48 |
} |
} |
49 |
|
|
52 |
if (pParentProgress && pParentProgress->callback) { |
if (pParentProgress && pParentProgress->callback) { |
53 |
const float totalrange = pParentProgress->__range_max - pParentProgress->__range_min; |
const float totalrange = pParentProgress->__range_max - pParentProgress->__range_min; |
54 |
pSubProgress->callback = pParentProgress->callback; |
pSubProgress->callback = pParentProgress->callback; |
55 |
|
pSubProgress->custom = pParentProgress->custom; |
56 |
pSubProgress->__range_min = pParentProgress->__range_min + totalrange * currentTask / totalTasks; |
pSubProgress->__range_min = pParentProgress->__range_min + totalrange * currentTask / totalTasks; |
57 |
pSubProgress->__range_max = pSubProgress->__range_min + totalrange / totalTasks; |
pSubProgress->__range_max = pSubProgress->__range_min + totalrange / totalTasks; |
58 |
} |
} |
1865 |
std::cout << "gig::Exception: " << Message << std::endl; |
std::cout << "gig::Exception: " << Message << std::endl; |
1866 |
} |
} |
1867 |
|
|
1868 |
|
|
1869 |
|
// *************** functions *************** |
1870 |
|
// * |
1871 |
|
|
1872 |
|
/** |
1873 |
|
* Returns the name of this C++ library. This is usually "libgig" of |
1874 |
|
* course. This call is equivalent to RIFF::libraryName() and |
1875 |
|
* DLS::libraryName(). |
1876 |
|
*/ |
1877 |
|
String libraryName() { |
1878 |
|
return PACKAGE; |
1879 |
|
} |
1880 |
|
|
1881 |
|
/** |
1882 |
|
* Returns version of this C++ library. This call is equivalent to |
1883 |
|
* RIFF::libraryVersion() and DLS::libraryVersion(). |
1884 |
|
*/ |
1885 |
|
String libraryVersion() { |
1886 |
|
return VERSION; |
1887 |
|
} |
1888 |
|
|
1889 |
} // namespace gig |
} // namespace gig |