public void InitializeRender(EventType eventType, viz.Context context) { if (eventType == EventType.Monitor) { lock (this.lockObj) { if (this.audioPlayer == null) { try { this.audioPlayer = new AudioPlayer(); } catch (Exception) { if (this.loggingService != null) { this.loggingService.LogLine(Strings.Audio_Error_CannotInitializePlayer); } } } if (context != null) { this.font = new viz.Font(context); this.overlay = new viz.Overlay(context); const float cHorizontalFov = 70.6f; float beamZ = 4.5f; // max depth in meters float beamY = (float)(beamZ * Math.Tan(cHorizontalFov / 2.0)); viz.Vertex[] vertices = new viz.Vertex[] { new viz.Vertex(0, 0, 0, 0, 0, 0, 0, 0, 0xFFFFFFFF), new viz.Vertex(0, beamY, beamZ, 0, 0, 0, 0, 0, 0xFFFFFFFF), new viz.Vertex(0, -beamY, beamZ, 0, 0, 0, 0, 0, 0xFFFFFFFF), }; uint[] indices = new uint[] { 0, 1, 2, 0, 2, 1, }; this.beamMesh = new viz::Mesh(context, (uint)vertices.Length, (uint)indices.Length); this.beamMesh.UpdateVertex(vertices); this.beamMesh.UpdateIndex(indices); this.outChart = new viz.TemporalChart(context); this.micCharts = new viz.TemporalChart[nui.Constants.AUDIO_NUM_MIC]; for (int i = 0; i < this.micCharts.Length; ++i) { this.micCharts[i] = new viz.TemporalChart(context); } this.speakerCharts = new viz.TemporalChart[nui.Constants.AUDIO_NUM_SPK]; for (int i = 0; i < this.speakerCharts.Length; ++i) { this.speakerCharts[i] = new viz.TemporalChart(context); } #if TODO_AUDIO_OUT // audio out if (FAILED(InitializeWASAPI())) { // TODO_LOG } #endif // TODO_AUDIO_OUT } } } }
public void InitializeRender(EventType eventType, viz.Context context) { if (eventType == EventType.Monitor) { lock (this.lockObj) { if (this.audioPlayer == null) { try { this.audioPlayer = new AudioPlayer(); } catch (Exception) { if (this.loggingService != null) { this.loggingService.LogLine(Strings.Audio_Error_CannotInitializePlayer); } } } if (context != null) { this.font = new viz.Font(context); this.overlay = new viz.Overlay(context); const float cHorizontalFov = 70.6f; float beamZ = 4.5f; // max depth in meters float beamY = (float)(beamZ * Math.Tan(cHorizontalFov / 2.0)); viz.Vertex[] vertices = new viz.Vertex[] { new viz.Vertex(0, 0, 0, 0, 0, 0, 0, 0, 0xFFFFFFFF), new viz.Vertex(0, beamY, beamZ, 0, 0, 0, 0, 0, 0xFFFFFFFF), new viz.Vertex(0, -beamY, beamZ, 0, 0, 0, 0, 0, 0xFFFFFFFF), }; uint[] indices = new uint[] { 0, 1, 2, 0, 2, 1, }; this.beamMesh = new viz::Mesh(context, (uint)vertices.Length, (uint)indices.Length); this.beamMesh.UpdateVertex(vertices); this.beamMesh.UpdateIndex(indices); this.outChart = new viz.TemporalChart(context); this.micCharts = new viz.TemporalChart[nui.Constants.AUDIO_NUM_MIC]; for (int i = 0; i < this.micCharts.Length; ++i) { this.micCharts[i] = new viz.TemporalChart(context); } this.speakerCharts = new viz.TemporalChart[nui.Constants.AUDIO_NUM_SPK]; for (int i = 0; i < this.speakerCharts.Length; ++i) { this.speakerCharts[i] = new viz.TemporalChart(context); } #if TODO_AUDIO_OUT // audio out if (FAILED(InitializeWASAPI())) { // TODO_LOG } #endif // TODO_AUDIO_OUT } } } }