2008-11-29 00:56:26 -05:00
|
|
|
|
/*
|
|
|
|
|
|
$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);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2012-03-05 21:22:08 -05:00
|
|
|
|
const char *genre2str (cdtext_genre_t i)
|
|
|
|
|
|
{
|
|
|
|
|
|
return cdtext_genre2str (i);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
const char *lang2str (cdtext_lang_t i)
|
|
|
|
|
|
{
|
|
|
|
|
|
return cdtext_lang2str (i);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2008-11-29 00:56:26 -05:00
|
|
|
|
/*! 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.
|
|
|
|
|
|
|
|
|
|
|
|
*/
|
2011-11-24 20:54:40 -05:00
|
|
|
|
char *get (cdtext_field_t key, track_t i_track)
|
2008-11-29 00:56:26 -05:00
|
|
|
|
{
|
2012-03-05 21:22:08 -05:00
|
|
|
|
return cdtext_get (p_cdtext, key, i_track);
|
2008-11-29 00:56:26 -05:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/*! 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.
|
|
|
|
|
|
|
|
|
|
|
|
*/
|
2011-11-24 20:54:40 -05:00
|
|
|
|
const char *getConst (cdtext_field_t key, track_t i_track)
|
2008-11-29 00:56:26 -05:00
|
|
|
|
{
|
2012-03-05 21:22:08 -05:00
|
|
|
|
return cdtext_get_const (p_cdtext, key, i_track);
|
2008-11-29 00:56:26 -05:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/*!
|
|
|
|
|
|
sets cdtext's keyword entry to field
|
|
|
|
|
|
*/
|
2012-03-05 21:22:08 -05:00
|
|
|
|
void set (cdtext_field_t key, track_t i_track, const uint8_t *value, const char *charset)
|
2008-11-29 00:56:26 -05:00
|
|
|
|
{
|
2012-03-05 21:22:08 -05:00
|
|
|
|
cdtext_set (p_cdtext, key, value, i_track, charset);
|
2008-11-29 00:56:26 -05:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
|
* Local variables:
|
|
|
|
|
|
* c-file-style: "gnu"
|
|
|
|
|
|
* tab-width: 8
|
|
|
|
|
|
* indent-tabs-mode: nil
|
|
|
|
|
|
* End:
|
|
|
|
|
|
*/
|