You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

546 lines
15KB

  1. /* SpiralPlugin
  2. * Copyleft (C) 2000 David Griffiths <dave@pawfal.org>
  3. *
  4. * This program is free software; you can redistribute it and/or modify
  5. * it under the terms of the GNU General Public License as published by
  6. * the Free Software Foundation; either version 2 of the License, or
  7. * (at your option) any later version.
  8. *
  9. * This program is distributed in the hope that it will be useful,
  10. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. * GNU General Public License for more details.
  13. *
  14. * You should have received a copy of the GNU General Public License
  15. * along with this program; if not, write to the Free Software
  16. * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  17. */
  18. #include "PoshSamplerPluginGUI.h"
  19. #include <FL/fl_draw.h>
  20. #include <FL/fl_draw.H>
  21. #include <FL/fl_file_chooser.h>
  22. static const int GUI_COLOUR = 179;
  23. static const int GUIBG_COLOUR = 144;
  24. static const int GUIBG2_COLOUR = 145;
  25. ////////////////////////////////////////////
  26. Fl_WaveDisplay::Fl_WaveDisplay(int x,int y,int w,int h, char *Name) :
  27. Fl_Widget(x,y,w,h,Name),
  28. m_Sample(NULL),
  29. m_StartPos(1),
  30. m_EndPos(10),
  31. m_ViewStart(0),
  32. m_ViewEnd(INT_MAX),
  33. m_PlayPos(0),
  34. m_PlayStart(0),
  35. m_LoopStart(0),
  36. m_LoopEnd(INT_MAX),
  37. m_PosMarker(true)
  38. {
  39. }
  40. Fl_WaveDisplay::~Fl_WaveDisplay()
  41. {
  42. }
  43. void Fl_WaveDisplay::draw()
  44. {
  45. int ho=h()/2;
  46. fl_color(GUIBG_COLOUR);
  47. fl_rectf(x(), y(), w(), h());
  48. if (!m_Sample || m_Sample->GetLength()==0) return;
  49. if (m_ViewStart<0) m_ViewStart=0;
  50. if (m_ViewEnd>m_Sample->GetLength()-1) m_ViewEnd=m_Sample->GetLength()-1;
  51. if (m_PlayStart<0) m_PlayStart=0;
  52. if (m_PlayStart>m_Sample->GetLength()-1) m_PlayStart=m_Sample->GetLength()-1;
  53. if (m_LoopStart<0) m_LoopStart=0;
  54. if (m_LoopStart>m_Sample->GetLength()-1) m_LoopStart=m_Sample->GetLength()-1;
  55. if (m_LoopEnd<0) m_LoopEnd=0;
  56. if (m_LoopEnd>m_Sample->GetLength()-1) m_LoopEnd=m_Sample->GetLength()-1;
  57. float Value=0,NextValue=0;
  58. int pos=0;
  59. int Jump=(m_ViewEnd-m_ViewStart)/w();
  60. if (Jump==0) Jump=1;
  61. for(int n=m_ViewStart; n<m_ViewEnd-Jump; n+=Jump)
  62. {
  63. fl_font(fl_font(),10);
  64. if (m_PlayPos>=n && m_PlayPos<n+Jump)
  65. {
  66. fl_color(FL_YELLOW);
  67. fl_line(x()+pos, y(),
  68. x()+pos, y()+h());
  69. }
  70. if (m_PlayStart>=n && m_PlayStart<n+Jump)
  71. {
  72. fl_color(FL_GREEN);
  73. fl_draw("S",x()+pos+2,y()+h());
  74. fl_line(x()+pos, y(),
  75. x()+pos, y()+h());
  76. }
  77. if (m_LoopStart>=n && m_LoopStart<n+Jump)
  78. {
  79. fl_color(FL_GREEN);
  80. fl_draw("LS",x()+pos+2,y()+h());
  81. fl_line(x()+pos, y(),
  82. x()+pos, y()+h());
  83. }
  84. if (m_LoopEnd>=n && m_LoopEnd<n+Jump)
  85. {
  86. fl_color(FL_GREEN);
  87. fl_draw("LE",x()+pos+2,y()+h());
  88. fl_line(x()+pos, y(),
  89. x()+pos, y()+h());
  90. }
  91. if (n>m_StartPos && n<m_EndPos) fl_color(FL_RED);
  92. else fl_color(FL_WHITE);
  93. Value = NextValue;
  94. // get average
  95. NextValue=0;
  96. for (int m=n; m<n+Jump; m++)
  97. {
  98. NextValue+=(*m_Sample)[m];
  99. }
  100. NextValue=(NextValue*ho)/Jump;
  101. fl_line(x()+pos-2, y()+ho-(int)Value,
  102. x()+pos-1, y()+ho-(int)NextValue);
  103. pos++;
  104. }
  105. }
  106. int Fl_WaveDisplay::handle(int event)
  107. {
  108. int xx=Fl::event_x();
  109. int yy=Fl::event_y();
  110. static int DragX,DragY;
  111. static int Mousebutton=0;
  112. static int Holding=0;
  113. static int GrabDist=10;
  114. if (event==FL_PUSH)
  115. {
  116. GrabDist=(int)((m_ViewEnd-m_ViewStart)*0.03f);
  117. Mousebutton=Fl::event_button();
  118. DragX=xx;
  119. DragY=yy;
  120. if (Mousebutton==1)
  121. {
  122. int MousePos=(xx-x())*((m_ViewEnd-m_ViewStart)/w())+m_ViewStart;
  123. Holding=0;
  124. if (abs(MousePos-m_StartPos)<GrabDist) Holding=1;
  125. else if (abs(MousePos-m_EndPos)<GrabDist) Holding=2;
  126. else if (abs(MousePos-m_PlayStart)<GrabDist) Holding=3;
  127. else if (abs(MousePos-m_LoopStart)<GrabDist) Holding=4;
  128. else if (abs(MousePos-m_LoopEnd)<GrabDist) Holding=5;
  129. else
  130. {
  131. m_StartPos=MousePos;
  132. m_EndPos=MousePos;
  133. }
  134. }
  135. }
  136. if (event==FL_DRAG)
  137. {
  138. if (Mousebutton==1)
  139. {
  140. int MousePos=(xx-x())*((m_ViewEnd-m_ViewStart)/w())+m_ViewStart;
  141. switch (Holding)
  142. {
  143. case 0:
  144. {
  145. if (MousePos>m_EndPos) m_EndPos=MousePos;
  146. else m_StartPos=MousePos;
  147. } break;
  148. case 1:
  149. {
  150. m_StartPos=MousePos;
  151. if (m_StartPos>m_EndPos) Holding=2; // swap
  152. } break;
  153. case 2:
  154. {
  155. m_EndPos=MousePos;
  156. if (m_StartPos>m_EndPos) Holding=1; // swap
  157. } break;
  158. case 3: m_PlayStart=MousePos; break;
  159. case 4: m_LoopStart=MousePos; break;
  160. case 5: m_LoopEnd=MousePos; break;
  161. }
  162. }
  163. if (Mousebutton==2)
  164. {
  165. int Dist=(DragX-xx)*((m_ViewEnd-m_ViewStart)/w());
  166. if (m_ViewStart>0 && m_ViewEnd<m_Sample->GetLength()-1)
  167. {
  168. m_ViewStart+=Dist;
  169. m_ViewEnd+=Dist;
  170. }
  171. else // stop it sticking when at end/beginning
  172. {
  173. if ((Dist>0 && m_ViewStart<=0) ||
  174. (Dist<0 && m_ViewEnd>=m_Sample->GetLength()-1))
  175. {
  176. m_ViewStart+=Dist;
  177. m_ViewEnd+=Dist;
  178. }
  179. }
  180. DragX=xx;
  181. DragY=yy;
  182. }
  183. if (Mousebutton==3)
  184. {
  185. // only draw wave at 1 pixel = 1 sample
  186. if ((m_ViewEnd-m_ViewStart)/w()==1)
  187. {
  188. int MousePos=(xx-x())*((m_ViewEnd-m_ViewStart)/w())+m_ViewStart;
  189. float Value=-(yy-y())/((float)h()/2.0f)+1.0f;
  190. m_Sample->Set(MousePos,Value);
  191. redraw();
  192. }
  193. }
  194. do_callback();
  195. redraw();
  196. }
  197. if (event==FL_KEYBOARD || event==FL_SHORTCUT)
  198. {
  199. if (Fl::event_key('+'))
  200. {
  201. int Zoom=(int)((m_ViewEnd-m_ViewStart)*0.03f);
  202. if ((m_ViewEnd-m_ViewStart)/w()>1)
  203. {
  204. m_ViewStart+=Zoom;
  205. m_ViewEnd-=Zoom;
  206. }
  207. redraw();
  208. }
  209. if (Fl::event_key('-'))
  210. {
  211. int Zoom=(int)((m_ViewEnd-m_ViewStart)*0.03f);
  212. m_ViewStart-=Zoom;
  213. m_ViewEnd+=Zoom;
  214. redraw();
  215. }
  216. }
  217. if (m_EndPos>=m_Sample->GetLength()) m_EndPos=m_Sample->GetLength()-1;
  218. return 1;
  219. }
  220. ////////////////////////////////////////////
  221. PoshSamplerPluginGUI::PoshSamplerPluginGUI(int w, int h,PoshSamplerPlugin *o,const HostInfo *Info) :
  222. SpiralPluginGUI(w,h,o)
  223. {
  224. m_Plugin=o;
  225. int n=0;
  226. m_Load = new Fl_Button(5, 20, 70, 20, "Load");
  227. m_Load->labelsize(10);
  228. m_Load->callback((Fl_Callback*)cb_Load);
  229. add(m_Load);
  230. m_Save = new Fl_Button(5, 40, 70, 20, "Save");
  231. m_Save->labelsize(10);
  232. m_Save->callback((Fl_Callback*)cb_Save);
  233. add(m_Save);
  234. m_Record = new Fl_Button(5, 60, 70, 20, "Record");
  235. m_Record->type(1);
  236. m_Record->labelsize(10);
  237. m_Record->labelcolor(FL_RED);
  238. m_Record->callback((Fl_Callback*)cb_Record);
  239. add(m_Record);
  240. m_Loop = new Fl_Button(80, 20, 70, 20, "Loop");
  241. m_Loop->labelsize(10);
  242. m_Loop->type(1);
  243. m_Loop->callback((Fl_Callback*)cb_Loop);
  244. add(m_Loop);
  245. m_PingPong = new Fl_Button(80, 40, 70, 20, "PingPong");
  246. m_PingPong->labelsize(10);
  247. m_PingPong->type(1);
  248. m_PingPong->callback((Fl_Callback*)cb_PingPong);
  249. add(m_PingPong);
  250. m_PosMarker = new Fl_Button(80, 60, 70, 20, "PosMarker");
  251. m_PosMarker->labelsize(10);
  252. m_PosMarker->type(1);
  253. m_PosMarker->value(1);
  254. m_PosMarker->callback((Fl_Callback*)cb_PosMarker);
  255. add(m_PosMarker);
  256. m_Volume = new Fl_Knob(160, 20, 50, 50, "Volume");
  257. m_Volume->color(GUI_COLOUR);
  258. m_Volume->type(Fl_Knob::LINELIN);
  259. m_Volume->labelsize(10);
  260. m_Volume->maximum(2);
  261. m_Volume->step(0.001);
  262. m_Volume->value(1);
  263. m_Volume->callback((Fl_Callback*)cb_Volume);
  264. add(m_Volume);
  265. m_Pitch = new Fl_Knob(220, 20, 50, 50, "Pitch");
  266. m_Pitch->color(GUI_COLOUR);
  267. m_Pitch->type(Fl_Knob::LINELIN);
  268. m_Pitch->labelsize(10);
  269. m_Pitch->maximum(10);
  270. m_Pitch->step(0.001);
  271. m_Pitch->value(1);
  272. m_Pitch->callback((Fl_Callback*)cb_Pitch);
  273. add(m_Pitch);
  274. m_Octave = new Fl_Knob(280, 20, 50, 50, "Octave");
  275. m_Octave->color(GUI_COLOUR);
  276. m_Octave->type(Fl_Knob::LINELIN);
  277. m_Octave->labelsize(10);
  278. m_Octave->maximum(12);
  279. m_Octave->step(1);
  280. m_Octave->value(6);
  281. m_Octave->callback((Fl_Callback*)cb_Octave);
  282. add(m_Octave);
  283. m_Note = new Fl_Counter(w-45, 50, 30, 20, "Trig Note");
  284. m_Note->labelsize(10);
  285. m_Note->type(FL_SIMPLE_COUNTER);
  286. m_Note->step(1);
  287. m_Note->value(n);
  288. m_Note->callback((Fl_Callback*)cb_Note);
  289. add(m_Note);
  290. m_SampleNum = new Fl_Counter(w-45, 15, 30, 20, "Sample");
  291. m_SampleNum->labelsize(10);
  292. m_SampleNum->type(FL_SIMPLE_COUNTER);
  293. m_SampleNum->step(1);
  294. m_SampleNum->value(n);
  295. m_SampleNum->callback((Fl_Callback*)cb_SampleNum);
  296. add(m_SampleNum);
  297. m_Display = new Fl_WaveDisplay(5,85,w-10,100,"");
  298. m_Display->SetSample(m_Plugin->GetSample(0));
  299. m_Display->callback((Fl_Callback*)cb_WaveDisplay);
  300. int bx=5,by=190,bw=w/7-2,bh=20,bs=w/7-2;
  301. n=0;
  302. m_Cut = new Fl_Button(bx+(n++*bs),by,bw,bh,"Cut");
  303. m_Cut->labelsize(10);
  304. m_Cut->callback((Fl_Callback*)cb_Cut);
  305. m_Copy = new Fl_Button(bx+(n++*bs),by,bw,bh,"Copy");
  306. m_Copy->labelsize(10);
  307. m_Copy->callback((Fl_Callback*)cb_Copy);
  308. m_Paste = new Fl_Button(bx+(n++*bs),by,bw,bh,"Paste");
  309. m_Paste->labelsize(10);
  310. m_Paste->callback((Fl_Callback*)cb_Paste);
  311. m_Mix = new Fl_Button(bx+(n++*bs),by,bw,bh,"Mix");
  312. m_Mix->labelsize(10);
  313. m_Mix->callback((Fl_Callback*)cb_Mix);
  314. m_Crop = new Fl_Button(bx+(n++*bs),by,bw,bh,"Crop");
  315. m_Crop->labelsize(10);
  316. m_Crop->callback((Fl_Callback*)cb_Crop);
  317. m_Reverse = new Fl_Button(bx+(n++*bs),by,bw,bh,"Reverse");
  318. m_Reverse->labelsize(10);
  319. m_Reverse->callback((Fl_Callback*)cb_Reverse);
  320. m_Amp = new Fl_Button(bx+(n++*bs),by,bw,bh,"Amp");
  321. m_Amp->labelsize(10);
  322. m_Amp->callback((Fl_Callback*)cb_Amp);
  323. end();
  324. redraw();
  325. }
  326. void PoshSamplerPluginGUI::UpdateValues()
  327. {
  328. m_Volume->value(m_Plugin->GetVolume((int)m_SampleNum->value()));
  329. m_Pitch->value(m_Plugin->GetPitch((int)m_SampleNum->value()));
  330. m_Note->value(m_Plugin->GetNote((int)m_SampleNum->value()));
  331. m_Loop->value(m_Plugin->GetLoop((int)m_SampleNum->value()));
  332. m_Display->SetSample(m_Plugin->GetSample((int)m_SampleNum->value()));
  333. m_Display->SetPlayStart(m_Plugin->GetPlayStart((int)m_SampleNum->value()));
  334. m_Display->SetLoopStart(m_Plugin->GetLoopStart((int)m_SampleNum->value()));
  335. m_Display->SetLoopEnd(m_Plugin->GetLoopEnd((int)m_SampleNum->value()));
  336. m_Display->redraw();
  337. }
  338. inline void PoshSamplerPluginGUI::cb_Load_i(Fl_Button* o, void* v)
  339. {
  340. char *fn=fl_file_chooser("Load a sample", "{*.wav,*.WAV}", NULL);
  341. if (fn && fn!='\0')
  342. {
  343. m_Plugin->LoadSample((int)m_SampleNum->value(),fn);
  344. m_Display->SetSample(m_Plugin->GetSample((int)m_SampleNum->value()));
  345. UpdateValues();
  346. m_Display->redraw();
  347. redraw();
  348. }
  349. }
  350. void PoshSamplerPluginGUI::cb_Load(Fl_Button* o, void* v)
  351. { ((PoshSamplerPluginGUI*)(o->parent()))->cb_Load_i(o,v);}
  352. inline void PoshSamplerPluginGUI::cb_Save_i(Fl_Button* o, void* v)
  353. {
  354. char *fn=fl_file_chooser("Save sample", "{*.wav,*.WAV}", NULL);
  355. if (fn && fn!='\0')
  356. {
  357. m_Plugin->SaveSample((int)m_SampleNum->value(),fn);
  358. }
  359. }
  360. void PoshSamplerPluginGUI::cb_Save(Fl_Button* o, void* v)
  361. { ((PoshSamplerPluginGUI*)(o->parent()))->cb_Save_i(o,v);}
  362. inline void PoshSamplerPluginGUI::cb_Volume_i(Fl_Knob* o, void* v)
  363. { m_Plugin->SetVolume((int)m_SampleNum->value(),o->value()); }
  364. void PoshSamplerPluginGUI::cb_Volume(Fl_Knob* o, void* v)
  365. { ((PoshSamplerPluginGUI*)(o->parent()))->cb_Volume_i(o,v);}
  366. inline void PoshSamplerPluginGUI::cb_Pitch_i(Fl_Knob* o, void* v)
  367. { m_Plugin->SetPitch((int)m_SampleNum->value(),o->value()); }
  368. void PoshSamplerPluginGUI::cb_Pitch(Fl_Knob* o, void* v)
  369. { ((PoshSamplerPluginGUI*)(o->parent()))->cb_Pitch_i(o,v);}
  370. inline void PoshSamplerPluginGUI::cb_Octave_i(Fl_Knob* o, void* v)
  371. { m_Plugin->SetOctave((int)m_SampleNum->value(), (int)o->value()); }
  372. void PoshSamplerPluginGUI::cb_Octave(Fl_Knob* o, void* v)
  373. { ((PoshSamplerPluginGUI*)(o->parent()))->cb_Octave_i(o,v);}
  374. inline void PoshSamplerPluginGUI::cb_Loop_i(Fl_Button* o, void* v)
  375. { m_Plugin->SetLoop((int)m_SampleNum->value(),o->value()); }
  376. void PoshSamplerPluginGUI::cb_Loop(Fl_Button* o, void* v)
  377. { ((PoshSamplerPluginGUI*)(o->parent()))->cb_Loop_i(o,v);}
  378. inline void PoshSamplerPluginGUI::cb_PingPong_i(Fl_Button* o, void* v)
  379. { m_Plugin->SetPingPong((int)m_SampleNum->value(), o->value()); }
  380. void PoshSamplerPluginGUI::cb_PingPong(Fl_Button* o, void* v)
  381. { ((PoshSamplerPluginGUI*)(o->parent()))->cb_PingPong_i(o,v);}
  382. inline void PoshSamplerPluginGUI::cb_Record_i(Fl_Button* o, void* v)
  383. {
  384. m_Plugin->SetRecord(o->value());
  385. redraw();
  386. }
  387. void PoshSamplerPluginGUI::cb_Record(Fl_Button* o, void* v)
  388. { ((PoshSamplerPluginGUI*)(o->parent()))->cb_Record_i(o,v);}
  389. inline void PoshSamplerPluginGUI::cb_PosMarker_i(Fl_Button* o, void* v)
  390. { m_Display->SetPosMarker(o->value()); }
  391. void PoshSamplerPluginGUI::cb_PosMarker(Fl_Button* o, void* v)
  392. { ((PoshSamplerPluginGUI*)(o->parent()))->cb_PosMarker_i(o,v);}
  393. inline void PoshSamplerPluginGUI::cb_Note_i(Fl_Counter* o, void* v)
  394. { m_Plugin->SetNote((int)m_SampleNum->value(),(int)o->value()); }
  395. void PoshSamplerPluginGUI::cb_Note(Fl_Counter* o, void* v)
  396. { ((PoshSamplerPluginGUI*)(o->parent()))->cb_Note_i(o,v);}
  397. inline void PoshSamplerPluginGUI::cb_SampleNum_i(Fl_Counter* o, void* v)
  398. {
  399. if (m_SampleNum->value()<0) m_SampleNum->value(0);
  400. if (m_SampleNum->value()>7) m_SampleNum->value(7);
  401. UpdateValues();
  402. }
  403. void PoshSamplerPluginGUI::cb_SampleNum(Fl_Counter* o, void* v)
  404. { ((PoshSamplerPluginGUI*)(o->parent()))->cb_SampleNum_i(o,v);}
  405. inline void PoshSamplerPluginGUI::cb_Cut_i(Fl_Button* o, void* v)
  406. {
  407. m_Plugin->Cut((int)m_SampleNum->value(),m_Display->GetRangeStart(),m_Display->GetRangeEnd());
  408. m_Display->redraw();
  409. }
  410. void PoshSamplerPluginGUI::cb_Cut(Fl_Button* o, void* v)
  411. { ((PoshSamplerPluginGUI*)(o->parent()))->cb_Cut_i(o,v);}
  412. inline void PoshSamplerPluginGUI::cb_Copy_i(Fl_Button* o, void* v)
  413. {
  414. m_Plugin->Copy((int)m_SampleNum->value(),m_Display->GetRangeStart(),m_Display->GetRangeEnd());
  415. m_Display->redraw();
  416. }
  417. void PoshSamplerPluginGUI::cb_Copy(Fl_Button* o, void* v)
  418. { ((PoshSamplerPluginGUI*)(o->parent()))->cb_Copy_i(o,v);}
  419. inline void PoshSamplerPluginGUI::cb_Paste_i(Fl_Button* o, void* v)
  420. {
  421. m_Plugin->Paste((int)m_SampleNum->value(),m_Display->GetRangeStart(),m_Display->GetRangeEnd());
  422. m_Display->redraw();
  423. }
  424. void PoshSamplerPluginGUI::cb_Paste(Fl_Button* o, void* v)
  425. { ((PoshSamplerPluginGUI*)(o->parent()))->cb_Paste_i(o,v);}
  426. inline void PoshSamplerPluginGUI::cb_Mix_i(Fl_Button* o, void* v)
  427. {
  428. m_Plugin->Mix((int)m_SampleNum->value(),m_Display->GetRangeStart(),m_Display->GetRangeEnd());
  429. m_Display->redraw();
  430. }
  431. void PoshSamplerPluginGUI::cb_Mix(Fl_Button* o, void* v)
  432. { ((PoshSamplerPluginGUI*)(o->parent()))->cb_Mix_i(o,v);}
  433. inline void PoshSamplerPluginGUI::cb_Crop_i(Fl_Button* o, void* v)
  434. {
  435. m_Plugin->Crop((int)m_SampleNum->value(),m_Display->GetRangeStart(),m_Display->GetRangeEnd());
  436. m_Display->redraw();
  437. }
  438. void PoshSamplerPluginGUI::cb_Crop(Fl_Button* o, void* v)
  439. { ((PoshSamplerPluginGUI*)(o->parent()))->cb_Crop_i(o,v);}
  440. inline void PoshSamplerPluginGUI::cb_Reverse_i(Fl_Button* o, void* v)
  441. {
  442. m_Plugin->Reverse((int)m_SampleNum->value(),m_Display->GetRangeStart(),m_Display->GetRangeEnd());
  443. m_Display->redraw();
  444. }
  445. void PoshSamplerPluginGUI::cb_Reverse(Fl_Button* o, void* v)
  446. { ((PoshSamplerPluginGUI*)(o->parent()))->cb_Reverse_i(o,v);}
  447. inline void PoshSamplerPluginGUI::cb_Amp_i(Fl_Button* o, void* v)
  448. {
  449. m_Plugin->Amp((int)m_SampleNum->value(),m_Display->GetRangeStart(),m_Display->GetRangeEnd());
  450. m_Display->redraw();
  451. }
  452. void PoshSamplerPluginGUI::cb_Amp(Fl_Button* o, void* v)
  453. { ((PoshSamplerPluginGUI*)(o->parent()))->cb_Amp_i(o,v);}
  454. inline void PoshSamplerPluginGUI::cb_WaveDisplay_i(Fl_WaveDisplay* o, void* v)
  455. {
  456. m_Plugin->SetPlayStart((int)m_SampleNum->value(),o->GetPlayStart());
  457. m_Plugin->SetLoopStart((int)m_SampleNum->value(),o->GetLoopStart());
  458. m_Plugin->SetLoopEnd((int)m_SampleNum->value(),o->GetLoopEnd());
  459. }
  460. void PoshSamplerPluginGUI::cb_WaveDisplay(Fl_WaveDisplay* o, void* v)
  461. { ((PoshSamplerPluginGUI*)(o->parent()))->cb_WaveDisplay_i(o,v);}