Skip to content

Commit

Permalink
Implemented support for remaining plaback_control methods.
Browse files Browse the repository at this point in the history
  • Loading branch information
stuerp committed Jul 7, 2024
1 parent 7e4f13f commit bfc7c26
Show file tree
Hide file tree
Showing 8 changed files with 580 additions and 26 deletions.
6 changes: 3 additions & 3 deletions DUIElement.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

/** $VER: DUIElement.cpp (2024.07.05) P. Stuer **/
/** $VER: DUIElement.cpp (2024.07.07) P. Stuer **/

#include "pch.h"

Expand Down Expand Up @@ -48,7 +48,7 @@ GUID DUIElement::g_get_guid()
/// </summary>
GUID DUIElement::g_get_subclass()
{
return { }; // Don't display in the View menu.
return ui_element_subclass_utility;
}

/// <summary>
Expand Down Expand Up @@ -135,6 +135,6 @@ void DUIElement::GetColors() noexcept
_BackgroundColor = (COLORREF) m_callback->query_std_color(ui_color_background);
}

static service_factory_single_t<ui_element_impl_visualisation<DUIElement>> _Factory;
static service_factory_single_t<PopupDUIElement> _Factory;

#pragma endregion
9 changes: 8 additions & 1 deletion DUIElement.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

/** $VER: DUIElement.h (2024.07.03) P. Stuer - Default User Interface support **/
/** $VER: DUIElement.h (2024.07.07) P. Stuer - Default User Interface support **/

#pragma once

Expand Down Expand Up @@ -49,3 +49,10 @@ class DUIElement : public UIElement, public ui_element_instance
protected:
ui_element_instance_callback::ptr m_callback; // Don't rename this. BumpableElement uses it.
};

/// <summary>
/// Implements a Default UI element with support for a standalone version of our component and proper menu commands.
/// </summary>
class PopupDUIElement : public ui_element_impl_withpopup<DUIElement>
{
};
39 changes: 38 additions & 1 deletion HostObject.idl
Original file line number Diff line number Diff line change
@@ -1,13 +1,50 @@
import "oaidl.idl";
import "ocidl.idl";

[uuid(0a7a4655-5660-47d0-8a37-98ae21399e57), version(0.1)]
[uuid(0a7a4655-5660-47d0-8a37-98ae21399e57), version(0.2)]
library HostObjectLibrary
{
//! [AddHostObjectInterface]
[uuid(3a14c9c0-bc3e-453f-a314-4ce4a0ec81d8), object, local]
interface IHostObject : IUnknown
{
[propget] HRESULT ComponentVersion([out, retval] __int32 * version);
[propget] HRESULT ComponentVersionText([out, retval] BSTR * versionText);

HRESULT Print([in] BSTR text);

HRESULT Stop();
HRESULT Play([in] bool paused);
HRESULT Pause([in] bool paused);
HRESULT Previous();
HRESULT Next();
HRESULT Random();

HRESULT TogglePause();
HRESULT ToggleMute();
HRESULT ToggleStopAfterCurrent();

HRESULT VolumeUp();
HRESULT VolumeDown();

HRESULT Seek([in] double time);
HRESULT SeekDelta([in] double delta);

[propget] HRESULT IsPlaying([out, retval] bool * value);
[propget] HRESULT IsPaused([out, retval] bool * value);

[propget] HRESULT StopAfterCurrent([out, retval] bool * value);
[propput] HRESULT StopAfterCurrent([in] bool value);

[propget] HRESULT Length([out, retval] double * value);
[propget] HRESULT Position([out, retval] double * value);
[propget] HRESULT CanSeek([out, retval] bool * value);

[propget] HRESULT Volume([out, retval] double * value);
[propput] HRESULT Volume([in] double value);

[propget] HRESULT IsMuted([out, retval] bool * value);

HRESULT GetFormattedText([in] BSTR text, [out, retval] BSTR * formattedText);
};

Expand Down
Loading

0 comments on commit bfc7c26

Please sign in to comment.