Opened 10 years ago

Closed 10 years ago

#4332 closed bug (fixed)

The MediaPlayer can’t load saved playlist from Playlist window with Open File

Reported by: modeenf Owned by: stippi
Priority: normal Milestone: R1/alpha1
Component: Applications/MediaPlayer Version: R1/pre-alpha1
Keywords: Cc:
Blocked By: Blocking:
Has a Patch: no Platform: All


The MediaPlayer can’t load saved playlist from Playlist window with Open File.

To reproduce:

  • Add mp3’s to MediaPlayer
  • Go to Playlist and save playlist.
  • Close MediaPlayer
  • Start MediaPlayer
  • Open Playlist
  • Open File and select your playlist.

The Playlist file works. If you instead select the most resent file used it will fill the playlist and start playing.

This is how the code looks like. PlayListWindow.cpp

143	                case B_REFS_RECEIVED:
144	                case B_SIMPLE_DATA: {
145	                        // only accept this message when it comes from the
146	                        // player window, _not_ when it is dropped in this window
147	                        // outside of the playlist!
148	                        int32 appendIndex;
149	                        if (message->FindInt32("append_index", &appendIndex) == B_OK) {
150	                                fListView->RefsReceived(message, appendIndex);
151	                        }
152	                        break;
153	                }
155	                case M_PLAYLIST_OPEN: {
156	                        BMessenger target(this);
157	                        BMessage result(B_REFS_RECEIVED);
158	                        BMessage appMessage(M_SHOW_OPEN_PANEL);
159	                        appMessage.AddMessenger("target", target);
160	                        appMessage.AddMessage("message", &result);
161	                        appMessage.AddString("title", "Open Playlist");
162	                        appMessage.AddString("label", "Open");
163	                        be_app->PostMessage(&appMessage);
164	                        break;
165	                }

The code that works look like this and are from MainWin.cpp.

848	void
849	MainWin::_RefsReceived(BMessage* msg)
850	{
851	        // the playlist ist replaced by dropped files
852	        // or the dropped files are appended to the end
853	        // of the existing playlist if <shift> is pressed
854	        BAutolock _(fPlaylist);
855	        int32 appendIndex = modifiers() & B_SHIFT_KEY ?
856	                fPlaylist->CountItems() : -1;
857	        msg->AddInt32("append_index", appendIndex);
859	        // forward the message to the playlist window,
860	        // so that undo/redo is used for modifying the playlist
861	        fPlaylistWindow->PostMessage(msg);
862	}

As you can see, the code that works, add things to the BMessage and send it to PlayListWindow.cpp.

So how does this get fixed? ether we need to change so that PlayListWindow.cpp send's it Open file message to MainWin.cpp or change "case B_REFS_RECEIVED:" part in PlayListWindow.cpp to also take our own (PlayListWindow.cpp) BMessage. I don't know how I should do with the append_index.

Change History (2)

comment:1 by marcusoverhagen, 10 years ago

Owner: changed from marcusoverhagen to stippi

comment:2 by modeenf, 10 years ago

Resolution: fixed
Status: newclosed

fixed in hrev32828

Note: See TracTickets for help on using tickets.