Skip to content

Commit

Permalink
1.8.2.3
Browse files Browse the repository at this point in the history
  • Loading branch information
0ceal0t committed Feb 24, 2024
1 parent e59c22a commit 84ae9a2
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 22 deletions.
44 changes: 25 additions & 19 deletions VFXEditor/Formats/ScdFormat/Music/AudioPlayer.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using Dalamud.Interface;
using Dalamud.Interface.Utility.Raii;
using ImGuiNET;
using NAudio.Wave;
using Dalamud.Interface.Utility.Raii;
using System;
using System.IO;
using System.Numerics;
Expand Down Expand Up @@ -54,27 +54,25 @@ public void Draw() {
DrawPlayer();
DrawChannels();
DrawConverter();

ProcessQueue();
ProcessQueue(); // Loop, etc.
}

private void DrawPlayer() {
using var tabItem = ImRaii.TabItem( "Music" );
if( !tabItem ) return;

public void DrawMiniPlayer() {
using var _ = ImRaii.PushId( "Music" );
DrawControls();
ProcessQueue(); // Loop, etc.
}

// Controls
using( var font = ImRaii.PushFont( UiBuilder.IconFont ) ) {
if( State == PlaybackState.Stopped ) {
if( ImGui.Button( FontAwesomeIcon.Play.ToIconString() ) ) Play();
}
else if( State == PlaybackState.Playing ) {
if( ImGui.Button( FontAwesomeIcon.Pause.ToIconString() ) ) CurrentOutput.Pause();
}
else if( State == PlaybackState.Paused ) {
if( ImGui.Button( FontAwesomeIcon.Play.ToIconString() ) ) CurrentOutput.Play();
}
private void DrawControls() {
using var font = ImRaii.PushFont( UiBuilder.IconFont );
if( State == PlaybackState.Stopped ) {
if( ImGui.Button( FontAwesomeIcon.Play.ToIconString() ) ) Play();
}
else if( State == PlaybackState.Playing ) {
if( ImGui.Button( FontAwesomeIcon.Pause.ToIconString() ) ) CurrentOutput.Pause();
}
else if( State == PlaybackState.Paused ) {
if( ImGui.Button( FontAwesomeIcon.Play.ToIconString() ) ) CurrentOutput.Play();
}

var selectedTime = ( float )CurrentTime;
Expand Down Expand Up @@ -105,6 +103,15 @@ private void DrawPlayer() {
drawList.AddRectFilled( startPos, startPos + new Vector2( 4, height ), 0xFFFF0000, 1 );
drawList.AddRectFilled( endPos, endPos + new Vector2( 4, height ), 0xFFFF0000, 1 );
}
}

private void DrawPlayer() {
using var tabItem = ImRaii.TabItem( "Music" );
if( !tabItem ) return;

using var _ = ImRaii.PushId( "Music" );

DrawControls();

// Save
ImGui.SameLine();
Expand Down Expand Up @@ -210,7 +217,6 @@ private void ProcessQueue() {

if( currentState == PlaybackState.Stopped && PrevState == PlaybackState.Playing &&
( ( IsVorbis && Plugin.Configuration.LoopMusic ) || ( !IsVorbis && Plugin.Configuration.LoopSoundEffects ) ) ) {
Dalamud.Log( "Looping..." );
Play();
if( !Entry.NoLoop && Plugin.Configuration.SimulateScdLoop && LoopTimeInitialized && LoopStartTime > 0 ) {
if( QueueSeek == -1 ) {
Expand Down
4 changes: 2 additions & 2 deletions VFXEditor/VFXEditor.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
<Company></Company>
<Product>VFXEditor</Product>
<Copyright>Copyright © 2020</Copyright>
<FileVersion>1.8.2.2</FileVersion>
<AssemblyVersion>1.8.2.2</AssemblyVersion>
<FileVersion>1.8.2.3</FileVersion>
<AssemblyVersion>1.8.2.3</AssemblyVersion>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
<CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>
Expand Down
2 changes: 1 addition & 1 deletion VFXEditor/VFXEditor.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"Punchline": "VFX editor and viewer",
"Description": "VFX, animation, and sound editing plugin. Icon by PAPACHIN",
"InternalName": "VFXEditor",
"AssemblyVersion": "1.8.2.2",
"AssemblyVersion": "1.8.2.3",
"RepoUrl": "https://github.com/0ceal0t/Dalamud-VFXEditor",
"ApplicableVersion": "any",
"Tags": [ "VFX", "AVFX" ],
Expand Down

0 comments on commit 84ae9a2

Please sign in to comment.