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

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

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

FASTEST WAY TO INSTALL
------------------------------------------------------------------------
  1. Open Terminal (Applications -> Utilities -> Terminal).
  2. Drag this "mac" folder into the Terminal window (or `cd` into it),
     then run:

        ./install-mac.sh

     If you get a permissions error first, run:

        chmod +x install-mac.sh

  3. Follow the on-screen steps. It only touches your own user profile
     (no admin/sudo required).

install-mac.sh is plain text — open it in TextEdit first if you want to
see exactly what it does before running it.

------------------------------------------------------------------------
  BEFORE FIRST USE — two files you must add
------------------------------------------------------------------------
Inside SinhalaSubtitles-mac/assets/ and SinhalaSubtitles-mac/icons/ there
are placeholder .txt files marking where two files belong. Add them
either before installing (edit the SinhalaSubtitles-mac folder here) or
after (edit the installed copy in ~/Library/Application Support/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 Terminal commands):
        defaults write com.adobe.CSXS.12 PlayerDebugMode 1
        defaults write com.adobe.CSXS.11 PlayerDebugMode 1
        defaults write com.adobe.CSXS.10 PlayerDebugMode 1
     (Recommended) then run:  killall cfprefsd

  2. Copy the SinhalaSubtitles-mac folder's *contents* (not the folder
     itself) into:
        ~/Library/Application Support/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 Terminal 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).

------------------------------------------------------------------------
  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 macOS, but plan for a future UXP
version for long-term use.

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