Skip to content

Derek/ticket 379 Add generic file picker control for file inputs#427

Open
derekllanes wants to merge 6 commits into
developfrom
derek/ticket-379
Open

Derek/ticket 379 Add generic file picker control for file inputs#427
derekllanes wants to merge 6 commits into
developfrom
derek/ticket-379

Conversation

@derekllanes
Copy link
Copy Markdown

Summary

This PR adds support for generic file inputs as GUI controls

The intended behavior is:

  • gr.File(...) inputs for MIDI files (.mid, .midi) still behave as MIDI tracks.
  • Other gr.File(...) inputs become a generic file picker control in the GUI.
  • The file picker uses the model builder’s label and allowed file extensions from app.py.
  • HARP does not hardcode a specific use case like NAM. The model builder controls what file types are allowed through file_types.

In the HARP UI, the new control appears as:

  • a label from the model definition
  • a Browse... button
  • a read-only text field showing No file selected or the selected file path

What Changed

pyharp:

  • Added a new HarpFilePicker component type.
  • Updated generic gr.File(...) handling so non-MIDI file inputs are represented as file_picker.
  • Preserved the model builder’s label, info, required, and file_types values.
  • Updated the UI tester app with a generic file input for testing.

HARP:

  • Added FilePickerComponentInfo to store: selected file path, required status, allowed file extensions
  • Updated Model.h so file_picker inputs are parsed as GUI controls rather than input tracks.
  • Added FilePickerWithLabel
  • Updated ControlAreaWidget to display file picker controls alongside sliders, dropdowns, toggles, and text boxes.
  • Removed the old generic file-track routing from TrackAreaWidget, since generic files should now be selected through the GUI control system.

TESTING
While testing with the updated "ui_tester" in pyharp is working. Note that extensive testing has not been done.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants