* Implemented a "refs catcher" that will catch refs received through a

B_REFS_RECEIVED within a short amount of time (0.5 seconds right now) and
  send them to the last window to be appended to the playlist. This allows to
  select multiple media files in Tracker and get them inside a playlist of a
  single window instead of spawning many individual ones (like when filtering
  for an album, selecting all tracks and opening them by hitting enter).
* Introduce special append index values APPEND_INDEX_REPLACE_PLAYLIST (-1, does
  the same as before) and APPEND_INDEX_APPEND_LAST. The latter is used when
  appending through a RefsReceived() call and ensures that the index is
  evaluated at the actual insertion time (in ImportPLItemsCommand::Perform())
  as by the time this function is called the playlist count may have changed
  already due to multiple RefsReceived() invokations, which would then mess up
  the order. This makes the above item work as expected.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@35352 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Michael Lotz
2010-01-31 01:03:06 +00:00
parent 497aa62c2f
commit eeeef45c69
6 changed files with 58 additions and 12 deletions
+6 -2
View File
@@ -1122,9 +1122,13 @@ MainWin::_RefsReceived(BMessage* message)
// the playlist is replaced by dropped files
// or the dropped files are appended to the end
// of the existing playlist if <shift> is pressed
bool append = false;
if (message->FindBool("append to playlist", &append) != B_OK)
append = modifiers() & B_SHIFT_KEY;
BAutolock _(fPlaylist);
int32 appendIndex = modifiers() & B_SHIFT_KEY ?
fPlaylist->CountItems() : -1;
int32 appendIndex = append ? APPEND_INDEX_APPEND_LAST
: APPEND_INDEX_REPLACE_PLAYLIST;
message->AddInt32("append_index", appendIndex);
// forward the message to the playlist window,