MIRAGE_Language object

## MIRAGE_Language object MIRAGE_Language object — Object representing a language for session or track |

## Synopsis

    #include <mirage.h>

    enum                MIRAGE_Language_PackTypes;
                        MIRAGE_Language;
    gboolean            mirage_language_set_langcode        (MIRAGE_Language *self,
                                                             gint langcode,
                                                             GError **error);
    gboolean            mirage_language_get_langcode        (MIRAGE_Language *self,
                                                             gint *langcode,
                                                             GError **error);
    gboolean            mirage_language_set_pack_data       (MIRAGE_Language *self,
                                                             gint pack_type,
                                                             gchar *pack_data,
                                                             gint length,
                                                             GError **error);
    gboolean            mirage_language_get_pack_data       (MIRAGE_Language *self,
                                                             gint pack_type,
                                                             gchar **pack_data,
                                                             gint *length,
                                                             GError **error);

## Object Hierarchy

      GObject
       +----MIRAGE_Object
             +----MIRAGE_Language

## Description

MIRAGE_Language object represents a CD-TEXT language for session or track. It is a container object that stores language code and CD-TEXT pack data for different pack types.

## Details

### enum MIRAGE_Language_PackTypes

    typedef enum {
        MIRAGE_LANGUAGE_PACK_TITLE       = 0x80,
        MIRAGE_LANGUAGE_PACK_PERFORMER   = 0x81,
        MIRAGE_LANGUAGE_PACK_SONGWRITER  = 0x82,
        MIRAGE_LANGUAGE_PACK_COMPOSER    = 0x83,
        MIRAGE_LANGUAGE_PACK_ARRANGER    = 0x84,
        MIRAGE_LANGUAGE_PACK_MESSAGE     = 0x85,
        MIRAGE_LANGUAGE_PACK_DISC_ID     = 0x86,
        MIRAGE_LANGUAGE_PACK_GENRE       = 0x87,
        MIRAGE_LANGUAGE_PACK_TOC         = 0x88,
        MIRAGE_LANGUAGE_PACK_TOC2        = 0x89,
        MIRAGE_LANGUAGE_PACK_RES_8A      = 0x8A,
        MIRAGE_LANGUAGE_PACK_RES_8B      = 0x8B,
        MIRAGE_LANGUAGE_PACK_RES_8C      = 0x8C,
        MIRAGE_LANGUAGE_PACK_CLOSED_INFO = 0x8D,
        MIRAGE_LANGUAGE_PACK_UPC_ISRC    = 0x8E,
        MIRAGE_LANGUAGE_PACK_SIZE        = 0x8F,
    } MIRAGE_Language_PackTypes;

CD-TEXT pack types

`MIRAGE_LANGUAGE_PACK_TITLE` | Album name and Track titles
`MIRAGE_LANGUAGE_PACK_PERFORMER` | Singer/player/conductor/orchestra
`MIRAGE_LANGUAGE_PACK_SONGWRITER` | Name of the songwriter
`MIRAGE_LANGUAGE_PACK_COMPOSER` | Name of the composer
`MIRAGE_LANGUAGE_PACK_ARRANGER` | Name of the arranger
`MIRAGE_LANGUAGE_PACK_MESSAGE` | Message from content provider or artist
`MIRAGE_LANGUAGE_PACK_DISC_ID` | Disc identification information
`MIRAGE_LANGUAGE_PACK_GENRE` | Genre identification / information
`MIRAGE_LANGUAGE_PACK_TOC` | TOC information
`MIRAGE_LANGUAGE_PACK_TOC2` | Second TOC
`MIRAGE_LANGUAGE_PACK_RES_8A` | Reserved 8A
`MIRAGE_LANGUAGE_PACK_RES_8B` | Reserved 8B
`MIRAGE_LANGUAGE_PACK_RES_8C` | Reserved 8C
`MIRAGE_LANGUAGE_PACK_CLOSED_INFO` | For internal use by content provider
`MIRAGE_LANGUAGE_PACK_UPC_ISRC` | UPC/EAN code of album and ISRC for tracks
`MIRAGE_LANGUAGE_PACK_SIZE` | Size information of the block

### MIRAGE_Language

    typedef struct _MIRAGE_Language MIRAGE_Language;

Contains private data only, and should be accessed using the functions below.

### mirage_language_set_langcode ()

    gboolean            mirage_language_set_langcode        (MIRAGE_Language *self,
                                                             gint langcode,
                                                             GError **error);

Sets language's language code.

`self` : | a MIRAGE_Language
`langcode` : | language code
`error` : | location to store error, or `NULL`
Returns : | `TRUE` on success, `FALSE` on failure

### mirage_language_get_langcode ()

    gboolean            mirage_language_get_langcode        (MIRAGE_Language *self,
                                                             gint *langcode,
                                                             GError **error);

Retrieves language's language code.

`self` : | a MIRAGE_Language
`langcode` : | location to store language code
`error` : | location to store error, or `NULL`
Returns : | `TRUE` on success, `FALSE` on failure

### mirage_language_set_pack_data ()

    gboolean            mirage_language_set_pack_data       (MIRAGE_Language *self,
                                                             gint pack_type,
                                                             gchar *pack_data,
                                                             gint length,
                                                             GError **error);

Sets pack data of type `pack_type` to data in `pack_data`. `length` is length of data in `pack_data`. `pack_type` must be one of MIRAGE_Language_PackTypes.

`self` : | a MIRAGE_Language
`pack_type` : | pack type
`pack_data` : | pack data
`length` : | length of pack data
`error` : | location to store error, or `NULL`
Returns : | `TRUE` on success, `FALSE` on failure

### mirage_language_get_pack_data ()

    gboolean            mirage_language_get_pack_data       (MIRAGE_Language *self,
                                                             gint pack_type,
                                                             gchar **pack_data,
                                                             gint *length,
                                                             GError **error);

Retrieves pack data of type `pack_type`. Copy of pack data is stored in `pack` data; it should be freed with `g_free()` when no longer needed.

`self` : | a MIRAGE_Language
`pack_type` : | pack type
`pack_data` : | location to store buffer containing pack data, or `NULL`
`length` : | location to store length of pack data, or `NULL`
`error` : | location to store error, or `NULL`
Returns : | `TRUE` on success, `FALSE` on failure