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?

Postby egwqgwe » Thu May 10, 2018 5:31 pm

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: 2785
Joined: Sat Apr 16, 2005 7:22 am
Location: USA, Ukraine

Re: wxMediaCtrl, how to use it?

Postby ONEEYEMAN » Thu May 10, 2018 6:20 pm

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?

Postby egwqgwe » Fri May 11, 2018 12:59 pm

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: 12801
Joined: Fri Apr 21, 2006 8:03 pm
Location: $FCE2

Re: wxMediaCtrl, how to use it?

Postby doublemax » Fri May 11, 2018 2:44 pm

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: 2785
Joined: Sat Apr 16, 2005 7:22 am
Location: USA, Ukraine

Re: wxMediaCtrl, how to use it?

Postby ONEEYEMAN » Fri May 11, 2018 2:46 pm

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?

Postby egwqgwe » Fri May 11, 2018 3:09 pm

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: 2785
Joined: Sat Apr 16, 2005 7:22 am
Location: USA, Ukraine

Re: wxMediaCtrl, how to use it?

Postby ONEEYEMAN » Fri May 11, 2018 3:21 pm

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?

Postby egwqgwe » Fri May 11, 2018 3:24 pm

I am using Codeblocks with wxSmith

ONEEYEMAN
Part Of The Furniture
Part Of The Furniture
Posts: 2785
Joined: Sat Apr 16, 2005 7:22 am
Location: USA, Ukraine

Re: wxMediaCtrl, how to use it?

Postby ONEEYEMAN » Fri May 11, 2018 3:59 pm

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?

Postby egwqgwe » Fri May 11, 2018 6:36 pm

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?

Postby egwqgwe » Fri May 11, 2018 6:42 pm

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: 2785
Joined: Sat Apr 16, 2005 7:22 am
Location: USA, Ukraine

Re: wxMediaCtrl, how to use it?

Postby ONEEYEMAN » Fri May 11, 2018 6:56 pm

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?

Postby egwqgwe » Sat May 12, 2018 9:29 am

Yes, but that's occupies the place of window, so it's looking weird.

User avatar
doublemax
Moderator
Moderator
Posts: 12801
Joined: Fri Apr 21, 2006 8:03 pm
Location: $FCE2

Re: wxMediaCtrl, how to use it?

Postby doublemax » Sat May 12, 2018 9:49 am

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?

Postby egwqgwe » Sat May 12, 2018 10:25 am

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.


Return to “C++ Development”

Who is online

Users browsing this forum: No registered users and 18 guests