~ubuntu-branches/ubuntu/karmic/alogg/karmic

« back to all changes in this revision

Viewing changes to alogg.h

  • Committer: Bazaar Package Importer
  • Author(s): Alexandre Pineau
  • Date: 2004-02-15 23:01:45 UTC
  • Revision ID: james.westby@ubuntu.com-20040215230145-6ij4xz3m3t2zijg4
Tags: upstream-1.3.3
ImportĀ upstreamĀ versionĀ 1.3.3

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* Copyright (C) 2002, 2003 Vincent Penquerc'h.
 
2
   This file is part of the alogg library.
 
3
   Written by Vincent Penquerc'h <lyrian -at- kezako -dot- net>.
 
4
 
 
5
   The alogg library is free software; you can redistribute it and/or
 
6
   modify it under the terms of the GNU Lesser General Public
 
7
   License as published by the Free Software Foundation; either
 
8
   version 2.1 of the License, or (at your option) any later version.
 
9
 
 
10
   The alogg library is distributed in the hope that it will be useful,
 
11
   but WITHOUT ANY WARRANTY; without even the implied warranty of
 
12
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 
13
   Lesser General Public License for more details.
 
14
 
 
15
   You should have received a copy of the GNU Lesser General Public
 
16
   License along with the alogg Library; if not, write to the Free
 
17
   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
 
18
   02111-1307 USA.
 
19
 
 
20
   As a special exception, if you link this library statically with a
 
21
   program, you do not have to distribute the object files for this
 
22
   program.
 
23
   This exception does not however invalidate any other reasons why
 
24
   you would have to distribute the object files for this program.  */
 
25
 
 
26
 
 
27
#ifndef _ALOGG_H_
 
28
#define _ALOGG_H_
 
29
 
 
30
#define ALOGG_MAJOR 1
 
31
#define ALOGG_MINOR 3
 
32
#define ALOGG_PATCH 3
 
33
#define ALOGG_MAKE_VERSION(x,y,z) (((x)*10000)+((y)*100)+(z))
 
34
#define ALOGG_VERSION ALOGG_MAKE_VERSION(ALOGG_MAJOR,ALOGG_MINOR,ALOGG_PATCH)
 
35
#define ALOGG_ID "alogg 1.3.3"
 
36
 
 
37
#define DAT_OGG_VORBIS DAT_ID('O','G','G','V')
 
38
 
 
39
#ifdef DEBUG
 
40
#include <fortify.h>
 
41
#endif
 
42
 
 
43
struct SAMPLE;
 
44
struct PACKFILE;
 
45
struct DATAFILE;
 
46
struct AUDIOSTREAM;
 
47
struct OggVorbis_File;
 
48
struct ov_callbacks;
 
49
 
 
50
struct alogg_stream;
 
51
struct alogg_encoding_data;
 
52
 
 
53
extern int alogg_error_code;
 
54
 
 
55
#ifdef __cplusplus
 
56
extern "C" {
 
57
#endif
 
58
 
 
59
void alogg_init();
 
60
void alogg_exit();
 
61
 
 
62
/* Integration with Allegro's SAMPLE management */
 
63
struct SAMPLE *alogg_load_ogg(AL_CONST char *filename);
 
64
struct SAMPLE *alogg_create_sample(struct DATAFILE *dat);
 
65
 
 
66
#ifndef ALOGG_USE_TREMOR
 
67
int alogg_save_ogg_param(
 
68
  AL_CONST char *filename,struct SAMPLE *sample,float quality,
 
69
  size_t ncomments,char **comments
 
70
);
 
71
int alogg_save_ogg(AL_CONST char *filename,struct SAMPLE *sample);
 
72
#endif
 
73
 
 
74
/* Streaming support */
 
75
struct alogg_stream *alogg_start_streaming(
 
76
  AL_CONST char *filename,size_t block_size
 
77
);
 
78
struct alogg_stream *alogg_start_streaming_datafile(
 
79
  AL_CONST struct DATAFILE *dat,size_t block_size
 
80
);
 
81
struct alogg_stream *alogg_start_streaming_callbacks(
 
82
  void *datasource,struct ov_callbacks *callbacks,size_t block_size,
 
83
  int (*update)(struct alogg_stream*,void*)
 
84
);
 
85
int alogg_read_stream_data(struct alogg_stream*,void *buffer,size_t size);
 
86
int alogg_update_streaming(struct alogg_stream*);
 
87
int alogg_stop_streaming(struct alogg_stream*);
 
88
struct AUDIOSTREAM *alogg_get_audio_stream(struct alogg_stream*);
 
89
struct OggVorbis_File *alogg_get_vorbis_file(struct alogg_stream*);
 
90
 
 
91
#ifndef ALOGG_USE_TREMOR
 
92
 
 
93
/* Encoding */
 
94
struct alogg_encoding_data *alogg_start_encoding(
 
95
  size_t channels,size_t freq,float quality,size_t ncomments,char **comments,
 
96
  void (*write)(void*,size_t,unsigned long),unsigned long write_data
 
97
);
 
98
int alogg_update_encoding(
 
99
  struct alogg_encoding_data*,AL_CONST void *buffer,
 
100
  size_t num_samples,size_t channels,size_t bits
 
101
);
 
102
int alogg_stop_encoding(struct alogg_encoding_data*);
 
103
 
 
104
#endif
 
105
 
 
106
#ifdef __cplusplus
 
107
}
 
108
#endif
 
109
 
 
110
#endif