Skip to content

Commit

Permalink
Remove unused code
Browse files Browse the repository at this point in the history
  • Loading branch information
xanderfrangos committed Dec 3, 2024
1 parent 4d9bc08 commit 5c7bf3c
Showing 1 changed file with 0 additions and 41 deletions.
41 changes: 0 additions & 41 deletions src/modules/tt-windows-utils/windows_media_status.cc
Original file line number Diff line number Diff line change
Expand Up @@ -16,47 +16,6 @@ typedef GlobalSystemMediaTransportControlsSessionMediaProperties
MediaProperties;
typedef Windows::Media::MediaPlaybackType MediaPlaybackType;

winrt::Windows::Foundation::IAsyncAction Run() {
auto manager =
co_await GlobalSystemMediaTransportControlsSessionManager::RequestAsync();
auto current = manager.GetCurrentSession();
if (current) {
auto mediaProperties = co_await current.TryGetMediaPropertiesAsync();
if (mediaProperties) {
printf("\tTitle: %ls\n", mediaProperties.Title().c_str());
printf("\tSubtitle: %ls\n", mediaProperties.Subtitle().c_str());
printf("\tArtist: %ls\n", mediaProperties.Artist().c_str());
printf("\tAlbum: %ls\n", mediaProperties.AlbumTitle().c_str());
printf("\tSource: %ls\n", current.SourceAppUserModelId().c_str());
printf("\tTrack number: %d\n", mediaProperties.TrackNumber());
printf("\tTracks: %d\n", mediaProperties.AlbumTrackCount());

std::string typeStr = "unknown";
MediaPlaybackType type = mediaProperties.PlaybackType().Value();

switch (type) {
case MediaPlaybackType::Music:
typeStr = "music";
break;
case MediaPlaybackType::Video:
typeStr = "video";
break;
case MediaPlaybackType::Image:
typeStr = "image";
break;
}

printf("\tType: %s\n", typeStr);
}
}
}

Napi::String getPlaybackStatusAlt(const Napi::CallbackInfo &info) {
winrt::init_apartment(winrt::apartment_type::multi_threaded);
Run().get();
return Napi::String::New(info.Env(), "test");
}

Napi::String getPlaybackStatus(const Napi::CallbackInfo &info) {
std::string statusStr = "closed";

Expand Down

0 comments on commit 5c7bf3c

Please sign in to comment.