Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: generate SystemMediaTransportControls related classes #88

Closed
wants to merge 3 commits into from

Conversation

mokurin000
Copy link

SystemMediaTransportControls is a class in the Universal Windows Platform (UWP) that allows developers to integrate media playback controls into their Windows apps. It provides a set of controls that allow users to play, pause, skip, and adjust the volume of media content being played within the app.

Integrating with SystemMediaTransportControls is beneficial because it provides a consistent and familiar user experience across different Windows devices. Users can control media playback using standard system controls, such as those found in the Windows taskbar or on external keyboards. This integration enhances usability and accessibility, as users can easily interact with media content without needing to navigate within the app interface. Additionally, it allows developers to focus on other aspects of their app, knowing that media playback controls are handled by the system.

@jagobagascon
Copy link
Contributor

Seems like some class is still missing (storage.StorageFile). Add them to the PR or filter out the methods that use it.

@mokurin000
Copy link
Author

@jagobagascon Hi! Thank you for having a look, could you please re-run the sanity check?

@jagobagascon
Copy link
Contributor

There's still a few errors. You can test it yourself by running the tests:

$ > go test github.com/saltosystems/winrt-go/...
# github.com/saltosystems/winrt-go/windows/media
windows\media\systemmediatransportcontrols.go:274:88: undefined: SystemMediaTransportControlsTimelineProperties
windows\media\systemmediatransportcontrols.go:939:87: undefined: SystemMediaTransportControlsTimelineProperties
windows\media\systemmediatransportcontrolsdisplayupdater.go:22:68: undefined: MediaPlaybackType
windows\media\systemmediatransportcontrolsdisplayupdater.go:29:71: undefined: MediaPlaybackType
windows\media\systemmediatransportcontrolsdisplayupdater.go:50:82: undefined: streams.RandomAccessStreamReference
windows\media\systemmediatransportcontrolsdisplayupdater.go:57:85: undefined: streams.RandomAccessStreamReference
windows\media\systemmediatransportcontrolsdisplayupdater.go:64:80: undefined: MusicDisplayProperties    
windows\media\systemmediatransportcontrolsdisplayupdater.go:71:80: undefined: VideoDisplayProperties    
windows\media\systemmediatransportcontrolsdisplayupdater.go:78:80: undefined: ImageDisplayProperties    
windows\media\systemmediatransportcontrolsdisplayupdater.go:127:66: undefined: MediaPlaybackType        
windows\media\systemmediatransportcontrolsdisplayupdater.go:127:66: too many errors

I encourage you to use your own fork of winrt-go in whatever project you are building, and validate your changes fit your your needs there before updating the PR.

@mokurin000 mokurin000 closed this Apr 9, 2024
@mokurin000
Copy link
Author

mokurin000 commented Apr 19, 2024

Seems like some class is still missing (storage.StorageFile). Add them to the PR or filter out the methods that use it.

Thanks for your patience and you advises

I found a strange issue: -method-filter !GetThumbnails and -method-filter !SetThumbnails doesn't work, neither of the method were ignored in the generated code, thus I have to remove them manually. I am unsure if this is a bug, or something expected

update: As in Microsoft doc, the two functions are not method, they are getter/setter for the Thumbnails property, does winrt-go have any option to ignore a property for similar scenarios?

@jagobagascon
Copy link
Contributor

Yes, getters and setters are treated differently. You have to use the get_ and put_ prefix for them

-method-filter get_MaintainConnection -method-filter put_MaintainConnection

There are also other prefixes, like the ones used for events (add_ and remove_).

-method-filter add_Received -method-filter remove_Received

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants