"Fossies" - the Fresh Open Source Software Archive

Member "libcdio-2.1.0/include/cdio++/cdtext.hpp" (12 Aug 2018, 3092 Bytes) of package /linux/privat/libcdio-2.1.0.tar.bz2:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) C and C++ source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file. For more information about "cdtext.hpp" see the Fossies "Dox" file reference documentation and the latest Fossies "Diffs" side-by-side code changes report: 2.0.0_vs_2.1.0.

    1 /*
    2     Copyright (C) 2018 Thomas Schmitt
    3     Copyright (C) 2005, 2008, 2012 Rocky Bernstein <rocky@gnu.org>
    4 
    5     This program is free software: you can redistribute it and/or modify
    6     it under the terms of the GNU General Public License as published by
    7     the Free Software Foundation, either version 3 of the License, or
    8     (at your option) any later version.
    9 
   10     This program is distributed in the hope that it will be useful,
   11     but WITHOUT ANY WARRANTY; without even the implied warranty of
   12     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   13     GNU General Public License for more details.
   14 
   15     You should have received a copy of the GNU General Public License
   16     along with this program.  If not, see <http://www.gnu.org/licenses/>.
   17 */
   18 
   19 /** \file cdtext.hpp
   20  *  \brief methods relating to CD-Text information. This file
   21  *  should not be #included directly.
   22  */
   23 
   24 /*! Return string representation of the enum values above */
   25 const char *field2str (cdtext_field_t i)
   26 {
   27   return cdtext_field2str (i);
   28 }
   29 
   30 const char *genre2str (cdtext_genre_t i)
   31 {
   32   return cdtext_genre2str (i);
   33 }
   34 
   35 const char *lang2str (cdtext_lang_t i)
   36 {
   37   return cdtext_lang2str (i);
   38 }
   39 
   40 /*! returns an allocated string associated with the given field.  NULL is
   41   returned if key is CDTEXT_INVALID or the field is not set.
   42 
   43   The user needs to free the string using cdio_free() when done with it.
   44 
   45   @see getConst to retrieve a constant string that doesn't
   46   have to be freed.
   47 
   48 */
   49 char *get (cdtext_field_t key, track_t i_track)
   50 {
   51   return cdtext_get (p_cdtext, key, i_track);
   52 }
   53 
   54 /*! returns a const string associated with the given field.  NULL is
   55   returned if key is CDTEXT_INVALID or the field is not set.
   56 
   57   Don't use the string when the cdtext object (i.e. the CdIo_t object
   58   you got it from) is no longer valid.
   59 
   60   @see cdio_get to retrieve an allocated string that persists past the
   61   cdtext object.
   62 
   63 */
   64 const char *getConst (cdtext_field_t key, track_t i_track)
   65 {
   66   return cdtext_get_const (p_cdtext, key, i_track);
   67 }
   68 
   69 /*!
   70   sets cdtext's keyword entry to field
   71 */
   72 void set (cdtext_field_t key, track_t i_track, const uint8_t *value, const char *charset)
   73 {
   74   cdtext_set (p_cdtext, key, value, i_track, charset);
   75 }
   76 
   77 /*!
   78   returns the selected language
   79 */
   80 cdtext_lang_t getLanguage()
   81 {
   82   return cdtext_get_language(p_cdtext);
   83 }
   84 
   85 /*!
   86   selects a language
   87 */
   88 bool selectLanguage(cdtext_lang_t lang)
   89 {
   90   return cdtext_select_language(p_cdtext, lang);
   91 }
   92 
   93 /*!
   94   selects a language by index rather than language code
   95 */
   96 bool setLanguageIndex(int idx)
   97 {
   98   return cdtext_set_language_index(p_cdtext, idx);
   99 }
  100 
  101 /*!
  102 
  103   @deprecated. Use listLanguagesV2(), see cdio/cdtext.h
  104 
  105   returns a list of available languages (which has various problems)
  106 */
  107 cdtext_lang_t *listLanguages()
  108 {
  109   return cdtext_list_languages(p_cdtext);
  110 }
  111 
  112 /*!
  113   returns a pointer to an array with 8 elements which indicate available
  114   languages
  115 */
  116 cdtext_lang_t *listLanguagesV2()
  117 {
  118   return cdtext_list_languages_v2(p_cdtext);
  119 }
  120 
  121 
  122 /*
  123  * Local variables:
  124  *  c-file-style: "gnu"
  125  *  tab-width: 8
  126  *  indent-tabs-mode: nil
  127  * End:
  128  */