subtitle_select.c File Reference
`#include "config.h"`
`#include <glib/gi18n-lib.h>`
`#include <glib.h>`
`#include "quvi.h"`
`#include "_quvi_s.h"`
`#include "_quvi_subtitle_s.h"`
`#include "misc/re.h"`

## Functions

const quvi_subtitle_lang_t | quvi_subtitle_select (quvi_subtitle_t handle, const char *id)
| Select a sub_lang matching a sub_lang_id.

## Function Documentation

## quvi_subtitle_select()

const quvi_subtitle_lang_t quvi_subtitle_select | ( | quvi_subtitle_t | handle,
|  | const char * | id )

Select a sub_lang matching a sub_lang_id.

Matches the sub_lang_id (pattern) to the available subtitle language IDs and selects the language. This function returns immediately if a matching ID was found. The ID value may be a comma-separated value (e.g. "foo,bar,baz"). The ID may also contain the keyword 'croak' (see the notes below).

Note
  - ID value is used as regular expression pattern
  - ID may contain the keyword 'croak'
    - This will cause the function to exit immediately when it is reached
    - The result may be checked with quvi_ok
      - The code may be retrieved using quvi_get
      - The error message may be retrieved using quvi_errmsg
  - If nothing matched (and the 'croak' keyword was not specified) the function will either:
    - return the first (default) available language, or
    - NULL if the library failed to find any subtitle languages for the media
  - Always confirm the result with quvi_ok
  - Calling this function will reset the list pointers for both sub_type and sub_lang

See also
  parse_subtitle
  quvi_subtitle_type_reset
  quvi_subtitle_lang_reset
  quvi_subtitle_type_next
  quvi_subtitle_lang_next
  quvi_subtitle_new