Search found 64 matches

by marcusbarnet
Sat Oct 26, 2019 4:10 pm
Forum: C++ Development
Topic: How to play and stop mp3 asynchronously
Replies: 14
Views: 888

Re: How to play and stop mp3 asynchronously

I tried to compile it, but I receive lots of errors: g++ doc_libvlc_wx_player.cpp `wx-config --libs` `wx-config --cxxflags` `pkg-config --cflags gtk+-2.0 libvlc` `pkg-config --libs gtk+-2.0 libvlc` -o wx_player doc_libvlc_wx_player.cpp:14:14: fatal error: gtk/win_gtk.h: No such file or directory Fr...
by marcusbarnet
Sat Oct 26, 2019 11:58 am
Forum: C++ Development
Topic: How to play and stop mp3 asynchronously
Replies: 14
Views: 888

Re: How to play and stop mp3 asynchronously

Like i already explained a few times, it's bad to call a method from one panel from another panel. You'll always run into these kind of problem. Now panel2 needs to know that panel1 exists and it needs a pointer to it. These kind of dependencies should ring an alarm bell in your head. Use their par...
by marcusbarnet
Sat Oct 26, 2019 11:49 am
Forum: C++ Development
Topic: How to play and stop mp3 asynchronously
Replies: 14
Views: 888

Re: How to play and stop mp3 asynchronously

Here's sample code for a minimal media player using libvlc with wxWidgets: https://git.videolan.org/?p=vlc.git;a=blob;f=doc/libvlc/wx_player.cpp No threads are needed. I tried to compile it, but I receive lots of errors: g++ doc_libvlc_wx_player.cpp `wx-config --libs` `wx-config --cxxflags` `pkg-co...
by marcusbarnet
Sat Oct 26, 2019 7:25 am
Forum: C++ Development
Topic: How to play and stop mp3 asynchronously
Replies: 14
Views: 888

Re: How to play and stop mp3 asynchronously

I usually use this procedure to declare variables and I get only a warning since they works fine at runtime so I wasnt thinking that the problem could be that.

How can I correctly initialize the ptr?
Can you give me an example please?
by marcusbarnet
Sat Oct 26, 2019 6:44 am
Forum: C++ Development
Topic: How to play and stop mp3 asynchronously
Replies: 14
Views: 888

Re: How to play and stop mp3 asynchronously

Thank you for your support! This is the output: [New Thread 0x7fffafd23700 (LWP 9736)] hey Thread 1 "Isola02" received signal SIGSEGV, Segmentation fault. 0x0000555555689484 in secondpanel::OnBitmapButton2Click (this=0x555555f32840, event=...) at /home/isola/Documents/Isola02/secondpanel.cpp:96 96 p...
by marcusbarnet
Fri Oct 25, 2019 9:28 pm
Forum: C++ Development
Topic: How to play and stop mp3 asynchronously
Replies: 14
Views: 888

Re: How to play and stop mp3 asynchronously

I can't access my laptop right now, but it should be the last version since I installed the library few weeks ago by using apt-get. I didn't launch the mediaplayer example because when I saw it I realized that it comes with a gui to control the music file. I just need to run the mp3 in background (i...
by marcusbarnet
Fri Oct 25, 2019 6:51 pm
Forum: C++ Development
Topic: How to play and stop mp3 asynchronously
Replies: 14
Views: 888

How to play and stop mp3 asynchronously

I'm struggling with no success to find a way to play mp3 files asynchronously and to stop them depending on user's actions. I do not want to stop the program's flow since the mp3 are like a voice over to support the user during the use of the application. I'm using C++ and Ubuntu 18.04 and WxWidgets...
by marcusbarnet
Sun Oct 20, 2019 7:52 pm
Forum: C++ Development
Topic: Static Text strings in wxwidgets
Replies: 7
Views: 569

Re: Static Text strings in wxwidgets

Yes I think it can help a little bit the visualization, thank you!
by marcusbarnet
Sun Oct 20, 2019 5:58 pm
Forum: C++ Development
Topic: Application randomly reset and loads new windows
Replies: 23
Views: 952

Re: Application randomly reset and loads new windows

Thank you a lot, doublemax! Now, it works very well! I did in this way as you suggested: Isola02App.cpp wxIMPLEMENT_APP(Isola02App); bool Isola02App::OnInit() { Isola02Frame* frame = new Isola02Frame(L"Isola02Frame"); pointer = frame; frame->Show(true); m_timer.Bind(wxEVT_TIMER, &Isola02App::reset, ...
by marcusbarnet
Sun Oct 20, 2019 4:58 pm
Forum: C++ Development
Topic: Application randomly reset and loads new windows
Replies: 23
Views: 952

Re: Application randomly reset and loads new windows

Thank you again for your efforts! I'm writing down all the advices so I can use them also in future! I made the variables protected, the program compiles correctly and runs fine. As last task, I was trying the filter function to catch the last user action and trigger the timer, but it seems that it ...
by marcusbarnet
Sun Oct 20, 2019 4:45 pm
Forum: C++ Development
Topic: Application randomly reset and loads new windows
Replies: 23
Views: 952

Re: Application randomly reset and loads new windows

Thank you a lot for all your support and suggestions! Now, it can swap from one panel to another without problems! I modified all the parameters and now it works! I also followed your advice and I added the ShowPage() function, here is the code. class Isola02Frame : public wxFrame { public: Isola02F...
by marcusbarnet
Sun Oct 20, 2019 4:21 pm
Forum: C++ Development
Topic: Static Text strings in wxwidgets
Replies: 7
Views: 569

Re: Static Text strings in wxwidgets

yes, unfortunately, it's only one page; since there were lots of user interactions in my previous application, I wanted to avoid to create too many pages and so I tried to insert all the texts in a single page; the result was really a mess because it is hard to handle all the strings. However, if it...
by marcusbarnet
Sun Oct 20, 2019 4:12 pm
Forum: C++ Development
Topic: Application randomly reset and loads new windows
Replies: 23
Views: 952

Re: Application randomly reset and loads new windows

I'm sorry if my question is too stupid, but what means this line of code? pointer = mainFrame; I can understand that the error is caused by the pointer which is NULL and not initialized, but what should mainFrame be? Are you suggesting to use ShowPage() as a function which accepts as parameter the n...
by marcusbarnet
Sun Oct 20, 2019 3:25 pm
Forum: C++ Development
Topic: Application randomly reset and loads new windows
Replies: 23
Views: 952

Re: Application randomly reset and loads new windows

Thank you for your support. I'm having problems when trying to switch from the current page to the next page. To do a test, I simply added a button to the first panel to change the page selection when pressed, but I receive segmentation fault error. In the button pressed event, in firstpanel.cpp, I ...
by marcusbarnet
Sun Oct 20, 2019 2:54 pm
Forum: C++ Development
Topic: Static Text strings in wxwidgets
Replies: 7
Views: 569

Re: Static Text strings in wxwidgets

This is an example of the mess I have in each frame caused by the multiple text strings. Most of them are set as hidden and then I show() them depending on the user input. Other strings have default values and then I change them with values generated by the user. I can't use the same string because ...