{
   "labels" : [
      "gui",
      "sampler",
      "code fork",
      "loader",
      "soundfile"
   ],
   "code" : "//samplePlayerGUI\r\n\r\nvar make;\r\nvar dialog = Dialog.openPanel({ |list| make.(list) }, nil, true);\r\nvar win = Window(\"Sample Player 3001\").front;\r\nvar samples = ();\r\nvar buttons = ();\r\nvar players = ();\r\n\r\nmake = { |paths|\r\n\t{\r\n\t\tpaths.do{ |path|\r\n\t\t\t[\\loaded, path.basename].postln;\r\n\t\t\tsamples[path] = SoundFile.collect(path).first;\r\n\t\t\tbuttons[path] = Button()\r\n\t\t\t\t.states_([[path.basename], [path.basename, Color.red]])\r\n\t\t\t\t.action_{|me| \r\n\t\t\t\t\t(me.value == 1).if({\r\n\t\t\t\t\t\tplayers[path] = samples[path].cue((amp: 1, server: Server.default), true)\r\n\t\t\t\t\t}, {\r\n\t\t\t\t\t\tplayers[path].release;\r\n\t\t\t\t\t});\r\n\t\t\t\t};\r\n\t\t};\r\n\t\twin.layout = VLayout(*buttons.asArray);\r\n\t\twin.onClose_{\r\n\t\t\tsamples.do{ |player|\r\n\t\t\t\tplayer.release;\r\n\t\t\t};\r\n\t\t};\r\n\t}.fork(AppClock);\r\n};",
   "is_private" : null,
   "id" : "1-46Y",
   "name" : "Re: Load and play samples from GUI (Qt GUI only), adapted to use SoundFile:cue",
   "author" : "LFSaw",
   "description" : "*Needs Qt GUI (VLayout)*\r\n-----\r\nBasic GUI for loading samples and playing them via button presses. Differences to the original version by rukano:\r\n\r\n+ adapted to use SoundFile:cue\r\n+ you can start and stop playing the samples",
   "ancestor_list" : [
      "1-3CI"
   ]
}
