Skip to content

Commit

Permalink
Merge pull request #356 from asb2m10/scaling2x
Browse files Browse the repository at this point in the history
Merging Scaling2x
  • Loading branch information
asb2m10 authored Jun 26, 2022
2 parents 75c299b + bc782d3 commit 796ae80
Show file tree
Hide file tree
Showing 29 changed files with 1,895 additions and 1,853 deletions.
19 changes: 19 additions & 0 deletions Dexed.jucer
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,25 @@
jucerFormatVersion="1">
<MAINGROUP id="kHXTgw" name="Dexed">
<GROUP id="{F12593AE-639A-6F59-5819-ACE25AF86F95}" name="Resources">
<FILE id="dOtSsy" name="ButtonUnlabeled_100x60.png" compile="0" resource="1"
file="Resources/ui/ButtonUnlabeled_100x60.png"/>
<FILE id="qDdLJl" name="LFO_72_52.png" compile="0" resource="1" file="Resources/ui/LFO_72_52.png"/>
<FILE id="Bj066F" name="Light_28x28.png" compile="0" resource="1" file="Resources/ui/Light_28x28.png"/>
<FILE id="spGdhV" name="Meter_280x16.png" compile="0" resource="1"
file="Resources/ui/Meter_280x16.png"/>
<FILE id="cSqILo" name="Switch_96x52.png" compile="0" resource="1"
file="Resources/ui/Switch_96x52.png"/>
<FILE id="bXTjsi" name="Slider_52x52.png" compile="0" resource="1"
file="Resources/ui/Slider_52x52.png"/>
<FILE id="X47NV4" name="Scaling_72-52.png" compile="0" resource="1"
file="Resources/ui/Scaling_72-52.png"/>
<FILE id="yDmJ9m" name="Knob_68x68.png" compile="0" resource="1" file="Resources/ui/Knob_68x68.png"/>
<FILE id="V3i7uA" name="OperatorEditor_574x436.png" compile="0" resource="1"
file="Resources/ui/OperatorEditor_574x436.png"/>
<FILE id="u0KDj7" name="Switch_64x64.png" compile="0" resource="1"
file="Resources/ui/Switch_64x64.png"/>
<FILE id="RDSvL4" name="GlobalEditor_1728x288.png" compile="0" resource="1"
file="Resources/ui/GlobalEditor_1728x288.png"/>
<FILE id="kj2Ow6" name="dexed-logo.png" compile="0" resource="1" file="Resources/ui/dexed-logo.png"/>
<FILE id="h1sDac" name="HelpButton.png" compile="0" resource="1" file="Resources/ui/HelpButton.png"/>
<FILE id="oVmTCw" name="HelpButton.svg" compile="0" resource="1" file="Resources/ui/HelpButton.svg"/>
Expand Down
14 changes: 7 additions & 7 deletions Resources/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,20 +7,20 @@ juce_add_binary_data(DexedResources SOURCES
ui/ButtonUnlabeled_50x30.png
ui/dexedIcon.png
ui/dexed-logo.png
ui/GlobalEditor_864x144.png
ui/GlobalEditor_1728x288.png
ui/HelpButton.png
ui/HelpButton.svg
ui/Knob_34x34.png
ui/Knob_68x68.png
ui/LFO_36_26.png
ui/Light_14x14.png
ui/Light_28x28.png
ui/Meter_140x8.png
ui/NotoSans-Bold.ttf
ui/NotoSans-Regular.ttf
ui/OperatorEditor_287x218.png
ui/OperatorEditor_574x436.png
ui/Scaling_36_26.png
ui/Slider_26x26.png
ui/Switch_32x32.png
ui/Switch_48x26.png
ui/Slider_52x52.png
ui/Switch_64x64.png
ui/Switch_96x52.png
ui/SwitchLighted_48x26.png
builtin_pgm.zip
)
Binary file added Resources/ui/ButtonUnlabeled_100x60.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Resources/ui/GlobalEditor_1728x288.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Resources/ui/Knob_68x68.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Resources/ui/LFO_72_52.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Resources/ui/Light_28x28.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Resources/ui/Meter_280x16.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Resources/ui/OperatorEditor_574x436.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Resources/ui/Scaling_72-52.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Resources/ui/Slider_52x52.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Resources/ui/Switch_64x64.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Resources/ui/Switch_96x52.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified Resources/ui/dexedIcon.png
100755 → 100644
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified Resources/ui/source/Global.skin
Binary file not shown.
Binary file added Resources/ui/source/Knob_68x68.knob
Binary file not shown.
Binary file modified Resources/ui/source/Operator.skin
Binary file not shown.
Empty file modified Resources/ui/source/dexed-logo.xcf
100755 → 100644
Empty file.
3 changes: 1 addition & 2 deletions Source/AlgoDisplay.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -115,8 +115,7 @@ void AlgoDisplay::displayOp(Graphics &g, char id, int x, int y, char link, char

}

void AlgoDisplay::paint(Graphics &g) {

void AlgoDisplay::paint(Graphics &g) {
g.setColour(DXLookNFeel::fillColour);
g.fillRect(1, 3, 20, 15);
String n = String(*algo +1);
Expand Down
1 change: 1 addition & 0 deletions Source/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ target_compile_definitions(${BaseTargetName} PUBLIC
JUCE_MODAL_LOOPS_PERMITTED=1 # needed for FileBrowser in CartManager
JUCE_DISPLAY_SPLASH_SCREEN=0
JUCE_REPORT_APP_USAGE=0
JUCE_COREGRAPHICS_RENDER_WITH_MULTIPLE_PAINT_CALLS=1
)

target_link_libraries(${BaseTargetName}
Expand Down
26 changes: 14 additions & 12 deletions Source/DXLookNFeel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -62,17 +62,17 @@ DXLookNFeel::DXLookNFeel() {
REG_COLOUR(DirectoryContentsDisplayComponent::highlightColourId, fillColour);
REG_COLOUR(DirectoryContentsDisplayComponent::textColourId, Colours::white);

imageKnob = ImageCache::getFromMemory(BinaryData::Knob_34x34_png, BinaryData::Knob_34x34_pngSize);
imageSwitch = ImageCache::getFromMemory(BinaryData::Switch_48x26_png, BinaryData::Switch_48x26_pngSize);
imageKnob = ImageCache::getFromMemory(BinaryData::Knob_68x68_png, BinaryData::Knob_68x68_pngSize); // 2x
imageSwitch = ImageCache::getFromMemory(BinaryData::Switch_96x52_png, BinaryData::Switch_96x52_pngSize); // 2x
imageSwitchLighted = ImageCache::getFromMemory(BinaryData::SwitchLighted_48x26_png, BinaryData::SwitchLighted_48x26_pngSize);
imageSwitchOperator = ImageCache::getFromMemory(BinaryData::Switch_32x32_png, BinaryData::Switch_32x32_pngSize);
imageSwitchOperator = ImageCache::getFromMemory(BinaryData::Switch_64x64_png, BinaryData::Switch_64x64_pngSize); // 2x
imageButton = ImageCache::getFromMemory(BinaryData::ButtonUnlabeled_50x30_png, BinaryData::ButtonUnlabeled_50x30_pngSize);
imageSlider = ImageCache::getFromMemory(BinaryData::Slider_26x26_png, BinaryData::Slider_26x26_pngSize);
imageScaling = ImageCache::getFromMemory(BinaryData::Scaling_36_26_png, BinaryData::Scaling_36_26_pngSize);;
imageLight = ImageCache::getFromMemory(BinaryData::Light_14x14_png, BinaryData::Light_14x14_pngSize);
imageSlider = ImageCache::getFromMemory(BinaryData::Slider_52x52_png, BinaryData::Slider_52x52_pngSize); // 2x
imageScaling = ImageCache::getFromMemory(BinaryData::Scaling_36_26_png, BinaryData::Scaling_36_26_pngSize); // 2x
imageLight = ImageCache::getFromMemory(BinaryData::Light_28x28_png, BinaryData::Light_28x28_pngSize); // 2x
imageLFO = ImageCache::getFromMemory(BinaryData::LFO_36_26_png, BinaryData::LFO_36_26_pngSize);
imageOperator = ImageCache::getFromMemory(BinaryData::OperatorEditor_287x218_png, BinaryData::OperatorEditor_287x218_pngSize);
imageGlobal = ImageCache::getFromMemory (BinaryData::GlobalEditor_864x144_png, BinaryData::GlobalEditor_864x144_pngSize);
imageOperator = ImageCache::getFromMemory(BinaryData::OperatorEditor_574x436_png, BinaryData::OperatorEditor_574x436_pngSize); // 2x
imageGlobal = ImageCache::getFromMemory (BinaryData::GlobalEditor_1728x288_png, BinaryData::GlobalEditor_1728x288_pngSize); // 2x

File dexedTheme = DexedAudioProcessor::dexedAppDir.getChildFile("DexedTheme.xml");

Expand Down Expand Up @@ -107,6 +107,7 @@ DXLookNFeel::DXLookNFeel() {
}
}

// TODO: THIS IS DEAD CODE. NOBODY IS USING THIS.
forEachXmlChildElementWithTagName(*root, image, "image") {
String name = image->getStringAttribute("id", "");
String path = image->getStringAttribute("path", "");
Expand Down Expand Up @@ -163,6 +164,7 @@ Typeface::Ptr DXLookNFeel::getTypefaceForFont(const Font &) {

void DXLookNFeel::drawRotarySlider( Graphics &g, int x, int y, int width, int height, float sliderPosProportional,
float rotaryStartAngle, float rotaryEndAngle, Slider &slider ) {
TRACE("knob render");
if ( imageKnob.isNull() ) {
LookAndFeel_V3::drawRotarySlider(g, x, y, width, height, sliderPosProportional, rotaryStartAngle, rotaryEndAngle, slider);
return;
Expand All @@ -171,13 +173,13 @@ void DXLookNFeel::drawRotarySlider( Graphics &g, int x, int y, int width, int he
const double fractRotation = (slider.getValue() - slider.getMinimum()) / (slider.getMaximum() - slider.getMinimum()); //value between 0 and 1 for current amount of rotation
const int nFrames = imageKnob.getHeight()/imageKnob.getWidth(); // number of frames for vertical film strip
const int frameIdx = (int)ceil(fractRotation * ((double)nFrames-1.0) ); // current index from 0 --> nFrames-1

const float radius = jmin (width / 2.0f, height / 2.0f) ;
const float centreX = x + width * 0.5f;
const float centreY = y + height * 0.5f;
const float rx = centreX - radius - 1.0f;
const float ry = centreY - radius - 1.0f;

g.drawImage(imageKnob, (int)rx, (int)ry, 2*(int)radius, 2*(int)radius, 0, frameIdx*imageKnob.getWidth(), imageKnob.getWidth(), imageKnob.getWidth());
};

Expand All @@ -198,7 +200,7 @@ void DXLookNFeel::drawToggleButton(Graphics& g, ToggleButton& button, bool isMou
g.drawImage(imageSwitchLighted, 0, 0, 48, 26, 0, button.getToggleState() ? 0 : 26, 48, 26);
}
else
g.drawImage(imageSwitch, 0, 0, 48, 26, 0, button.getToggleState() ? 0 : 26, 48, 26);
g.drawImage(imageSwitch, 0, 0, 48, 26, 0, button.getToggleState() ? 0 : 52, 96, 52);

}

Expand Down Expand Up @@ -234,7 +236,7 @@ void DXLookNFeel::drawLinearSliderThumb (Graphics& g, int x, int y, int width, i

int p = sliderPos - minSliderPos;
p -= 6;
g.drawImage(imageSlider, p, 0, 26, 26, 0, 0, 26, 26);
g.drawImage(imageSlider, p, 0, 26, 26, 0, 0, 52, 52);
}

void DXLookNFeel::positionComboBoxText(ComboBox& box, Label& label) {
Expand Down
16 changes: 8 additions & 8 deletions Source/GlobalEditor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
the "//[xyz]" and "//[/xyz]" sections will be retained when the file is loaded
and re-saved.
Created with Projucer version: 6.0.1
Created with Projucer version: 6.0.7
------------------------------------------------------------------------------
Expand Down Expand Up @@ -66,7 +66,7 @@ class AboutBox : public DialogWindow {
HyperlinkButton dexed;
HyperlinkButton surge;

AboutBox(Component *parent) : DialogWindow("About", Colour(0xFF000000), true),
AboutBox(Component *parent) : DialogWindow("About", Colour(0xFF000000), true),
dexed("https://asb2m10.github.io/dexed/", URL("https://asb2m10.github.io/dexed/")),
surge("https://surge-synthesizer.github.io/", URL("https://surge-synthesizer.github.io/")) {
setUsingNativeTitleBar(false);
Expand All @@ -76,11 +76,11 @@ class AboutBox : public DialogWindow {
centreAroundComponent(parent, getWidth(), getHeight());

dexed.setColour(HyperlinkButton::ColourIds::textColourId, Colour(0xFF4ea097));
dexed.setJustificationType(Justification::left);
dexed.setJustificationType(Justification::left);
dexed.setBounds(18, 433, getWidth() - 36, 30);
addAndMakeVisible(&dexed);
surge.setColour(HyperlinkButton::ColourIds::textColourId, Colour(0xFF4ea097));
surge.setJustificationType(Justification::left);
surge.setJustificationType(Justification::left);
surge.setBounds(18, 458, getWidth() - 36, 30);
addAndMakeVisible(&surge);
}
Expand Down Expand Up @@ -462,13 +462,13 @@ GlobalEditor::~GlobalEditor()
void GlobalEditor::paint (juce::Graphics& g)
{
//[UserPrePaint] Add your own custom painting code here..
g.drawImage(background, 0, 0, 864, 144, 0, 0, 864, 144);
g.drawImage(background, 0, 0, 864, 144, 0, 0, 1728, 288);
//[/UserPrePaint]

//[UserPaint] Add your own custom painting code here..
g.drawImage(imageLight, 300, 70, 14, 14, 0, monoMode->getToggleState() ? 14 : 0, 14, 14);
g.drawImage(imageLight, 619, 102, 14, 14, 0, lfoSync->getToggleState() ? 14 : 0, 14, 14);
g.drawImage(imageLight, 705, 102, 14, 14, 0, oscSync->getToggleState() ? 14 : 0, 14, 14);
g.drawImage(imageLight, 300, 70, 14, 14, 0, monoMode->getToggleState() ? 28 : 0, 28, 28);
g.drawImage(imageLight, 619, 102, 14, 14, 0, lfoSync->getToggleState() ? 28 : 0, 28, 28);
g.drawImage(imageLight, 705, 102, 14, 14, 0, oscSync->getToggleState() ? 28 : 0, 28, 28);
//[/UserPaint]
}

Expand Down
2 changes: 1 addition & 1 deletion Source/GlobalEditor.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
the "//[xyz]" and "//[/xyz]" sections will be retained when the file is loaded
and re-saved.
Created with Projucer version: 6.0.1
Created with Projucer version: 6.0.7
------------------------------------------------------------------------------
Expand Down
8 changes: 4 additions & 4 deletions Source/OperatorEditor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public :
}

void paintButton (Graphics& g, bool isMouseOverButton, bool isButtonDown) {
g.drawImage(image, 0, 0, 32, 32, 0, getToggleState() ? 0 : 32, 32, 32);
g.drawImage(image, 0, 0, 32, 32, 0, getToggleState() ? 0 : 64, 64, 64);
}
};

Expand Down Expand Up @@ -336,7 +336,7 @@ OperatorEditor::~OperatorEditor()
void OperatorEditor::paint (juce::Graphics& g)
{
//[UserPrePaint] Add your own custom painting code here..
g.drawImage(background, 0, 0, 287, 218, 0, 0, 287, 218);
g.drawImage(background, 0, 0, 287, 218, 0, 0, 574, 436);
//[/UserPrePaint]

//[UserPaint] Add your own custom painting code here..
Expand All @@ -352,9 +352,9 @@ void OperatorEditor::paint (juce::Graphics& g)
bool state = opMode->getToggleState();

// 129 x 24
g.drawImage(light, 127, 24, 14, 14, 0, state ? 0 : 14, 14, 14);
g.drawImage(light, 127, 24, 14, 14, 0, state ? 0 : 28, 28, 28);
// 199 x 24
g.drawImage(light, 198, 24, 14, 14, 0, !state ? 0 : 14, 14, 14);
g.drawImage(light, 198, 24, 14, 14, 0, !state ? 0 : 28, 28, 28);
//[/UserPaint]
}

Expand Down
Loading

0 comments on commit 796ae80

Please sign in to comment.