From 1452ccc1796249f036ab98fa746be492ca02202f Mon Sep 17 00:00:00 2001 From: Erik Zandvliet Date: Wed, 22 May 2013 15:47:05 +0200 Subject: [PATCH] Updated track selection. --- src/buffer/player.cpp | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/src/buffer/player.cpp b/src/buffer/player.cpp index 78c05dff..04439c4f 100644 --- a/src/buffer/player.cpp +++ b/src/buffer/player.cpp @@ -199,9 +199,17 @@ int main(int argc, char** argv){ break; } case 't': { - std::vector selected; - selected.push_back(in_out.Received().get().substr(2)); - source.selectTracks(selected); + std::set newSelect; + std::string tmp = in_out.Received().get().substr(2); + while (tmp != ""){ + newSelect.insert(atoi(tmp.substr(0,tmp.find(' ')).c_str())); + if (tmp.find(' ') != std::string::npos){ + tmp.erase(0,tmp.find(' ')+1); + }else{ + tmp = ""; + } + } + source.selectTracks(newSelect); break; } #if DEBUG >= 4