Skip to content

Commit

Permalink
feat: OBS.Beat.Duration ( Fixes #189 )
Browse files Browse the repository at this point in the history
  • Loading branch information
StartAutomating authored and StartAutomating committed Feb 14, 2024
1 parent 4d81ed7 commit 5f9d825
Showing 1 changed file with 39 additions and 0 deletions.
39 changes: 39 additions & 0 deletions obs-powershell.types.ps1xml
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,45 @@ $BPM
)
$this | Add-Member NoteProperty ".BPM" $BPM -Force -PassThru

</SetScriptBlock>
</ScriptProperty>
<ScriptProperty>
<Name>Duration</Name>
<GetScriptBlock>
&lt;#
.SYNOPSIS
Gets the Duration
.DESCRIPTION
Gets the Duration of a Beat
.OUTPUTS
[TimeSpan]
#&gt;
if ($this.'.BPM') {
[Timespan]::FromMilliseconds((60 * 1000) / $this.'.BPM')
}

</GetScriptBlock>
<SetScriptBlock>
&lt;#
.SYNOPSIS
Gets the Duration
.DESCRIPTION
Gets the Duration of a Beat
.OUTPUTSobs
[TimeSpan]
#&gt;
param(
# The new duration.
# This will also set the BPM
[timespan]
$Duration
)

$this | Add-Member NoteProperty ".BPM" (
(60 * 1000) / $Duration.TotalMilliseconds
) -Force -PassThru


</SetScriptBlock>
</ScriptProperty>
</Members>
Expand Down

0 comments on commit 5f9d825

Please sign in to comment.