UNPKG

3.38 kBJavaScriptView Raw
1export { getContext, setContext } from "./core/Global.js";
2export * from "./classes.js";
3export * from "./version.js";
4import { getContext } from "./core/Global.js";
5import { ToneAudioBuffer } from "./core/context/ToneAudioBuffer.js";
6export { start } from "./core/Global.js";
7export { supported } from "./core/context/AudioContext.js";
8/**
9 * The current audio context time of the global {@link BaseContext}.
10 * @see {@link Context.now}
11 * @category Core
12 */
13export function now() {
14 return getContext().now();
15}
16/**
17 * The current audio context time of the global {@link Context} without the {@link Context.lookAhead}
18 * @see {@link Context.immediate}
19 * @category Core
20 */
21export function immediate() {
22 return getContext().immediate();
23}
24/**
25 * The Transport object belonging to the global Tone.js Context.
26 * @see {@link TransportClass}
27 * @category Core
28 * @deprecated Use {@link getTransport} instead
29 */
30export const Transport = getContext().transport;
31/**
32 * The Transport object belonging to the global Tone.js Context.
33 * @see {@link TransportClass}
34 * @category Core
35 */
36export function getTransport() {
37 return getContext().transport;
38}
39/**
40 * The Destination (output) belonging to the global Tone.js Context.
41 * @see {@link DestinationClass}
42 * @category Core
43 * @deprecated Use {@link getDestination} instead
44 */
45export const Destination = getContext().destination;
46/**
47 * @deprecated Use {@link getDestination} instead
48 */
49export const Master = getContext().destination;
50/**
51 * The Destination (output) belonging to the global Tone.js Context.
52 * @see {@link DestinationClass}
53 * @category Core
54 */
55export function getDestination() {
56 return getContext().destination;
57}
58/**
59 * The {@link ListenerClass} belonging to the global Tone.js Context.
60 * @category Core
61 * @deprecated Use {@link getListener} instead
62 */
63export const Listener = getContext().listener;
64/**
65 * The {@link ListenerClass} belonging to the global Tone.js Context.
66 * @category Core
67 */
68export function getListener() {
69 return getContext().listener;
70}
71/**
72 * Draw is used to synchronize the draw frame with the Transport's callbacks.
73 * @see {@link DrawClass}
74 * @category Core
75 * @deprecated Use {@link getDraw} instead
76 */
77export const Draw = getContext().draw;
78/**
79 * Get the singleton attached to the global context.
80 * Draw is used to synchronize the draw frame with the Transport's callbacks.
81 * @see {@link DrawClass}
82 * @category Core
83 */
84export function getDraw() {
85 return getContext().draw;
86}
87/**
88 * A reference to the global context
89 * @see {@link Context}
90 * @deprecated Use {@link getContext} instead
91 */
92export const context = getContext();
93/**
94 * Promise which resolves when all of the loading promises are resolved.
95 * Alias for static {@link ToneAudioBuffer.loaded} method.
96 * @category Core
97 */
98export function loaded() {
99 return ToneAudioBuffer.loaded();
100}
101// this fills in name changes from 13.x to 14.x
102import { ToneAudioBuffers } from "./core/context/ToneAudioBuffers.js";
103import { ToneBufferSource } from "./source/buffer/ToneBufferSource.js";
104/** @deprecated Use {@link ToneAudioBuffer} */
105export const Buffer = ToneAudioBuffer;
106/** @deprecated Use {@link ToneAudioBuffers} */
107export const Buffers = ToneAudioBuffers;
108/** @deprecated Use {@link ToneBufferSource} */
109export const BufferSource = ToneBufferSource;
110//# sourceMappingURL=index.js.map
\No newline at end of file