Main Page | File List | File Members

cddb_disc.h

Go to the documentation of this file.
00001 /* 00002 $Id: cddb_disc.h,v 1.21 2005/07/09 08:32:48 airborne Exp $ 00003 00004 Copyright (C) 2003, 2004, 2005 Kris Verbeeck <airborne@advalvas.be> 00005 00006 This library is free software; you can redistribute it and/or 00007 modify it under the terms of the GNU Library General Public 00008 License as published by the Free Software Foundation; either 00009 version 2 of the License, or (at your option) any later version. 00010 00011 This library is distributed in the hope that it will be useful, 00012 but WITHOUT ANY WARRANTY; without even the implied warranty of 00013 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00014 Library General Public License for more details. 00015 00016 You should have received a copy of the GNU Library General Public 00017 License along with this library; if not, write to the 00018 Free Software Foundation, Inc., 59 Temple Place - Suite 330, 00019 Boston, MA 02111-1307, USA. 00020 */ 00021 00022 #ifndef CDDB_DISC_H 00023 #define CDDB_DISC_H 1 00024 00025 #ifdef __cplusplus 00026 extern "C" { 00027 #endif 00028 00029 00030 #include <cddb/cddb_track.h> 00031 00032 00036 #define FRAMES_PER_SECOND 75 00037 00041 #define FRAMES_TO_SECONDS(f) ((f) / FRAMES_PER_SECOND) 00042 00046 #define SECONDS_TO_FRAMES(s) ((s) * FRAMES_PER_SECOND) 00047 00051 typedef enum { 00052 CDDB_CAT_DATA = 0, 00053 CDDB_CAT_FOLK, 00054 CDDB_CAT_JAZZ, 00055 CDDB_CAT_MISC, 00057 CDDB_CAT_ROCK, 00058 CDDB_CAT_COUNTRY, 00059 CDDB_CAT_BLUES, 00060 CDDB_CAT_NEWAGE, 00061 CDDB_CAT_REGGAE, 00062 CDDB_CAT_CLASSICAL, 00063 CDDB_CAT_SOUNDTRACK, 00064 CDDB_CAT_INVALID, 00065 CDDB_CAT_LAST 00066 } cddb_cat_t; 00067 00071 extern const char *CDDB_CATEGORY[CDDB_CAT_LAST]; 00072 00077 typedef struct cddb_disc_s cddb_disc_t; 00078 00079 00080 /* --- construction / destruction */ 00081 00082 00088 cddb_disc_t *cddb_disc_new(void); 00089 00096 void cddb_disc_destroy(cddb_disc_t *disc); 00097 00103 cddb_disc_t *cddb_disc_clone(const cddb_disc_t *disc); 00104 00105 00106 /* --- track manipulation */ 00107 00108 00116 void cddb_disc_add_track(cddb_disc_t *disc, cddb_track_t *track); 00117 00125 cddb_track_t *cddb_disc_get_track(const cddb_disc_t *disc, int track_no); 00126 00137 cddb_track_t *cddb_disc_get_track_first(cddb_disc_t *disc); 00138 00149 cddb_track_t *cddb_disc_get_track_next(cddb_disc_t *disc); 00150 00151 00152 /* --- setters / getters --- */ 00153 00154 00161 unsigned int cddb_disc_get_discid(const cddb_disc_t *disc); 00162 00174 void cddb_disc_set_discid(cddb_disc_t *disc, unsigned int id); 00175 00191 cddb_cat_t cddb_disc_get_category(const cddb_disc_t *disc); 00192 00205 void cddb_disc_set_category(cddb_disc_t *disc, cddb_cat_t cat); 00206 00220 const char *cddb_disc_get_category_str(cddb_disc_t *disc); 00221 00234 void cddb_disc_set_category_str(cddb_disc_t *disc, const char *cat); 00235 00244 const char *cddb_disc_get_genre(const cddb_disc_t *disc); 00245 00257 void cddb_disc_set_genre(cddb_disc_t *disc, const char *genre); 00258 00266 unsigned int cddb_disc_get_length(const cddb_disc_t *disc); 00267 00274 void cddb_disc_set_length(cddb_disc_t *disc, unsigned int l); 00275 00283 unsigned int cddb_disc_get_year(const cddb_disc_t *disc); 00284 00291 void cddb_disc_set_year(cddb_disc_t *disc, unsigned int y); 00292 00300 int cddb_disc_get_track_count(const cddb_disc_t *disc); 00301 00309 const char *cddb_disc_get_title(const cddb_disc_t *disc); 00310 00320 void cddb_disc_set_title(cddb_disc_t *disc, const char *title); 00321 00330 void cddb_disc_append_title(cddb_disc_t *disc, const char *title); 00331 00339 const char *cddb_disc_get_artist(const cddb_disc_t *disc); 00340 00350 void cddb_disc_set_artist(cddb_disc_t *disc, const char *artist); 00351 00360 void cddb_disc_append_artist(cddb_disc_t *disc, const char *artist); 00361 00369 const char *cddb_disc_get_ext_data(const cddb_disc_t *disc); 00370 00381 void cddb_disc_set_ext_data(cddb_disc_t *disc, const char *ext_data); 00382 00392 void cddb_disc_append_ext_data(cddb_disc_t *disc, const char *ext_data); 00393 00394 00395 /* --- miscellaneous */ 00396 00397 00408 void cddb_disc_copy(cddb_disc_t *dst, cddb_disc_t *src); 00409 00420 int cddb_disc_calc_discid(cddb_disc_t *disc); 00421 00428 void cddb_disc_print(cddb_disc_t *disc); 00429 00430 00431 #ifdef __cplusplus 00432 } 00433 #endif 00434 00435 #endif /* CDDB_DISC_H */

Generated on Sat Jul 23 13:18:44 2005 for libcddb by doxygen 1.3.8