9 const t_uint32 decode_flags = input_flag_no_seeking | input_flag_no_looping;
16 input.
open(NULL,
m_items[walk], decode_flags, p_abort);
29 while(input.
run(l_chunk, p_abort)) {
33 if (decoded > length) decoded = length;
43 void on_done(HWND p_wnd,
bool p_was_aborted) {
49 result <<
"Value: " <<
m_peak <<
"\n\n";
50 result <<
"Scanned items:\n";
52 result <<
m_items[walk] <<
"\n";
66 if (data.
get_count() == 0)
throw pfc::exception_invalid_params();
72 "Sample component: peak scan");
void on_init(HWND p_wnd)
Called from the main thread before spawning the worker thread. Note that you should not access the w...
Implementation of audio_chunk. Takes pfc allocator template as template parameter.
audio_sample get_peak(audio_sample p_peak) const
Helper, calculates peak value of data in the chunk. The optional parameter specifies initial peak val...
Template implementing reference-counting features of service_base. Intended for dynamic instantiation...
Shows the item being currently processed.
void RunCalculatePeak(metadb_handle_list_cref data)
double get_length() const
Retrieves audio duration, in seconds. Note that the reported duration should not be assumed to be th...
void run(threaded_process_status &p_status, abort_callback &p_abort)
Called from the worker thread. Do all the hard work here.
virtual void set_progress_secondary(t_size p_state)=0
Sets the secondary progress bar state; scale from progress_min to progress_max.
Callback class passed to your threaded_process client code; allows you to give various visual feedbac...
void info(const char *p_message)
void set_progress_secondary_float(double p_state)
Helper; sets secondary progress with a float 0..1 scale.
virtual void set_item_path(const char *p_item, t_size p_item_len=~0)=0
Sets the currently progressed item label; treats the label as a file path.
calculate_peak_process(metadb_handle_list_cref items)
string8_fastalloc string_formatter
Shows dual progress bars; implies flag_show_progress.
virtual t_size get_count() const =0
const metadb_handle_list m_items
Callback class for the threaded_process API. You must implement this to create your own threaded_proc...
HWND get_main_window()
Retrieves main app window. WARNING: this is provided for parent of dialog windows and such only; usin...
Shows the "abort" button.
Autopointer class to be used with all services. Manages reference counter calls behind-the-scenes.
virtual void set_progress(t_size p_state)=0
Sets the primary progress bar state; scale from progress_min to progress_max.
Helper template used to easily access core services. Usage: static_api_ptr_t<myclass> api; api->doso...
double get_duration() const
Retrieves duration of contained audio data, in seconds.
void on_done(HWND p_wnd, bool p_was_aborted)
Called after the worker thread has finished executing.