diff --git a/PlotDirector.NativeCompanion/DeveloperVersion.props b/PlotDirector.NativeCompanion/DeveloperVersion.props
index 3334121c..9d393ef9 100644
--- a/PlotDirector.NativeCompanion/DeveloperVersion.props
+++ b/PlotDirector.NativeCompanion/DeveloperVersion.props
@@ -1 +1 @@
-1.0.0.37
+1.0.0.38
diff --git a/PlotDirector.NativeCompanion/Vsto/NativeRibbon.cs b/PlotDirector.NativeCompanion/Vsto/NativeRibbon.cs
index 28b8e045..d28e23a8 100644
--- a/PlotDirector.NativeCompanion/Vsto/NativeRibbon.cs
+++ b/PlotDirector.NativeCompanion/Vsto/NativeRibbon.cs
@@ -1,5 +1,7 @@
using System;
using System.Collections.Generic;
+using System.Drawing;
+using System.Drawing.Drawing2D;
using System.IO;
using System.Reflection;
using System.Runtime.InteropServices;
@@ -12,6 +14,7 @@ namespace PlotDirector.WordAddIn
{
private readonly Func adapter;
private readonly Dictionary displayed = new Dictionary();
+ private readonly Dictionary playbackIcons = new Dictionary();
private Office.IRibbonUI ui;
public NativeRibbon(Func adapter) { this.adapter = adapter; }
@@ -85,6 +88,53 @@ namespace PlotDirector.WordAddIn
public void AudioPause(Office.IRibbonControl control) => adapter()?.RequestAudio("pause");
public void AudioBack(Office.IRibbonControl control) => adapter()?.RequestAudio("back15");
public void AudioForward(Office.IRibbonControl control) => adapter()?.RequestAudio("forward15");
+
+ public object GetPlaybackIcon(Office.IRibbonControl control)
+ {
+ if (playbackIcons.TryGetValue(control.Id, out var icon)) return icon;
+
+ using (var bitmap = new Bitmap(32, 32))
+ using (var graphics = Graphics.FromImage(bitmap))
+ using (var fill = new SolidBrush(Color.FromArgb(69, 157, 216)))
+ using (var outline = new Pen(Color.FromArgb(26, 58, 80), 1))
+ using (var shape = new GraphicsPath())
+ {
+ graphics.SmoothingMode = SmoothingMode.AntiAlias;
+ switch (control.Id)
+ {
+ case "PlotDirectorAudioPlay":
+ shape.AddPolygon(new[] { new Point(8, 4), new Point(27, 16), new Point(8, 28) });
+ break;
+ case "PlotDirectorAudioPause":
+ shape.AddRectangle(new Rectangle(7, 5, 6, 22));
+ shape.AddRectangle(new Rectangle(19, 5, 6, 22));
+ break;
+ case "PlotDirectorAudioBack":
+ case "PlotDirectorAudioForward":
+ shape.AddPolygon(new[] { new Point(3, 7), new Point(15, 16), new Point(3, 25) });
+ shape.AddPolygon(new[] { new Point(16, 7), new Point(28, 16), new Point(16, 25) });
+ if (control.Id == "PlotDirectorAudioBack")
+ {
+ graphics.TranslateTransform(31, 0);
+ graphics.ScaleTransform(-1, 1);
+ }
+ break;
+ default:
+ return null;
+ }
+ graphics.FillPath(fill, shape);
+ graphics.DrawPath(outline, shape);
+ icon = RibbonPicture.FromImage(bitmap);
+ }
+ playbackIcons.Add(control.Id, icon);
+ return icon;
+ }
+
+ private sealed class RibbonPicture : System.Windows.Forms.AxHost
+ {
+ private RibbonPicture() : base("") { }
+ public static object FromImage(Image image) => GetIPictureDispFromPicture(image);
+ }
public bool AudioShowPlay(Office.IRibbonControl control) => adapter()?.HasAudioControls==true && adapter()?.AudioPlaying==false;
public bool AudioShowPause(Office.IRibbonControl control) => adapter()?.HasAudioControls==true && adapter()?.AudioPlaying==true;
public bool AudioShowSeek(Office.IRibbonControl control) => adapter()?.HasAudioControls==true;
diff --git a/PlotDirector.NativeCompanion/Vsto/Properties/AssemblyInfo.cs b/PlotDirector.NativeCompanion/Vsto/Properties/AssemblyInfo.cs
index 793a288b..fdf28783 100644
--- a/PlotDirector.NativeCompanion/Vsto/Properties/AssemblyInfo.cs
+++ b/PlotDirector.NativeCompanion/Vsto/Properties/AssemblyInfo.cs
@@ -3,6 +3,6 @@ using System.Runtime.InteropServices;
[assembly: AssemblyTitle("PlotDirector Word Companion — Native development")]
[assembly: AssemblyCompany("Nick Beckley")]
[assembly: AssemblyProduct("PlotDirector")]
-[assembly: AssemblyVersion("1.0.0.37")]
-[assembly: AssemblyFileVersion("1.0.0.37")]
+[assembly: AssemblyVersion("1.0.0.38")]
+[assembly: AssemblyFileVersion("1.0.0.38")]
[assembly: ComVisible(false)]
diff --git a/PlotDirector.NativeCompanion/Vsto/Ribbon.xml b/PlotDirector.NativeCompanion/Vsto/Ribbon.xml
index 645817c5..f7ddc9ba 100644
--- a/PlotDirector.NativeCompanion/Vsto/Ribbon.xml
+++ b/PlotDirector.NativeCompanion/Vsto/Ribbon.xml
@@ -17,10 +17,10 @@
-
-
-
-
+
+
+
+
diff --git a/PlotDirector.NativeCompanion/WindowsValidation/Setup/Release.json b/PlotDirector.NativeCompanion/WindowsValidation/Setup/Release.json
index 46c3dfb5..04571ebb 100644
--- a/PlotDirector.NativeCompanion/WindowsValidation/Setup/Release.json
+++ b/PlotDirector.NativeCompanion/WindowsValidation/Setup/Release.json
@@ -1,7 +1,7 @@
{
- "version": "1.0.0.37",
- "msiVersion": "1.0.37",
- "productCode": "{F6B25D8A-6592-49A4-B949-B93635722672}",
+ "version": "1.0.0.38",
+ "msiVersion": "1.0.38",
+ "productCode": "{A9EE39D7-33C6-4F0C-B1B6-DF94FAAE88E9}",
"upgradeCode": "{641A087B-9779-458C-B290-BCBBAD49319A}",
"atlasBaseline": "9fed339879887964d526cff00772ffc4dc522c5d",
"baselineProductCode": "{98F46939-764D-407F-BD1F-1D88315D010A}",