This repository has been archived by the owner on Jun 4, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Applies settings to multiple scenes and only triggers when the group is entered/left - Useful when having multiple scenes with the same camera angle. When manually adjusting the camera, the camera will not be controlled until you enter a new Group - Neutral groups behave as if they are of the same group as the previously active slot
- Loading branch information
Showing
32 changed files
with
1,030 additions
and
206 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
19 changes: 19 additions & 0 deletions
19
BetterMultiview/ObsMultiview/Data/IPluginSettingsProvider.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
using JetBrains.Annotations; | ||
using Newtonsoft.Json.Linq; | ||
|
||
namespace ObsMultiview.Data { | ||
public interface IPluginSettingsProvider { | ||
JObject GetPluginSettings(string pluginId); | ||
|
||
void SetPluginSettings(string pluginId, JObject pluginSettings); | ||
|
||
Guid Id { get; } | ||
|
||
string Name { get; set; } | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.ComponentModel; | ||
using System.Linq; | ||
using System.Runtime.CompilerServices; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
using System.Windows.Media; | ||
using JetBrains.Annotations; | ||
using Newtonsoft.Json.Linq; | ||
|
||
namespace ObsMultiview.Data { | ||
public class Set : INotifyPropertyChanged, IPluginSettingsProvider { | ||
private Color _color; | ||
public string Name { get; set; } | ||
|
||
/// <summary> | ||
/// Plugin configs | ||
/// </summary> | ||
public Dictionary<string, JObject> PluginConfigs { get; set; } = new(); | ||
|
||
public void SetPluginSettings(string pluginId, JObject pluginSettings) { | ||
if (pluginSettings == null) { | ||
PluginConfigs.Remove(pluginId); | ||
} else { | ||
PluginConfigs[pluginId] = pluginSettings; | ||
} | ||
} | ||
|
||
public Guid? Id { get; set; } | ||
|
||
Guid IPluginSettingsProvider.Id => Id ?? Guid.Empty; | ||
|
||
public Color Color { | ||
get => _color; | ||
set { | ||
if (value.Equals(_color)) return; | ||
_color = value; | ||
OnPropertyChanged(); | ||
} | ||
} | ||
|
||
public Set() { | ||
Id = Guid.NewGuid(); | ||
PluginConfigs = new Dictionary<string, JObject>(); | ||
} | ||
|
||
public event PropertyChangedEventHandler PropertyChanged; | ||
|
||
[NotifyPropertyChangedInvocator] | ||
protected virtual void OnPropertyChanged([CallerMemberName] string propertyName = null) { | ||
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName)); | ||
} | ||
|
||
public JObject GetPluginSettings(string pluginId) { | ||
if (PluginConfigs.ContainsKey(pluginId)) { | ||
return PluginConfigs[pluginId]; | ||
} else { | ||
return null; | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
<Window x:Class="ObsMultiview.Dialogs.SetConfig" | ||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | ||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | ||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" | ||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" | ||
xmlns:local="clr-namespace:ObsMultiview" | ||
xmlns:lex="http://wpflocalizeextension.codeplex.com" | ||
xmlns:data="clr-namespace:ObsMultiview.Data" | ||
xmlns:converters="clr-namespace:ObsMultiview.Converters" | ||
mc:Ignorable="d" | ||
Icon="pack://application:,,,/ObsMultiview;component/Images/Icon.png" | ||
Closing="SlotConfig_OnClosing" | ||
MinWidth="345" | ||
WindowStartupLocation="CenterOwner" | ||
lex:LocalizeDictionary.DesignCulture="en" | ||
lex:ResxLocalizationProvider.DefaultAssembly="ObsMultiview" | ||
lex:ResxLocalizationProvider.DefaultDictionary="Dialogs" | ||
DataContext="{Binding RelativeSource={RelativeSource Self}}" | ||
Title="{lex:Loc SetConfig}" Height="450" Width="345"> | ||
<Grid> | ||
<Grid.Resources> | ||
<converters:NullToVis x:Key="NullToVis" /> | ||
|
||
<Style TargetType="TextBlock"> | ||
<Setter Property="Margin" Value="2" /> | ||
</Style> | ||
|
||
<Style TargetType="TextBox"> | ||
<Setter Property="Margin" Value="2" /> | ||
</Style> | ||
|
||
<Style TargetType="Rectangle"> | ||
<Setter Property="Margin" Value="0,5" /> | ||
</Style> | ||
|
||
<Style TargetType="ComboBox"> | ||
<Setter Property="Margin" Value="2" /> | ||
</Style> | ||
</Grid.Resources> | ||
<Grid.RowDefinitions> | ||
<RowDefinition /> | ||
<RowDefinition Height="Auto" /> | ||
</Grid.RowDefinitions> | ||
|
||
<ScrollViewer HorizontalScrollBarVisibility="Disabled" VerticalScrollBarVisibility="Auto"> | ||
<StackPanel Margin="5" x:Name="ConfigPanel"> | ||
<TextBlock Text="{lex:Loc Name}" /> | ||
<TextBox Text="{Binding Set.Name}" x:Name="input" /> | ||
<Rectangle Height="2" Fill="LightGray" /> | ||
</StackPanel> | ||
</ScrollViewer> | ||
<StackPanel Orientation="Horizontal" Grid.Row="1"> | ||
<Button Width="100" Margin="5" Padding="2" Click="Ok_OnClick" Content="{lex:Loc Ok}" /> | ||
<Button Width="100" Margin="5" Padding="2" Click="Cancel_OnClick" Content="{lex:Loc Cancel}" /> | ||
<Button Margin="5" Padding="2" Width="100" FontFamily="Segoe MDL2 Assets" FontWeight="Bold" | ||
Foreground="Red" Click="Unlink_OnClick"> | ||
 | ||
</Button> | ||
</StackPanel> | ||
</Grid> | ||
</Window> |
Oops, something went wrong.