Utilities

Utilities — Some utility API

Synopsis

#include <rclib-util.h>

gchar *             rclib_util_detect_encoding_by_locale
                                                        ();
const gchar *       rclib_util_get_cover_search_dir     ();
gchar *             rclib_util_get_data_dir             (const gchar *name,
                                                         const gchar *arg0);
gboolean            rclib_util_is_supported_list        (const gchar *file);
gboolean            rclib_util_is_supported_media       (const gchar *file);
gchar *             rclib_util_search_cover             (const gchar *uri,
                                                         const gchar *title,
                                                         const gchar *artist,
                                                         const gchar *album);
void                rclib_util_set_cover_search_dir     (const gchar *dir);

Description

Some utility API for the player.

Details

rclib_util_detect_encoding_by_locale ()

gchar *             rclib_util_detect_encoding_by_locale
                                                        ();

Get the most possible encoding by current locale settings.

Returns :

The encoding, NULL if the encoding cannot be detected. Free it after usage.

rclib_util_get_cover_search_dir ()

const gchar *       rclib_util_get_cover_search_dir     ();

Get the directory for searching the album cover image files.

Returns :

The directory path.

rclib_util_get_data_dir ()

gchar *             rclib_util_get_data_dir             (const gchar *name,
                                                         const gchar *arg0);

Get the data directory of the program.

name :

the program name

arg0 :

the first argument from the main function (argv[0])

Returns :

The data directory path.

rclib_util_is_supported_list ()

gboolean            rclib_util_is_supported_list        (const gchar *file);

Check whether the given playlist file is supported by the player.

file :

the filename to check

Returns :

Whether the file is supported.

rclib_util_is_supported_media ()

gboolean            rclib_util_is_supported_media       (const gchar *file);

Check whether the given media file is supported by the player.

file :

the filename to check

Returns :

Whether the file is supported.

rclib_util_search_cover ()

gchar *             rclib_util_search_cover             (const gchar *uri,
                                                         const gchar *title,
                                                         const gchar *artist,
                                                         const gchar *album);

Search the album cover image file by given information.

uri :

the URI

title :

the title

artist :

the artist

album :

the album

Returns :

The album cover image file path, NULL if not found.

rclib_util_set_cover_search_dir ()

void                rclib_util_set_cover_search_dir     (const gchar *dir);

Set the directory for searching the album cover image files.

dir :

the directory to set