RIFF::progress_t Struct Reference

Used for indicating the progress of a certain task. More...

`#include <RIFF.h>`

## Public Member Functions

std::vector< progress_t > | subdivide (int iSubtasks) const
| Divides this progress task into the requested amount of equal weighted sub-progress tasks and returns a vector with those subprogress tasks.
std::vector< progress_t > | subdivide (std::vector< float > vSubTaskPortions) const
| Divides this progress task into the requested amount of sub-progress tasks, where each one of those new sub-progress tasks is created with its requested individual weight / portion, and finally returns a vector with those new subprogress tasks.

## Public Attributes

void(* | callback )(progress_t *)
| Callback function pointer which has to be assigned to a function for progress notification.
float | factor
| Reflects current progress as value between 0.0 and 1.0.
void * | custom
| This pointer can be used for arbitrary data.
const char * | activity
| Text which describes current ongoing action (e.g. to be displayed along a progress bar).
float | __range_min
| Only for internal usage, do not modify!
float | __range_max
| Only for internal usage, do not modify!
void * | __private
| Only for internal usage, do not modify!

## Detailed Description

Used for indicating the progress of a certain task.

The function pointer argument has to be supplied with a valid function of the given signature which will then be called on progress changes. An equivalent progress_t structure will be passed back as argument to the callback function on each progress change. The factor field of the supplied progress_t structure will then reflect the current progress as value between 0.0 and 1.0. You might want to use the custom field for data needed in your callback function.

Definition at line 167 of file RIFF.h.

## Constructor & Destructor Documentation

## progress_t()

RIFF::progress_t::progress_t | ( |  | ) |

Definition at line 83 of file RIFF.cpp.

## ~progress_t()

RIFF::progress_t::~progress_t | ( |  | ) |

virtual

Definition at line 92 of file RIFF.cpp.

## Member Function Documentation

## subdivide() [1/2]

std::vector< progress_t > RIFF::progress_t::subdivide | ( | int | iSubtasks | ) | const

Divides this progress task into the requested amount of equal weighted sub-progress tasks and returns a vector with those subprogress tasks.

Parameters

  iSubtasks | - total amount sub tasks this task should be subdivided

Returns
  subtasks

Definition at line 102 of file RIFF.cpp.

## subdivide() [2/2]

std::vector< progress_t > RIFF::progress_t::subdivide | ( | std::vector< float > | vSubTaskPortions | ) | const

Divides this progress task into the requested amount of sub-progress tasks, where each one of those new sub-progress tasks is created with its requested individual weight / portion, and finally returns a vector with those new subprogress tasks.

The amount of subprogresses to be created is determined by this method by calling `vSubTaskPortions.size()` .

Example: consider you wanted to create 3 subprogresses where the 1st subtask should be assigned 10% of the new 3 subprogresses' overall progress, the 2nd subtask should be assigned 50% of the new 3 subprogresses' overall progress, and the 3rd subtask should be assigned 40%, then you might call this method like this:

std::vector<progress_t> subprogresses = progress.subdivide({0.1, 0.5, 0.4});

Parameters

  vSubTaskPortions | - amount and individual weight of subtasks to be created

Returns
  subtasks

Definition at line 134 of file RIFF.cpp.

## Member Data Documentation

## __private

void* RIFF::progress_t::__private

Only for internal usage, do not modify!

Definition at line 174 of file RIFF.h.

Referenced by RIFF::File::Save(), RIFF::File::Save(), RIFF::Chunk::WriteChunk(), and RIFF::List::WriteChunk().

## __range_max

float RIFF::progress_t::__range_max

Only for internal usage, do not modify!

Definition at line 173 of file RIFF.h.

Referenced by gig::File::GetInstrument().

## __range_min

float RIFF::progress_t::__range_min

Only for internal usage, do not modify!

Definition at line 172 of file RIFF.h.

Referenced by gig::File::GetInstrument().

## activity

const char* RIFF::progress_t::activity

Text which describes current ongoing action (e.g. to be displayed along a progress bar).

Definition at line 171 of file RIFF.h.

Referenced by DLS::File::Save(), and DLS::File::Save().

## callback

void(* RIFF::progress_t::callback) (progress_t *)

Callback function pointer which has to be assigned to a function for progress notification.

Definition at line 168 of file RIFF.h.

Referenced by gig::File::GetInstrument().

## custom

void* RIFF::progress_t::custom

This pointer can be used for arbitrary data.

Definition at line 170 of file RIFF.h.

## factor

float RIFF::progress_t::factor

Reflects current progress as value between 0.0 and 1.0.

Definition at line 169 of file RIFF.h.

The documentation for this struct was generated from the following files:

- RIFF.h
- RIFF.cpp