Programmable real-time audio signal processing application
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.

cmGrScFltk.h 1.8KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. #ifndef cmGrScFltk_h
  2. #define cmGrScFltk_h
  3. class Fl_Menu_Bar;
  4. class cmdIf;
  5. class cmGrScFltk : public cmGrPlotFltk, public gvHashFuncArg
  6. {
  7. public:
  8. cmGrScFltk(cmCtx_t* ctx, cmdIf* cp, Fl_Menu_Bar* menuBar, int x, int y, int w, int h);
  9. virtual ~cmGrScFltk();
  10. virtual cmScMsgTypeId_t recvScoreMsg( const void* msg, unsigned msgByteCnt );
  11. void setSampleRate( double srate );
  12. virtual double sampleRate() const;
  13. virtual bool on_plot_object( cmGrPlotCbArg_t* arg );
  14. virtual void selectBar( unsigned barNumb );
  15. virtual unsigned scoreSelectedEleIndex() const;
  16. virtual void setScoreLocation( unsigned locIdx, unsigned vel, unsigned smpIdx );
  17. private:
  18. enum
  19. {
  20. kOkRC,
  21. kInsertObjFailRC
  22. };
  23. enum
  24. {
  25. kPitchMId,
  26. kAttrMId,
  27. kDynMId,
  28. kLocIdxMId,
  29. kFracMId,
  30. kSectEvenMId,
  31. kSectDynMId,
  32. kSectTempoMId,
  33. kMenuItemCnt
  34. };
  35. typedef struct
  36. {
  37. cmGrScFltk* p;
  38. int id;
  39. } item_t;
  40. typedef struct scObj_str
  41. {
  42. cmScMsgTypeId_t id; // kEventMsgScId | kSectionMsgScId
  43. union
  44. {
  45. const cmScoreEvt_t* ep;
  46. const cmScoreSection_t* sp;
  47. } u;
  48. scObj_str( const cmScoreEvt_t* e) : id(kEventMsgScId) {u.ep=e;}
  49. scObj_str( const cmScoreSection_t* s) : id(kSectionMsgScId) {u.sp=s;}
  50. } scObj_t;
  51. double _srate;
  52. cmErr_t _err;
  53. cmdIf* _cmdIf;
  54. Fl_Menu_Bar* _menuBar;
  55. unsigned _samplesMetricId;
  56. unsigned _secondsMetricId;
  57. double _objSecs;
  58. unsigned _objId;
  59. bool _togFl;
  60. cmGrPlObjH_t _lastBarPlotObjH;
  61. item_t _menuArray[ kMenuItemCnt ];
  62. void _insertSection( const cmScoreSection_t* s );
  63. void _insertEvent( const cmScoreEvt_t* m );
  64. void _createMenu();
  65. bool _isMenuChecked( int id );
  66. void _setEventLabels();
  67. void _setSectionLabels();
  68. static void _s_menuCallback(Fl_Widget* w, void* arg);
  69. };
  70. #endif