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.

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