HaikuArchives / StreamRadio

Haiku-native application to search for and listen to internet radio stations.
8 stars 11 forks source link

Start playing station when opening with a Station file #59

Closed humdingerb closed 9 months ago

humdingerb commented 1 year ago

The main window didn't exist yet to receive the RefReceived message. Fixes #58

lonemadmax commented 1 year ago

Are you sure you want to create the window in the app's destructor? :)

The right fix should probably be something like what's currently being done in ArgvReceived, where the args are checked and those that are file entries are saved in a message that is later delivered in ReadyToRun. So maybe changing RefsReceived to something like:

void
RadioApp::RefsReceived(BMessage* message)
{
    if (mainWindow != NULL)
        mainWindow->PostMessage(message);
    else
        fArgvMessage = new BMessage(*message);
}

I'm not sure right now about the details of copying a message, and maybe it would have to take into account the reception of several messages while the app is not ready, and the parallel playback option.

humdingerb commented 1 year ago

Are you sure you want to create the window in the app's destructor? :)

Whoopsie daisy... Must've missed the squiggly tilde there... :) I went with your suggestion and had a few more minor changes to make it work with parallel playback and dropping of files. Thanks for the review!

korli commented 9 months ago

should be superseded by fd0492de2d8b50edc27fad95fb3412d113b0e7a4. Sorry, should have reworked your PR.

humdingerb commented 9 months ago

No problem, you're on a roll. Are you on vacation ? 😃

korli commented 9 months ago

Now using a bit Haiku natively on my laptop with Falkon working good enough. StreamRadio needed a bit polishing.