Skip to content

Latest commit

Β 

History

History
438 lines (343 loc) Β· 10.7 KB

File metadata and controls

438 lines (343 loc) Β· 10.7 KB

πŸ“š WINGMAN CEF INTEGRATION - COMPLETE INDEX

Last Updated: 2025-10-13
Status: βœ… GPU-ENABLED CEF WORKING


πŸš€ QUICK START (NEW USERS)

Want to build and test right now?

cd C:\wingman
COMPLETE_FIX_AND_TEST.bat

That's it! This single script does everything:

  • Clears logs
  • Rebuilds plugin
  • Installs to VST3 folder
  • Verifies all files
  • Gives you testing instructions

πŸ“– DOCUMENTATION GUIDE

πŸ†˜ I NEED HELP RIGHT NOW!

Problem Solution
Black screen Read: CEF_GPU_FIX_SOLUTION.md
White screen Run: diagnose_cef.bat
JUCE sliders Check: CEF_GUARDRAILS.md Rule #2
DAW crashes Read: CEF_GUARDRAILS.md Rule #4
Build errors Run: COMPLETE_FIX_AND_TEST.bat

πŸŽ“ I WANT TO UNDERSTAND EVERYTHING

Read in this order:

  1. CEF_GPU_FIX_SOLUTION.md (5 min)

    • What was wrong
    • What was fixed
    • How to test
  2. CEF_GUARDRAILS.md (15 min)

    • 10 critical rules
    • Common mistakes
    • How to avoid breaking CEF
  3. COMPLETE_GUIDE.md (30 min)

    • Deep technical details
    • Advanced configuration
    • Troubleshooting matrix

πŸ€– I'M AN AI ASSISTANT HELPING WITH THIS PROJECT

READ THIS FIRST: CEF_GUARDRAILS.md

CRITICAL RULES:

  1. βœ… Enable GPU (don't disable) if user wants fancy UI
  2. βœ… Return WingmanEditor, not GenericAudioProcessorEditor
  3. βœ… Use native window mode (not OSR)
  4. βœ… Single process mode always
  5. βœ… Create browser after window exists

BEFORE ANY CHANGES:

  • Read all 10 rules in CEF_GUARDRAILS.md
  • Check existing code first
  • Test in real DAW after changes
  • Run diagnose_after_test.bat to verify

πŸ”§ SCRIPTS REFERENCE

Build & Install Scripts

COMPLETE_FIX_AND_TEST.bat ⭐ RECOMMENDED

  • Does everything: clean, build, install, verify
  • Use this for first-time setup or after major changes
  • Shows detailed progress and testing instructions

rebuild_and_install.bat

  • Quick rebuild and install
  • Use for minor code changes
  • Faster than complete fix

Diagnostic Scripts

diagnose_cef.bat

  • Run BEFORE testing
  • Checks if all files are present
  • Verifies plugin structure
  • Opens detailed report

diagnose_after_test.bat

  • Run AFTER testing in DAW
  • Analyzes CEF logs
  • Identifies specific issues
  • Shows what went wrong

Individual Scripts

rebuild_cef_fix.bat

  • Just rebuilds plugin
  • Doesn't install
  • Use for build verification only

diagnose.bat (if exists)

  • Legacy diagnostic script
  • Use diagnose_cef.bat instead

πŸ“ FILE STRUCTURE

C:\wingman\
β”‚
β”œβ”€β”€ πŸ“„ DOCUMENTATION
β”‚   β”œβ”€β”€ README.md                      ← Project overview
β”‚   β”œβ”€β”€ CEF_GPU_FIX_SOLUTION.md       ← Current fix explanation ⭐
β”‚   β”œβ”€β”€ CEF_GUARDRAILS.md             ← Rules to prevent breakage ⭐
β”‚   β”œβ”€β”€ COMPLETE_GUIDE.md             ← Deep technical guide
β”‚   β”œβ”€β”€ GETTING_STARTED.md            ← Beginner tutorial
β”‚   β”œβ”€β”€ CHECKLIST.md                  ← Verification checklist
β”‚   β”œβ”€β”€ QUICK_REFERENCE.md            ← Command reference
β”‚   β”œβ”€β”€ CHANGES.md                    ← What changed
β”‚   └── INDEX.md                      ← This file
β”‚
β”œβ”€β”€ πŸ”§ SCRIPTS
β”‚   β”œβ”€β”€ COMPLETE_FIX_AND_TEST.bat     ← All-in-one solution ⭐
β”‚   β”œβ”€β”€ rebuild_and_install.bat       ← Quick rebuild
β”‚   β”œβ”€β”€ diagnose_cef.bat              ← Pre-test diagnostics
β”‚   β”œβ”€β”€ diagnose_after_test.bat       ← Post-test analysis ⭐
β”‚   └── rebuild_cef_fix.bat           ← Build only
β”‚
β”œβ”€β”€ πŸ’Ύ SOURCE CODE
β”‚   └── Source\
β”‚       β”œβ”€β”€ PluginProcessor.cpp       ← Audio + createEditor()
β”‚       β”œβ”€β”€ PluginEditor.cpp          ← CEF UI window
β”‚       β”œβ”€β”€ CEFApp.cpp                ← CEF initialization ⚠️
β”‚       β”œβ”€β”€ CEFSchemeManager.cpp      ← URL handler
β”‚       └── CEFResourceHandler.cpp    ← File serving
β”‚
β”œβ”€β”€ 🎨 RESOURCES
β”‚   └── Resources\
β”‚       └── webui\
β”‚           └── index.html            ← Test UI (purple gradient)
β”‚
└── πŸ—οΈ BUILD
    └── build\
        └── Wingman_artefacts\
            └── Release\VST3\
                └── Wingman.vst3\     ← Built plugin

🎯 COMMON TASKS

Task: Build Plugin

cd C:\wingman
COMPLETE_FIX_AND_TEST.bat

Task: Quick Rebuild After Code Change

cd C:\wingman
rebuild_and_install.bat

Task: Check If Plugin Has All Files

cd C:\wingman
diagnose_cef.bat

Task: Diagnose Why Plugin Shows Black Screen

cd C:\wingman
diagnose_after_test.bat

Task: View CEF Logs

notepad C:\temp\cef_debug.txt
notepad C:\temp\cef.log

Task: Clean Rebuild

cd C:\wingman\build
rmdir /s /q Wingman.dir
cd ..
COMPLETE_FIX_AND_TEST.bat

πŸ“Š TROUBLESHOOTING DECISION TREE

Plugin loaded in DAW?
β”‚
β”œβ”€ NO β†’ Check DAW scanned plugin folder
β”‚        Check moduleinfo.json has unique GUIDs
β”‚        Rescan plugins in DAW
β”‚
└─ YES β†’ UI opens?
    β”‚
    β”œβ”€ NO β†’ DAW crashes?
    β”‚        Check Windows Event Viewer
    β”‚        Missing VC++ Redistributable?
    β”‚
    └─ YES β†’ What do you see?
        β”‚
        β”œβ”€ Black Screen
        β”‚   β†’ Run: diagnose_after_test.bat
        β”‚   β†’ Check: C:\temp\cef_debug.txt
        β”‚   β†’ Issue: Browser not created or GPU failed
        β”‚
        β”œβ”€ White Screen
        β”‚   β†’ Run: diagnose_cef.bat
        β”‚   β†’ Check: CEF DLLs present?
        β”‚   β†’ Issue: Files missing or wrong paths
        β”‚
        β”œβ”€ JUCE Sliders (Gain/Cutoff/Type)
        β”‚   β†’ Check: PluginProcessor.cpp createEditor()
        β”‚   β†’ Issue: Returns GenericAudioProcessorEditor
        β”‚   β†’ Fix: Return WingmanEditor instead
        β”‚
        └─ Purple Gradient + Sparkle
            β†’ βœ… SUCCESS! CEF is working!

πŸ” KEY FILE LOCATIONS

After Building:

Plugin DLL:
C:\wingman\build\Wingman_artefacts\Release\VST3\Wingman.vst3\Contents\x86_64-win\Wingman.vst3

CEF Files:
C:\wingman\build\Wingman_artefacts\Release\VST3\Wingman.vst3\cef\libcef.dll

Web UI:
C:\wingman\build\Wingman_artefacts\Release\VST3\Wingman.vst3\Contents\Resources\webui\index.html

After Installing:

System Install:
C:\Program Files\Common Files\VST3\Wingman.vst3\

Logs (after running):
C:\temp\cef_debug.txt      ← CEF initialization log
C:\temp\cef.log            ← CEF runtime log

⚠️ CRITICAL WARNINGS

For Developers:

  1. NEVER disable GPU if user wants fancy UI
  2. NEVER return GenericAudioProcessorEditor in createEditor()
  3. NEVER use OSR mode (off-screen rendering)
  4. NEVER initialize CEF in constructor (wait for visibilityChanged)
  5. ALWAYS read CEF_GUARDRAILS.md before modifying CEF code

For AI Assistants:

  1. READ CEF_GUARDRAILS.md COMPLETELY before any changes
  2. TEST in real DAW after modifications
  3. RUN diagnose_after_test.bat to verify
  4. NEVER improvise - follow established patterns
  5. ASK if unsure - don't guess and break things

βœ… VERIFICATION CHECKLIST

Use this after building to ensure everything works:

Pre-Test (Build Time):

  • Build completed without errors
  • Plugin DLL exists
  • libcef.dll present in cef/ folder
  • chrome_elf.dll present
  • resources.pak present
  • icudtl.dat present
  • locales/ folder with .pak files
  • index.html present in webui/ folder

Test (Runtime):

  • Plugin loads in DAW without crash
  • UI window opens
  • See purple gradient (not black/white)
  • See "Hi, CEF is Working!" text
  • See animated sparkle emoji
  • Can click sparkle (shows alert)
  • Window is resizable
  • No errors in DAW console

Post-Test (Verification):

  • C:\temp\cef_debug.txt exists
  • Shows "CEF INITIALIZED" message
  • Shows "browser created successfully"
  • C:\temp\cef.log has minimal errors
  • No "FAILED" messages in logs
  • GPU errors are acceptable (fallback works)

πŸŽ“ LEARNING RESOURCES

For Complete Beginners:

  1. Start: GETTING_STARTED.md
  2. Build: Run COMPLETE_FIX_AND_TEST.bat
  3. Test: Follow on-screen instructions
  4. Issues: Run diagnose_after_test.bat

For Experienced Developers:

  1. Architecture: COMPLETE_GUIDE.md
  2. Rules: CEF_GUARDRAILS.md
  3. Current Fix: CEF_GPU_FIX_SOLUTION.md
  4. Reference: QUICK_REFERENCE.md

For AI Assistants:

  1. MUST READ: CEF_GUARDRAILS.md ⚠️
  2. Quick Ref: AI_ASSISTANT_GUIDE.md
  3. Technical: COMPLETE_GUIDE.md
  4. Current State: CEF_GPU_FIX_SOLUTION.md

πŸ“ˆ VERSION HISTORY

v2.0 (2025-10-13) - GPU FIX

  • βœ… Enabled GPU acceleration with fallback
  • βœ… Fixed black screen issue
  • βœ… Added comprehensive guardrails
  • βœ… Created complete test suite
  • βœ… Added diagnostic scripts

v1.0 (Previous) - Initial CEF Integration

  • βœ… Basic CEF integration
  • ❌ GPU disabled (caused black screen)
  • ❌ Limited documentation
  • ❌ No guardrails

πŸ†˜ GETTING HELP

Quick Help:

  1. Check this INDEX.md for common tasks
  2. Run appropriate diagnostic script
  3. Read relevant documentation

Still Stuck?

  1. Run diagnose_after_test.bat
  2. Check C:\temp\cef_debug.txt
  3. Check C:\temp\cef.log
  4. Read CEF_GUARDRAILS.md for common mistakes
  5. Compare your code with working version

For Future AIs:

  1. Read CEF_GUARDRAILS.md COMPLETELY
  2. Check existing code before suggesting changes
  3. Test changes in real DAW
  4. Run diagnose_after_test.bat to verify
  5. Don't disable features to "fix" issues - fix root cause

🎯 SUCCESS CRITERIA

Your setup is SUCCESSFUL if:

  1. βœ… Plugin builds without errors
  2. βœ… All files verified by diagnose_cef.bat
  3. βœ… Plugin loads in DAW
  4. βœ… Purple gradient displays
  5. βœ… "Hi, CEF is Working!" visible
  6. βœ… Sparkle emoji animating
  7. βœ… Can click and interact
  8. βœ… Window resizes smoothly
  9. βœ… No crashes
  10. βœ… cef_debug.txt shows success

πŸ“ž QUICK COMMAND REFERENCE

# Complete rebuild and test
COMPLETE_FIX_AND_TEST.bat

# Quick rebuild
rebuild_and_install.bat

# Check files before test
diagnose_cef.bat

# Analyze after test
diagnose_after_test.bat

# View logs
notepad C:\temp\cef_debug.txt
notepad C:\temp\cef.log

# Clean build
cd C:\wingman\build
rmdir /s /q Wingman.dir
cd ..
COMPLETE_FIX_AND_TEST.bat

πŸŽ‰ READY TO GO!

Everything is set up and documented. Time to build and test!

Start here: COMPLETE_FIX_AND_TEST.bat

Need help: Check this INDEX for relevant documentation

Break something: Read CEF_GUARDRAILS.md to fix it

Good luck! πŸš€