foobar2000 SDK  2015-08-03
Public Types | Public Member Functions | Protected Member Functions
threaded_process_statusabstract

#include <threaded_process.h>

Public Types

enum  { progress_min = 0, progress_max = 5000 }
 

Public Member Functions

virtual void force_update ()=0
 
virtual bool is_paused ()=0
 
void poll_pause ()
 
virtual bool process_pause ()=0
 
virtual void set_item (const char *p_item, t_size p_item_len=~0)=0
 
virtual void set_item_path (const char *p_item, t_size p_item_len=~0)=0
 
virtual void set_progress (t_size p_state)=0
 
void set_progress (t_size p_state, t_size p_max)
 
void set_progress_float (double p_state)
 
virtual void set_progress_secondary (t_size p_state)=0
 
void set_progress_secondary (t_size p_state, t_size p_max)
 
void set_progress_secondary_float (double p_state)
 
virtual void set_title (const char *p_title, t_size p_title_len=~0)=0
 

Protected Member Functions

 threaded_process_status ()
 
 ~threaded_process_status ()
 

Detailed Description

Callback class passed to your threaded_process client code; allows you to give various visual feedback to the user.

Definition at line 2 of file threaded_process.h.

Member Enumeration Documentation

anonymous enum
Enumerator
progress_min 
progress_max 

Definition at line 4 of file threaded_process.h.

Constructor & Destructor Documentation

threaded_process_status::threaded_process_status ( )
inlineprotected

Definition at line 37 of file threaded_process.h.

37 {}
threaded_process_status::~threaded_process_status ( )
inlineprotected

Definition at line 38 of file threaded_process.h.

38 {}

Member Function Documentation

virtual void threaded_process_status::force_update ( )
pure virtual

Should not be used.

virtual bool threaded_process_status::is_paused ( )
pure virtual

Returns whether the process is paused.

void threaded_process_status::poll_pause ( )
inline

Automatically sleeps if the process is paused.

Definition at line 26 of file threaded_process.h.

26 {if (!process_pause()) throw exception_aborted();}
virtual bool process_pause()=0
Checks if process is paused and sleeps if needed; returns false when process should be aborted...
virtual bool threaded_process_status::process_pause ( )
pure virtual

Checks if process is paused and sleeps if needed; returns false when process should be aborted, true on success.
You should use poll_pause() instead of calling this directly.

virtual void threaded_process_status::set_item ( const char *  p_item,
t_size  p_item_len = ~0 
)
pure virtual

Sets the currently progressed item label. When working with files, you should use set_file_path() instead.

virtual void threaded_process_status::set_item_path ( const char *  p_item,
t_size  p_item_len = ~0 
)
pure virtual

Sets the currently progressed item label; treats the label as a file path.

virtual void threaded_process_status::set_progress ( t_size  p_state)
pure virtual

Sets the primary progress bar state; scale from progress_min to progress_max.

void threaded_process_status::set_progress ( t_size  p_state,
t_size  p_max 
)

Helper; sets primary progress with a custom scale.

Definition at line 3 of file threaded_process.cpp.

4 {
6 }
t_size MulDiv_Size(t_size x, t_size y, t_size z)
Definition: int_types.h:52
virtual void set_progress(t_size p_state)=0
Sets the primary progress bar state; scale from progress_min to progress_max.
void threaded_process_status::set_progress_float ( double  p_state)

Helper; sets primary progress with a float 0..1 scale.

Definition at line 13 of file threaded_process.cpp.

14 {
15  if (p_state < 0.0) set_progress(progress_min);
16  else if (p_state < 1.0) set_progress( progress_min + (t_size)(p_state * (progress_max - progress_min)));
18 }
size_t t_size
Definition: int_types.h:48
virtual void set_progress(t_size p_state)=0
Sets the primary progress bar state; scale from progress_min to progress_max.
virtual void threaded_process_status::set_progress_secondary ( t_size  p_state)
pure virtual

Sets the secondary progress bar state; scale from progress_min to progress_max.

void threaded_process_status::set_progress_secondary ( t_size  p_state,
t_size  p_max 
)

Helper; sets secondary progress with a custom scale.

Definition at line 8 of file threaded_process.cpp.

9 {
11 }
virtual void set_progress_secondary(t_size p_state)=0
Sets the secondary progress bar state; scale from progress_min to progress_max.
t_size MulDiv_Size(t_size x, t_size y, t_size z)
Definition: int_types.h:52
void threaded_process_status::set_progress_secondary_float ( double  p_state)

Helper; sets secondary progress with a float 0..1 scale.

Definition at line 20 of file threaded_process.cpp.

21 {
22  if (p_state < 0.0) set_progress_secondary(progress_min);
23  else if (p_state < 1.0) set_progress_secondary( progress_min + (t_size)(p_state * (progress_max - progress_min)));
25 }
virtual void set_progress_secondary(t_size p_state)=0
Sets the secondary progress bar state; scale from progress_min to progress_max.
size_t t_size
Definition: int_types.h:48
virtual void threaded_process_status::set_title ( const char *  p_title,
t_size  p_title_len = ~0 
)
pure virtual

Sets the title of the dialog. You normally don't need this function unless you want to override the title you set when initializing the threaded_process.


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