-
Notifications
You must be signed in to change notification settings - Fork 141
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rename NoteBitmapDisplay → BitmapDisplay
- Loading branch information
Showing
7 changed files
with
58 additions
and
49 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
src/Display/NoteBitmapDisplay.cpp → src/Display/BitmapDisplay.cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
#ifdef TEST_COMPILE_ALL_HEADERS_SEPARATELY | ||
#include "NoteBitmapDisplay.hpp" | ||
#include "BitmapDisplay.hpp" | ||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
#pragma once | ||
|
||
#include <AH/STL/utility> // std::forward | ||
#include <Display/Bitmaps/XBitmaps.hpp> | ||
#include <Display/DisplayElement.hpp> | ||
#include <MIDI_Inputs/InterfaceMIDIInputElements.hpp> | ||
|
||
BEGIN_CS_NAMESPACE | ||
|
||
/// A class that displays a bitmap depending on the state of a MIDINote or any | ||
/// other object that has a `getValue()` method that returns true (or anything | ||
/// that evaluates to true) when the bitmap has to be displayed, as wel as a | ||
/// pair of `getDirty()`/`clearDirty()` methods to determine whether the display | ||
/// has to be updated. | ||
template <class Value_t = Interfaces::IValue &> | ||
class BitmapDisplay : public DisplayElement { | ||
public: | ||
BitmapDisplay(DisplayInterface &display, Value_t &&value, | ||
const XBitmap &xbm, PixelLocation loc, uint16_t color) | ||
: DisplayElement(display), value(std::forward<Value_t>(value)), | ||
xbm(xbm), x(loc.x), y(loc.y), color(color) {} | ||
|
||
void draw() override { | ||
if (value.getValue()) | ||
display.drawXBitmap(x, y, xbm.bits, xbm.width, xbm.height, color); | ||
value.clearDirty(); | ||
} | ||
|
||
bool getDirty() const override { return value.getDirty(); } | ||
|
||
private: | ||
Value_t value; | ||
const XBitmap &xbm; | ||
int16_t x, y; | ||
uint16_t color; | ||
}; | ||
|
||
template <class Value_t = Interfaces::IValue> | ||
using NoteBitmapDisplay [[deprecated("Use BitmapDisplay instead")]] = | ||
BitmapDisplay<Value_t>; | ||
|
||
END_CS_NAMESPACE |
This file was deleted.
Oops, something went wrong.