From 8c98fa10c5df0498715ded10b1b6fb51e58a584b Mon Sep 17 00:00:00 2001 From: lxmou666 <772765102@qq.com> Date: Tue, 29 Dec 2020 11:17:17 +0800 Subject: [PATCH] =?UTF-8?q?=E7=A3=81=E7=9B=98=E6=8F=90=E9=86=92?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- JianGongYun/Style/TRTCResource.xaml | 2 +- JianGongYun/TRTC/LiveClassroom.cs | 5 +++ .../TRTC/ViewModels/SettingWindowViewModel.cs | 33 ++++++++++++++++++- JianGongYun/TRTC/Windows/LiveWindow.xaml | 2 +- JianGongYun/TRTC/Windows/LiveWindow.xaml.cs | 6 ++++ JianGongYun/TRTC/Windows/SettingWindow.xaml | 7 ++-- 6 files changed, 50 insertions(+), 5 deletions(-) diff --git a/JianGongYun/Style/TRTCResource.xaml b/JianGongYun/Style/TRTCResource.xaml index 7e1529c..8a0182c 100644 --- a/JianGongYun/Style/TRTCResource.xaml +++ b/JianGongYun/Style/TRTCResource.xaml @@ -334,7 +334,7 @@ - + diff --git a/JianGongYun/TRTC/LiveClassroom.cs b/JianGongYun/TRTC/LiveClassroom.cs index 999af7d..465cad9 100644 --- a/JianGongYun/TRTC/LiveClassroom.cs +++ b/JianGongYun/TRTC/LiveClassroom.cs @@ -208,6 +208,11 @@ namespace JianGongYun.TRTC { liveWinMode.MicRunning = true; lTRTCCloud.startLocalAudio(settingWindowViewModel.LiveAudioLevel); + if (liveWinMode.IsLive) + { + var pars = new TRTCAudioRecordingParams { filePath = "" }; + lTRTCCloud.startAudioRecording(ref pars); + } } } /// diff --git a/JianGongYun/TRTC/ViewModels/SettingWindowViewModel.cs b/JianGongYun/TRTC/ViewModels/SettingWindowViewModel.cs index ceeeee1..f960ba1 100644 --- a/JianGongYun/TRTC/ViewModels/SettingWindowViewModel.cs +++ b/JianGongYun/TRTC/ViewModels/SettingWindowViewModel.cs @@ -10,6 +10,7 @@ using System.Windows.Controls; using JianGongYun.TRTC.Components; using System.Windows; using ManageLiteAV; +using System.Windows.Media; namespace JianGongYun.TRTC.ViewModels { @@ -420,7 +421,8 @@ namespace JianGongYun.TRTC.ViewModels storage.SetValue(INI_ROOT_KEY, INI_KEY_SCREEN_RECORDING_DIR, value.ToString());//生成保存本地 if (PropertyChanged != null) { - PropertyChanged(this, new PropertyChangedEventArgs("ScreenRecordingDir")); + PropertyChanged(this, new PropertyChangedEventArgs("ScreenRecordingDir")); + PropertyChanged(this, new PropertyChangedEventArgs("DiskSize")); } } } @@ -635,6 +637,35 @@ namespace JianGongYun.TRTC.ViewModels } #endregion + #region 磁盘剩余空间/// + /// 磁盘剩余空间 + /// + public double DiskSize + { + get + { + var disk = ScreenRecordingDir.Substring(0, 1); + var drive = new System.IO.DriveInfo(disk); + return Math.Round(drive.TotalFreeSpace / 1024d / 1024d / 1024d, 1, MidpointRounding.AwayFromZero);//GB + } + } + public string DiskSizeStr + { + get + { + return DiskSize + "G"; + } + } + public Brush DiskTipColor + { + get + { + return DiskSize <= 20 ? Brushes.Orange : Brushes.LawnGreen; + } + } + #endregion + + /// /// ini文件操作 /// diff --git a/JianGongYun/TRTC/Windows/LiveWindow.xaml b/JianGongYun/TRTC/Windows/LiveWindow.xaml index 9428c91..77e129d 100644 --- a/JianGongYun/TRTC/Windows/LiveWindow.xaml +++ b/JianGongYun/TRTC/Windows/LiveWindow.xaml @@ -72,7 +72,7 @@ -