Zrythm
a highly automated and intuitive digital audio workstation
Loading...
Searching...
No Matches
progress_info.h
Go to the documentation of this file.
1// SPDX-FileCopyrightText: © 2022 Alexandros Theodotou <alex@zrythm.org>
2// SPDX-License-Identifier: LicenseRef-ZrythmLicense
3
10#ifndef __UTILS_PROGRESS_INFO_H__
11#define __UTILS_PROGRESS_INFO_H__
12
19typedef enum ProgressStatus
20{
21 PROGRESS_STATUS_PENDING_START,
22 PROGRESS_STATUS_PENDING_CANCELLATION,
23 PROGRESS_STATUS_RUNNING,
24 PROGRESS_STATUS_COMPLETED,
25} ProgressStatus;
26
27typedef enum ProgressCompletionType
28{
29 PROGRESS_COMPLETED_CANCELLED,
30 PROGRESS_COMPLETED_HAS_WARNING,
31 PROGRESS_COMPLETED_HAS_ERROR,
32 PROGRESS_COMPLETED_SUCCESS,
33} ProgressCompletionType;
34
35typedef struct ProgressInfo ProgressInfo;
36
37ProgressInfo *
38progress_info_new (void);
39
40ProgressStatus
41progress_info_get_status (ProgressInfo * self);
42
43ProgressCompletionType
44progress_info_get_completion_type (ProgressInfo * self);
45
49void
51
55void
57 ProgressInfo * self,
58 ProgressCompletionType type,
59 const char * msg);
60
64char *
65progress_info_get_message (ProgressInfo * self);
66
70void
71progress_info_get_progress (ProgressInfo * self, double * progress, char ** str);
72
76void
78 ProgressInfo * self,
79 double progress,
80 const char * msg);
81
82bool
83progress_info_pending_cancellation (ProgressInfo * self);
84
85void
86progress_info_free (ProgressInfo * self);
87
92#endif
void progress_info_update_progress(ProgressInfo *self, double progress, const char *msg)
To be called by the task itself.
void progress_info_mark_completed(ProgressInfo *self, ProgressCompletionType type, const char *msg)
To be called by the task itself.
char * progress_info_get_message(ProgressInfo *self)
Returns a newly allocated string.
void progress_info_request_cancellation(ProgressInfo *self)
To be called by the task caller.
void progress_info_get_progress(ProgressInfo *self, double *progress, char **str)
To be called by the task caller.