-
Notifications
You must be signed in to change notification settings - Fork 111
/
Copy pathDanmakuViewModel.Properties.cs
128 lines (96 loc) · 2.93 KB
/
DanmakuViewModel.Properties.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
// Copyright (c) Bili Copilot. All rights reserved.
using CommunityToolkit.Mvvm.ComponentModel;
using Microsoft.Extensions.Logging;
using Richasy.BiliKernel.Bili.Media;
using Richasy.BiliKernel.Models;
using Richasy.BiliKernel.Models.Danmaku;
using Windows.UI;
namespace BiliCopilot.UI.ViewModels.Core;
/// <summary>
/// 弹幕视图模型.
/// </summary>
public sealed partial class DanmakuViewModel
{
private readonly IDanmakuService _danmakuService;
private readonly ILogger<DanmakuViewModel> _logger;
private string _aid;
private string _cid;
private int _position;
private int _duration;
[ObservableProperty]
private bool _isShowDanmaku;
[ObservableProperty]
private bool _canShowDanmaku;
[ObservableProperty]
private double _danmakuOpacity;
[ObservableProperty]
private double _danmakuFontSize;
[ObservableProperty]
private string _danmakuFontFamily;
[ObservableProperty]
private double _danmakuArea;
[ObservableProperty]
private double _danmakuSpeed;
[ObservableProperty]
private double _extraSpeed = 1;
[ObservableProperty]
private bool _isDanmakuLimit;
[ObservableProperty]
private bool _isDanmakuBold;
[ObservableProperty]
private bool _isStandardSize;
[ObservableProperty]
private DanmakuLocation _location;
[ObservableProperty]
private Color _color;
[ObservableProperty]
private bool _isLoading;
[ObservableProperty]
private List<DanmakuLocation> _locations;
[ObservableProperty]
private List<Color> _colors;
[ObservableProperty]
private List<string> _fonts;
[ObservableProperty]
private bool _isPaused;
/// <summary>
/// 当弹幕列表添加时触发的事件.
/// </summary>
public event EventHandler<IReadOnlyList<DanmakuInformation>> ListAdded;
/// <summary>
/// 速度加成改变时触发的事件.
/// </summary>
public event EventHandler ExtraSpeedChanged;
/// <summary>
/// 当请求清除弹幕时触发的事件.
/// </summary>
public event EventHandler RequestClearDanmaku;
/// <summary>
/// 当请求重绘弹幕时触发的事件.
/// </summary>
public event EventHandler RequestRedrawDanmaku;
/// <summary>
/// 当进度更新时触发的事件.
/// </summary>
public event EventHandler<int> ProgressChanged;
/// <summary>
/// 暂停弹幕.
/// </summary>
public event EventHandler PauseDanmaku;
/// <summary>
/// 恢复弹幕.
/// </summary>
public event EventHandler ResumeDanmaku;
/// <summary>
/// 请求添加单条弹幕.
/// </summary>
public event EventHandler<string> RequestAddSingleDanmaku;
/// <summary>
/// 请求重置样式.
/// </summary>
public event EventHandler RequestResetStyle;
/// <summary>
/// 是否为直播弹幕模块.
/// </summary>
public bool IsLive { get; private set; }
}