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
James Brundage committed Feb 14, 2024
1 parent ed4830f commit 6d09cb7
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 0 deletions.
11 changes: 11 additions & 0 deletions Types/OBS.Beat/get_Duration.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<#
.SYNOPSIS
Gets the Duration
.DESCRIPTION
Gets the Duration of a Beat
.OUTPUTS
[TimeSpan]
#>
if ($this.'.BPM') {
[Timespan]::FromMilliseconds((60 * 1000) / $this.'.BPM')
}
19 changes: 19 additions & 0 deletions Types/OBS.Beat/set_Duration.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<#
.SYNOPSIS
Gets the Duration
.DESCRIPTION
Gets the Duration of a Beat
.OUTPUTSobs
[TimeSpan]
#>
param(
# The new duration.
# This will also set the BPM
[timespan]
$Duration
)

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

0 comments on commit 6d09cb7

Please sign in to comment.