Move to Renderer V2

This commit is contained in:
duckietm
2024-04-03 09:27:56 +02:00
parent 110c3ad393
commit b3134ce50b
4080 changed files with 115593 additions and 66375 deletions
@@ -0,0 +1,24 @@
import { ISongInfo } from '@nitrots/api';
export class SongDataEntry implements ISongInfo
{
private _jukeboxDiskId:number = -1;
constructor(
public readonly id: number,
public readonly length: number,
public readonly name: string,
public readonly creator: string,
public readonly songData: string = ''
) {}
public get diskId(): number
{
return this._jukeboxDiskId;
}
public set diskId(k: number)
{
this._jukeboxDiskId = k;
}
}
@@ -0,0 +1,51 @@
export class SongStartRequestData
{
private _songId: number;
private _startPos: number;
private _playLength: number;
private _playRequestTime: number;
private _fadeInSeconds: number;
private _fadeOutSeconds: number;
constructor(songId: number, startPos: number, playLength: number, fadeInSeconds: number, fadeOutSeconds: number)
{
this._songId = songId;
this._startPos = startPos;
this._playLength = playLength;
this._fadeInSeconds = fadeInSeconds;
this._fadeOutSeconds = fadeOutSeconds;
this._playRequestTime = Date.now();
}
public get songId(): number
{
return this._songId;
}
public get startPos(): number
{
if(this._startPos < 0) return 0;
return this._startPos + ((Date.now() - this._playRequestTime) / 1000);
}
public get playLength(): number
{
return this._playLength;
}
public get playRequestTime(): number
{
return this._playRequestTime;
}
public get fadeInSeconds(): number
{
return this._fadeInSeconds;
}
public get fadeOutSeconds(): number
{
return this._fadeOutSeconds;
}
}
+2
View File
@@ -0,0 +1,2 @@
export * from './SongDataEntry';
export * from './SongStartRequestData';