diff options
| author | Paul Buetow <paul@buetow.org> | 2025-07-16 20:38:22 +0300 |
|---|---|---|
| committer | Paul Buetow <paul@buetow.org> | 2025-07-16 20:38:22 +0300 |
| commit | d46669426aa6b0ece71d0d05d0b6f2966686b17a (patch) | |
| tree | 9f927c3a8bc763943764ad63e3badafe8a9a7f62 /internal/gui/audio_player.go | |
| parent | e49ecfe601c924fa68671477331a860acf8a62f7 (diff) | |
feat: add custom image prompt support and keyboard shortcuts
- Add text area next to image display for custom image generation prompts
- Users can specify their own prompts or leave empty for auto-generation
- Display the used prompt in the text area after generation
- Load prompts from attribution files when navigating to existing cards
- Add keyboard shortcuts for all GUI buttons:
- G: Generate, N: New Word, I: Regenerate Image, A: Regenerate Audio
- R: Regenerate All, D: Delete, P: Play audio
- Left/Right arrows: Navigate between words
- Y/N: Confirm/cancel delete dialog
- Update UI layout with equal 50/50 split between image and prompt
- Enable text wrapping in prompt text area
- Add 25% chance to ask OpenAI for creative photo style suggestions
- Fix concurrent processing to properly use custom prompts
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
Diffstat (limited to 'internal/gui/audio_player.go')
| -rw-r--r-- | internal/gui/audio_player.go | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/internal/gui/audio_player.go b/internal/gui/audio_player.go index 161c635..2d4b2da 100644 --- a/internal/gui/audio_player.go +++ b/internal/gui/audio_player.go @@ -31,7 +31,7 @@ func NewAudioPlayer() *AudioPlayer { p := &AudioPlayer{} // Create controls - p.playButton = widget.NewButton("▶ Play", p.onPlay) + p.playButton = widget.NewButton("▶ Play (P)", p.onPlay) p.stopButton = widget.NewButton("■ Stop", p.onStop) p.statusLabel = widget.NewLabel("No audio loaded") @@ -98,7 +98,7 @@ func (p *AudioPlayer) onPlay() { } p.isPlaying = true - p.playButton.SetText("⏸ Pause") + p.playButton.SetText("⏸ Pause (P)") p.stopButton.Enable() p.statusLabel.SetText("Playing: " + filepath.Base(p.audioFile)) } @@ -111,11 +111,18 @@ func (p *AudioPlayer) onStop() { } p.isPlaying = false - p.playButton.SetText("▶ Play") + p.playButton.SetText("▶ Play (P)") p.stopButton.Disable() p.statusLabel.SetText("Stopped: " + filepath.Base(p.audioFile)) } +// Play triggers audio playback +func (p *AudioPlayer) Play() { + if !p.playButton.Disabled() { + p.onPlay() + } +} + // startPlayback starts audio playback using platform-specific commands func (p *AudioPlayer) startPlayback() error { var cmd *exec.Cmd @@ -157,7 +164,7 @@ func (p *AudioPlayer) startPlayback() error { // Playback finished normally fyne.Do(func() { p.isPlaying = false - p.playButton.SetText("▶ Play") + p.playButton.SetText("▶ Play (P)") p.stopButton.Disable() p.statusLabel.SetText("Finished: " + filepath.Base(p.audioFile)) }) |
