Loop.cpp 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118
  1. /*
  2. ==============================================================================
  3. This is an automatically generated GUI class created by the Introjucer!
  4. Be careful when adding custom code to these files, as only the code within
  5. the "//[xyz]" and "//[/xyz]" sections will be retained when the file is loaded
  6. and re-saved.
  7. Created with Introjucer version: 3.1.0
  8. ------------------------------------------------------------------------------
  9. The Introjucer is part of the JUCE library - "Jules' Utility Class Extensions"
  10. Copyright 2004-13 by Raw Material Software Ltd.
  11. ==============================================================================
  12. */
  13. //[Headers] You can add your own extra header files here...
  14. //[/Headers]
  15. #include "Loop.h"
  16. //[MiscUserDefs] You can add your own user definitions and misc code here...
  17. //[/MiscUserDefs]
  18. //==============================================================================
  19. Loop::Loop ()
  20. {
  21. setName ("Loop");
  22. addAndMakeVisible (progressBar = new ProgressBar (this->loopProgress = 0.0));
  23. progressBar->setName ("progressBar");
  24. //[UserPreSize]
  25. progressBar->setColour(ProgressBar::backgroundColourId , Colour(0x00000000));
  26. //[/UserPreSize]
  27. setSize (256, 16);
  28. //[Constructor] You can add your own custom stuff here..
  29. //[/Constructor]
  30. }
  31. Loop::~Loop()
  32. {
  33. //[Destructor_pre]. You can add your own custom destruction code here..
  34. //[/Destructor_pre]
  35. progressBar = nullptr;
  36. //[Destructor]. You can add your own custom destruction code here..
  37. //[/Destructor]
  38. }
  39. //==============================================================================
  40. void Loop::paint (Graphics& g)
  41. {
  42. //[UserPrePaint] Add your own custom painting code here..
  43. UNUSED(g) ;
  44. //[/UserPrePaint]
  45. //[UserPaint] Add your own custom painting code here..
  46. //[/UserPaint]
  47. }
  48. void Loop::resized()
  49. {
  50. progressBar->setBounds (0, 0, getWidth() - 0, getHeight() - 0);
  51. //[UserResized] Add your own custom resize handling here..
  52. //[/UserResized]
  53. }
  54. //[MiscUserCode] You can add your own definitions of your custom methods or any other code here...
  55. void Loop::updateBeatN(int beat_n)
  56. {
  57. this->progressBar->setTextToDisplay(String(beat_n)) ;
  58. }
  59. //[/MiscUserCode]
  60. //==============================================================================
  61. #if 0
  62. /* -- Introjucer information section --
  63. This is where the Introjucer stores the metadata that describe this GUI layout, so
  64. make changes in here at your peril!
  65. BEGIN_JUCER_METADATA
  66. <JUCER_COMPONENT documentType="Component" className="Loop" componentName="Loop"
  67. parentClasses="public Component" constructorParams="" variableInitialisers=""
  68. snapPixels="8" snapActive="1" snapShown="1" overlayOpacity="0.330"
  69. fixedSize="0" initialWidth="256" initialHeight="16">
  70. <BACKGROUND backgroundColour="0"/>
  71. <GENERICCOMPONENT name="progressBar" id="de373a8913a42503" memberName="progressBar"
  72. virtualName="" explicitFocusOrder="0" pos="0 0 0M 0M" class="ProgressBar"
  73. params="this-&gt;loopProgress = 0.0"/>
  74. </JUCER_COMPONENT>
  75. END_JUCER_METADATA
  76. */
  77. #endif
  78. //[EndFile] You can add extra defines here...
  79. //[/EndFile]