Skip to content

Commit

Permalink
给Desktop增加录制中间态展示,直观了解是否在录制弹幕
Browse files Browse the repository at this point in the history
  • Loading branch information
CHKZL committed Aug 3, 2024
1 parent 77a4c1d commit 971d7a4
Show file tree
Hide file tree
Showing 4 changed files with 42 additions and 11 deletions.
7 changes: 4 additions & 3 deletions Desktop/DataSource/RetrieveData.cs
Original file line number Diff line number Diff line change
Expand Up @@ -128,12 +128,13 @@ private static DataCard CreateDataCard(Server.WebAppServices.Api.batch_complete_
Nickname = item.userInfo.name,
//Live_Status = item.roomInfo.liveStatus,
//Live_Status_IsVisible = item.roomInfo.liveStatus ? System.Windows.Visibility.Visible : System.Windows.Visibility.Collapsed,
//#00aeec
IsRec = item.userInfo.isAutoRec,
RecSign = item.userInfo.isAutoRec ? new SolidColorBrush((Color)ColorConverter.ConvertFromString("#fb7299")) : new SolidColorBrush((Color)ColorConverter.ConvertFromString("#777777")),
RecSign = !item.userInfo.isAutoRec ? new SolidColorBrush((Color)ColorConverter.ConvertFromString("#777777")) : item.taskStatus.isDownload ? new SolidColorBrush((Color)ColorConverter.ConvertFromString("#fb7299")) : new SolidColorBrush((Color)ColorConverter.ConvertFromString("#00aeec")),
IsDanmu = item.userInfo.isRecDanmu,
DanmuSign = item.userInfo.isRecDanmu ? new SolidColorBrush((Color)ColorConverter.ConvertFromString("#fb7299")) : new SolidColorBrush((Color)ColorConverter.ConvertFromString("#777777")),
DanmuSign = !item.userInfo.isRecDanmu ? new SolidColorBrush((Color)ColorConverter.ConvertFromString("#777777")) : item.taskStatus.isDanma ? new SolidColorBrush((Color)ColorConverter.ConvertFromString("#fb7299")) : new SolidColorBrush((Color)ColorConverter.ConvertFromString("#00aeec")),
IsRemind = item.userInfo.isRemind,
RemindSign = item.userInfo.isRemind ? new SolidColorBrush((Color)ColorConverter.ConvertFromString("#fb7299")) : new SolidColorBrush((Color)ColorConverter.ConvertFromString("#777777")),
RemindSign = item.userInfo.isRemind ? new SolidColorBrush((Color)ColorConverter.ConvertFromString("#00aeec")) : new SolidColorBrush((Color)ColorConverter.ConvertFromString("#777777")),

Rec_Status = item.taskStatus.isDownload,
Rec_Status_IsVisible = item.taskStatus.isDownload ? Visibility.Visible : Visibility.Collapsed,
Expand Down
2 changes: 1 addition & 1 deletion Desktop/Views/Control/CardControl.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@

<TextBlock Text="{Binding LiveTime_str}" Margin="100,75,0,0" Foreground="#dddddd" FontSize="15" />
<TextBlock Text="{Binding DownloadSpe_str}" Margin="225,75,0,0" Foreground="#dddddd" FontSize="15" />
<ui:Button Foreground="{Binding RecSign}" FontSize="20" Margin="20,100,0,0" Content="录制" Icon="{ui:SymbolIcon Video32}"/>
<ui:Button Foreground="{Binding RecSign}" FontSize="20" Margin="20,100,0,0" Content="录制" Icon="{ui:SymbolIcon Video32}" />
<ui:Button Foreground="{Binding DanmuSign}" FontSize="20" Margin="120,100,0,0" Content="弹幕" Icon="{ui:SymbolIcon ChartPerson28}"/>
<ui:Button Foreground="{Binding RemindSign}" FontSize="20" Margin="220,100,0,0" Content="提醒" Icon="{ui:SymbolIcon AlertOn24}"/>
<Border Background="Transparent" MouseLeftButtonDown="Border_DoubleClickToOpenPlaybackWindow"></Border>
Expand Down
34 changes: 28 additions & 6 deletions Desktop/Views/Pages/DataPage.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@
Foreground="{DynamicResource TextFillColorPrimaryBrush}"
ScrollViewer.CanContentScroll="False"
mc:Ignorable="d">
<Page.Resources>
<BooleanToVisibilityConverter x:Key="BooleanToVisibilityConverter"/>
</Page.Resources>

<Grid Margin="20,0,20,20" SizeChanged="CardDataGrid_SizeChanged">
<Grid.RowDefinitions>
Expand All @@ -27,6 +30,7 @@
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="*" />

</Grid.ColumnDefinitions>
Expand All @@ -40,15 +44,27 @@
</ComboBox>
<ComboBox Name="PageComboBox" Width="100" SelectedIndex="0" Grid.Column="1" Margin="0,0,5,0" HorizontalAlignment="Left" ItemsSource="{Binding PageComboBoxItems}" SelectionChanged="PageComboBox_SelectionChanged">
</ComboBox>
<ui:AutoSuggestBox Name="ScreenNameBox" Width="200" Grid.Column="2" FontSize="20" Margin="50,0,10,0" Icon="{ui:SymbolIcon Search24}" PlaceholderText="输入昵称点击搜索" HorizontalAlignment="Left" KeyDown="ScreenNameBox_KeyDown" />
<Button Grid.Column="3" FontSize="20" Margin="0,0,170,0" Height="36" Content="搜索" HorizontalAlignment="Right" Click="ScreenName_Click"/>

<ui:DropDownButton Grid.Column="4" FontSize="20" Margin="0,0,5,0" Content="添加房间" Icon="{ui:SymbolIcon Addcircle12}" HorizontalAlignment="Right">
<ui:AutoSuggestBox Name="ScreenNameBox" Width="200" Grid.Column="2" FontSize="20" Margin="20,0,10,0" Icon="{ui:SymbolIcon Search24}" PlaceholderText="输入昵称点击搜索" HorizontalAlignment="Left" KeyDown="ScreenNameBox_KeyDown" />
<Button Grid.Column="3" FontSize="20" Margin="0,0,0,0" Height="36" Content="搜索" HorizontalAlignment="Right" Click="ScreenName_Click"/>
<Grid Grid.Column="4" Margin="15,0,0,0" VerticalAlignment="Center" ToolTipService.InitialShowDelay="100" ToolTipService.Placement="MousePoint" ToolTipService.ToolTip="初次录制时如果需要同时录制弹幕,请先打开弹幕,再打开录制。&#x0a;否则第一次只会录制视频。">
<StackPanel>
<TextBlock TextWrapping="Wrap">
<Run Text="卡片三兄弟:"/>
<Run Text="灰色:关闭" Foreground="#999999" />
<Run Text="|"/>
<Run Text="蓝色:打开" Foreground="#00aeec" />
<Run Text="|"/>
<Run Text="粉色:录制中" Foreground="#fb7299" />
<Run Text=""/>
</TextBlock>
</StackPanel>
</Grid>
<ui:DropDownButton Grid.Column="5" FontSize="20" Margin="0,0,5,0" Content="添加房间" Icon="{ui:SymbolIcon Addcircle12}" HorizontalAlignment="Right">
<ui:DropDownButton.Flyout>
<ContextMenu>
<MenuItem Header="用房间号添加一个房间" Click="AddRoomCardForRoomId_Click"/>
<MenuItem Header="用UID添加(可批量)" Click="AddRoomCardForUid_Click"/>

<Separator />
<MenuItem Name="ImportFromFollowList_Menu" Header="从关注分组导入"/>
<Separator />
Expand All @@ -70,9 +86,15 @@
ItemsSource="{Binding CardsCollection}">
<ui:VirtualizingItemsControl.ItemTemplate>
<DataTemplate>
<local:CardControl />
<local:CardControl>

</local:CardControl>
</DataTemplate>
</ui:VirtualizingItemsControl.ItemTemplate>
</ui:VirtualizingItemsControl>
</Grid>


</Page>


10 changes: 9 additions & 1 deletion Server/WebAppServices/Api/get_rooms.cs
Original file line number Diff line number Diff line change
Expand Up @@ -203,8 +203,15 @@ public ActionResult Post(PostCommonParameters commonParameters, [FromForm] int q
startTime = roomList.ElementAt(i).Value.DownInfo.StartTime,
title = roomList.ElementAt(i).Value.Title.Value,
status = roomList.ElementAt(i).Value.DownInfo.Status,
downloadRate= roomList.ElementAt(i).Value.DownInfo.RealTimeDownloadSpe
downloadRate = roomList.ElementAt(i).Value.DownInfo.RealTimeDownloadSpe,
isDanma = false
};

if(roomList.ElementAt(i).Value.DownInfo.LiveChatListener!=null && roomList.ElementAt(i).Value.DownInfo.LiveChatListener.Register.Contains("DetectRoom_LiveStart"))
{
completeInfo.taskStatus.isDanma = true;
}

completeRoomInfoRes.completeInfoList.Add(completeInfo);
}
}
Expand Down Expand Up @@ -266,6 +273,7 @@ public class TaskStatus
public DateTime startTime { get; set; }
public DateTime endTime { get; set; }
public string title { get; set; }
public bool isDanma { get; set; }
}
}
}
Expand Down

0 comments on commit 971d7a4

Please sign in to comment.