diff --git a/CMakeLists.txt b/CMakeLists.txt index 5dc1800..b1b475f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -50,10 +50,12 @@ if(ARSON_BUILD_PLUGIN) PRODUCT_NAME "ArSonComp" IS_SYNTH FALSE NEEDS_MIDI_INPUT FALSE NEEDS_MIDI_OUTPUT FALSE IS_MIDI_EFFECT FALSE EDITOR_WANTS_KEYBOARD_FOCUS FALSE COPY_PLUGIN_AFTER_BUILD FALSE VST3_CATEGORIES Fx Dynamics) - # Keep only knob, toggle and logo assets: faders are pure JUCE vectors. - # No track/thumb PNG or runtime resampling. + # Knob/toggle artwork and the approved flat brushed-metal fader pair + # are compiled into the VST3/Standalone. No file-system reads at runtime. juce_add_binary_data(ArSonCompKnobAssets SOURCES assets/black_brushed_knob.jpg + assets/sliders/arsoncomp_flat_track_480.png + assets/sliders/arsoncomp_silver_thumb_96.png assets/toggle/arson_toggle_on.png assets/toggle/arson_toggle_off.png assets/arsoncomp_header_logo.png) diff --git a/assets/sliders/arsoncomp_flat_track_480.png b/assets/sliders/arsoncomp_flat_track_480.png new file mode 100644 index 0000000..9068e61 Binary files /dev/null and b/assets/sliders/arsoncomp_flat_track_480.png differ diff --git a/assets/sliders/arsoncomp_silver_thumb_96.png b/assets/sliders/arsoncomp_silver_thumb_96.png new file mode 100644 index 0000000..6b9e9fe Binary files /dev/null and b/assets/sliders/arsoncomp_silver_thumb_96.png differ diff --git a/docs/M63-BRUSHED-METAL-SLIDERS.md b/docs/M63-BRUSHED-METAL-SLIDERS.md new file mode 100644 index 0000000..63b8d2d --- /dev/null +++ b/docs/M63-BRUSHED-METAL-SLIDERS.md @@ -0,0 +1,18 @@ +# M6.3 approved flat brushed-metal photographic fader + +Two distinct user-approved transparent PNGs are bundled in the VST3 and +Standalone binary: + +- assets/sliders/arsoncomp_flat_track_480.png — 480×66 cropped transparent + stationary horizontally brushed metal ruler, with dark recessed slot. +- assets/sliders/arsoncomp_silver_thumb_96.png — 96×96 circular satin brushed + silver thumb, moves independently. + +These are cropped/downsized from the approved rendered assets, not new vector +approximations. Thumb and ruler retain original aspect ratio at all slider +widths, including the smaller Sidechain pair. Both assets decode once on the +JUCE editor creation thread; the audio thread is unaffected. The 612×580 +taller LCD and MINI mode remain unchanged. + +Release gates: Windows compile/CTest/screenshot artifacts, Linux sanitizer +engine tests. Final visual acceptance and physical audio tests are separate. diff --git a/plugin/Editor.cpp b/plugin/Editor.cpp index a3b14fd..4b4474a 100644 --- a/plugin/Editor.cpp +++ b/plugin/Editor.cpp @@ -52,6 +52,15 @@ CompLook::CompLook() { static_cast(BinaryData::arson_toggle_off_pngSize)); jassert(toggleOn.isValid() && toggleOff.isValid()); jassert(toggleOn.getBounds()==toggleOff.getBounds()); + // Independent stationary track + moving circular silver thumb. + // Decode only on editor construction, never in draw or the audio thread. + sliderTrack=juce::ImageFileFormat::loadFrom( + BinaryData::arsoncomp_flat_track_480_png, + static_cast(BinaryData::arsoncomp_flat_track_480_pngSize)); + sliderThumb=juce::ImageFileFormat::loadFrom( + BinaryData::arsoncomp_silver_thumb_96_png, + static_cast(BinaryData::arsoncomp_silver_thumb_96_pngSize)); + jassert(sliderTrack.isValid() && sliderThumb.isValid()); setColour(juce::Slider::textBoxTextColourId,text); setColour(juce::Slider::textBoxBackgroundColourId,juce::Colour{0xff111417}); setColour(juce::Slider::textBoxOutlineColourId,juce::Colour{0xff31383e}); @@ -194,71 +203,20 @@ void CompLook::drawRotarySlider(juce::Graphics& g,int x,int y,int w,int h, void CompLook::drawLinearSlider(juce::Graphics& g,int x,int y,int w,int h, float pos,float,float, const juce::Slider::SliderStyle,juce::Slider&) { - // Modern vector-only JUCE fader; no texture, sprite or image resampling. - // Host automation, keyboard input and gestures remain native JUCE Slider. - const auto geometry=arson::ui::FaderGeometry::calculate( + // Two approved photographic assets: the flat grey brushed-metal ruler + // stays stationary; only the circular satin-metal thumb moves. + // Preserve aspect ratio of both PNGs for a true hardware appearance. + const auto geom=arson::ui::FaderGeometry::calculate( static_cast(w),static_cast(h),pos); - const auto track=geometry.track.translated(static_cast(x), - static_cast(y)); - const auto thumb=geometry.thumb.translated(static_cast(x), - static_cast(y)); - const float cy=static_cast(y)+static_cast(h)*0.5f; - const float progress=juce::jlimit(0.0f,1.0f, - (geometry.position-geometry.left)/(geometry.right-geometry.left)); - - // Inset charcoal rail: restrained outline, clear separation from chassis. - const auto housing=track.expanded(1.4f,2.6f); - g.setColour(juce::Colour{0xff11171b}); - g.fillRoundedRectangle(housing,4.2f); - g.setColour(juce::Colour{0xff6e777c}.withAlpha(0.43f)); - g.drawRoundedRectangle(housing.reduced(0.35f),4.0f,0.85f); - g.setColour(juce::Colour{0xff070c10}); - g.fillRoundedRectangle(track,track.getHeight()*0.5f); - g.setColour(juce::Colour{0xff9ba4a8}.withAlpha(0.15f)); - g.drawHorizontalLine(juce::roundToInt(track.getY()+1.0f), - track.getX()+3.0f,track.getRight()-3.0f); - - // Coral level fill, clipped into rounded channel. Minimum is fully dark. - if(progress>0.001f) { - juce::Graphics::ScopedSaveState clip(g); - juce::Path channel; - channel.addRoundedRectangle(track,track.getHeight()*0.5f); - g.reduceClipRegion(channel); - const float litRight=track.getX()+track.getWidth()*progress; - g.setGradientFill(juce::ColourGradient( - juce::Colour{0xfffc8587},track.getX(),track.getY(), - juce::Colour{0xffb33b4d},track.getX(),track.getBottom(),false)); - g.fillRect(track.getX(),track.getY(), - litRight-track.getX(),track.getHeight()); - if(litRight>track.getX()+4.0f) { - g.setColour(juce::Colour{0xffffd1cf}.withAlpha(0.43f)); - g.drawHorizontalLine(juce::roundToInt(cy-0.5f), - track.getX()+2.0f,litRight-1.0f); - } + const auto rail=geom.track.translated(static_cast(x), + static_cast(y)); + const auto cap=geom.thumb.translated(static_cast(x), + static_cast(y)); + if(sliderTrack.isValid() && sliderThumb.isValid()) { + g.setImageResamplingQuality(juce::Graphics::highResamplingQuality); + g.drawImage(sliderTrack,rail); + g.drawImage(sliderThumb,cap); } - - // Sharp graphite thumb with soft satin bevel + small red engraved grip. - // At actual 34px height the thumb remains 13-15px wide and 28px tall. - g.setColour(juce::Colours::black.withAlpha(0.48f)); - g.fillRoundedRectangle(thumb.translated(0.0f,1.4f),3.2f); - juce::ColourGradient brushed(juce::Colour{0xff869198},thumb.getX(),cy, - juce::Colour{0xff414a51},thumb.getRight(),cy,false); - brushed.addColour(0.19,juce::Colour{0xff707c83}); - brushed.addColour(0.40,juce::Colour{0xff333c43}); - brushed.addColour(0.73,juce::Colour{0xff222b31}); - g.setGradientFill(brushed); - g.fillRoundedRectangle(thumb,3.1f); - g.setColour(juce::Colour{0xffa3adb2}.withAlpha(0.62f)); - g.drawRoundedRectangle(thumb.reduced(0.7f),2.6f,0.85f); - g.setColour(juce::Colours::white.withAlpha(0.10f)); - g.drawVerticalLine(juce::roundToInt(thumb.getX()+2.1f), - thumb.getY()+4.0f,thumb.getBottom()-4.0f); - const juce::Rectangle grip{ - thumb.getX()+3.1f,cy-1.2f,thumb.getWidth()-6.2f,2.4f}; - g.setColour(juce::Colour{0xff141a1f}); - g.fillRoundedRectangle(grip.expanded(0.4f,0.65f),1.25f); - g.setColour(juce::Colour{0xffed7279}); - g.fillRoundedRectangle(grip,1.2f); } void CompLook::drawToggleButton(juce::Graphics& g,juce::ToggleButton& button, bool highlighted,bool down) { diff --git a/plugin/Editor.h b/plugin/Editor.h index c260259..3e43dbb 100644 --- a/plugin/Editor.h +++ b/plugin/Editor.h @@ -22,6 +22,7 @@ class CompLook final : public juce::LookAndFeel_V4 { std::array faces; // normal + oversized Threshold only juce::Image sourceFace; // decoded once on GUI initialization juce::Image toggleOn, toggleOff; // matched, predecoded state sprites + juce::Image sliderTrack, sliderThumb; // approved separate flat-metal PNGs const juce::Image& knobFace(int diameter,bool primary); }; class Editor final : public juce::AudioProcessorEditor, private juce::Timer { diff --git a/plugin/FaderGeometry.h b/plugin/FaderGeometry.h index f2de112..e35c4ea 100644 --- a/plugin/FaderGeometry.h +++ b/plugin/FaderGeometry.h @@ -3,23 +3,27 @@ #include namespace arson::ui { -// Canonical vector geometry for the six horizontal faders. -// No bitmap aspect ratios, resampling or stretched controls. +// Cropped, transparent PNG source dimensions: 480x66 track, 96x96 thumb. +// The track remains stationary; the round silver cap slides on its axis. struct FaderGeometry { - static constexpr float railHeight=6.0f; - juce::Rectangle track, thumb; - float left=0.0f, right=0.0f, position=0.0f; + static constexpr float trackAspect=480.0f/66.0f; + juce::Rectangle track,thumb; + float left=0.0f,right=0.0f,position=0.0f; static FaderGeometry calculate(float width,float height,float sliderPos) noexcept { - const float inset=juce::jlimit(8.0f,11.0f,width*0.10f); - const float capW=juce::jlimit(12.0f,15.0f,height*0.40f); - const float capH=juce::jlimit(22.0f,29.0f,height-5.0f); + // Prevent image stretching at any supported Dynamics/Sidechain width. + const float trackWidth=juce::jmax(1.0f, + std::min(width-4.0f,(height-3.0f)*trackAspect)); + const float trackHeight=trackWidth/trackAspect; + const float thumbSize=juce::jlimit(22.0f,33.0f,height-4.0f); + const float railX=(width-trackWidth)*0.5f; const float cy=height*0.5f; FaderGeometry g; - g.track={inset,cy-railHeight*0.5f,width-2.0f*inset,railHeight}; - g.left=inset+capW*0.5f; - g.right=width-inset-capW*0.5f; + g.track={railX,cy-trackHeight*0.5f,trackWidth,trackHeight}; + g.left=railX+thumbSize*0.5f+2.0f; + g.right=railX+trackWidth-thumbSize*0.5f-2.0f; g.position=juce::jlimit(g.left,g.right,sliderPos); - g.thumb={g.position-capW*0.5f,cy-capH*0.5f,capW,capH}; + g.thumb={g.position-thumbSize*0.5f,cy-thumbSize*0.5f, + thumbSize,thumbSize}; return g; } }; diff --git a/tests/PluginSmoke.cpp b/tests/PluginSmoke.cpp index aa5a545..6510c96 100644 --- a/tests/PluginSmoke.cpp +++ b/tests/PluginSmoke.cpp @@ -209,53 +209,42 @@ static int runSmoke(int argc,char** argv) { if(std::abs(audio.getSample(0,0)-0.123f)>1.0e-6f || std::abs(audio.getSample(0,31)-0.123f)>1.0e-6f)return failHost(46); } - // Fully vector JUCE Graphics faders; raster and geometric regression. + // Approved M6.3 PNG resources are embedded and independently decoded. + // Never replace the textured ruler or circular thumb with drawn shapes. { + const auto track=juce::ImageFileFormat::loadFrom( + BinaryData::arsoncomp_flat_track_480_png, + static_cast(BinaryData::arsoncomp_flat_track_480_pngSize)); + const auto thumb=juce::ImageFileFormat::loadFrom( + BinaryData::arsoncomp_silver_thumb_96_png, + static_cast(BinaryData::arsoncomp_silver_thumb_96_pngSize)); + if(!track.isValid() || !thumb.isValid() || + track.getWidth()!=480 || track.getHeight()!=66 || + thumb.getWidth()!=96 || thumb.getHeight()!=96 || + track.getPixelAt(0,0).getFloatAlpha()>0.05f || + thumb.getPixelAt(0,0).getFloatAlpha()>0.05f || + track.getPixelAt(240,33).getFloatAlpha()<0.80f || + thumb.getPixelAt(48,48).getFloatAlpha()<0.80f) { + std::cerr<<"PHOTO_ASSET_47: invalid dimensions or alpha\n"; + return 47; + } for(float width : {70.0f,90.0f,105.0f,150.0f}) - for(float height : {34.0f,36.0f,40.0f}) + for(float height : {34.0f,40.0f}) for(float pos : {-100.0f,width*0.5f,width+100.0f}) { const auto shape=arson::ui::FaderGeometry::calculate( width,height,pos); - if(shape.track.getHeight()!=arson::ui::FaderGeometry::railHeight || - shape.track.getX()<0||shape.track.getRight()>width || - shape.thumb.getX()<0||shape.thumb.getRight()>width || - shape.thumb.getY()<0||shape.thumb.getBottom()>height || - shape.thumb.getWidth()<12.0f||shape.thumb.getHeight()<22.0f || - shape.right<=shape.left)return 73; + if(std::abs(shape.track.getWidth()/shape.track.getHeight()- + arson::ui::FaderGeometry::trackAspect)>0.001f || + std::abs(shape.thumb.getWidth()-shape.thumb.getHeight())>0.001f || + shape.track.getX()<0.0f || shape.track.getRight()>width || + shape.thumb.getX()<0.0f || shape.thumb.getRight()>width || + shape.thumb.getY()<0.0f || shape.thumb.getBottom()>height || + shape.left>=shape.right) { + std::cerr<<"PHOTO_GEOMETRY_73 w="< + 0.5f*std::min(width,arson::ui::EditorMetrics::knobHeight) + +0.01f)return 83; + } } // Production ON/OFF resources and Bypass inversion contract. {