wxMediaCtrl, how to use it?

If you are using the main C++ distribution of wxWidgets, Feel free to ask any question related to wxWidgets development here. This means questions regarding to C++ and wxWidgets, not compile problems.
egwqgwe
In need of some credit
In need of some credit
Posts: 8
Joined: Thu May 10, 2018 5:19 pm

wxMediaCtrl, how to use it?

Post by egwqgwe »

Hi, I am using Codeblocks with wxSmith plugin and I need help how to use wxMediaCtrl for Mp3 playing. Would someone send simple(very simple if posible) code, which will play any *.mp3 file? Thank you for your every help of this.

(I am sorry for my bad english)
ONEEYEMAN
Part Of The Furniture
Part Of The Furniture
Posts: 7477
Joined: Sat Apr 16, 2005 7:22 am
Location: USA, Ukraine

Re: wxMediaCtrl, how to use it?

Post by ONEEYEMAN »

Hi,
Please look at the media{ctrl} sample.
Compile it, run it and see if you can play the file you want.

Thank you.
egwqgwe
In need of some credit
In need of some credit
Posts: 8
Joined: Thu May 10, 2018 5:19 pm

Re: wxMediaCtrl, how to use it?

Post by egwqgwe »

Thank you so much for answer, but what if i will want to use that, like wxSound? Without gui for that.
User avatar
doublemax
Moderator
Moderator
Posts: 19159
Joined: Fri Apr 21, 2006 8:03 pm
Location: $FCE2

Re: wxMediaCtrl, how to use it?

Post by doublemax »

You can't use wxMediaCtrl like wxSound. But you can Hide() the control after creation, then it will be invisible.
Use the source, Luke!
ONEEYEMAN
Part Of The Furniture
Part Of The Furniture
Posts: 7477
Joined: Sat Apr 16, 2005 7:22 am
Location: USA, Ukraine

Re: wxMediaCtrl, how to use it?

Post by ONEEYEMAN »

Hi,
Well, there is a sound sample and the console sample which you can look at.

Thank you.
egwqgwe
In need of some credit
In need of some credit
Posts: 8
Joined: Thu May 10, 2018 5:19 pm

Re: wxMediaCtrl, how to use it?

Post by egwqgwe »

Oh, that sounds badly for me, because I can't find the MediaCtrl between components in panel of them.
ONEEYEMAN
Part Of The Furniture
Part Of The Furniture
Posts: 7477
Joined: Sat Apr 16, 2005 7:22 am
Location: USA, Ukraine

Re: wxMediaCtrl, how to use it?

Post by ONEEYEMAN »

Hi,
Are you using some kind of EAD tool? Which one - wxSmith, wxGlade, wxCrafter?

Thank you.
egwqgwe
In need of some credit
In need of some credit
Posts: 8
Joined: Thu May 10, 2018 5:19 pm

Re: wxMediaCtrl, how to use it?

Post by egwqgwe »

I am using Codeblocks with wxSmith
ONEEYEMAN
Part Of The Furniture
Part Of The Furniture
Posts: 7477
Joined: Sat Apr 16, 2005 7:22 am
Location: USA, Ukraine

Re: wxMediaCtrl, how to use it?

Post by ONEEYEMAN »

Hi,
You can try to put some placeholder (wxStaticText with the text "Media goes here") and after you done and the code is generated, replace it with the actual wxMediaCtrl.
Or you can just create the design by hand...

Thank you.
egwqgwe
In need of some credit
In need of some credit
Posts: 8
Joined: Thu May 10, 2018 5:19 pm

Re: wxMediaCtrl, how to use it?

Post by egwqgwe »

It works! :D, thank you so much.
Is it okay, if it hasn't icon, it looks like a custom widget, and it has same events as a custom widget?
egwqgwe
In need of some credit
In need of some credit
Posts: 8
Joined: Thu May 10, 2018 5:19 pm

Re: wxMediaCtrl, how to use it?

Post by egwqgwe »

Oh, when i compile that, that works and it plays a .mp3 file... but it also delete the header of mediactrl and also MediaCtrl1 = new wxMediaCtrl(this,...
ONEEYEMAN
Part Of The Furniture
Part Of The Furniture
Posts: 7477
Joined: Sat Apr 16, 2005 7:22 am
Location: USA, Ukraine

Re: wxMediaCtrl, how to use it?

Post by ONEEYEMAN »

Hi,
But you said you want to hide the control? So of course everything will be hidden...

Thank you.
egwqgwe
In need of some credit
In need of some credit
Posts: 8
Joined: Thu May 10, 2018 5:19 pm

Re: wxMediaCtrl, how to use it?

Post by egwqgwe »

Yes, but that's occupies the place of window, so it's looking weird.
User avatar
doublemax
Moderator
Moderator
Posts: 19159
Joined: Fri Apr 21, 2006 8:03 pm
Location: $FCE2

Re: wxMediaCtrl, how to use it?

Post by doublemax »

What exactly is the problem right now?

Do you want the control to be visible or not?
Use the source, Luke!
egwqgwe
In need of some credit
In need of some credit
Posts: 8
Joined: Thu May 10, 2018 5:19 pm

Re: wxMediaCtrl, how to use it?

Post by egwqgwe »

https://ctrlv.cz/3vdG

It doesn't have appearance, so that is invisible every time, but It looks weird, because it occupies a place.

(I am sorry for my english)
Last edited by egwqgwe on Sat May 12, 2018 12:57 pm, edited 1 time in total.
Post Reply