![]() | ![]() | ![]() | streamtuner Developers Manual | ![]() |
---|
st-util — miscellaneous utility functions.
#define ST_NUMERIC char* st_format_bitrate (int bitrate); char* st_format_samplerate (int samplerate); char* st_format_channels (int channels); char* st_format_audio_properties (int bitrate, int samplerate, int channels); char* st_strchr_span (const char *str, int c); char* st_strstr_span (const char *big, const char *little); char* st_str_has_prefix_span (const char *str, const char *prefix); gboolean st_str_like (const char *str, const char *charset); GdkPixbuf* st_pixbuf_new_from_file (const char *filename); GtkWidget* st_hig_section_new (const char *title, GtkWidget *contents); void st_set_tooltip (GtkWidget *widget, const char *tooltip);
char* st_format_bitrate (int bitrate);
Formats bitrate as a string.
bitrate : | a bitrate to format, expressed in kilobits per seconds. |
Returns : | bitrate formatted as a string, which should be freed when no longer needed. |
char* st_format_samplerate (int samplerate);
Formats samplerate as a string.
samplerate : | a samplerate to format, expressed in Hz. |
Returns : | samplerate formatted as a string, which should be freed when no longer needed. |
char* st_format_channels (int channels);
Formats channels as a string.
channels : | a number of audio channels, which must be greater than 0. |
Returns : | channels formatted as a string, which should be freed when no longer needed. |
char* st_format_audio_properties (int bitrate, int samplerate, int channels);
Formats bitrate, samplerate and channels as a string.
bitrate : | a bitrate expressed in kbps, or 0. |
samplerate : | a samplerate expressed in kbps, or 0. |
channels : | a number of audio channels, or 0. |
Returns : | a formatted string, which should be freed when no longer needed. |
char* st_strchr_span (const char *str, int c);
Locates the first occurrence of c (converted to a char) in str.
str : | a string. |
c : | a character to locate, which must not be 0. |
Returns : | a pointer to the character following the first occurrence of c in str, or NULL if c does not appear in str. |
char* st_strstr_span (const char *big, const char *little);
Locates the first occurrence of little in big.
big : | a string. |
little : | a string to search for in big. |
Returns : | a pointer to the character following the first occurrence of little in big, or NULL if little does not appear in big. |
char* st_str_has_prefix_span (const char *str, const char *prefix);
Checks if str begins with prefix.
str : | a string. |
prefix : | the prefix to look for. |
Returns : | a pointer to the character following prefix in str, or NULL if str does not begin with prefix. |
gboolean st_str_like (const char *str, const char *charset);
Checks if all the characters of str are members of charset.
str : | a string. |
charset : | a set of characters. |
Returns : | TRUE if all the characters of str are members of charset. |
GdkPixbuf* st_pixbuf_new_from_file (const char *filename);
Creates a new pixbuf by loading an image from a file. If the file cannot be loaded, st_notice() will be used to print the error.
filename : | the name of the file to load. |
Returns : | a new GdkPixbuf, or NULL on error. |
GtkWidget* st_hig_section_new (const char *title, GtkWidget *contents);
Creates a new HIG-compliant section, as defined by Window Layout.
title : | the section title. |
contents : | the widget to use as section contents. |
Returns : | a new GtkVBox containing title and contents. |
<< st-transfer | st-version >> |