namespace DownKyi.Core.Settings
{
public partial class SettingsManager
{
// 是否屏蔽顶部弹幕
private readonly AllowStatus danmakuTopFilter = AllowStatus.NO;
// 是否屏蔽底部弹幕
private readonly AllowStatus danmakuBottomFilter = AllowStatus.NO;
// 是否屏蔽滚动弹幕
private readonly AllowStatus danmakuScrollFilter = AllowStatus.NO;
// 是否自定义分辨率
private readonly AllowStatus isCustomDanmakuResolution = AllowStatus.NO;
// 分辨率-宽
private readonly int danmakuScreenWidth = 1920;
// 分辨率-高
private readonly int danmakuScreenHeight = 1080;
// 弹幕字体
private readonly string danmakuFontName = "黑体";
// 弹幕字体大小
private readonly int danmakuFontSize = 50;
// 弹幕限制行数
private readonly int danmakuLineCount = 0;
// 弹幕布局算法
private readonly DanmakuLayoutAlgorithm danmakuLayoutAlgorithm = DanmakuLayoutAlgorithm.SYNC;
///
/// 获取是否屏蔽顶部弹幕
///
///
public AllowStatus GetDanmakuTopFilter()
{
appSettings = GetSettings();
if (appSettings.Danmaku.DanmakuTopFilter == 0)
{
// 第一次获取,先设置默认值
SetDanmakuTopFilter(danmakuTopFilter);
return danmakuTopFilter;
}
return appSettings.Danmaku.DanmakuTopFilter;
}
///
/// 设置是否屏蔽顶部弹幕
///
///
///
public bool SetDanmakuTopFilter(AllowStatus danmakuFilter)
{
appSettings.Danmaku.DanmakuTopFilter = danmakuFilter;
return SetSettings();
}
///
/// 获取是否屏蔽底部弹幕
///
///
public AllowStatus GetDanmakuBottomFilter()
{
appSettings = GetSettings();
if (appSettings.Danmaku.DanmakuBottomFilter == 0)
{
// 第一次获取,先设置默认值
SetDanmakuBottomFilter(danmakuBottomFilter);
return danmakuBottomFilter;
}
return appSettings.Danmaku.DanmakuBottomFilter;
}
///
/// 设置是否屏蔽底部弹幕
///
///
///
public bool SetDanmakuBottomFilter(AllowStatus danmakuFilter)
{
appSettings.Danmaku.DanmakuBottomFilter = danmakuFilter;
return SetSettings();
}
///
/// 获取是否屏蔽滚动弹幕
///
///
public AllowStatus GetDanmakuScrollFilter()
{
appSettings = GetSettings();
if (appSettings.Danmaku.DanmakuScrollFilter == 0)
{
// 第一次获取,先设置默认值
SetDanmakuScrollFilter(danmakuScrollFilter);
return danmakuScrollFilter;
}
return appSettings.Danmaku.DanmakuScrollFilter;
}
///
/// 设置是否屏蔽滚动弹幕
///
///
///
public bool SetDanmakuScrollFilter(AllowStatus danmakuFilter)
{
appSettings.Danmaku.DanmakuScrollFilter = danmakuFilter;
return SetSettings();
}
///
/// 获取是否自定义分辨率
///
///
public AllowStatus IsCustomDanmakuResolution()
{
appSettings = GetSettings();
if (appSettings.Danmaku.IsCustomDanmakuResolution == 0)
{
// 第一次获取,先设置默认值
IsCustomDanmakuResolution(isCustomDanmakuResolution);
return isCustomDanmakuResolution;
}
return appSettings.Danmaku.IsCustomDanmakuResolution;
}
///
/// 设置是否自定义分辨率
///
///
///
public bool IsCustomDanmakuResolution(AllowStatus isCustomResolution)
{
appSettings.Danmaku.IsCustomDanmakuResolution = isCustomResolution;
return SetSettings();
}
///
/// 获取分辨率-宽
///
///
public int GetDanmakuScreenWidth()
{
appSettings = GetSettings();
if (appSettings.Danmaku.DanmakuScreenWidth == 0)
{
// 第一次获取,先设置默认值
SetDanmakuScreenWidth(danmakuScreenWidth);
return danmakuScreenWidth;
}
return appSettings.Danmaku.DanmakuScreenWidth;
}
///
/// 设置分辨率-宽
///
///
///
public bool SetDanmakuScreenWidth(int screenWidth)
{
appSettings.Danmaku.DanmakuScreenWidth = screenWidth;
return SetSettings();
}
///
/// 获取分辨率-高
///
///
public int GetDanmakuScreenHeight()
{
appSettings = GetSettings();
if (appSettings.Danmaku.DanmakuScreenHeight == 0)
{
// 第一次获取,先设置默认值
SetDanmakuScreenHeight(danmakuScreenHeight);
return danmakuScreenHeight;
}
return appSettings.Danmaku.DanmakuScreenHeight;
}
///
/// 设置分辨率-高
///
///
///
public bool SetDanmakuScreenHeight(int screenHeight)
{
appSettings.Danmaku.DanmakuScreenHeight = screenHeight;
return SetSettings();
}
///
/// 获取弹幕字体
///
///
public string GetDanmakuFontName()
{
appSettings = GetSettings();
if (appSettings.Danmaku.DanmakuFontName == null)
{
// 第一次获取,先设置默认值
SetDanmakuFontName(danmakuFontName);
return danmakuFontName;
}
return appSettings.Danmaku.DanmakuFontName;
}
///
/// 设置弹幕字体
///
///
///
public bool SetDanmakuFontName(string danmakuFontName)
{
appSettings.Danmaku.DanmakuFontName = danmakuFontName;
return SetSettings();
}
///
/// 获取弹幕字体大小
///
///
public int GetDanmakuFontSize()
{
appSettings = GetSettings();
if (appSettings.Danmaku.DanmakuFontSize == 0)
{
// 第一次获取,先设置默认值
SetDanmakuFontSize(danmakuFontSize);
return danmakuFontSize;
}
return appSettings.Danmaku.DanmakuFontSize;
}
///
/// 设置弹幕字体大小
///
///
///
public bool SetDanmakuFontSize(int danmakuFontSize)
{
appSettings.Danmaku.DanmakuFontSize = danmakuFontSize;
return SetSettings();
}
///
/// 获取弹幕限制行数
///
///
public int GetDanmakuLineCount()
{
appSettings = GetSettings();
if (appSettings.Danmaku.DanmakuLineCount == 0)
{
// 第一次获取,先设置默认值
SetDanmakuLineCount(danmakuLineCount);
return danmakuLineCount;
}
return appSettings.Danmaku.DanmakuLineCount;
}
///
/// 设置弹幕限制行数
///
///
///
public bool SetDanmakuLineCount(int danmakuLineCount)
{
appSettings.Danmaku.DanmakuLineCount = danmakuLineCount;
return SetSettings();
}
///
/// 获取弹幕布局算法
///
///
public DanmakuLayoutAlgorithm GetDanmakuLayoutAlgorithm()
{
appSettings = GetSettings();
if (appSettings.Danmaku.DanmakuLayoutAlgorithm == 0)
{
// 第一次获取,先设置默认值
SetDanmakuLayoutAlgorithm(danmakuLayoutAlgorithm);
return danmakuLayoutAlgorithm;
}
return appSettings.Danmaku.DanmakuLayoutAlgorithm;
}
///
/// 设置弹幕布局算法
///
///
///
public bool SetDanmakuLayoutAlgorithm(DanmakuLayoutAlgorithm danmakuLayoutAlgorithm)
{
appSettings.Danmaku.DanmakuLayoutAlgorithm = danmakuLayoutAlgorithm;
return SetSettings();
}
}
}