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.

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