This repository has been archived on 2025-05-24. You can view files and clone it, but cannot push or open issues or pull requests.
Files
libcdio-osx/include/cdio++/cdtext.hpp
R. Bernstein dbf6d24765 1) cdtext objects are no longer associated with a track but with the disc.
2) - cdio_get_cdtext no longer takes track as an argument
- cdtext_get, cdtext_get_const, cdtext_set require track argument
3) Language, Genre, Genre Code and Encoding Fields are now properly parsed and stored in the cdtext object
4) Added public function cdio_get_cdtext_raw to extract the binary CD-Text
5) Added CDTEXTFILE keyword logic in cue sheet parser. Parses binary/raw CD-Text files
6) Added cdtext_genre2str to convert genre code
7) altered the example programs, test drivers, cdda-player and cd-info to work with these changes
8) Added test case
9) A few smaller changes
A disc either holds CD-Text for all the tracks or does not hold any. Therefore a CD-Text object for the whole disc seems more natural to me. It also enables us to store global fields, like genre, encoding, language.

Patch was tested on GNU/Linux 32 bit running Gentoo.
2011-11-24 20:54:40 -05:00

91 lines
2.4 KiB
C++
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

/*
$Id: cdtext.hpp,v 1.2 2008/03/25 15:59:10 karl Exp $
Copyright (C) 2005, 2008 Rocky Bernstein <rocky@gnu.org>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/** \file cdtext.hpp
* \brief methods relating to CD-Text information. This file
* should not be #included directly.
*/
/*! Return string representation of the enum values above */
const char *field2str (cdtext_field_t i)
{
return cdtext_field2str (i);
}
/*! returns an allocated string associated with the given field. NULL is
returned if key is CDTEXT_INVALID or the field is not set.
The user needs to free the string when done with it.
@see getConst to retrieve a constant string that doesn't
have to be freed.
*/
char *get (cdtext_field_t key, track_t i_track)
{
return cdtext_get (key, i_track, p_cdtext);
}
/*! returns the C cdtext_t pointer associated with this object. */
cdtext_t *get ()
{
return p_cdtext;
}
/*! returns a const string associated with the given field. NULL is
returned if key is CDTEXT_INVALID or the field is not set.
Don't use the string when the cdtext object (i.e. the CdIo_t object
you got it from) is no longer valid.
@see cdio_get to retrieve an allocated string that persists past the
cdtext object.
*/
const char *getConst (cdtext_field_t key, track_t i_track)
{
return cdtext_get_const (key, i_track, p_cdtext);
}
/*!
returns enum of keyword if key is a CD-Text keyword,
returns MAX_CDTEXT_FIELDS non-zero otherwise.
*/
cdtext_field_t isKeyword (const char *key)
{
return cdtext_is_keyword (key);
}
/*!
sets cdtext's keyword entry to field
*/
void set (cdtext_field_t key, track_t i_track, const char *value)
{
cdtext_set (key, i_track, value, p_cdtext);
}
/*
* Local variables:
* c-file-style: "gnu"
* tab-width: 8
* indent-tabs-mode: nil
* End:
*/