2 * arch-tag: Header for RhythmDB private bits
4 * Copyright (C) 2004 Colin Walters <walters@rhythmbox.org>
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
22 #ifndef RHYTHMDB_PRIVATE_H
23 #define RHYTHMDB_PRIVATE_H
28 #include "rb-refstring.h"
29 #include "rb-metadata.h"
31 #include <libgnomevfs/gnome-vfs-utils.h>
32 #include <libgnomevfs/gnome-vfs-file-info.h>
33 #include <libgnomevfs/gnome-vfs-ops.h>
34 #include <libgnomevfs/gnome-vfs-async-ops.h>
38 RhythmDBEntry
* rhythmdb_entry_allocate (RhythmDB
*db
, RhythmDBEntryType type
);
39 void rhythmdb_entry_insert (RhythmDB
*db
, RhythmDBEntry
*entry
);
43 RBRefString
*description
;
44 RBRefString
*subtitle
;
47 RBRefString
*copyright
;
49 gulong status
; /* 0-99: downloading
55 } RhythmDBPodcastFields
;
58 RHYTHMDB_ENTRY_HIDDEN
= 1,
59 RHYTHMDB_ENTRY_INSERTED
= 2,
60 RHYTHMDB_ENTRY_LAST_PLAYED_DIRTY
= 4,
61 RHYTHMDB_ENTRY_FIRST_SEEN_DIRTY
= 8,
62 RHYTHMDB_ENTRY_LAST_SEEN_DIRTY
= 16,
64 /* the backend can use the top 16 bits for private flags */
65 RHYTHMDB_ENTRY_PRIVATE_FLAG_BASE
= 65536,
68 struct RhythmDBEntry_
{
71 volatile gint refcount
;
73 RhythmDBEntryType type
;
81 RBRefString
*musicbrainz_trackid
;
93 RBRefString
*location
;
94 RBRefString
*mountpoint
;
96 RBRefString
*mimetype
;
107 gpointer last_played_str
;
108 gpointer first_seen_str
;
109 gpointer last_seen_str
;
111 /* playback error string */
112 RBRefString
*playback_error
;
115 struct RhythmDBPrivate
121 RBMetaData
*metadata
;
123 xmlChar
**column_xml_names
;
125 RBRefString
*empty_string
;
126 RBRefString
*octet_stream_str
;
128 gboolean action_thread_running
;
129 gint outstanding_threads
;
130 GAsyncQueue
*action_queue
;
131 GAsyncQueue
*event_queue
;
132 GAsyncQueue
*restored_queue
;
133 GThreadPool
*query_thread_pool
;
134 GThreadPool
*add_thread_pool
;
137 GHashTable
*stat_events
;
138 GnomeVFSAsyncHandle
*stat_handle
;
139 GList
*outstanding_stats
;
142 GHashTable
*monitored_directories
;
143 GHashTable
*changed_files
;
144 guint library_location_notify_id
;
145 guint changed_files_id
;
146 GSList
*library_locations
;
151 GMutex
*change_mutex
;
152 GHashTable
*added_entries
;
153 GHashTable
*changed_entries
;
154 GHashTable
*deleted_entries
;
156 GHashTable
*propname_map
;
161 GCond
*saving_condition
;
162 GMutex
*saving_mutex
;
165 guint commit_timeout_id
;
166 guint save_timeout_id
;
168 guint emit_entry_signals_id
;
169 GList
*added_entries_to_emit
;
170 GList
*deleted_entries_to_emit
;
176 GHashTable
*entry_type_map
;
177 GMutex
*entry_type_map_mutex
;
178 GMutex
*entry_type_mutex
;
187 RHYTHMDB_EVENT_METADATA_LOAD
,
188 RHYTHMDB_EVENT_DB_LOAD
,
189 RHYTHMDB_EVENT_THREAD_EXITED
,
190 RHYTHMDB_EVENT_DB_SAVED
,
191 RHYTHMDB_EVENT_QUERY_COMPLETE
,
192 RHYTHMDB_EVENT_FILE_CREATED_OR_MODIFIED
,
193 RHYTHMDB_EVENT_FILE_DELETED
,
194 RHYTHMDB_EVENT_ENTRY_SET
197 RBRefString
*real_uri
; /* Target of a symlink, if any */
198 RhythmDBEntryType entry_type
;
204 GnomeVFSFileInfo
*vfsinfo
;
205 GnomeVFSAsyncHandle
*handle
;
207 RBMetaData
*metadata
;
209 RhythmDBQueryResults
*results
;
211 RhythmDBEntry
*entry
;
213 gboolean signal_change
;
214 RhythmDBEntryChange change
;
217 /* from rhythmdb.c */
218 void queue_stat_uri (const char *uri
, RhythmDB
*db
, RhythmDBEntryType type
);
219 void rhythmdb_entry_set_visibility (RhythmDB
*db
, RhythmDBEntry
*entry
,
220 gboolean visibility
);
221 void rhythmdb_entry_set_internal (RhythmDB
*db
, RhythmDBEntry
*entry
,
222 gboolean notify_if_inserted
, guint propid
,
223 const GValue
*value
);
224 void rhythmdb_entry_type_foreach (RhythmDB
*db
, GHFunc func
, gpointer data
);
225 RhythmDBEntry
* rhythmdb_entry_lookup_by_location_refstring (RhythmDB
*db
, RBRefString
*uri
);
227 /* from rhythmdb-monitor.c */
228 void rhythmdb_init_monitoring (RhythmDB
*db
);
229 void rhythmdb_finalize_monitoring (RhythmDB
*db
);
230 void rhythmdb_stop_monitoring (RhythmDB
*db
);
231 void rhythmdb_start_monitoring (RhythmDB
*db
);
232 void rhythmdb_monitor_uri_path (RhythmDB
*db
, const char *uri
, GError
**error
);
234 /* from rhythmdb-query.c */
235 GPtrArray
*rhythmdb_query_parse_valist (RhythmDB
*db
, va_list args
);
236 void rhythmdb_read_encoded_property (RhythmDB
*db
, const char *data
, RhythmDBPropType propid
, GValue
*val
);
240 #endif /* __RHYTHMDB_PRIVATE_H */