BEAST/BSE - Better Audio System and Sound Engine  0.8.2
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
Defines | Functions
sfitime.hh File Reference
#include <sfi/sfivalues.hh>

Go to the source code of this file.

Defines

#define SFI_USEC_FACTOR
#define SFI_MIN_TIME
#define SFI_MAX_TIME

Functions

SfiTime sfi_time_system (void)
SfiTime sfi_time_to_utc (SfiTime ustime)
SfiTime sfi_time_from_utc (SfiTime ustime)
gchar * sfi_time_to_string (SfiTime ustime)
gchar * sfi_time_to_nice_string (SfiTime ustime, const gchar *elements)
SfiTime sfi_time_from_string (const gchar *time_string)
SfiTime sfi_time_from_string_err (const gchar *time_string, gchar **error_p)
void _sfi_init_time (void)

Detailed Description


Function Documentation

SfiTime sfi_time_from_string ( const gchar *  time_string)
Parameters:
time_stringstring containing human readable date and time
Returns:
parsed time in micro seconds or 0 on error

Simple variant of sfi_time_from_string_err().

SfiTime sfi_time_from_string_err ( const gchar *  time_string,
gchar **  error_p 
)
Parameters:
time_stringstring containing human readable date and time
error_plocation for newly allocated string containing conversion errors
Returns:
parsed time in micro seconds, may be 0 on error

Parse date and time from a string of characters and indicate possible errors. Several attempts are made to reconstruct a valid date and time despite possible errors. However, if all attempts fail, the returned time is 0. The time returned is UTC, refer to sfi_time_from_utc() in order to retrieve the local standard time.

SfiTime sfi_time_from_utc ( SfiTime  ustime)
Parameters:
ustimeUTC relative time in micro seconds
Returns:
local standard time in micro seconds

Convert the Coordinated Universal Time (UTC) ustime into local standard time. This function is MT-safe and may be called from any thread.

SfiTime sfi_time_system ( void  )
Returns:
Current system time in micro seconds

Get the current system time in micro seconds. Subsequent calls to this function do not necessarily return greater values. In fact, a second call may return a value smaller than the first call under certain system conditions. The time returned is UTC, refer to sfi_time_from_utc() in order to retrieve the local standard time. This function is MT-safe and may be called from any thread.

gchar* sfi_time_to_nice_string ( SfiTime  ustime,
const gchar *  elements 
)
Parameters:
ustimetime in micro seconds
elementsstring identifying time elements
Returns:
newly allocated string Retrieve the time ustime in human readable form. Within the rnage of date and time formats parsable by sfi_time_from_string(), the nicest display is selected according to the current locale and other user settings. By means of the elements argument, various elemtns of a full date string can be selected:
  • H - display hours
  • M - display minutes
  • S - display seconds
  • d - display day
  • m - display month
  • y - display year
The returned time string describes UTC time and thus contains no time zone or UTC offset information.
gchar* sfi_time_to_string ( SfiTime  ustime)
Parameters:
ustimetime in micro seconds
Returns:
newly allocated string

Retrieve the time ustime in human readable form. The returned time string describes UTC time and thus contains no time zone or UTC offset information.

SfiTime sfi_time_to_utc ( SfiTime  ustime)
Parameters:
ustimelocal standard time in micro seconds
Returns:
UTC relative time in micro seconds

Convert the local standard time ustime into Coordinated Universal Time (UTC). This function is MT-safe and may be called from any thread.

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines