Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
aaronstatic committed Nov 7, 2021
1 parent a5d393c commit e8c7072
Show file tree
Hide file tree
Showing 4 changed files with 80 additions and 68 deletions.
37 changes: 20 additions & 17 deletions src/ChordCV.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -116,25 +116,28 @@ struct ChordCVWidget : ModuleWidget {
module = _module;
}

void draw(const DrawArgs &args) override {
std::shared_ptr<Font> font = APP->window->loadFont(asset::plugin(pluginInstance, "res/fonts/PixelOperator.ttf"));
if(font){
NVGcolor textColor = prepareDisplay(args.vg, &box, 22);
nvgFontFaceId(args.vg, font->handle);
nvgTextLetterSpacing(args.vg, -1.5);
nvgTextAlign(args.vg, NVG_ALIGN_CENTER);

Vec textPos = Vec(box.size.x/2, 21.0f);
nvgFillColor(args.vg, textColor);

if (module != NULL){
get_chord_name(module->root_semi,module->chord_type,module->inverted,module->bass_note,text);
}else{
snprintf(text, 13, " ");
void drawLayer(const DrawArgs& args, int layer) override {
if (layer == 1) {
std::shared_ptr<Font> font = APP->window->loadFont(asset::plugin(pluginInstance, "res/fonts/PixelOperator.ttf"));
if(font){
NVGcolor textColor = prepareDisplay(args.vg, &box, 22);
nvgFontFaceId(args.vg, font->handle);
nvgTextLetterSpacing(args.vg, -1.5);
nvgTextAlign(args.vg, NVG_ALIGN_CENTER);

Vec textPos = Vec(box.size.x/2, 21.0f);
nvgFillColor(args.vg, textColor);

if (module != NULL){
get_chord_name(module->root_semi,module->chord_type,module->inverted,module->bass_note,text);
}else{
snprintf(text, 13, " ");
}

nvgText(args.vg, textPos.x, textPos.y, text, NULL);
}

nvgText(args.vg, textPos.x, textPos.y, text, NULL);
}
Widget::drawLayer(args, layer);
}

};
Expand Down
37 changes: 20 additions & 17 deletions src/DiatonicCV.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -151,25 +151,28 @@ struct DiatonicCVWidget : ModuleWidget {
module = _module;
}

void draw(const DrawArgs &args) override {
std::shared_ptr<Font> font = APP->window->loadFont(asset::plugin(pluginInstance, "res/fonts/PixelOperator.ttf"));
if(font){
NVGcolor textColor = prepareDisplay(args.vg, &box, 22);
nvgFontFaceId(args.vg, font->handle);
nvgTextLetterSpacing(args.vg, -1.5);
nvgTextAlign(args.vg, NVG_ALIGN_CENTER);

Vec textPos = Vec(box.size.x/2, 21.0f);
nvgFillColor(args.vg, textColor);

if (module != NULL && module->playing_chord.num_notes > 2){
detect_chord_name_simple(module->playing_chord,text);
}else{
snprintf(text, 13, " ");
void drawLayer(const DrawArgs& args, int layer) override {
if (layer == 1) {
std::shared_ptr<Font> font = APP->window->loadFont(asset::plugin(pluginInstance, "res/fonts/PixelOperator.ttf"));
if(font){
NVGcolor textColor = prepareDisplay(args.vg, &box, 22);
nvgFontFaceId(args.vg, font->handle);
nvgTextLetterSpacing(args.vg, -1.5);
nvgTextAlign(args.vg, NVG_ALIGN_CENTER);

Vec textPos = Vec(box.size.x/2, 21.0f);
nvgFillColor(args.vg, textColor);

if (module != NULL && module->playing_chord.num_notes > 2){
detect_chord_name_simple(module->playing_chord,text);
}else{
snprintf(text, 13, " ");
}

nvgText(args.vg, textPos.x, textPos.y, text, NULL);
}

nvgText(args.vg, textPos.x, textPos.y, text, NULL);
}
Widget::drawLayer(args, layer);
}

};
Expand Down
37 changes: 20 additions & 17 deletions src/RandomNoteCV.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -127,25 +127,28 @@ struct RandomNoteCVWidget : ModuleWidget {
module = _module;
}

void draw(const DrawArgs &args) override {
std::shared_ptr<Font> font = APP->window->loadFont(asset::plugin(pluginInstance, "res/fonts/PixelOperator.ttf"));
if(font){
NVGcolor textColor = prepareDisplay(args.vg, &box, 22);
nvgFontFaceId(args.vg, font->handle);
nvgTextLetterSpacing(args.vg, -1.5);
nvgTextAlign(args.vg, NVG_ALIGN_CENTER);

Vec textPos = Vec(box.size.x/2, 21.0f);
nvgFillColor(args.vg, textColor);

if (module != NULL){
get_note_name(module->playing_note,text);
}else{
snprintf(text, 1, " ");
void drawLayer(const DrawArgs& args, int layer) override {
if (layer == 1) {
std::shared_ptr<Font> font = APP->window->loadFont(asset::plugin(pluginInstance, "res/fonts/PixelOperator.ttf"));
if(font){
NVGcolor textColor = prepareDisplay(args.vg, &box, 22);
nvgFontFaceId(args.vg, font->handle);
nvgTextLetterSpacing(args.vg, -1.5);
nvgTextAlign(args.vg, NVG_ALIGN_CENTER);

Vec textPos = Vec(box.size.x/2, 21.0f);
nvgFillColor(args.vg, textColor);

if (module != NULL){
get_note_name(module->playing_note,text);
}else{
snprintf(text, 1, " ");
}

nvgText(args.vg, textPos.x, textPos.y, text, NULL);
}

nvgText(args.vg, textPos.x, textPos.y, text, NULL);
}
Widget::drawLayer(args, layer);
}

};
Expand Down
37 changes: 20 additions & 17 deletions src/ScaleCV.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -107,25 +107,28 @@ struct ScaleCVWidget : ModuleWidget {
module = _module;
}

void draw(const DrawArgs &args) override {
std::shared_ptr<Font> font = APP->window->loadFont(asset::plugin(pluginInstance, "res/fonts/PixelOperator.ttf"));
if(font){
NVGcolor textColor = prepareDisplay(args.vg, &box, 22);
nvgFontFaceId(args.vg, font->handle);
nvgTextLetterSpacing(args.vg, -1.5);
nvgTextAlign(args.vg, NVG_ALIGN_CENTER);

Vec textPos = Vec(box.size.x/2, 21.0f);
nvgFillColor(args.vg, textColor);

if (module != NULL){
get_scale_name(module->root_semi,module->mode,text);
}else{
snprintf(text, 13, " ");
void drawLayer(const DrawArgs& args, int layer) override {
if (layer == 1) {
std::shared_ptr<Font> font = APP->window->loadFont(asset::plugin(pluginInstance, "res/fonts/PixelOperator.ttf"));
if(font){
NVGcolor textColor = prepareDisplay(args.vg, &box, 22);
nvgFontFaceId(args.vg, font->handle);
nvgTextLetterSpacing(args.vg, -1.5);
nvgTextAlign(args.vg, NVG_ALIGN_CENTER);

Vec textPos = Vec(box.size.x/2, 21.0f);
nvgFillColor(args.vg, textColor);

if (module != NULL){
get_scale_name(module->root_semi,module->mode,text);
}else{
snprintf(text, 13, " ");
}

nvgText(args.vg, textPos.x, textPos.y, text, NULL);
}

nvgText(args.vg, textPos.x, textPos.y, text, NULL);
}
Widget::drawLayer(args, layer);
}

};
Expand Down

0 comments on commit e8c7072

Please sign in to comment.