Programmable real-time audio signal processing application
Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

tlCtl.h 3.0KB

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