2006-02-16 23:13:27 +00:00
|
|
|
#ifndef foocorescachehfoo
|
|
|
|
|
#define foocorescachehfoo
|
2004-07-20 01:07:06 +00:00
|
|
|
|
2004-08-17 19:47:42 +00:00
|
|
|
/***
|
2006-06-19 21:53:48 +00:00
|
|
|
This file is part of PulseAudio.
|
2007-01-04 13:43:45 +00:00
|
|
|
|
2007-02-13 15:35:19 +00:00
|
|
|
Copyright 2004-2006 Lennart Poettering
|
|
|
|
|
Copyright 2006 Pierre Ossman <ossman@cendio.se> for Cendio AB
|
|
|
|
|
|
2006-06-19 21:53:48 +00:00
|
|
|
PulseAudio is free software; you can redistribute it and/or modify
|
2004-11-14 14:58:54 +00:00
|
|
|
it under the terms of the GNU Lesser General Public License as published
|
2009-03-03 20:23:02 +00:00
|
|
|
by the Free Software Foundation; either version 2.1 of the License,
|
2004-08-17 19:47:42 +00:00
|
|
|
or (at your option) any later version.
|
2007-01-04 13:43:45 +00:00
|
|
|
|
2006-06-19 21:53:48 +00:00
|
|
|
PulseAudio is distributed in the hope that it will be useful, but
|
2004-08-17 19:47:42 +00:00
|
|
|
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.
|
2007-01-04 13:43:45 +00:00
|
|
|
|
2004-11-14 14:58:54 +00:00
|
|
|
You should have received a copy of the GNU Lesser General Public License
|
2006-06-19 21:53:48 +00:00
|
|
|
along with PulseAudio; if not, write to the Free Software
|
2004-08-17 19:47:42 +00:00
|
|
|
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
|
|
|
|
|
USA.
|
|
|
|
|
***/
|
|
|
|
|
|
2006-06-19 21:53:48 +00:00
|
|
|
#include <pulsecore/core.h>
|
|
|
|
|
#include <pulsecore/memchunk.h>
|
|
|
|
|
#include <pulsecore/sink.h>
|
2004-07-20 01:07:06 +00:00
|
|
|
|
2008-05-15 23:34:41 +00:00
|
|
|
#define PA_SCACHE_ENTRY_SIZE_MAX (1024*1024*16)
|
2006-04-23 20:59:09 +00:00
|
|
|
|
2006-01-11 01:17:39 +00:00
|
|
|
typedef struct pa_scache_entry {
|
2004-07-20 01:07:06 +00:00
|
|
|
uint32_t index;
|
2008-05-15 23:34:41 +00:00
|
|
|
pa_core *core;
|
|
|
|
|
|
2004-07-20 01:07:06 +00:00
|
|
|
char *name;
|
2007-01-04 13:43:45 +00:00
|
|
|
|
2006-01-27 16:25:31 +00:00
|
|
|
pa_cvolume volume;
|
2009-01-27 03:05:40 +01:00
|
|
|
pa_bool_t volume_is_set;
|
2006-01-11 01:17:39 +00:00
|
|
|
pa_sample_spec sample_spec;
|
2006-01-27 16:25:31 +00:00
|
|
|
pa_channel_map channel_map;
|
2006-01-11 01:17:39 +00:00
|
|
|
pa_memchunk memchunk;
|
2004-09-14 23:08:39 +00:00
|
|
|
|
2004-09-15 14:05:28 +00:00
|
|
|
char *filename;
|
2007-01-04 13:43:45 +00:00
|
|
|
|
2008-05-15 23:34:41 +00:00
|
|
|
pa_bool_t lazy;
|
2004-09-14 23:08:39 +00:00
|
|
|
time_t last_used_time;
|
2008-05-15 23:34:41 +00:00
|
|
|
|
|
|
|
|
pa_proplist *proplist;
|
2006-01-11 01:17:39 +00:00
|
|
|
} pa_scache_entry;
|
2004-07-20 01:07:06 +00:00
|
|
|
|
2008-05-15 23:34:41 +00:00
|
|
|
int pa_scache_add_item(pa_core *c, const char *name, const pa_sample_spec *ss, const pa_channel_map *map, const pa_memchunk *chunk, pa_proplist *p, uint32_t *idx);
|
2006-01-11 01:17:39 +00:00
|
|
|
int pa_scache_add_file(pa_core *c, const char *name, const char *filename, uint32_t *idx);
|
|
|
|
|
int pa_scache_add_file_lazy(pa_core *c, const char *name, const char *filename, uint32_t *idx);
|
2004-07-20 01:07:06 +00:00
|
|
|
|
2006-01-11 01:17:39 +00:00
|
|
|
int pa_scache_add_directory_lazy(pa_core *c, const char *pathname);
|
2004-11-17 00:05:25 +00:00
|
|
|
|
2006-01-11 01:17:39 +00:00
|
|
|
int pa_scache_remove_item(pa_core *c, const char *name);
|
2008-05-15 23:34:41 +00:00
|
|
|
int pa_scache_play_item(pa_core *c, const char *name, pa_sink *sink, pa_volume_t volume, pa_proplist *p, uint32_t *sink_input_idx);
|
2009-01-15 20:07:13 +01:00
|
|
|
int pa_scache_play_item_by_name(pa_core *c, const char *name, const char*sink_name, pa_volume_t volume, pa_proplist *p, uint32_t *sink_input_idx);
|
2009-01-29 16:25:29 +01:00
|
|
|
void pa_scache_free_all(pa_core *c);
|
2004-07-20 01:07:06 +00:00
|
|
|
|
2006-01-11 01:17:39 +00:00
|
|
|
const char *pa_scache_get_name_by_id(pa_core *c, uint32_t id);
|
|
|
|
|
uint32_t pa_scache_get_id_by_name(pa_core *c, const char *name);
|
2004-07-20 01:07:06 +00:00
|
|
|
|
2008-05-15 23:34:41 +00:00
|
|
|
size_t pa_scache_total_size(pa_core *c);
|
2004-09-01 22:46:27 +00:00
|
|
|
|
2006-01-11 01:17:39 +00:00
|
|
|
void pa_scache_unload_unused(pa_core *c);
|
2004-09-14 23:08:39 +00:00
|
|
|
|
2004-07-20 01:07:06 +00:00
|
|
|
#endif
|