1 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
2 
3 /*
4  *  Goo
5  *
6  *  Copyright (C) 2007 The Free Software Foundation, Inc.
7  *
8  *  This program is free software; you can redistribute it and/or modify
9  *  it under the terms of the GNU General Public License as published by
10  *  the Free Software Foundation; either version 2 of the License, or
11  *  (at your option) any later version.
12  *
13  *  This program is distributed in the hope that it will be useful,
14  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
15  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16  *  GNU General Public License for more details.
17  *
18  *  You should have received a copy of the GNU General Public License
19  *  along with this program; if not, see <http://www.gnu.org/licenses/>.
20  */
21 
22 #ifndef ALBUM_INFO_H
23 #define ALBUM_INFO_H
24 
25 #include <glib.h>
26 #include <glib-object.h>
27 #include <time.h>
28 #include "track-info.h"
29 
30 #define VARIUOS_ARTIST_ID "XYZ#!@$%"
31 #define KEEP_PREVIOUS_VALUE "(keep)"
32 
33 typedef struct {
34 	int       ref;
35 	char     *id;
36 	char     *title;
37 	char     *artist;
38 	char     *artist_id;
39 	gboolean  various_artist;
40 	char     *genre;
41 	char     *asin;
42 	GDate    *release_date;
43 	GList    *tracks; /* TrackInfo */
44 	int       n_tracks;
45 	gint64    total_length;
46 } AlbumInfo;
47 
48 #define GOO_TYPE_ALBUM_INFO (album_info_get_type ())
49 
50 GType           album_info_get_type         (void);
51 AlbumInfo *     album_info_new              (void);
52 AlbumInfo *     album_info_ref              (AlbumInfo  *album);
53 void            album_info_unref            (AlbumInfo  *album);
54 AlbumInfo *     album_info_copy             (AlbumInfo  *album);
55 void            album_info_set_id           (AlbumInfo  *album,
56 					     const char *id);
57 void            album_info_set_title        (AlbumInfo  *album,
58 					     const char *title);
59 void            album_info_set_artist       (AlbumInfo  *album,
60 					     const char *artist,
61 					     const char *artist_id);
62 void            album_info_set_genre        (AlbumInfo  *album,
63 					     const char *genre);
64 void            album_info_set_asin         (AlbumInfo  *album,
65 					     const char *asin);
66 void            album_info_set_release_date (AlbumInfo  *album,
67 					     GDate      *date);
68 void            album_info_set_tracks       (AlbumInfo  *album,
69 					     GList      *tracks);
70 TrackInfo *     album_info_get_track        (AlbumInfo  *album,
71 					     int         track_number);
72 void            album_info_copy_metadata    (AlbumInfo  *to_album,
73 					     AlbumInfo  *from_album);
74 gboolean        album_info_load_from_cache  (AlbumInfo  *album,
75 			    		     const char *disc_id);
76 void            album_info_save_to_cache    (AlbumInfo  *to_album,
77 			  		     const char *disc_id);
78 
79 GList *         album_list_dup              (GList      *album_list);
80 void            album_list_free             (GList      *album_list);
81 
82 #endif /* GOO_ALBUM_INFO_H */
83