@@ -44,7 +44,8 @@ namespace LfpViewer {
4444 bitmap is drawn by the LfpViewport using Viewport::setViewedComponent.
4545
4646 */
47- class LfpDisplay : public Component , public Timer
47+ class LfpDisplay : public Component ,
48+ public Timer
4849{
4950public:
5051
@@ -96,15 +97,25 @@ class LfpDisplay : public Component, public Timer
9697 /* * Returns the display range for the specified channel type */
9798 int getRange (ContinuousChannel::Type type);
9899
100+ /* * Sets the channel height in pixels */
99101 void setChannelHeight (int r, bool resetSingle = true );
102+
103+ /* * Returns the channel height in pixels */
100104 int getChannelHeight ();
101-
102- ChannelColourScheme * getColourSchemePtr ();
103-
105+
104106 /* * Caches a new channel height without updating the channels */
105107 void cacheNewChannelHeight (int r);
106108
109+ /* * Gets a pointer to the current color scheme */
110+ ChannelColourScheme* getColourSchemePtr ();
111+
112+ /* * Sets whether the input should be inverted */
107113 void setInputInverted (bool );
114+
115+ /* * Returns whether the input should be inverted across all channels */
116+ Array<bool > getInputInverted ();
117+
118+ /* * Changes between super-sampled and per-pixel plotter */
108119 void setDrawMethod (bool );
109120
110121 /* * Returns a bool indicating if the channels are displayed in reverse order (true) */
@@ -115,30 +126,50 @@ class LfpDisplay : public Component, public Timer
115126
116127 /* * Reorders the displayed channels by depth if state == true and normal if false */
117128 void orderChannelsByDepth (bool state);
129+
130+ /* * Returns true if channels are ordered by depth */
131+ bool shouldOrderChannelsByDepth ();
118132
119133 /* * Returns a factor of 2 by which the displayed channels should skip */
120134 int getChannelDisplaySkipAmount ();
121135
122136 /* * Set the amount of channels to skip (hide) between each that is displayed */
123137 void setChannelDisplaySkipAmount (int skipAmt);
124138
139+ /* * Updates colors across channels */
125140 void setColors ();
126141
142+ /* * Sets the index of the selected color scheme */
127143 void setActiveColourSchemeIdx (int index);
144+
145+ /* * Gets the index of the selected color scheme */
128146 int getActiveColourSchemeIdx ();
129147
148+ /* * Returns the number of available color schemes*/
130149 int getNumColourSchemes ();
150+
151+ /* * Returns the names of the available color schemes*/
131152 StringArray getColourSchemeNameArray ();
132153
133- bool setEventDisplayState (int ch, bool state);
134- bool getEventDisplayState (int ch);
154+ /* * Sets whether events are displayed for a particular ttl line*/
155+ bool setEventDisplayState (int ttlLine, bool state);
156+
157+ /* * Returns whether events are displayed for a particular ttl line */
158+ bool getEventDisplayState (int ttlLine);
135159
160+ /* * Returns the number of adjacent channels of each color */
136161 int getColorGrouping ();
162+
163+ /* * Sets the number of adjacent channels of each color */
137164 void setColorGrouping (int i);
138165
166+ /* * Sets whether a particular channel is enabled */
139167 void setEnabledState (bool state, int chan, bool updateSavedChans = true );
140- bool getEnabledState (int );
168+
169+ /* * Returns whether a particular channel is enabled */
170+ bool getEnabledState (int chan);
141171
172+ /* * Sets the scroll offset for this display*/
142173 void setScrollPosition (int x, int y);
143174
144175 /* * Returns true if the median offset is enabled for plotting, else false */
@@ -187,9 +218,8 @@ class LfpDisplay : public Component, public Timer
187218 LfpChannelDisplayInfo* channelInfo;
188219 };
189220
190- Array<LfpChannelTrack> drawableChannels; // holds the channels and info that are
191- // drawable to the screen
192-
221+ /* * Holds the channels that are being drawn */
222+ Array<LfpChannelTrack> drawableChannels;
193223
194224 /* * Set the viewport's channel focus behavior.
195225
@@ -214,18 +244,25 @@ class LfpDisplay : public Component, public Timer
214244 /* * Returns a const pointer to the internally managed plotter method class */
215245 LfpBitmapPlotter * const getPlotterPtr () const ;
216246
247+ /* * Current background color (based on the selected color scheme)*/
217248 Colour backgroundColour;
218249
250+ /* * Array of channel colors (based on the selected color scheme*/
219251 Array<Colour> channelColours;
220252
221- OwnedArray<LfpChannelDisplay> channels; // all channels
222- OwnedArray<LfpChannelDisplayInfo> channelInfo; // all channelInfos
253+ /* * All available channels (even ones that are not drawn) */
254+ OwnedArray<LfpChannelDisplay> channels;
223255
224- void timerCallback () override ;
225-
256+ /* * All available display info objects (even ones that are not drawn) */
257+ OwnedArray<LfpChannelDisplayInfo> channelInfo;
258+
259+ /* * Holds state of event display for first 8 ttl lines */
226260 bool eventDisplayEnabled[8 ];
227- bool displayIsPaused = false ; // simple pause function, skips screen buffer updates
228261
262+ /* * Enables simple pause function by skipping screen buffer updates */
263+ bool displayIsPaused = false ;
264+
265+ /* * Pointer to display options*/
229266 LfpDisplayOptions* options;
230267
231268 /* * Convenience struct to store all variables particular to zooming mechanics */
@@ -246,13 +283,19 @@ class LfpDisplay : public Component, public Timer
246283 bool unpauseOnScrollEnd;
247284 };
248285
249- TrackZoomInfo_Struct trackZoomInfo; // and create an instance here
286+ /* * Instance of trackZoomInfo struct */
287+ TrackZoomInfo_Struct trackZoomInfo;
250288
289+ /* * Stores whether or not channels are enabled */
251290 Array<bool > savedChannelState;
252291
292+ /* * x-index of display bitmap updated on previous refresh */
253293 int lastBitmapIndex;
254294
255295private:
296+
297+ /* * Used to throttle refresh speed when scrolling backwards */
298+ void timerCallback () override ;
256299
257300 int singleChan;
258301
@@ -266,7 +309,10 @@ class LfpDisplay : public Component, public Timer
266309
267310 int numChans;
268311 int displaySkipAmt;
269- int cachedDisplayChannelHeight; // holds a channel height if reset during single channel focus
312+
313+ /* * Holds a channel height if reset during single channel focus */
314+ int cachedDisplayChannelHeight;
315+
270316 float drawableSampleRate;
271317 uint32 drawableSubprocessor;
272318
@@ -297,5 +343,5 @@ class LfpDisplay : public Component, public Timer
297343 OwnedArray<ChannelColourScheme> colourSchemeList;
298344};
299345
300- }; // namespace
346+ }; // end LfpViewer namespace
301347#endif
0 commit comments