BBTrackContainer.h 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  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(TimePos start, const fpp_t frames, const f_cnt_t frameBase, int tcoNum = -1);
  36. void updateAfterTrackAdd() override;
  37. inline QString nodeName() const override
  38. {
  39. return "bbtrackcontainer";
  40. }
  41. bar_t lengthOfBB(int bb) const;
  42. inline bar_t lengthOfCurrentBB()
  43. {
  44. return lengthOfBB(currentBB());
  45. }
  46. int numOfBBs() const;
  47. void removeBB(int bb);
  48. void swapBB(int bb1, int bb2);
  49. void updateBBTrack(TrackContentObject * tco);
  50. void fixIncorrectPositions();
  51. void createTCOsForBB(int bb);
  52. AutomatedValueMap automatedValuesAt(TimePos time, int tcoNum) const override;
  53. public slots:
  54. void play();
  55. void stop();
  56. void updateComboBox();
  57. void currentBBChanged();
  58. private:
  59. ComboBoxModel m_bbComboBoxModel;
  60. friend class BBEditor;
  61. } ;
  62. #endif