@designliquido/delegua-node 1.16.0 → 1.16.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bibliotecas/dialetos/portugol-studio/mouse.d.ts +21 -0
- package/bibliotecas/dialetos/portugol-studio/mouse.d.ts.map +1 -0
- package/bibliotecas/dialetos/portugol-studio/mouse.js +127 -0
- package/bibliotecas/dialetos/portugol-studio/mouse.js.map +1 -0
- package/bibliotecas/dialetos/portugol-studio/sons.d.ts +92 -0
- package/bibliotecas/dialetos/portugol-studio/sons.d.ts.map +1 -0
- package/bibliotecas/dialetos/portugol-studio/sons.js +324 -0
- package/bibliotecas/dialetos/portugol-studio/sons.js.map +1 -0
- package/bin/package.json +7 -7
- package/excecoes/erro-execucao-biblioteca.d.ts +5 -0
- package/excecoes/erro-execucao-biblioteca.d.ts.map +1 -0
- package/excecoes/erro-execucao-biblioteca.js +11 -0
- package/excecoes/erro-execucao-biblioteca.js.map +1 -0
- package/excecoes/index.d.ts +1 -0
- package/excecoes/index.d.ts.map +1 -1
- package/excecoes/index.js +1 -0
- package/excecoes/index.js.map +1 -1
- package/package.json +7 -7
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
export interface InstaladorMouse {
|
|
2
|
+
definirCursor: (cursor: string) => void;
|
|
3
|
+
}
|
|
4
|
+
export declare const BOTAO_ESQUERDO = 0;
|
|
5
|
+
export declare const BOTAO_DIREITO = 1;
|
|
6
|
+
export declare const BOTAO_MEIO = 2;
|
|
7
|
+
export declare const instaladores: InstaladorMouse[];
|
|
8
|
+
export declare function mouseEntrou(e: MouseEvent): void;
|
|
9
|
+
export declare function mousePressionou(e: MouseEvent): void;
|
|
10
|
+
export declare function mouseSoltou(e: MouseEvent): void;
|
|
11
|
+
export declare function mouseMoveu(e: MouseEvent): void;
|
|
12
|
+
export declare function mouseArrastou(e: MouseEvent): void;
|
|
13
|
+
export declare function perdeuFoco(e: FocusEvent): void;
|
|
14
|
+
export declare function botaoPressionado(botao: number): boolean;
|
|
15
|
+
export declare function algumBotaoPressionado(): boolean;
|
|
16
|
+
export declare function lerBotao(): Promise<number>;
|
|
17
|
+
export declare function posicaoX(): number;
|
|
18
|
+
export declare function posicaoY(): number;
|
|
19
|
+
export declare function ocultarCursor(): void;
|
|
20
|
+
export declare function exibirCursor(): void;
|
|
21
|
+
//# sourceMappingURL=mouse.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mouse.d.ts","sourceRoot":"","sources":["../../../../fontes/bibliotecas/dialetos/portugol-studio/mouse.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,eAAe;IAC5B,aAAa,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,CAAC;CAC3C;AAED,eAAO,MAAM,cAAc,IAAI,CAAC;AAChC,eAAO,MAAM,aAAa,IAAI,CAAC;AAC/B,eAAO,MAAM,UAAU,IAAI,CAAC;AAU5B,eAAO,MAAM,YAAY,EAAE,eAAe,EAAO,CAAC;AAWlD,wBAAgB,WAAW,CAAC,CAAC,EAAE,UAAU,QAWxC;AAED,wBAAgB,eAAe,CAAC,CAAC,EAAE,UAAU,QAM5C;AAED,wBAAgB,WAAW,CAAC,CAAC,EAAE,UAAU,QASxC;AAED,wBAAgB,UAAU,CAAC,CAAC,EAAE,UAAU,QAGvC;AAED,wBAAgB,aAAa,CAAC,CAAC,EAAE,UAAU,QAG1C;AAED,wBAAgB,UAAU,CAAC,CAAC,EAAE,UAAU,QAYvC;AAED,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,MAAM,WAM7C;AAED,wBAAgB,qBAAqB,YAEpC;AAED,wBAAsB,QAAQ,oBAS7B;AAED,wBAAgB,QAAQ,WAAe;AAEvC,wBAAgB,QAAQ,WAAe;AAEvC,wBAAgB,aAAa,SAM5B;AAED,wBAAgB,YAAY,SAM3B"}
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.instaladores = exports.BOTAO_MEIO = exports.BOTAO_DIREITO = exports.BOTAO_ESQUERDO = void 0;
|
|
4
|
+
exports.mouseEntrou = mouseEntrou;
|
|
5
|
+
exports.mousePressionou = mousePressionou;
|
|
6
|
+
exports.mouseSoltou = mouseSoltou;
|
|
7
|
+
exports.mouseMoveu = mouseMoveu;
|
|
8
|
+
exports.mouseArrastou = mouseArrastou;
|
|
9
|
+
exports.perdeuFoco = perdeuFoco;
|
|
10
|
+
exports.botaoPressionado = botaoPressionado;
|
|
11
|
+
exports.algumBotaoPressionado = algumBotaoPressionado;
|
|
12
|
+
exports.lerBotao = lerBotao;
|
|
13
|
+
exports.posicaoX = posicaoX;
|
|
14
|
+
exports.posicaoY = posicaoY;
|
|
15
|
+
exports.ocultarCursor = ocultarCursor;
|
|
16
|
+
exports.exibirCursor = exibirCursor;
|
|
17
|
+
exports.BOTAO_ESQUERDO = 0;
|
|
18
|
+
exports.BOTAO_DIREITO = 1;
|
|
19
|
+
exports.BOTAO_MEIO = 2;
|
|
20
|
+
let x = 0, y = 0;
|
|
21
|
+
const buffer = [false, false, false];
|
|
22
|
+
let botoesPressionados = 0;
|
|
23
|
+
let aguardandoBotao = false;
|
|
24
|
+
let ultimoBotao = -1;
|
|
25
|
+
let cursorPadrao = "default";
|
|
26
|
+
let cursorTransparente = "none";
|
|
27
|
+
exports.instaladores = [];
|
|
28
|
+
let resolverAguardarBotao = null;
|
|
29
|
+
function mapearBotao(button) {
|
|
30
|
+
if (button === 0)
|
|
31
|
+
return exports.BOTAO_ESQUERDO;
|
|
32
|
+
if (button === 1)
|
|
33
|
+
return exports.BOTAO_MEIO;
|
|
34
|
+
if (button === 2)
|
|
35
|
+
return exports.BOTAO_DIREITO;
|
|
36
|
+
return -1;
|
|
37
|
+
}
|
|
38
|
+
function mouseEntrou(e) {
|
|
39
|
+
botoesPressionados = 0;
|
|
40
|
+
buffer[exports.BOTAO_ESQUERDO] = (e.buttons & 1) !== 0;
|
|
41
|
+
if (buffer[exports.BOTAO_ESQUERDO])
|
|
42
|
+
botoesPressionados += 1;
|
|
43
|
+
buffer[exports.BOTAO_DIREITO] = (e.buttons & 2) !== 0;
|
|
44
|
+
if (buffer[exports.BOTAO_DIREITO])
|
|
45
|
+
botoesPressionados += 1;
|
|
46
|
+
buffer[exports.BOTAO_MEIO] = (e.buttons & 4) !== 0;
|
|
47
|
+
if (buffer[exports.BOTAO_MEIO])
|
|
48
|
+
botoesPressionados += 1;
|
|
49
|
+
}
|
|
50
|
+
function mousePressionou(e) {
|
|
51
|
+
const botao = mapearBotao(e.button);
|
|
52
|
+
if (botao !== -1 && !buffer[botao]) {
|
|
53
|
+
buffer[botao] = true;
|
|
54
|
+
botoesPressionados += 1;
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
function mouseSoltou(e) {
|
|
58
|
+
const botao = mapearBotao(e.button);
|
|
59
|
+
if (botao !== -1 && buffer[botao]) {
|
|
60
|
+
buffer[botao] = false;
|
|
61
|
+
botoesPressionados -= 1;
|
|
62
|
+
ultimoBotao = botao;
|
|
63
|
+
}
|
|
64
|
+
if (aguardandoBotao)
|
|
65
|
+
acordarThread();
|
|
66
|
+
}
|
|
67
|
+
function mouseMoveu(e) {
|
|
68
|
+
x = e.offsetX;
|
|
69
|
+
y = e.offsetY;
|
|
70
|
+
}
|
|
71
|
+
function mouseArrastou(e) {
|
|
72
|
+
x = e.offsetX;
|
|
73
|
+
y = e.offsetY;
|
|
74
|
+
}
|
|
75
|
+
function perdeuFoco(e) {
|
|
76
|
+
buffer[0] = false;
|
|
77
|
+
buffer[1] = false;
|
|
78
|
+
buffer[2] = false;
|
|
79
|
+
ultimoBotao = -1;
|
|
80
|
+
botoesPressionados = 0;
|
|
81
|
+
if (aguardandoBotao) {
|
|
82
|
+
aguardandoBotao = false;
|
|
83
|
+
acordarThread();
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
function botaoPressionado(botao) {
|
|
87
|
+
if (botao >= 0 && botao < buffer.length) {
|
|
88
|
+
return buffer[botao];
|
|
89
|
+
}
|
|
90
|
+
else {
|
|
91
|
+
throw new Error(`O código '${botao}' não é um código de botão válido`);
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
function algumBotaoPressionado() {
|
|
95
|
+
return botoesPressionados > 0;
|
|
96
|
+
}
|
|
97
|
+
async function lerBotao() {
|
|
98
|
+
aguardandoBotao = true;
|
|
99
|
+
await new Promise(resolve => {
|
|
100
|
+
resolverAguardarBotao = resolve;
|
|
101
|
+
});
|
|
102
|
+
aguardandoBotao = false;
|
|
103
|
+
return ultimoBotao;
|
|
104
|
+
}
|
|
105
|
+
function posicaoX() { return x; }
|
|
106
|
+
function posicaoY() { return y; }
|
|
107
|
+
function ocultarCursor() {
|
|
108
|
+
for (const instalador of exports.instaladores) {
|
|
109
|
+
if (instalador && typeof instalador.definirCursor === "function") {
|
|
110
|
+
instalador.definirCursor(cursorTransparente);
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
function exibirCursor() {
|
|
115
|
+
for (const instalador of exports.instaladores) {
|
|
116
|
+
if (instalador && typeof instalador.definirCursor === "function") {
|
|
117
|
+
instalador.definirCursor(cursorPadrao);
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
function acordarThread() {
|
|
122
|
+
if (resolverAguardarBotao) {
|
|
123
|
+
resolverAguardarBotao(ultimoBotao);
|
|
124
|
+
resolverAguardarBotao = null;
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
//# sourceMappingURL=mouse.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mouse.js","sourceRoot":"","sources":["../../../../fontes/bibliotecas/dialetos/portugol-studio/mouse.ts"],"names":[],"mappings":";;;AA2BA,kCAWC;AAED,0CAMC;AAED,kCASC;AAED,gCAGC;AAED,sCAGC;AAED,gCAYC;AAED,4CAMC;AAED,sDAEC;AAED,4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AAC,aAAa,CAAC,YAAY,CAAC,CAAC;QAC3C,CAAC;IACL,CAAC;AACL,CAAC;AAED,SAAS,aAAa;IAClB,IAAI,qBAAqB,EAAE,CAAC;QACxB,qBAAqB,CAAC,WAAW,CAAC,CAAC;QACnC,qBAAqB,GAAG,IAAI,CAAC;IACjC,CAAC;AACL,CAAC"}
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
export declare class Sons {
|
|
2
|
+
private audioContext;
|
|
3
|
+
private reproducoes;
|
|
4
|
+
private _volumeGeral;
|
|
5
|
+
constructor();
|
|
6
|
+
finalizar(): void;
|
|
7
|
+
private _limparCacheReproducoes;
|
|
8
|
+
/**
|
|
9
|
+
* Carrega um som a partir de uma URL e retorna um endereço (handle) numérico.
|
|
10
|
+
*
|
|
11
|
+
* @param caminhoSom URL ou caminho do arquivo de áudio (MP3, WAV, OGG, etc.)
|
|
12
|
+
* @returns Endereço numérico do som carregado.
|
|
13
|
+
*/
|
|
14
|
+
carregarSom(caminhoSom: string): Promise<number>;
|
|
15
|
+
/**
|
|
16
|
+
* Libera a memória de um som previamente carregado, interrompendo todas as
|
|
17
|
+
* suas reproduções.
|
|
18
|
+
*
|
|
19
|
+
* @param endereco Endereço retornado por carregarSom().
|
|
20
|
+
*/
|
|
21
|
+
liberarSom(endereco: number): void;
|
|
22
|
+
/**
|
|
23
|
+
* Reproduz um som previamente carregado.
|
|
24
|
+
*
|
|
25
|
+
* @param endereco Endereço retornado por carregarSom().
|
|
26
|
+
* @param repetir Se verdadeiro, o som repete indefinidamente.
|
|
27
|
+
* @returns O mesmo endereço, para uso futuro (parar, pausar, etc.).
|
|
28
|
+
*/
|
|
29
|
+
reproduzirSom(endereco: number, repetir: boolean): number;
|
|
30
|
+
/**
|
|
31
|
+
* Pausa a reprodução de um som, preservando a posição atual para retomada.
|
|
32
|
+
*
|
|
33
|
+
* @param endereco Endereço do som.
|
|
34
|
+
*/
|
|
35
|
+
pausarSom(endereco: number): void;
|
|
36
|
+
/**
|
|
37
|
+
* Interrompe a reprodução de um som e reseta para o início.
|
|
38
|
+
*
|
|
39
|
+
* @param endereco Endereço do som.
|
|
40
|
+
*/
|
|
41
|
+
interromperSom(endereco: number): void;
|
|
42
|
+
/**
|
|
43
|
+
* Retorna a duração total do som em milissegundos.
|
|
44
|
+
*
|
|
45
|
+
* @param endereco Endereço do som.
|
|
46
|
+
*/
|
|
47
|
+
obterTamanhoMusica(endereco: number): number;
|
|
48
|
+
/**
|
|
49
|
+
* Retorna a posição atual de reprodução em milissegundos.
|
|
50
|
+
*
|
|
51
|
+
* @param endereco Endereço do som.
|
|
52
|
+
*/
|
|
53
|
+
obterPosicaoAtualMusica(endereco: number): number;
|
|
54
|
+
/**
|
|
55
|
+
* Define a posição de reprodução em milissegundos.
|
|
56
|
+
*
|
|
57
|
+
* @param endereco Endereço do som.
|
|
58
|
+
* @param milissegundos Nova posição em milissegundos.
|
|
59
|
+
*/
|
|
60
|
+
definirPosicaoAtualMusica(endereco: number, milissegundos: number): void;
|
|
61
|
+
/**
|
|
62
|
+
* Define o volume de uma reprodução específica.
|
|
63
|
+
*
|
|
64
|
+
* @param endereco Endereço do som.
|
|
65
|
+
* @param volume Valor entre 0 e 100.
|
|
66
|
+
*/
|
|
67
|
+
definirVolumeReproducao(endereco: number, volume: number): void;
|
|
68
|
+
/**
|
|
69
|
+
* Define o volume geral que afeta todas as reproduções.
|
|
70
|
+
*
|
|
71
|
+
* @param volume Valor entre 0 e 100.
|
|
72
|
+
*/
|
|
73
|
+
definirVolume(volume: number): void;
|
|
74
|
+
/**
|
|
75
|
+
* Retorna o volume geral atual.
|
|
76
|
+
*
|
|
77
|
+
* @returns Valor entre 0 e 100.
|
|
78
|
+
*/
|
|
79
|
+
obterVolume(): number;
|
|
80
|
+
/**
|
|
81
|
+
* Retorna o volume de uma reprodução específica.
|
|
82
|
+
*
|
|
83
|
+
* @param endereco Endereço do som.
|
|
84
|
+
* @returns Valor entre 0 e 100, ou -1 se a reprodução não existir.
|
|
85
|
+
*/
|
|
86
|
+
obterVolumeReproducao(endereco: number): number;
|
|
87
|
+
/**
|
|
88
|
+
* Gera um hash numérico a partir de uma string.
|
|
89
|
+
*/
|
|
90
|
+
private _hashCode;
|
|
91
|
+
}
|
|
92
|
+
//# sourceMappingURL=sons.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sons.d.ts","sourceRoot":"","sources":["../../../../fontes/bibliotecas/dialetos/portugol-studio/sons.ts"],"names":[],"mappings":"AAwKA,qBAAa,IAAI;IACb,OAAO,CAAC,YAAY,CAAe;IAEnC,OAAO,CAAC,WAAW,CAAsC;IAEzD,OAAO,CAAC,YAAY,CAAe;;IAMnC,SAAS,IAAI,IAAI;IAKjB,OAAO,CAAC,uBAAuB;IAO/B;;;;;MAKE;IACI,WAAW,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;IAwBtD;;;;;MAKE;IACF,UAAU,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI;IAQlC;;;;;;MAME;IACF,aAAa,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,GAAG,MAAM;IASzD;;;;MAIE;IACF,SAAS,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI;IAKjC;;;;MAIE;IACF,cAAc,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI;IAKtC;;;;MAIE;IACF,kBAAkB,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM;IAO5C;;;;MAIE;IACF,uBAAuB,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM;IAQjD;;;;;MAKE;IACF,yBAAyB,CAAC,QAAQ,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,GAAG,IAAI;IAiBxE;;;;;MAKE;IACF,uBAAuB,CAAC,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,IAAI;IAM/D;;;;MAIE;IACF,aAAa,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI;IAQnC;;;;MAIE;IACF,WAAW,IAAI,MAAM;IAIrB;;;;;MAKE;IACF,qBAAqB,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM;IAQ/C;;MAEE;IACF,OAAO,CAAC,SAAS;CAOpB"}
|
|
@@ -0,0 +1,324 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Sons = void 0;
|
|
4
|
+
const excecoes_1 = require("../../../excecoes");
|
|
5
|
+
function linearParaExponencial(linear) {
|
|
6
|
+
return Math.pow(linear, 3);
|
|
7
|
+
}
|
|
8
|
+
function limitaValorDoVolume(volume) {
|
|
9
|
+
if (volume < 0)
|
|
10
|
+
return 0;
|
|
11
|
+
if (volume > 1)
|
|
12
|
+
return 1;
|
|
13
|
+
return volume;
|
|
14
|
+
}
|
|
15
|
+
class Reproducao {
|
|
16
|
+
constructor(audioContext, audioBuffer) {
|
|
17
|
+
this._volume = 1.0;
|
|
18
|
+
this._volumeGeral = 1.0;
|
|
19
|
+
this.sourceNode = null;
|
|
20
|
+
this._posicaoAtual = 0;
|
|
21
|
+
this._inicioContextTime = 0;
|
|
22
|
+
this._reproduzindo = false;
|
|
23
|
+
this._repetindo = false;
|
|
24
|
+
this.audioContext = audioContext;
|
|
25
|
+
this.audioBuffer = audioBuffer;
|
|
26
|
+
this.gainNode = this.audioContext.createGain();
|
|
27
|
+
this.gainNode.connect(this.audioContext.destination);
|
|
28
|
+
this._atualizaGain();
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Define o volume individual desta reprodução.
|
|
32
|
+
* @param volume Valor entre 0.0 e 1.0
|
|
33
|
+
*/
|
|
34
|
+
setVolume(volume) {
|
|
35
|
+
this._volume = limitaValorDoVolume(volume);
|
|
36
|
+
this._atualizaGain();
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Define o volume geral (aplicado sobre o volume individual).
|
|
40
|
+
* @param volumeGeral Valor entre 0.0 e 1.0
|
|
41
|
+
*/
|
|
42
|
+
setVolumeGeral(volumeGeral) {
|
|
43
|
+
this._volumeGeral = limitaValorDoVolume(volumeGeral);
|
|
44
|
+
this._atualizaGain();
|
|
45
|
+
}
|
|
46
|
+
getVolume() {
|
|
47
|
+
return this._volume;
|
|
48
|
+
}
|
|
49
|
+
_atualizaGain() {
|
|
50
|
+
const valorLinear = this._volume * this._volumeGeral;
|
|
51
|
+
const valorExponencial = linearParaExponencial(valorLinear);
|
|
52
|
+
this.gainNode.gain.setValueAtTime(valorExponencial, this.audioContext.currentTime);
|
|
53
|
+
}
|
|
54
|
+
getTamanhoMusica() {
|
|
55
|
+
return this.audioBuffer.duration * 1000000;
|
|
56
|
+
}
|
|
57
|
+
getPosicaoAtualMusica() {
|
|
58
|
+
if (this._reproduzindo) {
|
|
59
|
+
const decorrido = this.audioContext.currentTime - this._inicioContextTime;
|
|
60
|
+
return (this._posicaoAtual + decorrido * 1000000);
|
|
61
|
+
}
|
|
62
|
+
return this._posicaoAtual;
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* Define a posição de reprodução.
|
|
66
|
+
* @param microsegundos Posição em microsegundos
|
|
67
|
+
*/
|
|
68
|
+
setPosicaoMusica(microsegundos) {
|
|
69
|
+
this._posicaoAtual = microsegundos;
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* Inicia (ou reinicia) a reprodução a partir da posição atual.
|
|
73
|
+
* @param repetir Se verdadeiro, repete indefinidamente.
|
|
74
|
+
*/
|
|
75
|
+
inicia(repetir) {
|
|
76
|
+
this._pararSourceNode();
|
|
77
|
+
this._repetindo = repetir;
|
|
78
|
+
const source = this.audioContext.createBufferSource();
|
|
79
|
+
source.buffer = this.audioBuffer;
|
|
80
|
+
source.loop = repetir;
|
|
81
|
+
source.connect(this.gainNode);
|
|
82
|
+
const offsetSegundos = this._posicaoAtual / 1000000;
|
|
83
|
+
source.start(0, offsetSegundos);
|
|
84
|
+
this._inicioContextTime = this.audioContext.currentTime - offsetSegundos;
|
|
85
|
+
this._posicaoAtual = 0;
|
|
86
|
+
this._reproduzindo = true;
|
|
87
|
+
this.sourceNode = source;
|
|
88
|
+
source.onended = () => {
|
|
89
|
+
if (this._reproduzindo && !this._repetindo) {
|
|
90
|
+
this._reproduzindo = false;
|
|
91
|
+
this._posicaoAtual = 0;
|
|
92
|
+
this.sourceNode = null;
|
|
93
|
+
}
|
|
94
|
+
};
|
|
95
|
+
}
|
|
96
|
+
/**
|
|
97
|
+
* Pausa a reprodução, preservando a posição atual.
|
|
98
|
+
* @param fechaRecursos Se verdadeiro, libera o buffer.
|
|
99
|
+
*/
|
|
100
|
+
pausa(fechaRecursos) {
|
|
101
|
+
if (this._reproduzindo) {
|
|
102
|
+
const decorrido = this.audioContext.currentTime - this._inicioContextTime;
|
|
103
|
+
this._posicaoAtual += decorrido * 1000000;
|
|
104
|
+
}
|
|
105
|
+
this._pararSourceNode();
|
|
106
|
+
if (fechaRecursos) {
|
|
107
|
+
this._liberarRecursos();
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
/**
|
|
111
|
+
* Interrompe a reprodução e reseta a posição para o início.
|
|
112
|
+
* @param fechaRecursos Se verdadeiro, libera o buffer.
|
|
113
|
+
*/
|
|
114
|
+
interrompe(fechaRecursos) {
|
|
115
|
+
this._pararSourceNode();
|
|
116
|
+
this._posicaoAtual = 0;
|
|
117
|
+
if (fechaRecursos) {
|
|
118
|
+
this._liberarRecursos();
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
_pararSourceNode() {
|
|
122
|
+
if (this.sourceNode) {
|
|
123
|
+
try {
|
|
124
|
+
this.sourceNode.stop();
|
|
125
|
+
}
|
|
126
|
+
catch (_a) {
|
|
127
|
+
// Ignorado: o nó pode já ter parado naturalmente
|
|
128
|
+
}
|
|
129
|
+
this.sourceNode.disconnect();
|
|
130
|
+
this.sourceNode = null;
|
|
131
|
+
}
|
|
132
|
+
this._reproduzindo = false;
|
|
133
|
+
}
|
|
134
|
+
_liberarRecursos() {
|
|
135
|
+
this.gainNode.disconnect();
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
class Sons {
|
|
139
|
+
constructor() {
|
|
140
|
+
this.reproducoes = new Map();
|
|
141
|
+
this._volumeGeral = 100;
|
|
142
|
+
this.audioContext = new AudioContext();
|
|
143
|
+
}
|
|
144
|
+
finalizar() {
|
|
145
|
+
this._limparCacheReproducoes();
|
|
146
|
+
this.audioContext.close();
|
|
147
|
+
}
|
|
148
|
+
_limparCacheReproducoes() {
|
|
149
|
+
for (const reproducao of this.reproducoes.values()) {
|
|
150
|
+
reproducao.interrompe(true);
|
|
151
|
+
}
|
|
152
|
+
this.reproducoes.clear();
|
|
153
|
+
}
|
|
154
|
+
/**
|
|
155
|
+
* Carrega um som a partir de uma URL e retorna um endereço (handle) numérico.
|
|
156
|
+
*
|
|
157
|
+
* @param caminhoSom URL ou caminho do arquivo de áudio (MP3, WAV, OGG, etc.)
|
|
158
|
+
* @returns Endereço numérico do som carregado.
|
|
159
|
+
*/
|
|
160
|
+
async carregarSom(caminhoSom) {
|
|
161
|
+
const endereco = this._hashCode(caminhoSom);
|
|
162
|
+
if (!this.reproducoes.has(endereco)) {
|
|
163
|
+
const response = await fetch(caminhoSom);
|
|
164
|
+
if (!response.ok) {
|
|
165
|
+
throw new excecoes_1.ErroExecucaoBiblioteca(`Não foi possível carregar o som: ${caminhoSom}`);
|
|
166
|
+
}
|
|
167
|
+
const arrayBuffer = await response.arrayBuffer();
|
|
168
|
+
const audioBuffer = await this.audioContext.decodeAudioData(arrayBuffer);
|
|
169
|
+
this.reproducoes.set(endereco, new Reproducao(this.audioContext, audioBuffer));
|
|
170
|
+
}
|
|
171
|
+
return endereco;
|
|
172
|
+
}
|
|
173
|
+
/**
|
|
174
|
+
* Libera a memória de um som previamente carregado, interrompendo todas as
|
|
175
|
+
* suas reproduções.
|
|
176
|
+
*
|
|
177
|
+
* @param endereco Endereço retornado por carregarSom().
|
|
178
|
+
*/
|
|
179
|
+
liberarSom(endereco) {
|
|
180
|
+
const reproducao = this.reproducoes.get(endereco);
|
|
181
|
+
if (reproducao) {
|
|
182
|
+
reproducao.interrompe(true);
|
|
183
|
+
this.reproducoes.delete(endereco);
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
/**
|
|
187
|
+
* Reproduz um som previamente carregado.
|
|
188
|
+
*
|
|
189
|
+
* @param endereco Endereço retornado por carregarSom().
|
|
190
|
+
* @param repetir Se verdadeiro, o som repete indefinidamente.
|
|
191
|
+
* @returns O mesmo endereço, para uso futuro (parar, pausar, etc.).
|
|
192
|
+
*/
|
|
193
|
+
reproduzirSom(endereco, repetir) {
|
|
194
|
+
const reproducao = this.reproducoes.get(endereco);
|
|
195
|
+
if (!reproducao) {
|
|
196
|
+
throw new excecoes_1.ErroExecucaoBiblioteca(`Endereço de som inválido (${endereco})!`);
|
|
197
|
+
}
|
|
198
|
+
reproducao.inicia(repetir);
|
|
199
|
+
return endereco;
|
|
200
|
+
}
|
|
201
|
+
/**
|
|
202
|
+
* Pausa a reprodução de um som, preservando a posição atual para retomada.
|
|
203
|
+
*
|
|
204
|
+
* @param endereco Endereço do som.
|
|
205
|
+
*/
|
|
206
|
+
pausarSom(endereco) {
|
|
207
|
+
const reproducao = this.reproducoes.get(endereco);
|
|
208
|
+
if (reproducao)
|
|
209
|
+
reproducao.pausa(false);
|
|
210
|
+
}
|
|
211
|
+
/**
|
|
212
|
+
* Interrompe a reprodução de um som e reseta para o início.
|
|
213
|
+
*
|
|
214
|
+
* @param endereco Endereço do som.
|
|
215
|
+
*/
|
|
216
|
+
interromperSom(endereco) {
|
|
217
|
+
const reproducao = this.reproducoes.get(endereco);
|
|
218
|
+
if (reproducao)
|
|
219
|
+
reproducao.interrompe(false);
|
|
220
|
+
}
|
|
221
|
+
/**
|
|
222
|
+
* Retorna a duração total do som em milissegundos.
|
|
223
|
+
*
|
|
224
|
+
* @param endereco Endereço do som.
|
|
225
|
+
*/
|
|
226
|
+
obterTamanhoMusica(endereco) {
|
|
227
|
+
const reproducao = this.reproducoes.get(endereco);
|
|
228
|
+
if (reproducao)
|
|
229
|
+
return Math.trunc(reproducao.getTamanhoMusica() / 1000);
|
|
230
|
+
return 0;
|
|
231
|
+
}
|
|
232
|
+
/**
|
|
233
|
+
* Retorna a posição atual de reprodução em milissegundos.
|
|
234
|
+
*
|
|
235
|
+
* @param endereco Endereço do som.
|
|
236
|
+
*/
|
|
237
|
+
obterPosicaoAtualMusica(endereco) {
|
|
238
|
+
const reproducao = this.reproducoes.get(endereco);
|
|
239
|
+
if (reproducao) {
|
|
240
|
+
return Math.trunc(reproducao.getPosicaoAtualMusica() / 1000);
|
|
241
|
+
}
|
|
242
|
+
return 0;
|
|
243
|
+
}
|
|
244
|
+
/**
|
|
245
|
+
* Define a posição de reprodução em milissegundos.
|
|
246
|
+
*
|
|
247
|
+
* @param endereco Endereço do som.
|
|
248
|
+
* @param milissegundos Nova posição em milissegundos.
|
|
249
|
+
*/
|
|
250
|
+
definirPosicaoAtualMusica(endereco, milissegundos) {
|
|
251
|
+
const reproducao = this.reproducoes.get(endereco);
|
|
252
|
+
if (!reproducao)
|
|
253
|
+
return;
|
|
254
|
+
const posicaoAtualMicros = reproducao.getPosicaoAtualMusica();
|
|
255
|
+
if (posicaoAtualMicros > 0) {
|
|
256
|
+
// Estava pausado: apenas atualiza a posição
|
|
257
|
+
reproducao.setPosicaoMusica(milissegundos * 1000);
|
|
258
|
+
}
|
|
259
|
+
else {
|
|
260
|
+
// Estava tocando: pausa, reposiciona e retoma
|
|
261
|
+
reproducao.pausa(false);
|
|
262
|
+
reproducao.setPosicaoMusica(milissegundos * 1000);
|
|
263
|
+
reproducao.inicia(false);
|
|
264
|
+
}
|
|
265
|
+
}
|
|
266
|
+
/**
|
|
267
|
+
* Define o volume de uma reprodução específica.
|
|
268
|
+
*
|
|
269
|
+
* @param endereco Endereço do som.
|
|
270
|
+
* @param volume Valor entre 0 e 100.
|
|
271
|
+
*/
|
|
272
|
+
definirVolumeReproducao(endereco, volume) {
|
|
273
|
+
const reproducao = this.reproducoes.get(endereco);
|
|
274
|
+
if (reproducao)
|
|
275
|
+
reproducao.setVolume(volume / 100);
|
|
276
|
+
else
|
|
277
|
+
console.warn("Índice de reprodução não encontrado!");
|
|
278
|
+
}
|
|
279
|
+
/**
|
|
280
|
+
* Define o volume geral que afeta todas as reproduções.
|
|
281
|
+
*
|
|
282
|
+
* @param volume Valor entre 0 e 100.
|
|
283
|
+
*/
|
|
284
|
+
definirVolume(volume) {
|
|
285
|
+
this._volumeGeral = volume;
|
|
286
|
+
const volumeFloat = volume / 100;
|
|
287
|
+
for (const reproducao of this.reproducoes.values()) {
|
|
288
|
+
reproducao.setVolumeGeral(volumeFloat);
|
|
289
|
+
}
|
|
290
|
+
}
|
|
291
|
+
/**
|
|
292
|
+
* Retorna o volume geral atual.
|
|
293
|
+
*
|
|
294
|
+
* @returns Valor entre 0 e 100.
|
|
295
|
+
*/
|
|
296
|
+
obterVolume() {
|
|
297
|
+
return this._volumeGeral;
|
|
298
|
+
}
|
|
299
|
+
/**
|
|
300
|
+
* Retorna o volume de uma reprodução específica.
|
|
301
|
+
*
|
|
302
|
+
* @param endereco Endereço do som.
|
|
303
|
+
* @returns Valor entre 0 e 100, ou -1 se a reprodução não existir.
|
|
304
|
+
*/
|
|
305
|
+
obterVolumeReproducao(endereco) {
|
|
306
|
+
const reproducao = this.reproducoes.get(endereco);
|
|
307
|
+
if (reproducao) {
|
|
308
|
+
return Math.trunc(reproducao.getVolume() * 100);
|
|
309
|
+
}
|
|
310
|
+
return -1;
|
|
311
|
+
}
|
|
312
|
+
/**
|
|
313
|
+
* Gera um hash numérico a partir de uma string.
|
|
314
|
+
*/
|
|
315
|
+
_hashCode(str) {
|
|
316
|
+
let hash = 0;
|
|
317
|
+
for (let i = 0; i < str.length; i++) {
|
|
318
|
+
hash = (Math.imul(31, hash) + str.charCodeAt(i)) | 0;
|
|
319
|
+
}
|
|
320
|
+
return hash;
|
|
321
|
+
}
|
|
322
|
+
}
|
|
323
|
+
exports.Sons = Sons;
|
|
324
|
+
//# sourceMappingURL=sons.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sons.js","sourceRoot":"","sources":["../../../../fontes/bibliotecas/dialetos/portugol-studio/sons.ts"],"names":[],"mappings":";;;AAAA,gDAA2D;AAE3D,SAAS,qBAAqB,CAAC,MAAc;IACzC,OAAO,IAAI,CAAC,GAAG,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC;AAC/B,CAAC;AAED,SAAS,mBAAmB,CAAC,MAAc;IACvC,IAAI,MAAM,GAAG,CAAC;QAAE,OAAO,CAAC,CAAC;IACzB,IAAI,MAAM,GAAG,CAAC;QAAE,OAAO,CAAC,CAAC;IACzB,OAAO,MAAM,CAAC;AAClB,CAAC;AAED,MAAM,UAAU;IAoBZ,YAAY,YAA0B,EAAE,WAAwB;QAdxD,YAAO,GAAW,GAAG,CAAC;QAEtB,iBAAY,GAAW,GAAG,CAAC;QAE3B,eAAU,GAAiC,IAAI,CAAC;QAEhD,kBAAa,GAAW,CAAC,CAAC;QAE1B,uBAAkB,GAAW,CAAC,CAAC;QAE/B,kBAAa,GAAY,KAAK,CAAC;QAE/B,eAAU,GAAY,KAAK,CAAC;QAGhC,IAAI,CAAC,YAAY,GAAG,YAAY,CAAC;QACjC,IAAI,CAAC,WAAW,GAAG,WAAW,CAAC;QAE/B,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,YAAY,CAAC,UAAU,EAAE,CAAC;QAC/C,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,IAAI,CAAC,YAAY,CAAC,WAAW,CAAC,CAAC;QAErD,IAAI,CAAC,aAAa,EAAE,CAAC;IACzB,CAAC;IAED;;;MAGE;IACF,SAAS,CAAC,MAAc;QACpB,IAAI,CAAC,OAAO,GAAG,mBAAmB,CAAC,MAAM,CAAC,CAAC;QAC3C,IAAI,CAAC,aAAa,EAAE,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,GAAG,GAAG,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC;QACzD,CAAC;QACD,OAAO,IAAI,CAAC;IAChB,CAAC;CACJ;AAjND,oBAiNC"}
|
package/bin/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@designliquido/delegua-node",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.16.0",
|
|
4
4
|
"description": "Linguagem Delégua com capacidades para ecossistema Node.js.",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"empacotar": "yarn rimraf ./dist && tsc && yarn copyfiles -V ./bin/delegua ./bin/delegua.cmd ./dist && yarn copyfiles -V ./package.json ./dist/bin && yarn copyfiles -V ./README.md ./dist && yarn copyfiles -V ./LICENSE ./dist",
|
|
@@ -12,12 +12,12 @@
|
|
|
12
12
|
"testes:servidor-depuracao": "yarn ts-node ./fontes/depuracao/servidor-depuracao.ts"
|
|
13
13
|
},
|
|
14
14
|
"dependencies": {
|
|
15
|
-
"@designliquido/birl": "^0.5.
|
|
16
|
-
"@designliquido/delegua": "^1.
|
|
17
|
-
"@designliquido/mapler": "^0.6.
|
|
18
|
-
"@designliquido/portugol-studio": "^0.9.
|
|
19
|
-
"@designliquido/potigol": "^0.8.
|
|
20
|
-
"@designliquido/visualg": "^0.8.
|
|
15
|
+
"@designliquido/birl": "^0.5.18",
|
|
16
|
+
"@designliquido/delegua": "^1.15.0",
|
|
17
|
+
"@designliquido/mapler": "^0.6.18",
|
|
18
|
+
"@designliquido/portugol-studio": "^0.9.18",
|
|
19
|
+
"@designliquido/potigol": "^0.8.18",
|
|
20
|
+
"@designliquido/visualg": "^0.8.18",
|
|
21
21
|
"chalk": "4.1.2",
|
|
22
22
|
"commander": "^14.0.0",
|
|
23
23
|
"json-colorizer": "^3.0.1",
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"erro-execucao-biblioteca.d.ts","sourceRoot":"","sources":["../../fontes/excecoes/erro-execucao-biblioteca.ts"],"names":[],"mappings":"AAAA,qBAAa,sBAAuB,SAAQ,KAAK;IAC7C,QAAQ,EAAE,MAAM,CAAC;gBAEL,QAAQ,EAAE,MAAM;CAI/B"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ErroExecucaoBiblioteca = void 0;
|
|
4
|
+
class ErroExecucaoBiblioteca extends Error {
|
|
5
|
+
constructor(mensagem) {
|
|
6
|
+
super(mensagem);
|
|
7
|
+
this.name = "ErroExecucaoBiblioteca";
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
exports.ErroExecucaoBiblioteca = ErroExecucaoBiblioteca;
|
|
11
|
+
//# sourceMappingURL=erro-execucao-biblioteca.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"erro-execucao-biblioteca.js","sourceRoot":"","sources":["../../fontes/excecoes/erro-execucao-biblioteca.ts"],"names":[],"mappings":";;;AAAA,MAAa,sBAAuB,SAAQ,KAAK;IAG7C,YAAY,QAAgB;QACxB,KAAK,CAAC,QAAQ,CAAC,CAAC;QAChB,IAAI,CAAC,IAAI,GAAG,wBAAwB,CAAC;IACzC,CAAC;CACJ;AAPD,wDAOC"}
|
package/excecoes/index.d.ts
CHANGED
package/excecoes/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../fontes/excecoes/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../fontes/excecoes/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAC;AAClC,cAAc,4BAA4B,CAAC"}
|
package/excecoes/index.js
CHANGED
|
@@ -15,4 +15,5 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
__exportStar(require("./erro-importacao"), exports);
|
|
18
|
+
__exportStar(require("./erro-execucao-biblioteca"), exports);
|
|
18
19
|
//# sourceMappingURL=index.js.map
|
package/excecoes/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../fontes/excecoes/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,oDAAkC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../fontes/excecoes/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,oDAAkC;AAClC,6DAA2C"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@designliquido/delegua-node",
|
|
3
|
-
"version": "1.16.
|
|
3
|
+
"version": "1.16.1",
|
|
4
4
|
"description": "Linguagem Delégua com capacidades para ecossistema Node.js.",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"empacotar": "yarn rimraf ./dist && tsc && yarn copyfiles -V ./bin/delegua ./bin/delegua.cmd ./dist && yarn copyfiles -V ./package.json ./dist/bin && yarn copyfiles -V ./README.md ./dist && yarn copyfiles -V ./LICENSE ./dist",
|
|
@@ -12,12 +12,12 @@
|
|
|
12
12
|
"testes:servidor-depuracao": "yarn ts-node ./fontes/depuracao/servidor-depuracao.ts"
|
|
13
13
|
},
|
|
14
14
|
"dependencies": {
|
|
15
|
-
"@designliquido/birl": "^0.5.
|
|
16
|
-
"@designliquido/delegua": "^1.
|
|
17
|
-
"@designliquido/mapler": "^0.6.
|
|
18
|
-
"@designliquido/portugol-studio": "^0.9.
|
|
19
|
-
"@designliquido/potigol": "^0.8.
|
|
20
|
-
"@designliquido/visualg": "^0.8.
|
|
15
|
+
"@designliquido/birl": "^0.5.18",
|
|
16
|
+
"@designliquido/delegua": "^1.15.0",
|
|
17
|
+
"@designliquido/mapler": "^0.6.18",
|
|
18
|
+
"@designliquido/portugol-studio": "^0.9.18",
|
|
19
|
+
"@designliquido/potigol": "^0.8.18",
|
|
20
|
+
"@designliquido/visualg": "^0.8.18",
|
|
21
21
|
"chalk": "4.1.2",
|
|
22
22
|
"commander": "^14.0.0",
|
|
23
23
|
"json-colorizer": "^3.0.1",
|