Loop.cpp 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115
  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. //[/UserPrePaint]
  44. //[UserPaint] Add your own custom painting code here..
  45. //[/UserPaint]
  46. }
  47. void Loop::resized()
  48. {
  49. progressBar->setBounds (0, 0, getWidth() - 0, getHeight() - 0);
  50. //[UserResized] Add your own custom resize handling here..
  51. //[/UserResized]
  52. }
  53. //[MiscUserCode] You can add your own definitions of your custom methods or any other code here...
  54. void Loop::updateBeat(int beat_n)
  55. { this->progressBar->setTextToDisplay(String(beat_n)) ; }
  56. //[/MiscUserCode]
  57. //==============================================================================
  58. #if 0
  59. /* -- Introjucer information section --
  60. This is where the Introjucer stores the metadata that describe this GUI layout, so
  61. make changes in here at your peril!
  62. BEGIN_JUCER_METADATA
  63. <JUCER_COMPONENT documentType="Component" className="Loop" componentName="Loop"
  64. parentClasses="public Component" constructorParams="" variableInitialisers=""
  65. snapPixels="8" snapActive="1" snapShown="1" overlayOpacity="0.330"
  66. fixedSize="0" initialWidth="256" initialHeight="16">
  67. <BACKGROUND backgroundColour="0"/>
  68. <GENERICCOMPONENT name="progressBar" id="de373a8913a42503" memberName="progressBar"
  69. virtualName="" explicitFocusOrder="0" pos="0 0 0M 0M" class="ProgressBar"
  70. params="this-&gt;loopProgress = 0.0"/>
  71. </JUCER_COMPONENT>
  72. END_JUCER_METADATA
  73. */
  74. #endif
  75. //[EndFile] You can add extra defines here...
  76. //[/EndFile]