Hello guys,
It's been a long time that I don't use wxWidgets and now I need to know if it supports some feature with the last stable version.
I need to make interactive videos based on a config file so I need:
1) parse a JSON file
2) play a video at full screen without showing media controls (play, pause, stop and so on)
3) perform some action when a video in on a specific second/interval of time
4) get input from a joypad
1) I found this plugin but IDK if it is good or if I need some other library that is not wx-based.
http://luccat.users.sourceforge.net/wxj ... nload.html
2) is it possible to run video directly without a visibile wxWindow? a simply process in background that run several video and some wxDialog without parent for asking questions to user (and play a video after the response)
3) I though to make a thread that cyclically (every 100ms) check the current position of the video and if it is in a specific range, it performs some specifc action
4) does wx support joypads C++ or I need some external library?
Thanks in advance
wx support to some feature
-
- Experienced Solver
- Posts: 96
- Joined: Thu Apr 17, 2014 10:10 am
wx support to some feature
I'm Italian but we can speak C++
Re: wx support to some feature
I tried wxJSON, but found it too bloated. I personally use this one: https://github.com/nbsdx/SimpleJSON (just one header file)1) parse a JSON file
Should be possible with wxMediaCtrl. Another alternative is https://github.com/tomay3000/wxVLC2) play a video at full screen without showing media controls (play, pause, stop and so on)
There is no event for that, but as you already suggested yourself, you could poll the current position. But don't use a thread, use a wxTimer.3) perform some action when a video in on a specific second/interval of time
http://docs.wxwidgets.org/trunk/classwx_joystick.html4) get input from a joypad
Use the source, Luke!
-
- Experienced Solver
- Posts: 96
- Joined: Thu Apr 17, 2014 10:10 am
Re: wx support to some feature
Thanks, very kind as always!
Just a question: some controller can vibrate. For example the PlayStation Dualshock controller. They have a 7V pin that allows it to vibrate. What about this with wx?
Just a question: some controller can vibrate. For example the PlayStation Dualshock controller. They have a 7V pin that allows it to vibrate. What about this with wx?
I'm Italian but we can speak C++
Re: wx support to some feature
No. You'll need another component for this. But i can't recommend one, i've never used this. But if this is for Windows only, there should be plenty of sample code out there.They have a 7V pin that allows it to vibrate. What about this with wx?
Use the source, Luke!
-
- Experienced Solver
- Posts: 96
- Joined: Thu Apr 17, 2014 10:10 am
Re: wx support to some feature
Better come late than never.
The static function:
is defined and implemented just for that.
And the vlc event binding to it, is called in wxVLCFrame's constructor:
So all you have to do is: Do an if test in this function:
https://github.com/mpv-player/mpv-examp ... /wxwidgets
https://github.com/mpv-player/mpv-examp ... ets_opengl
This is possible using wxVLC:wxProgrammer wrote: ↑Wed Aug 29, 2018 7:49 pm 3) perform some action when a video in on a specific second/interval of time
The static function:
Code: Select all
void OnPositionChanged_VLC(const libvlc_event_t *event, void *data)
{
wxVLCFrame *mainFrame = ((wxVLCFrame *)wxGetApp().GetTopWindow());
mainFrame->CallAfter(&wxVLCFrame::OnPositionChanged);
}
And the vlc event binding to it, is called in wxVLCFrame's constructor:
Code: Select all
libvlc_event_attach(vlc_evt_man, libvlc_MediaPlayerPositionChanged, ::OnPositionChanged_VLC, NULL);
Code: Select all
void wxVLCFrame::OnPositionChanged()
{
libvlc_time_t currTime = libvlc_media_player_get_time(media_player);
CurrTime_SttcTxt->SetLabel(wxTimeSpan::Milliseconds(currTime).Format());
libvlc_time_t movieLength = libvlc_media_player_get_length(media_player);
Timeline_Sldr->SetMax(movieLength / 1000);
Timeline_Sldr->SetValue(currTime / 1000);
MovieLength_SttcTxt->SetLabel(wxTimeSpan::Milliseconds(movieLength).Format());
unsigned width = 0, height = 0;
libvlc_video_get_size(media_player, 0, &width, &height);
int video_track = libvlc_video_get_track(media_player);
int audio_track = libvlc_audio_get_track(media_player);
int subtitle = libvlc_video_get_spu(media_player);
StatusBar1->SetStatusText(wxString::Format(_T("Video size: %d x %d - Video track: %d - Audio track: %d - Subtitle: %d"),
width, height, video_track, audio_track, subtitle));
if (currTime >= deltaTimeMin && currTime <= deltaTimeMax) // (deltaTimeMin <-> deltaTimeMax) is your delta time interval.
{
// Do what ever you want to do here.
}
BoxSizer3->Layout();
}
There is another cross-platform alternative (which back-end, I consider better than vlc in terms of performance and is compiled all-in-one rather than using modules like vlc):wxProgrammer wrote: ↑Wed Aug 29, 2018 7:49 pm 2) play a video at full screen without showing media controls (play, pause, stop and so on)
https://github.com/mpv-player/mpv-examp ... /wxwidgets
https://github.com/mpv-player/mpv-examp ... ets_opengl
-
- In need of some credit
- Posts: 7
- Joined: Mon Aug 28, 2023 1:07 am
Re: wx wiget video player
Hi Tomay3000,
this is rajk and I am looking to build a vide player using wxwidget. I came across your media player already built on wxwidget using wxVLC 5 years back I got the code from Github. I am trying to build it and play with it?. Can you help me build it using MSVS 2022. Any help would be appreciated
regards,
rajk.
this is rajk and I am looking to build a vide player using wxwidget. I came across your media player already built on wxwidget using wxVLC 5 years back I got the code from Github. I am trying to build it and play with it?. Can you help me build it using MSVS 2022. Any help would be appreciated
regards,
rajk.