summaryrefslogtreecommitdiff
path: root/src/libaudcore/internal.h
blob: 534ba691a803a04aca08755f5ffced37a3eb63f8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
/*
 * internal.h
 * Copyright 2014 John Lindgren
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions are met:
 *
 * 1. Redistributions of source code must retain the above copyright notice,
 *    this list of conditions, and the following disclaimer.
 *
 * 2. Redistributions in binary form must reproduce the above copyright notice,
 *    this list of conditions, and the following disclaimer in the documentation
 *    provided with the distribution.
 *
 * This software is provided "as is" and without any warranty, express or
 * implied. In no event shall the authors be liable for any damages arising from
 * the use of this software.
 */

#ifndef LIBAUDCORE_INTERNAL_H
#define LIBAUDCORE_INTERNAL_H

#include <stdint.h>
#include <sys/types.h>

#include "index.h"
#include "objects.h"

class InputPlugin;
class Plugin;
class PluginHandle;
class VFSFile;
class Tuple;

typedef bool (* DirForeachFunc) (const char * path, const char * basename, void * user);

/* adder.cc */
void adder_cleanup ();

/* art.cc */
void art_cache_current (const String & filename, Index<char> && data, String && art_file);
void art_clear_current ();
void art_cleanup ();

/* art-search.cc */
String art_search (const char * filename);

/* charset.cc */
void chardet_init ();
void chardet_cleanup ();

/* config.cc */
void config_load ();
void config_save ();
void config_cleanup ();

/* drct.cc */
void record_init ();
void record_cleanup ();

/* effect.cc */
void effect_start (int & channels, int & rate);
Index<float> & effect_process (Index<float> & data);
bool effect_flush (bool force);
Index<float> & effect_finish (Index<float> & data, bool end_of_playlist);
int effect_adjust_delay (int delay);

bool effect_plugin_start (PluginHandle * plugin);
void effect_plugin_stop (PluginHandle * plugin);

/* equalizer.cc */
void eq_init ();
void eq_cleanup ();
void eq_set_format (int new_channels, int new_rate);
void eq_filter (float * data, int samples);

/* eventqueue.cc */
void event_queue_cancel_all ();

/* fft.cc */
void calc_freq (const float data[512], float freq[256]);

/* hook.cc */
void hook_cleanup ();

/* interface.cc */
PluginHandle * iface_plugin_probe ();
PluginHandle * iface_plugin_get_current ();
bool iface_plugin_set_current (PluginHandle * plugin);

void interface_run ();

/* playback.cc */
/* do not call these; use aud_drct_play/stop() instead */
void playback_play (int seek_time, bool pause);
void playback_stop (bool exiting = false);

bool playback_check_serial (int serial);
void playback_set_info (int entry, Tuple && tuple);

/* probe.cc */
bool open_input_file (const char * filename, const char * mode,
 InputPlugin * ip, VFSFile & file, String * error = nullptr);
InputPlugin * load_input_plugin (PluginHandle * decoder, String * error = nullptr);

/* runtime.cc */
extern size_t misc_bytes_allocated;

/* strpool.cc */
void string_leak_check ();

/* timer.cc */
void timer_cleanup ();

/* util.cc */
const char * get_home_utf8 ();
bool dir_foreach (const char * path, DirForeachFunc func, void * user_data);
String write_temp_file (const void * data, int64_t len);

bool same_basename (const char * a, const char * b);
const char * last_path_element (const char * path);
void cut_path_element (char * path, int pos);

bool is_cuesheet_entry (const char * filename);
bool is_subtune (const char * filename);
StringBuf strip_subtune (const char * filename);

unsigned int32_hash (unsigned val);
unsigned ptr_hash (const void * ptr);

/* vis-runner.cc */
void vis_runner_start_stop (bool playing, bool paused);
void vis_runner_pass_audio (int time, const Index<float> & data, int channels, int rate);
void vis_runner_flush ();
void vis_runner_enable (bool enable);

/* visualization.cc */
void vis_activate (bool activate);
void vis_send_clear ();
void vis_send_audio (const float * data, int channels);

bool vis_plugin_start (PluginHandle * plugin);
void vis_plugin_stop (PluginHandle * plugin);

#endif