visual-song 0.13.4 → 0.13.6

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/dist/index.d.ts CHANGED
@@ -48,6 +48,7 @@ type VisualSongAudioRef = {
48
48
  setLoop(loop: boolean): void;
49
49
  };
50
50
  declare function useVisualSongAudio(file?: File): VisualSongAudioRef;
51
+ declare function setMainLoop(loop: boolean): void;
51
52
  type VisualSongRef = {
52
53
  IsInitialized(): boolean;
53
54
  getBackgroundColor(): Float32Array;
@@ -64,6 +65,9 @@ type VisualSongRef = {
64
65
  setUseCustomResolution(use: boolean, width?: number, height?: number): void;
65
66
  getFPS(): number;
66
67
  setFPS(fps: number): void;
68
+ setUseSinWaveOnly(use: boolean): void;
69
+ getUseSinWaveOnly(): boolean;
70
+ setRenderMode(mode: RenderMode): void;
67
71
  };
68
72
  type Props = {
69
73
  style?: React.CSSProperties;
@@ -77,5 +81,5 @@ type Props = {
77
81
  };
78
82
  declare const VisualSong: react.ForwardRefExoticComponent<Props & react.RefAttributes<VisualSongRef>>;
79
83
 
80
- export { EasingType, RenderMode, VisualSong, VisualSongProvider, useVisualSongAudio };
84
+ export { EasingType, RenderMode, VisualSong, VisualSongProvider, setMainLoop, useVisualSongAudio };
81
85
  export type { VisualSongAudioRef, VisualSongRef };
package/dist/index.js CHANGED
@@ -6312,6 +6312,15 @@ function useVisualSongAudio(file) {
6312
6312
  }
6313
6313
  };
6314
6314
  }
6315
+ function setMainLoop(loop) {
6316
+ const { module } = useContext(VisualSongContext);
6317
+ if (!module) return;
6318
+ if (loop) {
6319
+ module.resumeMainLoop();
6320
+ } else {
6321
+ module.pauseMainLoop();
6322
+ }
6323
+ }
6315
6324
  const VisualSong = /*#__PURE__*/ forwardRef(function VisualSong({ style, backgroundColor, vertexShader, primitiveMode, vertexCount, useSinWaveOnly, renderMode, initializedCallback }, ref) {
6316
6325
  const canvasRef = useRef(null);
6317
6326
  const canvasWrapperRef = useRef(null);
@@ -6590,4 +6599,4 @@ const VisualSong = /*#__PURE__*/ forwardRef(function VisualSong({ style, backgro
6590
6599
  });
6591
6600
  });
6592
6601
 
6593
- export { EasingType, RenderMode, VisualSong, VisualSongProvider, useVisualSongAudio };
6602
+ export { EasingType, RenderMode, VisualSong, VisualSongProvider, setMainLoop, useVisualSongAudio };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "visual-song",
3
- "version": "0.13.4",
3
+ "version": "0.13.6",
4
4
  "description": "visual-song core library",
5
5
  "author": "kunyoungparkk (rjsdud3263@gmail.com)",
6
6
  "license": "MIT",