BililiveRecorder/BililiveRecorder.WPF/MockData/MockRecordedRoom.cs

130 lines
3.6 KiB
C#
Raw Normal View History

2020-11-27 18:51:02 +08:00
using System;
using System.ComponentModel;
using BililiveRecorder.Core;
2020-12-20 20:56:40 +08:00
using BililiveRecorder.Core.Callback;
2021-01-01 14:46:27 +08:00
using BililiveRecorder.Core.Config.V2;
2020-11-27 18:51:02 +08:00
using BililiveRecorder.FlvProcessor;
2020-12-20 20:56:40 +08:00
#nullable enable
2020-11-27 18:51:02 +08:00
namespace BililiveRecorder.WPF.MockData
{
#if DEBUG
internal class MockRecordedRoom : IRecordedRoom
{
private bool disposedValue;
public MockRecordedRoom()
{
2021-01-01 14:46:27 +08:00
this.RoomId = 123456789;
this.ShortRoomId = 1234;
this.StreamerName = "Mock主播名Mock主播名Mock主播名Mock主播名";
this.IsMonitoring = false;
this.IsRecording = true;
this.IsStreaming = true;
this.DownloadSpeedPersentage = 100d;
this.DownloadSpeedMegaBitps = 2.45d;
2020-11-27 18:51:02 +08:00
}
public int ShortRoomId { get; set; }
public int RoomId { get; set; }
public string StreamerName { get; set; }
2020-12-20 20:56:40 +08:00
public string Title { get; set; } = string.Empty;
2020-11-27 18:51:02 +08:00
2020-12-20 20:56:40 +08:00
public IStreamMonitor StreamMonitor { get; set; } = null!;
public IFlvStreamProcessor? Processor { get; set; }
2020-11-27 18:51:02 +08:00
public bool IsMonitoring { get; set; }
public bool IsRecording { get; set; }
2020-12-15 19:38:35 +08:00
public bool IsDanmakuConnected { get; set; }
public bool IsStreaming { get; set; }
2020-11-27 18:51:02 +08:00
public double DownloadSpeedPersentage { get; set; }
public double DownloadSpeedMegaBitps { get; set; }
public DateTime LastUpdateDateTime { get; set; }
2020-12-05 18:30:04 +08:00
public Guid Guid { get; } = Guid.NewGuid();
2021-01-01 14:46:27 +08:00
public RoomConfig RoomConfig => new RoomConfig();
2020-12-20 20:56:40 +08:00
public event PropertyChangedEventHandler? PropertyChanged;
public event EventHandler<RecordEndData>? RecordEnded;
2020-11-27 18:51:02 +08:00
public void Clip()
{
}
public void RefreshRoomInfo()
{
}
public void Shutdown()
{
}
public bool Start()
{
2021-01-01 14:46:27 +08:00
this.IsMonitoring = true;
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(nameof(this.IsMonitoring)));
2020-11-27 18:51:02 +08:00
return true;
}
public void StartRecord()
{
2021-01-01 14:46:27 +08:00
this.IsRecording = true;
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(nameof(this.IsRecording)));
2020-11-27 18:51:02 +08:00
}
public void Stop()
{
2021-01-01 14:46:27 +08:00
this.IsMonitoring = false;
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(nameof(this.IsMonitoring)));
2020-11-27 18:51:02 +08:00
}
public void StopRecord()
{
2021-01-01 14:46:27 +08:00
this.IsRecording = false;
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(nameof(this.IsRecording)));
2020-11-27 18:51:02 +08:00
}
protected virtual void Dispose(bool disposing)
{
2021-01-01 14:46:27 +08:00
if (!this.disposedValue)
2020-11-27 18:51:02 +08:00
{
if (disposing)
{
// TODO: dispose managed state (managed objects)
}
// TODO: free unmanaged resources (unmanaged objects) and override finalizer
// TODO: set large fields to null
2021-01-01 14:46:27 +08:00
this.disposedValue = true;
2020-11-27 18:51:02 +08:00
}
}
// // TODO: override finalizer only if 'Dispose(bool disposing)' has code to free unmanaged resources
// ~MockRecordedRoom()
// {
// // Do not change this code. Put cleanup code in 'Dispose(bool disposing)' method
// Dispose(disposing: false);
// }
public void Dispose()
{
// Do not change this code. Put cleanup code in 'Dispose(bool disposing)' method
2021-01-01 14:46:27 +08:00
this.Dispose(disposing: true);
2020-11-27 18:51:02 +08:00
GC.SuppressFinalize(this);
}
}
#endif
}