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.

529 lines
16KB

  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 <stdio.h>
  19. #include "SequencerPluginGUI.h"
  20. #include <FL/fl_draw.h>
  21. #include <FL/fl_draw.H>
  22. #include <FL/fl_file_chooser.h>
  23. #include <FL/Fl_Color_Chooser.H>
  24. ////////////////////////////////////////////
  25. SequencerPluginGUI::PatternWin::PatternWin(int w,int h,const char* n) :
  26. Fl_Double_Window(w,h,n)
  27. {
  28. m_Scroll = new Fl_Scroll(0, 0, w, h, "");
  29. resizable(m_Scroll);
  30. add(m_Scroll);
  31. m_NextNoteID=0;
  32. m_Melody = new Fl_EventMap(0, 0, 1000, 1000, "");
  33. m_Melody->SetType(Fl_EventMap::MELODY_MAP);
  34. m_Scroll->add(m_Melody);
  35. m_Scroll->position(0,350);
  36. m_Melody->CreateWindow();
  37. m_Melody->show();
  38. // callbacks for note events
  39. Fl_EventMap::EventCallbacks cb;
  40. cb.cb_NewEvent=(Fl_Callback*)cb_NewNote;
  41. cb.cb_MoveEvent=(Fl_Callback*)cb_MoveNote;
  42. cb.cb_DelEvent=(Fl_Callback*)cb_RemoveNote;
  43. m_Melody->SetCallbacks(cb);
  44. end();
  45. }
  46. ////////////////////////////////////////////
  47. SequencerPluginGUI::SequencerPluginGUI(int w, int h,SequencerPlugin *o,ChannelHandler *ch,const HostInfo *Info) :
  48. SpiralPluginGUI(w,h,o,ch)
  49. {
  50. m_Scroll = new Fl_Scroll(50, 20, w-57, h-26, "");
  51. add(m_Scroll);
  52. m_ArrangementMap = new Fl_EventMap(0, 0, 1000, 132*10, "");
  53. // num midi notes * gridsize y ^
  54. m_ArrangementMap->user_data((void*)this);
  55. m_ArrangementMap->SetType(Fl_EventMap::ARRANGE_MAP);
  56. m_Scroll->add(m_ArrangementMap);
  57. m_Scroll->position(-50,350);
  58. m_ArrangementMap->CreateWindow();
  59. m_ArrangementMap->SetZoomLevel(3.0f);
  60. m_ArrangementMap->show();
  61. // callbacks for sequence events
  62. Fl_EventMap::EventCallbacks cb;
  63. cb.cb_EventDoubleClicked=(Fl_Callback*)cb_ArrangeRM;
  64. cb.cb_MoveEvent=(Fl_Callback*)cb_MoveSequence;
  65. cb.cb_RenameEvent=(Fl_Callback*)cb_Rename;
  66. cb.cb_Recolour=(Fl_Callback*)cb_Recolour;
  67. cb.cb_CopyEvent=(Fl_Callback*)cb_Copy;
  68. cb.cb_DelEvent=(Fl_Callback*)cb_RemoveSequence;
  69. cb.cb_EditEvent=(Fl_Callback*)cb_Edit;
  70. m_ArrangementMap->SetCallbacks(cb);
  71. m_Length = new Fl_Input(12, 15, 24, 12, "LengthBars");
  72. m_Length->color(Info->GUI_COLOUR);
  73. m_Length->labelsize(8);
  74. m_Length->align(FL_ALIGN_BOTTOM|FL_ALIGN_CENTER);
  75. m_Length->textsize(8);
  76. m_Length->value("4");
  77. m_Length->callback((Fl_Callback*)cb_Length);
  78. add(m_Length);
  79. m_BeatsPerBar = new Fl_Input(12, 38, 24, 12, "BeatsPerBar");
  80. m_BeatsPerBar->color(Info->GUI_COLOUR);
  81. m_BeatsPerBar->labelsize(8);
  82. m_BeatsPerBar->align(FL_ALIGN_BOTTOM|FL_ALIGN_CENTER);
  83. m_BeatsPerBar->textsize(8);
  84. m_BeatsPerBar->value("4");
  85. m_BeatsPerBar->callback((Fl_Callback*)cb_BeatsPerBar);
  86. add(m_BeatsPerBar);
  87. m_BarLength = new Fl_Knob(5, 60, 40, 40, "BarLength");
  88. m_BarLength->color(Info->GUI_COLOUR);
  89. m_BarLength->type(Fl_Knob::DOTLIN);
  90. m_BarLength->labelsize(10);
  91. m_BarLength->maximum(10);
  92. m_BarLength->step(0.01);
  93. m_BarLength->value(1.0);
  94. m_BarLength->callback((Fl_Callback*)cb_BarLength);
  95. add(m_BarLength);
  96. m_Speed = new Fl_Knob(5, 115, 40, 40, "Speed");
  97. m_Speed->color(Info->GUI_COLOUR);
  98. m_Speed->type(Fl_Knob::DOTLIN);
  99. m_Speed->labelsize(10);
  100. m_Speed->maximum(4);
  101. m_Speed->step(0.01);
  102. m_Speed->value(2.0);
  103. m_Speed->callback((Fl_Callback*)cb_Speed);
  104. add(m_Speed);
  105. m_Zoom = new Fl_Knob(5,170,40,40,"Zoom");
  106. m_Zoom->color(Info->GUI_COLOUR);
  107. m_Zoom->type(Fl_Knob::DOTLIN);
  108. m_Zoom->labelsize(10);
  109. m_Zoom->maximum(6);
  110. m_Zoom->step(0.01);
  111. m_Zoom->value(3.0);
  112. m_Zoom->callback((Fl_Callback*)cb_Zoom);
  113. add(m_Zoom);
  114. m_NewPattern = new Fl_Button(2,225,45,20,"New Pat");
  115. m_NewPattern->type(0);
  116. m_NewPattern->labelsize(10);
  117. m_NewPattern->callback((Fl_Callback*)cb_NewPattern,NULL);
  118. add(m_NewPattern);
  119. m_NoteCut = new Fl_Button(2,245,45,20,"NoteCut");
  120. m_NoteCut->type(1);
  121. m_NoteCut->labelsize(10);
  122. m_NoteCut->value(0);
  123. m_NoteCut->callback((Fl_Callback*)cb_NoteCut);
  124. add(m_NoteCut);
  125. m_Clear = new Fl_Button(2,265,45,20,"Clear");
  126. m_Clear->type(0);
  127. m_Clear->labelsize(10);
  128. m_Clear->value(0);
  129. m_Clear->callback((Fl_Callback*)cb_Clear);
  130. add(m_Clear);
  131. end();
  132. }
  133. void SequencerPluginGUI::LoadPatternData(int ID)
  134. {
  135. Note note(0,1.0f,0,0);
  136. m_PatternWinMap[ID]->GetEventMap()->RemoveAllEvents();
  137. m_GUICH->Wait();
  138. m_GUICH->Set("ID",ID);
  139. m_GUICH->SetCommand(SequencerPlugin::GET_PATTERN);
  140. m_GUICH->Wait();
  141. m_GUICH->RequestChannelAndWait("TransCount");
  142. int c = m_GUICH->GetInt("TransCount");
  143. cerr<<"TransCount="<<c<<endl;
  144. for (int n=0; n<c; n++)
  145. {
  146. m_GUICH->SetCommand(SequencerPlugin::GET_PATTERN);
  147. m_GUICH->RequestChannelAndWait("TransNote");
  148. m_GUICH->GetData("TransNote",(void*)&note);
  149. cerr<<"Adding note "<<n<<" "<<note.Time<<" "<<note.MidiNote<<" "<<note.Length<<endl;
  150. m_PatternWinMap[ID]->GetEventMap()->AddEventTime(note.Time,note.MidiNote,note.Length,Fl_SEvent::MELODY,false);
  151. }
  152. }
  153. void SequencerPluginGUI::UpdateValues(SpiralPlugin *o)
  154. {
  155. SequencerPlugin *Plugin = (SequencerPlugin *)o;
  156. Track *t = Plugin->GetTrack();
  157. map<int,Sequence> *seqmap=t->GetSequenceMap();
  158. map<int,Note>::iterator pi;
  159. // for each sequence
  160. for (map<int,Sequence>::iterator i=seqmap->begin();
  161. i!=seqmap->end(); i++)
  162. {
  163. int eid = m_ArrangementMap->AddEventTime(i->second.GetStartTime(),i->second.GetYPos(),i->second.GetLength(),Fl_SEvent::NO_TYPE,false);
  164. m_ArrangementMap->GetEvent(eid)->SetName(i->second.GetName());
  165. m_ArrangementMap->GetEvent(eid)->SetColour(i->second.GetColour());
  166. m_ArrangementMap->GetEvent(eid)->SetChannel(i->second.GetChannel());
  167. m_ArrangementMap->GetEvent(eid)->SetLengthTime(i->second.GetLength());
  168. m_PatternWinMap[eid] = new PatternWin(400,200,m_ArrangementMap->GetEvent(eid)->GetName().c_str());
  169. Fl_EventMap *map = m_PatternWinMap[eid]->GetEventMap();
  170. map->user_data((void*)this);
  171. map->SetID(eid);
  172. // load the pattern data
  173. Pattern *p = t->GetPattern(i->second.GetPatternID());
  174. for (pi=p->m_NoteMap.begin();
  175. pi!=p->m_NoteMap.end(); pi++)
  176. {
  177. map->AddEventTime(pi->second.Time,pi->second.MidiNote,pi->second.Length,Fl_SEvent::MELODY,false);
  178. }
  179. }
  180. redraw();
  181. }
  182. void SequencerPluginGUI::Update()
  183. {
  184. float Time=m_GUICH->GetFloat("CurrentTime");
  185. m_ArrangementMap->SetTime(Time);
  186. for (map<int,PatternWin*>::iterator i=m_PatternWinMap.begin();
  187. i!=m_PatternWinMap.end(); i++)
  188. {
  189. i->second->GetEventMap()->SetTime(Time);
  190. }
  191. }
  192. void SequencerPluginGUI::ChangeSequenceHelper(Fl_SEvent *event)
  193. {
  194. m_GUICH->Set("ID",event->GetID());
  195. m_GUICH->Set("ID2",event->GetColour());
  196. char t[256];
  197. sprintf(t,"%s",event->GetName().c_str());
  198. m_GUICH->SetData("Name",(void*)t);
  199. m_GUICH->Set("Length",event->GetLengthTime());
  200. m_GUICH->Set("Note",event->GetGroup());
  201. m_GUICH->Set("Channel",event->GetChannel());
  202. m_GUICH->Set("Time",event->GetStartTime());
  203. m_GUICH->SetCommand(SequencerPlugin::CHG_SEQ);
  204. }
  205. inline void SequencerPluginGUI::cb_NoteCut_i(Fl_Button* o, void* v)
  206. {
  207. //m_Plugin->SetNoteCut(o->value());
  208. }
  209. void SequencerPluginGUI::cb_NoteCut(Fl_Button* o, void* v)
  210. { ((SequencerPluginGUI*)(o->parent()))->cb_NoteCut_i(o,v);}
  211. inline void SequencerPluginGUI::cb_Zoom_i(Fl_Knob* o, void* v)
  212. {
  213. if (o->value()!=0) m_ArrangementMap->SetZoomLevel(o->value());
  214. }
  215. void SequencerPluginGUI::cb_Zoom(Fl_Knob* o, void* v)
  216. { ((SequencerPluginGUI*)(o->parent()))->cb_Zoom_i(o,v);}
  217. inline void SequencerPluginGUI::cb_Pattern_i(Fl_Counter* o, void* v)
  218. {
  219. if (o->value()<0) o->value(0);
  220. if (o->value()>NUM_PATTERNS-1) o->value(NUM_PATTERNS-1);
  221. //m_Plugin->SetPattern((int)o->value());
  222. //UpdateValues();
  223. }
  224. void SequencerPluginGUI::cb_Pattern(Fl_Counter* o, void* v)
  225. { ((SequencerPluginGUI*)(o->parent()))->cb_Pattern_i(o,v);}
  226. inline void SequencerPluginGUI::cb_Length_i(Fl_Input* o, void* v)
  227. {
  228. int val=(int)strtod(o->value(),NULL);
  229. if (val<1) o->value("error!");
  230. else
  231. {
  232. m_GUICH->Set("TotalLength",val);
  233. }
  234. }
  235. void SequencerPluginGUI::cb_Length(Fl_Input* o, void* v)
  236. { ((SequencerPluginGUI*)(o->parent()))->cb_Length_i(o,v);}
  237. inline void SequencerPluginGUI::cb_BeatsPerBar_i(Fl_Input* o, void* v)
  238. {
  239. int val=(int)strtod(o->value(),NULL);
  240. if (val<1) o->value("error!");
  241. else
  242. {
  243. m_GUICH->Set("BeatsPerBar",val);
  244. m_ArrangementMap->SetBeatsBar(val);
  245. m_ArrangementMap->redraw();
  246. for (map<int,PatternWin*>::iterator i=m_PatternWinMap.begin();
  247. i!=m_PatternWinMap.end(); i++)
  248. {
  249. i->second->GetEventMap()->SetBeatsBar(val);
  250. i->second->GetEventMap()->redraw();
  251. }
  252. }
  253. }
  254. void SequencerPluginGUI::cb_BeatsPerBar(Fl_Input* o, void* v)
  255. { ((SequencerPluginGUI*)(o->parent()))->cb_BeatsPerBar_i(o,v);}
  256. inline void SequencerPluginGUI::cb_BarLength_i(Fl_Knob* o, void* v)
  257. {
  258. if (o->value()!=0)
  259. {
  260. m_GUICH->Set("BarLength",(float)o->value());
  261. m_ArrangementMap->SetBarLength(o->value());
  262. m_ArrangementMap->redraw();
  263. for (map<int,PatternWin*>::iterator i=m_PatternWinMap.begin();
  264. i!=m_PatternWinMap.end(); i++)
  265. {
  266. i->second->GetEventMap()->SetBarLength(o->value());
  267. i->second->GetEventMap()->redraw();
  268. }
  269. redraw();
  270. }
  271. }
  272. void SequencerPluginGUI::cb_BarLength(Fl_Knob* o, void* v)
  273. { ((SequencerPluginGUI*)(o->parent()))->cb_BarLength_i(o,v);}
  274. inline void SequencerPluginGUI::cb_Speed_i(Fl_Knob* o, void* v)
  275. {
  276. //m_Plugin->SetSpeed(o->value()-2.0f);
  277. }
  278. void SequencerPluginGUI::cb_Speed(Fl_Knob* o, void* v)
  279. { ((SequencerPluginGUI*)(o->parent()))->cb_Speed_i(o,v);}
  280. inline void SequencerPluginGUI::cb_Clear_i(Fl_Button* o, void* v)
  281. {
  282. //m_Plugin->ClearAll();
  283. }
  284. void SequencerPluginGUI::cb_Clear(Fl_Button* o, void* v)
  285. { ((SequencerPluginGUI*)(o->parent()))->cb_Clear_i(o,v);}
  286. /// sequence callbacks /////////////////////////////////////////////////////////
  287. inline void SequencerPluginGUI::cb_NewPattern_i(Fl_Button* o, void* v)
  288. {
  289. int eid = m_ArrangementMap->AddEventTime(1,50,2,Fl_SEvent::NO_TYPE);
  290. m_ArrangementMap->GetEvent(eid)->SetName("My Pattern");
  291. m_PatternWinMap[eid] = new PatternWin(400,200,m_ArrangementMap->GetEvent(eid)->GetName().c_str());
  292. Fl_EventMap *map = m_PatternWinMap[eid]->GetEventMap();
  293. Fl_SEvent *event = m_ArrangementMap->GetEvent(eid);
  294. // setup the stuff needed by the callbacks
  295. map->user_data((void*)this);
  296. map->SetID(eid);
  297. m_GUICH->Set("ID",eid);
  298. m_GUICH->Set("ID2",event->GetColour());
  299. char t[256];
  300. sprintf(t,"%s",event->GetName().c_str());
  301. m_GUICH->SetData("Name",(void*)t);
  302. m_GUICH->Set("Length",event->GetLengthTime());
  303. m_GUICH->Set("Channel",event->GetChannel());
  304. m_GUICH->Set("Note",event->GetGroup());
  305. m_GUICH->SetCommand(SequencerPlugin::NEW_SEQ);
  306. redraw();
  307. }
  308. void SequencerPluginGUI::cb_NewPattern(Fl_Button* o, void* v)
  309. { ((SequencerPluginGUI*)(o->parent()))->cb_NewPattern_i(o,v);}
  310. inline void SequencerPluginGUI::cb_Rename_i(Fl_Widget* o, void* v)
  311. {
  312. Fl_SEvent *event = ((Fl_SEvent*)v);
  313. const char *name = fl_input("Rename the sequence:",
  314. m_ArrangementMap->GetEvent(event->GetID())->GetName().c_str());
  315. if (name) m_ArrangementMap->GetEvent(event->GetID())->SetName(name);
  316. ChangeSequenceHelper(event);
  317. redraw();
  318. }
  319. void SequencerPluginGUI::cb_Rename(Fl_Widget* o, void* v)
  320. { ((SequencerPluginGUI*)(o->parent()->parent()->user_data()))->cb_Rename_i(o,v);}
  321. inline void SequencerPluginGUI::cb_Recolour_i(Fl_Widget* o, void* v)
  322. {
  323. Fl_SEvent *event = ((Fl_SEvent*)v);
  324. unsigned char r=255,g=255,b=255;
  325. if (fl_color_chooser("colour",r,g,b))
  326. {
  327. fl_color(r,g,b);
  328. Fl_Color col=fl_color();
  329. m_ArrangementMap->GetEvent(event->GetID())->SetColour(col);
  330. ChangeSequenceHelper(event);
  331. redraw();
  332. }
  333. }
  334. void SequencerPluginGUI::cb_Recolour(Fl_Widget* o, void* v)
  335. { ((SequencerPluginGUI*)(o->parent()->parent()->user_data()))->cb_Recolour_i(o,v);}
  336. inline void SequencerPluginGUI::cb_RemoveSequence_i(Fl_Widget* o, void* v)
  337. {
  338. Fl_SEvent *event = ((Fl_SEvent*)v);
  339. Fl_EventMap *map = ((Fl_EventMap*)event->parent());
  340. event->KillMe();
  341. map->redraw();
  342. m_GUICH->Set("ID",event->GetID());
  343. m_GUICH->SetCommand(SequencerPlugin::REM_SEQ);
  344. }
  345. void SequencerPluginGUI::cb_RemoveSequence(Fl_Widget* o, void* v)
  346. { ((SequencerPluginGUI*)(o->parent()->parent()->user_data()))->cb_RemoveSequence_i(o,v);}
  347. inline void SequencerPluginGUI::cb_Copy_i(Fl_Widget* o, void* v)
  348. {
  349. Fl_SEvent *event = ((Fl_SEvent*)v);
  350. int NewID = m_ArrangementMap->CopyEvent(event->x()+event->w(),event->y(),event->w(),event->GetID(), event->GetLengthTime());
  351. m_PatternWinMap[NewID] = new PatternWin(400,200,m_ArrangementMap->GetEvent(NewID)->GetName().c_str());
  352. m_PatternWinMap[NewID]->GetEventMap()->user_data((void*)this);
  353. m_PatternWinMap[NewID]->GetEventMap()->SetID(NewID);
  354. m_GUICH->Set("ID",event->GetID());
  355. m_GUICH->Set("ID2",NewID);
  356. m_GUICH->SetCommand(SequencerPlugin::COPY_SEQ);
  357. LoadPatternData(NewID);
  358. }
  359. void SequencerPluginGUI::cb_Copy(Fl_Widget* o, void* v)
  360. { ((SequencerPluginGUI*)(o->parent()->parent()->user_data()))->cb_Copy_i(o,v);}
  361. inline void SequencerPluginGUI::cb_MoveSequence_i(Fl_Widget* o, void* v)
  362. {
  363. Fl_SEvent *event = ((Fl_SEvent*)o);
  364. m_PatternWinMap[event->GetID()]->GetEventMap()->SetTimeOffset(event->GetStartTime());
  365. ChangeSequenceHelper(event);
  366. }
  367. void SequencerPluginGUI::cb_MoveSequence(Fl_Widget* o, void* v)
  368. { ((SequencerPluginGUI*)(o->parent()->user_data()))->cb_MoveSequence_i(o,v);}
  369. inline void SequencerPluginGUI::cb_ArrangeRM_i(Fl_Button* o, void* v)
  370. {
  371. int ID=((Fl_SEvent*)o)->GetID();
  372. if (m_PatternWinMap[ID]->shown()) m_PatternWinMap[ID]->hide();
  373. else m_PatternWinMap[ID]->show();
  374. }
  375. void SequencerPluginGUI::cb_ArrangeRM(Fl_Button* o, void* v)
  376. { ((SequencerPluginGUI*)(o->parent()->user_data()))->cb_ArrangeRM_i(o,v);}
  377. #include <unistd.h>
  378. inline void SequencerPluginGUI::cb_Edit_i(Fl_Widget* o, void* v)
  379. {
  380. Fl_SEvent *event = ((Fl_SEvent*)v);
  381. Fl_Double_Window *EditWin = new Fl_Double_Window(100,100,"Properties");
  382. Fl_Button *exit = new Fl_Button(10,80,80,10,"Exit");
  383. exit->labelsize(8);
  384. Fl_Counter *channel = new Fl_Counter(5,10,90,20,"Channel");
  385. channel->labelsize(8);
  386. channel->textsize(8);
  387. channel->type(FL_SIMPLE_COUNTER);
  388. channel->step(1);
  389. channel->value(event->GetChannel());
  390. EditWin->show();
  391. while (!exit->value() || !EditWin->shown())
  392. {
  393. Fl::check();
  394. usleep(10000);
  395. }
  396. event->SetChannel((int)channel->value());
  397. ChangeSequenceHelper(event);
  398. redraw();
  399. EditWin->hide();
  400. }
  401. void SequencerPluginGUI::cb_Edit(Fl_Widget* o, void* v)
  402. { ((SequencerPluginGUI*)(o->parent()->parent()->user_data()))->cb_Edit_i(o,v);}
  403. /// note callbacks ///////////////////////////////////////////////////////////////
  404. inline void SequencerPluginGUI::cb_NewNote_i(Fl_Widget* o, void* v)
  405. {
  406. Fl_SEvent *event = ((Fl_SEvent*)o);
  407. Fl_EventMap *map = ((Fl_EventMap*)o->parent());
  408. m_GUICH->Set("ID",event->GetID());
  409. m_GUICH->Set("Sequence",map->GetID());
  410. m_GUICH->Set("Time",event->GetStartTime());
  411. m_GUICH->Set("Length",event->GetLengthTime());
  412. m_GUICH->Set("Note",event->GetGroup());
  413. m_GUICH->Set("Vol",1.0f);
  414. m_GUICH->SetCommand(SequencerPlugin::NEW_NOTE);
  415. }
  416. void SequencerPluginGUI::cb_NewNote(Fl_Widget* o, void* v)
  417. { ((SequencerPluginGUI*)(o->parent()->user_data()))->cb_NewNote_i(o,v);}
  418. inline void SequencerPluginGUI::cb_MoveNote_i(Fl_Widget* o, void* v)
  419. {
  420. Fl_SEvent *event = ((Fl_SEvent*)o);
  421. Fl_EventMap *map = ((Fl_EventMap*)o->parent());
  422. m_GUICH->Set("ID",event->GetID());
  423. m_GUICH->Set("Sequence",map->GetID());
  424. m_GUICH->Set("Time",event->GetStartTime());
  425. m_GUICH->Set("Length",event->GetLengthTime());
  426. m_GUICH->Set("Note",event->GetGroup());
  427. m_GUICH->Set("Vol",1.0f);
  428. m_GUICH->SetCommand(SequencerPlugin::CHG_NOTE);
  429. }
  430. void SequencerPluginGUI::cb_MoveNote(Fl_Widget* o, void* v)
  431. { ((SequencerPluginGUI*)(o->parent()->user_data()))->cb_MoveNote_i(o,v);}
  432. inline void SequencerPluginGUI::cb_RemoveNote_i(Fl_Widget* o, void* v)
  433. {
  434. Fl_SEvent *event = ((Fl_SEvent*)v);
  435. Fl_EventMap *map = ((Fl_EventMap*)event->parent());
  436. event->KillMe();
  437. map->redraw();
  438. m_GUICH->Set("ID",event->GetID());
  439. m_GUICH->Set("Sequence",map->GetID());
  440. m_GUICH->SetCommand(SequencerPlugin::REM_NOTE);
  441. }
  442. void SequencerPluginGUI::cb_RemoveNote(Fl_Widget* o, void* v)
  443. { ((SequencerPluginGUI*)(o->parent()->parent()->user_data()))->cb_RemoveNote_i(o,v);}