From 00c9c97fb111884bb0ed25218566847ee28bbb85 Mon Sep 17 00:00:00 2001 From: Bluefissure Date: Fri, 29 Dec 2023 15:02:31 -0600 Subject: [PATCH] feat: SetRecordDirectory --- TestClient/MainWindow.Designer.cs | 2 -- TestClient/MainWindow.cs | 3 +-- obs-websocket-dotnet/OBSWebsocket_Requests.cs | 16 ++++++++++++++++ 3 files changed, 17 insertions(+), 4 deletions(-) diff --git a/TestClient/MainWindow.Designer.cs b/TestClient/MainWindow.Designer.cs index 8809ad3..29ecca8 100644 --- a/TestClient/MainWindow.Designer.cs +++ b/TestClient/MainWindow.Designer.cs @@ -432,7 +432,6 @@ private void InitializeComponent() // btnBrowse // this.btnBrowse.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); - this.btnBrowse.Enabled = false; this.btnBrowse.Location = new System.Drawing.Point(277, 29); this.btnBrowse.Margin = new System.Windows.Forms.Padding(5, 4, 5, 4); this.btnBrowse.Name = "btnBrowse"; @@ -454,7 +453,6 @@ private void InitializeComponent() // btnSetPath // this.btnSetPath.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); - this.btnSetPath.Enabled = false; this.btnSetPath.Location = new System.Drawing.Point(365, 28); this.btnSetPath.Margin = new System.Windows.Forms.Padding(5, 4, 5, 4); this.btnSetPath.Name = "btnSetPath"; diff --git a/TestClient/MainWindow.cs b/TestClient/MainWindow.cs index 2e82b54..adb2717 100644 --- a/TestClient/MainWindow.cs +++ b/TestClient/MainWindow.cs @@ -489,8 +489,7 @@ private void btnBrowse_Click(object sender, EventArgs e) private void btnSetPath_Click(object sender, EventArgs e) { - // TODO: Need a method here, or the button must be removed - //obs.SetRecordingFolder(tbFolderPath.Text); + obs.SetRecordDirectory(tbFolderPath.Text); } private void onVirtualCamStateChanged(object sender, VirtualcamStateChangedEventArgs args) diff --git a/obs-websocket-dotnet/OBSWebsocket_Requests.cs b/obs-websocket-dotnet/OBSWebsocket_Requests.cs index 773eb5b..df0c942 100644 --- a/obs-websocket-dotnet/OBSWebsocket_Requests.cs +++ b/obs-websocket-dotnet/OBSWebsocket_Requests.cs @@ -2152,5 +2152,21 @@ public void OpenVideoMixProjector(string videoMixType, string projectorGeometry, SendRequest(nameof(OpenVideoMixProjector), request); } + + + /// + /// Sets the current directory that the record output writes files to. + /// + /// Output directory + public void SetRecordDirectory(string recordDirectory) + { + var requestFields = new JObject + { + { nameof(recordDirectory), recordDirectory } + }; + + SendRequest(nameof(SetRecordDirectory), requestFields); + } + } } \ No newline at end of file