spAudio
Loading...
Searching...
No Matches
spOutputPlugin.h
Go to the documentation of this file.
1
4#ifndef __SPOUTPUTPLUGIN_H
5#define __SPOUTPUTPLUGIN_H
6
7#include <sp/spWave.h>
8#include <sp/spPlugin.h>
9
10#ifdef __cplusplus
11extern "C" {
12#endif
13
27/*
28 * - Internal bits/sample must be greater than 16.
29 * - If bits/sample = 8 or 16, internal data must be short format.
30 * - If bits/sample = 33, it means float data.
31 * - If bits/sample >= 33, internal data must be double format (case without SP_PLUGIN_CAPS_NO_FLOAT_CONVERSION).
32 * - If bits/sample = 24 or 32, internal data must be long format.
33 */
34
35#define SP_PLUGIN_OUTPUT "output 1.3"
36
37/* Version 1.6.1+ */
38#define SP_PLUGIN_CAPS_REPLACE_SONG_INFO (1<<12) /* can replace song info by set_song_info */
39/* Version 1.7.1+ */
40#define SP_PLUGIN_CAPS_NO_FLOAT_CONVERSION (1<<13)
41/* Version 1.7.2+ */
42#define SP_PLUGIN_CAPS_LIVE_WRITE (1<<14)
43
44/* plugin information ID */
45#define SP_PLUGIN_INFO_SONG_INFO_MASK "song_info_mask"
46#define SP_PLUGIN_INFO_BIT_RATE "bit_rate"
47#define SP_PLUGIN_INFO_HEADER_LENGTH "header_length"
48#define SP_PLUGIN_INFO_MPEG_DECODE_OPTION "mpeg_decode_option"
49#define SP_PLUGIN_INFO_NUM_ORDER "num_order"
50#define SP_PLUGIN_INFO_MAX_CHANNEL "max_channel"
51
52#define SP_PLUGIN_INFO_NUM_BUFFER "num_buffer"
53#define SP_PLUGIN_INFO_BLOCKING_MODE "blocking_mode"
54
55#define SP_PLUGIN_INFO_DIALOG_RECT "dialog_rect"
56#define SP_PLUGIN_INFO_DIALOG_CREATE "dialog_create"
57#define SP_PLUGIN_INFO_DIALOG_END "dialog_end"
58#define SP_PLUGIN_INFO_DIALOG_DESTROY "dialog_destroy"
59
60/* for backwards compatibility */
61#define SP_BIT_RATE_ID SP_PLUGIN_INFO_BIT_RATE
62#define SP_HEADER_LENGTH_ID SP_PLUGIN_INFO_HEADER_LENGTH
63#define SP_MPEG_DECODE_OPTION_ID SP_PLUGIN_INFO_MPEG_DECODE_OPTION
64
65#define SP_PLUGIN_INFO_CALLBACK_FUNC "device_callback_func"
66#define SP_PLUGIN_INFO_CALLBACK_TYPE "device_callback_type"
67#define SP_PLUGIN_INFO_CALLBACK_DATA "device_callback_data"
68#define SP_PLUGIN_INFO_CALLBACK_HOST_DATA "device_callback_host_data"
69
70
71#define SP_PLUGIN_DEVICE_NO_CALLBACK 0
72#define SP_PLUGIN_DEVICE_OUTPUT_POSITION_CALLBACK (1<<0) /* data1: long *position, data2: NULL */
73#define SP_PLUGIN_DEVICE_OUTPUT_BUFFER_CALLBACK (2<<0) /* data1: void *buffer, data2: long *buffer_length */
74
75
76typedef struct _spOutputPluginRec spOutputPluginRec;
77
80#if defined(MACOS)
81#pragma import on
82#endif
83
84extern spBool spIsIoPlugin(spPlugin *plugin);
85extern spBool spIsOutputPlugin(spPlugin *plugin);
86extern spPluginDeviceType spGetPluginDeviceType(spPlugin *plugin);
87
88/* file type must be set before other file-rerated settings such as sample rate, bits/sample, etc. */
89extern int spFindPluginFileTypeIndex(spPlugin *plugin, const char *type);
90extern spBool spSetPluginFileTypeIndex(spPlugin *plugin, int index);
91extern int spGetPluginFileTypeIndex(spPlugin *plugin);
92extern const char *spGetPluginFileTypeString(spPlugin *plugin, int index);
93extern const char *spGetPluginFileDescString(spPlugin *plugin, int index);
94extern const char *spGetPluginFileFilterString(spPlugin *plugin, int index);
95extern spBool spSetPluginFileType(spPlugin *plugin, const char *type);
96extern char *xspGetPluginFileType(spPlugin *plugin, spBool long_flag);
97extern char *xspGetPluginFileDescription(spPlugin *plugin, spBool filter_flag);
98extern char *xspGetPluginFileFilter(spPlugin *plugin);
99extern spBool spSearchPluginFileType(int index, spPluginType plugin_type,
100 spPluginDeviceType device_type, char *plugin_name,
101 char *file_type, char *file_desc, char *file_filter);
102extern spBool spSearchPluginDevice(int index, spPluginType plugin_type,
103 spPluginDeviceType device_type, char *plugin_name);
104extern spBool spSetPluginSongInfo(spPlugin *plugin, spSongInfo *song_info);
105extern spBool spGetPluginSongInfo(spPlugin *plugin, spSongInfo *song_info);
106extern spBool spGetPluginSongInfoMask(spPlugin *plugin, unsigned long *info_mask); /* mask doesn't include ID3v2's support masks if the mask includes flag of ID3v2 such as SP_SONG_ID3V2_4_MASK. */
107extern const char *spGetPluginBestSuffix(spPlugin *plugin);
108extern spBool spIsSupportedByPlugin(spPlugin *plugin, const char *filename);
109
110extern spBool spGetPluginNumDevice(spPlugin *plugin, int *num_device);
111extern const char *spGetPluginDeviceName(spPlugin *plugin, int index);
112extern spBool spSelectPluginDevice(spPlugin *plugin, int index);
113extern spBool spSetPluginBufferSize(spPlugin *plugin, int buffer_size);
114extern spBool spGetPluginBufferSize(spPlugin *plugin, int *buffer_size);
115extern spBool spSetPluginVolume(spPlugin *plugin, int channel, int volume);
116extern spBool spGetPluginVolume(spPlugin *plugin, int channel, int *volume);
117extern spBool spSetPluginVolumeStereo(spPlugin *plugin, int l_volume, int r_volume);
118extern spBool spGetPluginVolumeStereo(spPlugin *plugin, int *l_volume, int *r_volume);
119
120extern spBool spSetPluginSampleBit(spPlugin *plugin, int samp_bit);
121extern spBool spGetPluginSampleBit(spPlugin *plugin, int *samp_bit);
122extern spBool spGetPluginDataSampleByte(spPlugin *plugin, int *samp_byte);
123extern spBool spGetPluginDataSampleBit(spPlugin *plugin, int *samp_bit);
124extern spBool spSetPluginChannel(spPlugin *plugin, int num_channel);
125extern spBool spGetPluginChannel(spPlugin *plugin, int *num_channel);
126extern spBool spSetPluginSampleRate(spPlugin *plugin, double samp_rate);
127extern spBool spGetPluginSampleRate(spPlugin *plugin, double *samp_rate);
128extern spBool spSetPluginOtherInfo(spPlugin *plugin, const char *id, void *data);
129extern spBool spGetPluginOtherInfo(spPlugin *plugin, const char *id, void *data);
130
131extern spPluginError spOpenPlugin(spPlugin *plugin, const char *filename, const char *mode);
132extern spBool spClosePlugin(spPlugin *plugin);
133extern spPluginState spGetPluginState(spPlugin *plugin);
134extern spLong spGetPluginCurrentPosition(spPlugin *plugin);
135extern spBool spStopPlugin(spPlugin *plugin);
136extern spBool spPausePlugin(spPlugin *plugin);
137extern spBool spRestartPlugin(spPlugin *plugin);
138
147extern long spWritePlugin(spPlugin *plugin, void *data, long length);
155extern long spWritePluginInByte(spPlugin *plugin, void *data, long data_size);
164extern long spWritePluginDoubleWeighted(spPlugin *plugin, double *data, long length, double weight);
172extern long spWritePluginDouble(spPlugin *plugin, double *data, long length);
173extern spBool spFlushPlugin(spPlugin *plugin);
174
179extern char *xspFindRelatedPluginFile(const char *plugin_name);
189 const char *filename, const char *mode, int *current_priority);
196extern char *xspFindSuitablePluginFile(spPluginDeviceType device_type, const char *filename, const char *mode);
213extern spPlugin *spOpenFilePlugin(const char *plugin_name, const char *filename, const char *mode,
214 spPluginDeviceType device_type,
215 spWaveInfo *wave_info, spSongInfo *song_info,
216 spPluginOpenCallback call_func, void *call_data,
217 spPluginError *error);
234extern spPlugin *spOpenFilePluginAuto(const char *plugin_name, const char *filename, const char *mode,
235 spPluginDeviceType device_type,
236 spWaveInfo *wave_info, spSongInfo *song_info,
237 spPluginOpenCallback call_func, void *call_data,
238 spPluginError *error);
253extern spPlugin *spOpenFilePluginArg(const char *plugin_name, const char *filename, const char *mode,
254 spPluginDeviceType device_type,
255 spWaveInfo *wave_info, spSongInfo *song_info,
256 int argc, char **argv, spPluginError *error);
271extern spPlugin *spOpenFilePluginArgAuto(const char *plugin_name, const char *filename, const char *mode,
272 spPluginDeviceType device_type,
273 spWaveInfo *wave_info, spSongInfo *song_info,
274 int argc, char **argv, spPluginError *error);
281
282#if defined(MACOS)
283#pragma import off
284#endif
285
286#ifdef __cplusplus
287} /* Close scope of 'extern "C"' declaration */
288#endif
289
290#endif /* __SPOUTPUTPLUGIN_H */
spPlugin * spOpenFilePluginAuto(const char *plugin_name, const char *filename, const char *mode, spPluginDeviceType device_type, spWaveInfo *wave_info, spSongInfo *song_info, spPluginOpenCallback call_func, void *call_data, spPluginError *error)
long spWritePluginDouble(spPlugin *plugin, double *data, long length)
long spWritePlugin(spPlugin *plugin, void *data, long length)
spPlugin * spOpenFilePluginArgAuto(const char *plugin_name, const char *filename, const char *mode, spPluginDeviceType device_type, spWaveInfo *wave_info, spSongInfo *song_info, int argc, char **argv, spPluginError *error)
spBool spCloseFilePlugin(spPlugin *plugin)
long spWritePluginDoubleWeighted(spPlugin *plugin, double *data, long length, double weight)
char * xspFindSuitablePluginFileWithPriority(spPluginDeviceType device_type, const char *filename, const char *mode, int *current_priority)
spPlugin * spOpenFilePluginArg(const char *plugin_name, const char *filename, const char *mode, spPluginDeviceType device_type, spWaveInfo *wave_info, spSongInfo *song_info, int argc, char **argv, spPluginError *error)
long spWritePluginInByte(spPlugin *plugin, void *data, long data_size)
spPlugin * spOpenFilePlugin(const char *plugin_name, const char *filename, const char *mode, spPluginDeviceType device_type, spWaveInfo *wave_info, spSongInfo *song_info, spPluginOpenCallback call_func, void *call_data, spPluginError *error)
char * xspFindSuitablePluginFile(spPluginDeviceType device_type, const char *filename, const char *mode)
char * xspFindRelatedPluginFile(const char *plugin_name)
int spBool
spPluginDeviceType
int spPluginError
spPluginState
Definition spWave.h:117
Definition spWave.h:43