annotate osx/include/rubberband/rubberband-c.h @ 58:eab3b14ddc95

Further win32 build updates
author Chris Cannam
date Mon, 09 Jan 2017 13:51:38 +0000
parents fffb975dc0b1
children
rev   line source
matthiasm@27 1 /* -*- c-basic-offset: 4 indent-tabs-mode: nil -*- vi:set ts=8 sts=4 sw=4: */
matthiasm@27 2
matthiasm@27 3 /*
matthiasm@27 4 Rubber Band Library
matthiasm@27 5 An audio time-stretching and pitch-shifting library.
matthiasm@27 6 Copyright 2007-2012 Particular Programs Ltd.
matthiasm@27 7
matthiasm@27 8 This program is free software; you can redistribute it and/or
matthiasm@27 9 modify it under the terms of the GNU General Public License as
matthiasm@27 10 published by the Free Software Foundation; either version 2 of the
matthiasm@27 11 License, or (at your option) any later version. See the file
matthiasm@27 12 COPYING included with this distribution for more information.
matthiasm@27 13
matthiasm@27 14 Alternatively, if you have a valid commercial licence for the
matthiasm@27 15 Rubber Band Library obtained by agreement with the copyright
matthiasm@27 16 holders, you may redistribute and/or modify it under the terms
matthiasm@27 17 described in that licence.
matthiasm@27 18
matthiasm@27 19 If you wish to distribute code using the Rubber Band Library
matthiasm@27 20 under terms other than those of the GNU General Public License,
matthiasm@27 21 you must obtain a valid commercial licence before doing so.
matthiasm@27 22 */
matthiasm@27 23
matthiasm@27 24 #ifndef _RUBBERBAND_C_API_H_
matthiasm@27 25 #define _RUBBERBAND_C_API_H_
matthiasm@27 26
matthiasm@27 27 #ifdef __cplusplus
matthiasm@27 28 extern "C" {
matthiasm@27 29 #endif
matthiasm@27 30
matthiasm@27 31 #define RUBBERBAND_VERSION "1.8.1"
matthiasm@27 32 #define RUBBERBAND_API_MAJOR_VERSION 2
matthiasm@27 33 #define RUBBERBAND_API_MINOR_VERSION 5
matthiasm@27 34
matthiasm@27 35 /**
matthiasm@27 36 * This is a C-linkage interface to the Rubber Band time stretcher.
matthiasm@27 37 *
matthiasm@27 38 * This is a wrapper interface: the primary interface is in C++ and is
matthiasm@27 39 * defined and documented in RubberBandStretcher.h. The library
matthiasm@27 40 * itself is implemented in C++, and requires C++ standard library
matthiasm@27 41 * support even when using the C-linkage API.
matthiasm@27 42 *
matthiasm@27 43 * Please see RubberBandStretcher.h for documentation.
matthiasm@27 44 *
matthiasm@27 45 * If you are writing to the C++ API, do not include this header.
matthiasm@27 46 */
matthiasm@27 47
matthiasm@27 48 enum RubberBandOption {
matthiasm@27 49
matthiasm@27 50 RubberBandOptionProcessOffline = 0x00000000,
matthiasm@27 51 RubberBandOptionProcessRealTime = 0x00000001,
matthiasm@27 52
matthiasm@27 53 RubberBandOptionStretchElastic = 0x00000000,
matthiasm@27 54 RubberBandOptionStretchPrecise = 0x00000010,
matthiasm@27 55
matthiasm@27 56 RubberBandOptionTransientsCrisp = 0x00000000,
matthiasm@27 57 RubberBandOptionTransientsMixed = 0x00000100,
matthiasm@27 58 RubberBandOptionTransientsSmooth = 0x00000200,
matthiasm@27 59
matthiasm@27 60 RubberBandOptionDetectorCompound = 0x00000000,
matthiasm@27 61 RubberBandOptionDetectorPercussive = 0x00000400,
matthiasm@27 62 RubberBandOptionDetectorSoft = 0x00000800,
matthiasm@27 63
matthiasm@27 64 RubberBandOptionPhaseLaminar = 0x00000000,
matthiasm@27 65 RubberBandOptionPhaseIndependent = 0x00002000,
matthiasm@27 66
matthiasm@27 67 RubberBandOptionThreadingAuto = 0x00000000,
matthiasm@27 68 RubberBandOptionThreadingNever = 0x00010000,
matthiasm@27 69 RubberBandOptionThreadingAlways = 0x00020000,
matthiasm@27 70
matthiasm@27 71 RubberBandOptionWindowStandard = 0x00000000,
matthiasm@27 72 RubberBandOptionWindowShort = 0x00100000,
matthiasm@27 73 RubberBandOptionWindowLong = 0x00200000,
matthiasm@27 74
matthiasm@27 75 RubberBandOptionSmoothingOff = 0x00000000,
matthiasm@27 76 RubberBandOptionSmoothingOn = 0x00800000,
matthiasm@27 77
matthiasm@27 78 RubberBandOptionFormantShifted = 0x00000000,
matthiasm@27 79 RubberBandOptionFormantPreserved = 0x01000000,
matthiasm@27 80
matthiasm@27 81 RubberBandOptionPitchHighQuality = 0x00000000,
matthiasm@27 82 RubberBandOptionPitchHighSpeed = 0x02000000,
matthiasm@27 83 RubberBandOptionPitchHighConsistency = 0x04000000,
matthiasm@27 84
matthiasm@27 85 RubberBandOptionChannelsApart = 0x00000000,
matthiasm@27 86 RubberBandOptionChannelsTogether = 0x10000000,
matthiasm@27 87 };
matthiasm@27 88
matthiasm@27 89 typedef int RubberBandOptions;
matthiasm@27 90
matthiasm@27 91 struct RubberBandState_;
matthiasm@27 92 typedef struct RubberBandState_ *RubberBandState;
matthiasm@27 93
matthiasm@27 94 extern RubberBandState rubberband_new(unsigned int sampleRate,
matthiasm@27 95 unsigned int channels,
matthiasm@27 96 RubberBandOptions options,
matthiasm@27 97 double initialTimeRatio,
matthiasm@27 98 double initialPitchScale);
matthiasm@27 99
matthiasm@27 100 extern void rubberband_delete(RubberBandState);
matthiasm@27 101
matthiasm@27 102 extern void rubberband_reset(RubberBandState);
matthiasm@27 103
matthiasm@27 104 extern void rubberband_set_time_ratio(RubberBandState, double ratio);
matthiasm@27 105 extern void rubberband_set_pitch_scale(RubberBandState, double scale);
matthiasm@27 106
matthiasm@27 107 extern double rubberband_get_time_ratio(const RubberBandState);
matthiasm@27 108 extern double rubberband_get_pitch_scale(const RubberBandState);
matthiasm@27 109
matthiasm@27 110 extern unsigned int rubberband_get_latency(const RubberBandState);
matthiasm@27 111
matthiasm@27 112 extern void rubberband_set_transients_option(RubberBandState, RubberBandOptions options);
matthiasm@27 113 extern void rubberband_set_detector_option(RubberBandState, RubberBandOptions options);
matthiasm@27 114 extern void rubberband_set_phase_option(RubberBandState, RubberBandOptions options);
matthiasm@27 115 extern void rubberband_set_formant_option(RubberBandState, RubberBandOptions options);
matthiasm@27 116 extern void rubberband_set_pitch_option(RubberBandState, RubberBandOptions options);
matthiasm@27 117
matthiasm@27 118 extern void rubberband_set_expected_input_duration(RubberBandState, unsigned int samples);
matthiasm@27 119
matthiasm@27 120 extern unsigned int rubberband_get_samples_required(const RubberBandState);
matthiasm@27 121
matthiasm@27 122 extern void rubberband_set_max_process_size(RubberBandState, unsigned int samples);
matthiasm@27 123 extern void rubberband_set_key_frame_map(RubberBandState, unsigned int keyframecount, unsigned int *from, unsigned int *to);
matthiasm@27 124
matthiasm@27 125 extern void rubberband_study(RubberBandState, const float *const *input, unsigned int samples, int final);
matthiasm@27 126 extern void rubberband_process(RubberBandState, const float *const *input, unsigned int samples, int final);
matthiasm@27 127
matthiasm@27 128 extern int rubberband_available(const RubberBandState);
matthiasm@27 129 extern unsigned int rubberband_retrieve(const RubberBandState, float *const *output, unsigned int samples);
matthiasm@27 130
matthiasm@27 131 extern unsigned int rubberband_get_channel_count(const RubberBandState);
matthiasm@27 132
matthiasm@27 133 extern void rubberband_calculate_stretch(RubberBandState);
matthiasm@27 134
matthiasm@27 135 extern void rubberband_set_debug_level(RubberBandState, int level);
matthiasm@27 136 extern void rubberband_set_default_debug_level(int level);
matthiasm@27 137
matthiasm@27 138 #ifdef __cplusplus
matthiasm@27 139 }
matthiasm@27 140 #endif
matthiasm@27 141
matthiasm@27 142 #endif