mirror of
				https://github.com/AquaMorph/Droplets.git
				synced 2025-10-30 08:03:20 +00:00 
			
		
		
		
	Sequencer graph title
This commit is contained in:
		| @@ -5,12 +5,16 @@ SequencerDroplet::SequencerDroplet(DaisyPatch* m_patch, | |||||||
| 				 float sample_rate) : | 				 float sample_rate) : | ||||||
|   Droplet(m_patch, |   Droplet(m_patch, | ||||||
| 	  m_state) { | 	  m_state) { | ||||||
|  |   SetAnimationRate(20); | ||||||
|  |   CreateTitleGraph(); | ||||||
|   SetDimensions(); |   SetDimensions(); | ||||||
|   SetControls(); |   SetControls(); | ||||||
|   SetInMenu(); |   SetInMenu(); | ||||||
| } | } | ||||||
|  |  | ||||||
| SequencerDroplet::~SequencerDroplet() {} | SequencerDroplet::~SequencerDroplet() { | ||||||
|  |   delete title_graph; | ||||||
|  | } | ||||||
|  |  | ||||||
| void SequencerDroplet::Control() { | void SequencerDroplet::Control() { | ||||||
|   Patch()->ProcessAnalogControls(); |   Patch()->ProcessAnalogControls(); | ||||||
| @@ -109,12 +113,20 @@ void SequencerDroplet::Draw() { | |||||||
| 	      56, | 	      56, | ||||||
| 	      length_text, | 	      length_text, | ||||||
| 	      !InMenu()); | 	      !InMenu()); | ||||||
|  |  | ||||||
|  |   if(NeedUpdate()) { | ||||||
|  |     title_graph->Update(); | ||||||
|  |   } | ||||||
|  |   title_graph->SetPixelPercentage(sequence[step]/5.0f); | ||||||
|  |   title_graph->Draw(Patch(), GetScreenMin(), 0); | ||||||
|   DrawName("Sequencer"); |   DrawName("Sequencer"); | ||||||
| } | } | ||||||
|  |  | ||||||
| void SequencerDroplet::UpdateStateCallback() { | void SequencerDroplet::UpdateStateCallback() { | ||||||
|   SetDimensions(); |   SetDimensions(); | ||||||
|   SetInMenu(); |   SetInMenu(); | ||||||
|  |   delete title_graph; | ||||||
|  |   CreateTitleGraph(); | ||||||
| } | } | ||||||
|  |  | ||||||
| void SequencerDroplet::SetControls() { | void SequencerDroplet::SetControls() { | ||||||
| @@ -157,3 +169,8 @@ void SequencerDroplet::SetInMenu() { | |||||||
|   selected = 0; |   selected = 0; | ||||||
|   AdjustSelected(-1); |   AdjustSelected(-1); | ||||||
| } | } | ||||||
|  |  | ||||||
|  | void SequencerDroplet::CreateTitleGraph() { | ||||||
|  |   title_graph = new Graph(GetScreenMax()-GetScreenMin(), | ||||||
|  | 			  GetTitleHeight()); | ||||||
|  | } | ||||||
|   | |||||||
| @@ -8,6 +8,7 @@ | |||||||
|  |  | ||||||
| #include "droplet.h" | #include "droplet.h" | ||||||
| #include "../util.h" | #include "../util.h" | ||||||
|  | #include "../graphics/graph.h" | ||||||
|  |  | ||||||
| #define MAX_SEQUENCE_LENGTH 32 | #define MAX_SEQUENCE_LENGTH 32 | ||||||
| #define CONTROL_DEADZONE 0.00499f | #define CONTROL_DEADZONE 0.00499f | ||||||
| @@ -26,6 +27,7 @@ private: | |||||||
|   Parameter control[4]; |   Parameter control[4]; | ||||||
|   float last_control_value[4] = { 0.0f }; |   float last_control_value[4] = { 0.0f }; | ||||||
|   std::string length_text = ""; |   std::string length_text = ""; | ||||||
|  |   Graph* title_graph; | ||||||
|  |  | ||||||
|   /* |   /* | ||||||
|    * Set the sequencer to the next step. |    * Set the sequencer to the next step. | ||||||
| @@ -60,6 +62,11 @@ private: | |||||||
|    * Set sequancer in the menu. |    * Set sequancer in the menu. | ||||||
|    */ |    */ | ||||||
|   void SetInMenu(); |   void SetInMenu(); | ||||||
|  |  | ||||||
|  |   /* | ||||||
|  |    * Create a new graph for the title bar. | ||||||
|  |    */ | ||||||
|  |   void CreateTitleGraph(); | ||||||
| public: | public: | ||||||
|   /* |   /* | ||||||
|    * Constructor for a droplet. |    * Constructor for a droplet. | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user