2023-08-16 00:20:26 +10:00
|
|
|
/* SPDX-FileCopyrightText: 2008 Blender Authors
|
2023-05-31 16:19:06 +02:00
|
|
|
*
|
|
|
|
|
* SPDX-License-Identifier: GPL-2.0-or-later */
|
2014-01-29 20:01:30 +11:00
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
2019-02-18 08:08:12 +11:00
|
|
|
/** \file
|
2021-10-06 11:37:50 +11:00
|
|
|
* \ingroup bli
|
2014-01-29 20:01:30 +11:00
|
|
|
*/
|
|
|
|
|
|
2015-06-30 14:47:31 +10:00
|
|
|
#include "BLI_compiler_attrs.h"
|
|
|
|
|
|
2020-03-02 15:04:53 +01:00
|
|
|
#ifdef __cplusplus
|
|
|
|
|
extern "C" {
|
|
|
|
|
#endif
|
|
|
|
|
|
2021-12-09 20:01:44 +11:00
|
|
|
/**
|
|
|
|
|
* Generate time-code/frame number string and store in \a str
|
|
|
|
|
*
|
|
|
|
|
* \param str: destination string
|
|
|
|
|
* \param maxncpy: maximum number of characters to copy `sizeof(str)`
|
|
|
|
|
* \param brevity_level: special setting for #View2D grid drawing,
|
|
|
|
|
* used to specify how detailed we need to be
|
|
|
|
|
* \param time_seconds: time total time in seconds
|
|
|
|
|
* \param fps: frames per second, typically from the #FPS macro
|
|
|
|
|
* \param timecode_style: enum from #eTimecodeStyles
|
|
|
|
|
* \return length of \a str
|
|
|
|
|
*/
|
2014-01-29 20:01:30 +11:00
|
|
|
size_t BLI_timecode_string_from_time(char *str,
|
2022-01-12 12:49:36 +01:00
|
|
|
size_t maxncpy,
|
2022-01-07 11:38:08 +11:00
|
|
|
int brevity_level,
|
|
|
|
|
float time_seconds,
|
|
|
|
|
double fps,
|
|
|
|
|
short timecode_style) ATTR_NONNULL();
|
2014-01-29 20:01:30 +11:00
|
|
|
|
2021-12-09 20:01:44 +11:00
|
|
|
/**
|
|
|
|
|
* Generate time string and store in \a str
|
|
|
|
|
*
|
|
|
|
|
* \param str: destination string
|
|
|
|
|
* \param maxncpy: maximum number of characters to copy `sizeof(str)`
|
|
|
|
|
* \param time_seconds: time total time in seconds
|
|
|
|
|
* \return length of \a str
|
|
|
|
|
*/
|
2022-01-12 12:49:36 +01:00
|
|
|
size_t BLI_timecode_string_from_time_simple(char *str, size_t maxncpy, double time_seconds)
|
2022-01-07 11:38:08 +11:00
|
|
|
ATTR_NONNULL();
|
2015-06-30 14:47:31 +10:00
|
|
|
|
2021-12-09 20:01:44 +11:00
|
|
|
/**
|
|
|
|
|
* Generate time string and store in \a str
|
|
|
|
|
*
|
|
|
|
|
* \param str: destination string
|
|
|
|
|
* \param maxncpy: maximum number of characters to copy `sizeof(str)`
|
|
|
|
|
* \param brevity_level: special setting for #View2D grid drawing,
|
|
|
|
|
* used to specify how detailed we need to be
|
|
|
|
|
* \param time_seconds: time total time in seconds
|
|
|
|
|
* \return length of \a str
|
|
|
|
|
*
|
|
|
|
|
* \note in some cases this is used to print non-seconds values.
|
|
|
|
|
*/
|
2015-06-30 14:47:31 +10:00
|
|
|
size_t BLI_timecode_string_from_time_seconds(char *str,
|
2022-01-12 12:49:36 +01:00
|
|
|
size_t maxncpy,
|
2022-01-07 11:38:08 +11:00
|
|
|
int brevity_level,
|
|
|
|
|
float time_seconds) ATTR_NONNULL();
|
2014-01-29 20:01:30 +11:00
|
|
|
|
2020-03-02 15:04:53 +01:00
|
|
|
#ifdef __cplusplus
|
|
|
|
|
}
|
|
|
|
|
#endif
|