========================================================================
  SINHALA SUBTITLE GENERATOR — Windows INSTALL
  Premiere Pro CEP Extension
========================================================================

This folder is a self-contained Windows install package. It contains:

  install-windows.bat            <- run this
  SinhalaSubtitles-windows/      <- the extension itself (installer
                                     copies this into Premiere's
                                     extensions folder)

FASTEST WAY TO INSTALL
------------------------------------------------------------------------
  1. Open this "windows" folder in File Explorer.
  2. Double-click install-windows.bat.
     (If Windows SmartScreen warns you, click "More info" -> "Run
     anyway" — this is a local, unsigned .bat file you can read in
     Notepad before running it, see below.)
  3. Follow the on-screen steps. It only touches your own Windows user
     profile (no admin rights required).

install-windows.bat is plain text — right-click it -> Edit (or open it
in Notepad) first if you want to see exactly what it does before
running it.

------------------------------------------------------------------------
  BEFORE FIRST USE — two files you must add
------------------------------------------------------------------------
Inside SinhalaSubtitles-windows\assets\ and SinhalaSubtitles-windows\
icons\ there are placeholder .txt files marking where two files belong.
Add them either before installing (edit the SinhalaSubtitles-windows
folder here) or after (edit the installed copy in %APPDATA%\Adobe\CEP\
extensions\com.example.sinhalasubtitles) — the installer checks and
tells you at the end either way.

  1. assets\audio_wav_48k_16bit.epr
     An audio-only export preset. Create it once in Premiere:
       Export panel -> Format: Waveform Audio -> uncheck Export Video
       -> save the preset -> find the .epr file it creates -> copy it
       into the "assets" folder with the name audio_wav_48k_16bit.epr
     (Easier: skip this and use the plugin's own Settings tab ->
      "Find & use my WAV preset" button after installing — it scans
      your Premiere/Media Encoder presets and installs one for you.)

  2. icons\icon.png
     Any small PNG (about 48x48) so the panel has an icon.

Optional, only for "Add Text Object to Timeline":
  3. assets\text_template.mogrt — a text Motion Graphics template.
     See the plugin's Converter/About tab for how to get one.

========================================================================
  MANUAL INSTALL (if you'd rather not run the script)
========================================================================
  1. Enable unsigned extensions (one-time, Command Prompt — no admin
     needed, these are per-user HKEY_CURRENT_USER keys):
        reg add "HKCU\Software\Adobe\CSXS.12" /v PlayerDebugMode /t REG_SZ /d 1 /f
        reg add "HKCU\Software\Adobe\CSXS.11" /v PlayerDebugMode /t REG_SZ /d 1 /f
        reg add "HKCU\Software\Adobe\CSXS.10" /v PlayerDebugMode /t REG_SZ /d 1 /f
        reg add "HKCU\Software\Adobe\CSXS.9"  /v PlayerDebugMode /t REG_SZ /d 1 /f

  2. Copy the SinhalaSubtitles-windows folder's *contents* (not the
     folder itself) into:
        %APPDATA%\Adobe\CEP\extensions\com.example.sinhalasubtitles
     Create that path if it doesn't exist yet. Final layout should be:
        ...\com.example.sinhalasubtitles\CSXS\manifest.xml
        ...\com.example.sinhalasubtitles\index.html
        ...\com.example.sinhalasubtitles\js\...
        ...\com.example.sinhalasubtitles\jsx\...
        (etc.)

  3. Fully quit and restart Premiere Pro, then open:
        Window -> Extensions -> Sinhala Subtitles

========================================================================
  FIRST-RUN SETUP (after install)
========================================================================
  1. Settings tab:
       - Paste your Gemini API key (from aistudio.google.com) -> Save Key
         -> Test. It should say the key works and name a model.
       - Under "Audio export preset", click "Find & use my WAV preset"
         (or make sure assets\audio_wav_48k_16bit.epr exists).

  2. Install a Sinhala font so captions render correctly:
       - For Unicode captions: install "Noto Sans Sinhala" (or similar)
         and set it in Premiere's Window -> Captions.
       - For FM output (Converter tab / "Convert all to FM"): install
         the FM Abhaya font and set that as the caption font instead.

  3. Generate tab:
       - Select audio source -> Transcribe Audio -> review -> Add
         Subtitle Track.

========================================================================
  TROUBLESHOOTING
========================================================================
Panel doesn't appear under Window -> Extensions
  - PlayerDebugMode wasn't set for the CSXS version your Premiere uses.
    Re-run the registry commands above, then fully restart Premiere.
  - Confirm the folder is directly inside "extensions" — check that
    ...\extensions\com.example.sinhalasubtitles\index.html exists.

"Test" says the key works but transcription fails
  - Reload the panel (close/reopen it) so the latest code loads.
  - Use the "Diagnose" button in Settings to see which models your key
    can use.

"No audio export preset" / export produces nothing
  - Create an audio-only .epr (Waveform Audio, no video) and place it
    at assets\audio_wav_48k_16bit.epr, or use "Find & use my WAV preset".

Captions look like random letters
  - The correct font isn't set. Unicode text needs a Sinhala Unicode
    font; FM text needs the FM Abhaya font. Set it in Window -> Captions.

Caption track won't create (Premiere 2026)
  - Use "Save SRT", then drag the .srt onto the timeline manually and
    choose the Subtitle format. If imports keep failing, clear the
    media cache (Preferences -> Media Cache -> Delete).

SmartScreen blocks install-windows.bat
  - This is expected for any unsigned script downloaded from outside
    the Microsoft Store. Click "More info" -> "Run anyway", or just
    read it in Notepad and run the "MANUAL INSTALL" steps above by
    hand — it does nothing the manual steps don't also do.

------------------------------------------------------------------------
  NOTE ON PREMIERE VERSIONS
------------------------------------------------------------------------
This is a CEP extension. Adobe is phasing out CEP in favour of UXP;
CEP support is expected to end around September 2026. The extension
works on current Premiere releases on Windows, but plan for a future
UXP version for long-term use.

Developer: Kusal Rathna
Facebook: https://www.facebook.com/KusalrathnaBandara/
========================================================================
