Refactor GetOutputExtension

This commit is contained in:
copecone committed 2026-07-07 15:58:09 +09:00
1 parent 9e30c1302f
commit 08b36b1866
2 files changed
+5 -6

No files matched your search

+4 -5
View File
@@ -384,7 +384,7 @@ namespace ADOFAIRenderer.Core
private IEnumerator SetupPlay() private IEnumerator SetupPlay()
{ {
if (Configuration.RenderAudio && GetOutputExtension() != ".mp4") if (Configuration.RenderAudio && GetOutputExtension(Configuration.Codec) != ".mp4")
{ {
Configuration.AudioSampleRate = 48000; Configuration.AudioSampleRate = 48000;
} }
@@ -468,7 +468,7 @@ namespace ADOFAIRenderer.Core
var videoFPS = Configuration.VideoFPS; var videoFPS = Configuration.VideoFPS;
var selectedCodec = Configuration.Codec; var selectedCodec = Configuration.Codec;
var ext = GetOutputExtension(); var ext = GetOutputExtension(selectedCodec);
var startTime = DateTime.Now; var startTime = DateTime.Now;
var fileName = startTime.ToString("yyyy-MM-dd HH-mm-ss") + ext; var fileName = startTime.ToString("yyyy-MM-dd HH-mm-ss") + ext;
@@ -803,10 +803,9 @@ namespace ADOFAIRenderer.Core
Cursor.visible = true; Cursor.visible = true;
} }
private string GetOutputExtension() private string GetOutputExtension(Codec codec)
{ {
var selectedCodec = Configuration.Codec; return codec switch
return selectedCodec switch
{ {
Codec.AV1 or Codec.VP9 => ".webm", Codec.AV1 or Codec.VP9 => ".webm",
Codec.VVC => ".mkv", Codec.VVC => ".mkv",
+1 -1
View File
@@ -7,7 +7,7 @@ using MelonLoader.Utils;
using UnityEngine; using UnityEngine;
using UnityEngine.EventSystems; using UnityEngine.EventSystems;
[assembly: MelonInfo(typeof(RenderMod), "ADOFAI Renderer", "0.2.4-BETA", "ADOFAI Editor Forum")] [assembly: MelonInfo(typeof(RenderMod), "ADOFAI Renderer", "0.0.6-INDEV-AUDIO", "ADOFAI Editor Forum")]
[assembly: MelonGame("7th Beat Games", "A Dance of Fire and Ice")] [assembly: MelonGame("7th Beat Games", "A Dance of Fire and Ice")]
namespace ADOFAIRenderer namespace ADOFAIRenderer