From 2cfd2ee5bae4f139b69372993c7b572e94291c54 Mon Sep 17 00:00:00 2001 From: Prathyush Thota Date: Sun, 22 Mar 2009 06:38:07 +0530 Subject: [PATCH] Modified play() for playing selected tracks in the view --- xulmus/content/player.js | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/xulmus/content/player.js b/xulmus/content/player.js index 2a028246..5fe543cb 100755 --- a/xulmus/content/player.js +++ b/xulmus/content/player.js @@ -218,8 +218,18 @@ function Player() // {{{ play: function play() { - gMM.sequencer.playView(SBGetBrowser().currentMediaListView, 0); - focusTrack(gMM.sequencer.currentItem); + //Check if there is any selection in place, else play first item of the visible view. + if (_SBGetCurrentView().selection.count != 0) + { + //Play the selection. + gMM.sequencer.playView(_SBGetCurrentView(),_SBGetCurrentView().getIndexForItem(_SBGetCurrentView().selection.currentMediaItem)); + focusTrack(gMM.sequencer.currentItem); + } + else + { + gMM.sequencer.playView(SBGetBrowser().currentMediaListView, 0); + focusTrack(gMM.sequencer.currentItem); + } }, stop: function stop()