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.

tlCtl.h 2.8KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  1. #ifndef tlCtl_h
  2. #define tlCtl_h
  3. class Fl_Menu_Bar;
  4. class cmGrTlFltk;
  5. class cmGrScFltk;
  6. class cmGrTksbFltk;
  7. class cmGrTksrFltk;
  8. class cmGr2dFltk;
  9. class tlStatusWnd;
  10. class tlCtl;
  11. class tlCtlRspdr
  12. {
  13. public:
  14. virtual ~tlCtlRspdr(){}
  15. virtual void tlCtlNewTimeLineFile( tlCtl* tlCtl, const cmChar_t* fn ) = 0;
  16. virtual void tlCtlNewScoreFile( tlCtl* tlCtl, const cmChar_t* fn ) = 0;
  17. };
  18. class tlCtl : public cmdIfRspdr
  19. {
  20. public:
  21. tlCtl( cmCtx_t* ctx, Fl_Window* app, Fl_Menu_Bar* menuBar, tlCtlRspdr* rspdr );
  22. virtual ~tlCtl();
  23. //
  24. // This group of functions represent commands from the application (kcApp) to the
  25. // time-line control.
  26. //
  27. Fl_Widget* initTimeLineCtlr( int x, int y, int w, int h );
  28. Fl_Widget* initScoreCtlr( int x, int y, int w, int h );
  29. Fl_Widget* initTakeSeqBldrCtlr( int x, int y, int w, int h );
  30. Fl_Widget* initTakeSeqRendCtlr( int x, int y, int w, int h );
  31. Fl_Widget* init2dCtlr( int x, int y, int w, int h );
  32. void openTlFile( const cmChar_t* fn );
  33. void openScoreFile( const cmChar_t* fn );
  34. void openTakeSeqBldr( void* v );
  35. void openTakeSeqRend( void* v );
  36. void setAudioFilePath( const cmChar_t* path );
  37. void setAudioFileCursor( unsigned smpIdx );
  38. void setTimeLineSelectBar( unsigned barNumb );
  39. void setScoreSelectBar( unsigned barNumb );
  40. // Set the currrent score location
  41. void setScoreLocation( unsigned locIdx, unsigned smpIdx, unsigned pitch, unsigned vel );
  42. // Set the value of a score variable.
  43. void setScoreVarValue( unsigned locIdx, unsigned varId, double value );
  44. // Set the performed dynamic level of a score event.
  45. void setScoreDynLevel( unsigned evtIdx, unsigned dynLvl );
  46. void refreshTakeSeqRend();
  47. void onIdle();
  48. //
  49. // cmdIfRspdr Interface
  50. //
  51. // These functions are callbacks from cmdIf to communicate
  52. // from cmdIf processes to the UI or back to the engine.
  53. virtual void cmdIfShowStatusMsg( const char* msg );
  54. virtual void cmdIfHideStatus();
  55. virtual void cmdIfErrorMsg( const char* msg );
  56. virtual void cmdIfTimeLineMsg( const void* msg, unsigned msgByteCnt );
  57. virtual void cmdIfAudioFileLoad( unsigned fileId );
  58. virtual void cmdIfScoreMsg( const void* msg, unsigned msgByteCnt );
  59. virtual void cmdIfOnTimeLineMarkerSelect( unsigned markerId );
  60. virtual void cmdIfOnTimeLineMidiEvtSelect(unsigned midiEvtId );
  61. virtual void cmdIfOnScoreBarSelect( unsigned scoreIndex );
  62. unsigned timeLineSelectedMarkerId() const;
  63. unsigned scoreSelectedEleIndex() const;
  64. unsigned tksbSelectedEleIndex() const;
  65. void testStub();
  66. private:
  67. cmErr_t _err;
  68. cmCtx_t* _ctx;
  69. tlCtlRspdr* _rspdr;
  70. cmdIf* _cmdIf;
  71. cmGrTlFltk* _tlCtlr;
  72. cmGrScFltk* _scCtlr;
  73. cmGrTksbFltk* _tksbCtlr;
  74. cmGrTksrFltk* _tksrCtlr;
  75. cmGr2dFltk* _2dCtlr;
  76. tlStatusWnd* _statusWnd;
  77. Fl_Menu_Bar* _menu;
  78. };
  79. #endif