![]() | ![]() | ![]() | Kipinä internals: reference Manual | ![]() |
---|
enum KPWorkoutSplitType; KPWorkout* kp_workout_new (void); void kp_workout_destroy (KPWorkout *wo); gint kp_workout_cmp (gconstpointer a, gconstpointer b); void kp_workout_print (KPWorkout *wo); gboolean kp_workout_is_valid (KPWorkout *wo); void kp_workout_add_split (KPWorkout *wo, KPWorkoutSplitType, guint n, gfloat distance, KPCalendarTime *ct, const gchar *comment); guint kp_workout_get_n_splits (KPWorkout *wo); GSList* kp_workout_get_splits (KPWorkout *wo); gdouble kp_workout_get_distance (KPWorkout *wo); gdouble kp_workout_get_duration_in_seconds (KPWorkout *wo); void kp_workout_set_duration_in_seconds (KPWorkout *wo, gdouble seconds); gchar* kp_workout_get_duration_str (KPWorkout *wo); gint kp_workout_get_param_int (KPWorkout *wo, const gchar *param); gdouble kp_workout_get_param_double (KPWorkout *wo, const gchar *param); gchar* kp_workout_get_param (KPWorkout *wo, const gchar *param); gchar* kp_workout_get_formatted_date (KPWorkout *wo); gboolean kp_workout_set_param (KPWorkout *wo, gboolean replace, const gchar *param, const GValue *value);
typedef enum { KP_WORKOUT_SPLIT_TYPE_NORMAL, KP_WORKOUT_SPLIT_TYPE_WARM_UP, KP_WORKOUT_SPLIT_TYPE_COOL_DOWN, KP_WORKOUT_SPLIT_TYPE_RECOVERY, KP_WORKOUT_SPLIT_TYPE_N } KPWorkoutSplitType;
KPWorkout* kp_workout_new (void);
Create a new instance of
Returns : | A new |
gboolean kp_workout_is_valid (KPWorkout *wo);
Check the validity of the
wo : | A |
Returns : | TRUE if workout is valid and FALSE otherwise. |
void kp_workout_add_split (KPWorkout *wo, KPWorkoutSplitType, guint n, gfloat distance, KPCalendarTime *ct, const gchar *comment);
Dum.
wo : | A |
Param2 : | |
n : | number of split |
distance : | distance |
ct : | Duration of the split |
comment : | Some comments or NULL |
guint kp_workout_get_n_splits (KPWorkout *wo);
Just returns the number of splits of this workout.
wo : | A |
Returns : | Number of splits. |
GSList* kp_workout_get_splits (KPWorkout *wo);
Retrieve list of splits of this workout.
wo : | A |
Returns : | List of all splits of the workout or NULL if there are not any splits. |
gdouble kp_workout_get_distance (KPWorkout *wo);
wo : | a KPWorkout |
Returns : | distance as gdouble. |
gdouble kp_workout_get_duration_in_seconds (KPWorkout *wo);
Retrieve duration of the kp_workout in seconds. It can have up to 3 decimals because it can include milliseconds too.
wo : | A |
Returns : | Number of seconds (and milliseconds). |
void kp_workout_set_duration_in_seconds (KPWorkout *wo, gdouble seconds);
Sets 'duration' key in params-hashtable to string which
presents the same amount of time as seconds
.
wo : | a KPWorkout |
seconds : | duration in seconds |
gint kp_workout_get_param_int (KPWorkout *wo, const gchar *param);
wo : | |
param : | |
Returns : |
|
gdouble kp_workout_get_param_double (KPWorkout *wo, const gchar *param);
wo : | |
param : | |
Returns : |
|
gchar* kp_workout_get_param (KPWorkout *wo, const gchar *param);
Get value of the param.
wo : | A |
param : | The name of the param whose value to get |
Returns : | A newly-allocated string that must be freed by
the caller or NULL if there is no such param in
his |
gboolean kp_workout_set_param (KPWorkout *wo, gboolean replace, const gchar *param, const GValue *value);
Just sets kp_workouts' param
to value
and returns TRUE if
successful and FALSE otherwise.
wo : | a KPWorkout |
replace : | if TRUE and param exists, it will be replaced |
param : | name of the param |
value : | value of the param |
Returns : |
|
<<< kpcomment | kpcalendartime >>> |