BBTrackContainer.h 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. /*
  2. * BBTrackContainer.h - model-component of BB-Editor
  3. *
  4. * Copyright (c) 2004-2014 Tobias Doerffel <tobydox/at/users.sourceforge.net>
  5. *
  6. * This file is part of LMMS - https://lmms.io
  7. *
  8. * This program is free software; you can redistribute it and/or
  9. * modify it under the terms of the GNU General Public
  10. * License as published by the Free Software Foundation; either
  11. * version 2 of the License, or (at your option) any later version.
  12. *
  13. * This program is distributed in the hope that it will be useful,
  14. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  15. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  16. * General Public License for more details.
  17. *
  18. * You should have received a copy of the GNU General Public
  19. * License along with this program (see COPYING); if not, write to the
  20. * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
  21. * Boston, MA 02110-1301 USA.
  22. *
  23. */
  24. #ifndef BB_TRACK_CONTAINER_H
  25. #define BB_TRACK_CONTAINER_H
  26. #include "TrackContainer.h"
  27. #include "ComboBoxModel.h"
  28. class LMMS_EXPORT BBTrackContainer : public TrackContainer
  29. {
  30. Q_OBJECT
  31. mapPropertyFromModel(int,currentBB,setCurrentBB,m_bbComboBoxModel);
  32. public:
  33. BBTrackContainer();
  34. virtual ~BBTrackContainer();
  35. virtual bool play( MidiTime _start, const fpp_t _frames,
  36. const f_cnt_t _frame_base, int _tco_num = -1 );
  37. void updateAfterTrackAdd() override;
  38. inline QString nodeName() const override
  39. {
  40. return "bbtrackcontainer";
  41. }
  42. bar_t lengthOfBB( int _bb ) const;
  43. inline bar_t lengthOfCurrentBB()
  44. {
  45. return lengthOfBB( currentBB() );
  46. }
  47. int numOfBBs() const;
  48. void removeBB( int _bb );
  49. void swapBB( int _bb1, int _bb2 );
  50. void updateBBTrack( TrackContentObject * _tco );
  51. void fixIncorrectPositions();
  52. void createTCOsForBB( int _bb );
  53. AutomatedValueMap automatedValuesAt(MidiTime time, int tcoNum) const override;
  54. public slots:
  55. void play();
  56. void stop();
  57. void updateComboBox();
  58. void currentBBChanged();
  59. private:
  60. ComboBoxModel m_bbComboBoxModel;
  61. friend class BBEditor;
  62. } ;
  63. #endif