Skip to content

Commit

Permalink
Added first playlist functionality.
Browse files Browse the repository at this point in the history
  • Loading branch information
stuerp committed Nov 24, 2024
1 parent f799bcf commit d64b852
Show file tree
Hide file tree
Showing 8 changed files with 753 additions and 67 deletions.
20 changes: 10 additions & 10 deletions Build-FB2KComponent.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,9 @@ if ($Platform -eq 'x64')

Copy-Item "$OutputPath/$TargetFileName" -Destination "$PackagePath/x64" -Force -Verbose;
Copy-Item "$OutputPath/WebView2Loader.dll" -Destination "$PackagePath/x64" -Force -Verbose;
# Copy-Item "$OutputPath/$TargetName.tlb" -Destination "$PackagePath/x64" -Force -Verbose;
Copy-Item "Template.html" -Destination "$PackagePath/x64/Default-Template.html" -Force -Verbose;
Copy-Item "FrameTemplate.html" -Destination "$PackagePath/x64/Default-FrameTemplate.html" -Force -Verbose;
Copy-Item "PlaylistTemplate.html" -Destination "$PackagePath/x64/Default-PlaylistTemplate.html" -Force -Verbose;
}

# install the component in the foobar2000 x64 components directory.
Expand All @@ -66,10 +66,10 @@ if ($Platform -eq 'x64')

Write-Host "Installing x64 component in foobar2000 64-bit profile...";

Copy-Item "$PackagePath/x64/*.dll" -Destination "$ComponentPath/$TargetName" -Force -Verbose;
# Copy-Item "$PackagePath/x64/$TargetName.tlb" -Destination "$ComponentPath/$TargetName" -Force -Verbose;
Copy-Item "$PackagePath/x64/Default-Template.html" -Destination "$ComponentPath/$TargetName" -Force -Verbose;
Copy-Item "$PackagePath/x64/Default-FrameTemplate.html" -Destination "$ComponentPath/$TargetName" -Force -Verbose;
Copy-Item "$PackagePath/x64/*.dll" -Destination "$ComponentPath/$TargetName" -Force -Verbose;
Copy-Item "$PackagePath/x64/Default-Template.html" -Destination "$ComponentPath/$TargetName" -Force -Verbose;
Copy-Item "$PackagePath/x64/Default-FrameTemplate.html" -Destination "$ComponentPath/$TargetName" -Force -Verbose;
Copy-Item "$PackagePath/x64/Default-PlaylistTemplate.html" -Destination "$ComponentPath/$TargetName" -Force -Verbose;
}
else
{
Expand All @@ -90,10 +90,10 @@ elseif ($Platform -eq 'Win32')
Write-Host "Copying $TargetFileName to `"$PackagePath`"...";

Copy-Item "$OutputPath/$TargetFileName" -Destination "$PackagePath" -Force -Verbose;
# Copy-Item "$OutputPath/$TargetName.tlb" -Destination "$PackagePath" -Force -Verbose;
Copy-Item "$OutputPath/WebView2Loader.dll" -Destination "$PackagePath" -Force -Verbose;
Copy-Item "Template.html" -Destination "$PackagePath/Default-Template.html" -Force -Verbose;
Copy-Item "FrameTemplate.html" -Destination "$PackagePath/Default-FrameTemplate.html" -Force -Verbose;
Copy-Item "PlaylistTemplate.html" -Destination "$PackagePath/Default-PlaylistTemplate.html" -Force -Verbose;
}

# install the x86 component in the foobar2000 x86 components directory.
Expand All @@ -109,10 +109,10 @@ elseif ($Platform -eq 'Win32')

Write-Host "Installing x86 component in foobar2000 32-bit profile...";

Copy-Item "$PackagePath/*.dll" -Destination "$ComponentPath/$TargetName" -Force -Verbose;
# Copy-Item "$PackagePath/$TargetName.tlb" -Destination "$ComponentPath/$TargetName" -Force -Verbose;
Copy-Item "$PackagePath/Default-Template.html" -Destination "$ComponentPath/$TargetName" -Force -Verbose;
Copy-Item "$PackagePath/Default-FrameTemplate.html" -Destination "$ComponentPath/$TargetName" -Force -Verbose;
Copy-Item "$PackagePath/*.dll" -Destination "$ComponentPath/$TargetName" -Force -Verbose;
Copy-Item "$PackagePath/Default-Template.html" -Destination "$ComponentPath/$TargetName" -Force -Verbose;
Copy-Item "$PackagePath/Default-FrameTemplate.html" -Destination "$ComponentPath/$TargetName" -Force -Verbose;
Copy-Item "$PackagePath/Default-PlaylistTemplate.html" -Destination "$ComponentPath/$TargetName" -Force -Verbose;
}
else
{
Expand Down
37 changes: 37 additions & 0 deletions HostObject.idl
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,44 @@ library HostObjectLibrary

HRESULT GetArtwork([in] BSTR type, [out, retval] BSTR * image);

// Files
HRESULT ReadAllText([in] BSTR filePath, [in] __int32 codePage, [out, retval] BSTR * text);
HRESULT ReadImage([in] BSTR filePath, [out, retval] BSTR * image);

// Playlists
[propget] HRESULT PlaylistCount([out, retval] unsigned __int32 * count);

[propget] HRESULT ActivePlaylist([out, retval] __int32 * index);
[propput] HRESULT ActivePlaylist([in] __int32 index);

[propget] HRESULT PlayingPlaylist([out, retval] __int32 * index);
[propput] HRESULT PlayingPlaylist([in] __int32 index);

HRESULT GetPlaylistName([in] __int32 index, [out, retval] BSTR * name);
HRESULT SetPlaylistName([in] __int32 index, [in] BSTR name);

HRESULT FindPlaylist([in] BSTR name, [out, retval] __int32 * index);

HRESULT GetPlaylistItemCount([in] __int32 playlistIndex, [out, retval] unsigned __int32 * itemCount);

HRESULT GetFocusedPlaylistItem([in] __int32 playlistIndex, [out, retval] __int32 * itemIndex);
HRESULT SetFocusedPlaylistItem([in] __int32 playlistIndex, [in] __int32 itemIndex);
HRESULT EnsurePlaylistItemVisible([in] __int32 playlistIndex, [in] __int32 itemIndex);
HRESULT ExecutePlaylistDefaultAction([in] __int32 playlistIndex, [in] __int32 itemIndex);

HRESULT CreatePlaylist([in] __int32 playlistIndex, [in] BSTR name, [out, retval] __int32 * newPlaylistIndex);
HRESULT DuplicatePlaylist([in] __int32 playlistIndex, [in] BSTR name, [out, retval] __int32 * newPlaylistIndex);
HRESULT ClearPlaylist([in] __int32 playlistIndex);
HRESULT GetSelectedPlaylistItems([in] __int32 playlistIndex);
HRESULT ClearPlaylistSelection([in] __int32 playlistIndex);

// Auto Playlists
HRESULT CreateAutoPlaylist([in] __int32 playlistIndex, [in] BSTR name, [in] BSTR query, [in] BSTR sort, [in] unsigned __int32 flags, [out, retval] __int32 * newPlaylistIndex);
HRESULT IsAutoPlaylist([in] __int32 playlistIndex, [out, retval] bool * result);

// Playback Order
[propget] HRESULT PlaybackOrder([out, retval] __int32 * index);
[propput] HRESULT PlaybackOrder([in] __int32 index);
};

[uuid(637abc45-11f7-4dde-84b4-317d62a638d3)]
Expand Down
Loading

0 comments on commit d64b852

Please sign in to comment.