Skip to content

Commit

Permalink
v1.2.0
Browse files Browse the repository at this point in the history
- Improved piano look with real key images
- Increased timer precision control and view
- Can now control playback time using right mouse button, panning up and down
- More precise keyboard arrows playback controls when CTRL is pressed (0.1sec instead of 1sec)
- Changed time bar color style
- New note text info types (velocity, octave)
- Reduced vertical lines count
  • Loading branch information
ImAxel0 committed Jun 4, 2024
1 parent 8a53dda commit 5bd72cb
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 3 deletions.
1 change: 1 addition & 0 deletions Openthesia/Drawings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ public class Drawings
{
public static IntPtr C;
public static IntPtr CSharp;
public static IntPtr CSharpWhite;

public static void RenderMatrixBackground()
{
Expand Down
10 changes: 10 additions & 0 deletions Openthesia/ImGuiController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,16 @@ public static void LoadImages(GraphicsDevice _gd, ImGuiController _controller)
var img3 = new ImageSharpTexture(stream3);
var dimg3 = img3.CreateDeviceTexture(_gd, _gd.ResourceFactory);
Drawings.CSharp = _controller.GetOrCreateImGuiBinding(_gd.ResourceFactory, dimg3);

// Black white
TryGetEmbeddedResourceBytes("wsharp", out var cSharpWhite);
Stream stream4 = new MemoryStream();
stream4.Write(cSharpWhite);
stream4.Position = 0;

var img4 = new ImageSharpTexture(stream4);
var dimg4 = img4.CreateDeviceTexture(_gd, _gd.ResourceFactory);
Drawings.CSharpWhite = _controller.GetOrCreateImGuiBinding(_gd.ResourceFactory, dimg4);
}

public void WindowResized(int width, int height)
Expand Down
2 changes: 2 additions & 0 deletions Openthesia/Openthesia.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
<None Remove="Resources\Font\Roboto-Regular.ttf" />
<None Remove="Resources\imgui-frag.hlsl.bytes" />
<None Remove="Resources\imgui-vertex.hlsl.bytes" />
<None Remove="Resources\Keys\wsharp.png" />
<None Remove="Resources\logoimg.png" />
</ItemGroup>

Expand All @@ -30,6 +31,7 @@
<EmbeddedResource Include="Resources\Font\Roboto-Regular.ttf" />
<EmbeddedResource Include="Resources\imgui-frag.hlsl.bytes" />
<EmbeddedResource Include="Resources\imgui-vertex.hlsl.bytes" />
<EmbeddedResource Include="Resources\Keys\wsharp.png" />
<EmbeddedResource Include="Resources\logoimg.png" />
</ItemGroup>

Expand Down
5 changes: 3 additions & 2 deletions Openthesia/PianoRenderer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ public class PianoRenderer
static uint _black = ImGui.GetColorU32(ImGuiTheme.HtmlToVec4("#141414"));
static uint _white = ImGui.GetColorU32(ImGuiTheme.HtmlToVec4("#FFFFFF"));
static uint _whitePressed = ImGui.GetColorU32(ImGuiTheme.HtmlToVec4("#888888"));
static uint _blackPressed = ImGui.GetColorU32(ImGuiTheme.HtmlToVec4("#888888"));
static uint _blackPressed = ImGui.GetColorU32(ImGuiTheme.HtmlToVec4("#555555"));

public static float Width;
public static float Height;
Expand Down Expand Up @@ -131,6 +131,7 @@ public static void RenderKeyboard()
}

var offset = IOHandle.PressedKeys.Contains(cur_key) ? 1 : 0;
var blackImage = IOHandle.PressedKeys.Contains(cur_key) ? Drawings.CSharpWhite : Drawings.CSharp;

/*
draw_list.AddRectFilledMultiColor(new Vector2(P.X + key * Width + Width * 3 / 4, P.Y),
Expand All @@ -143,7 +144,7 @@ public static void RenderKeyboard()
_black, 0);
*/

draw_list.AddImage(Drawings.CSharp,
draw_list.AddImage(blackImage,
new Vector2(P.X + key * Width + Width * 3 / 4, P.Y),
new Vector2(P.X + key * Width + Width * 5 / 4 + 1, P.Y + Height / 1.5f) + new Vector2(offset), Vector2.Zero, Vector2.One, col);

Expand Down
2 changes: 1 addition & 1 deletion Openthesia/ProgramData.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ namespace Openthesia;

public class ProgramData
{
public static readonly string ProgramVersion = "1.1.0";
public static readonly string ProgramVersion = "1.2.0";
public static IntPtr LogoImage;
public static string SettingsPath = Path.Combine(KnownFolders.RoamingAppData.Path, "Openthesia", "Settings.json");
public static string HandsDataPath = Path.Combine(KnownFolders.RoamingAppData.Path, "Openthesia\\HandsData");
Expand Down
Binary file added Openthesia/Resources/Keys/wsharp.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 5bd72cb

Please sign in to comment.