You've already forked Nitro_Render_V3
mirror of
https://github.com/duckietm/Nitro_Render_V3.git
synced 2026-06-20 07:26:18 +00:00
Move to Renderer V2
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
export * from './SongDataEntry';
|
||||
export * from './SongStartRequestData';
|
||||
Reference in New Issue
Block a user