# Models Directory

This directory contains the core data models for the screenmucord application.

## Files

### RecordingConfiguration.swift
Defines the `RecordingConfiguration` struct that holds all settings for a recording session:
- Recording mode
- Video settings (resolution, frame rate, quality, encoder, format)
- Cursor settings
- Audio settings
- Visual settings
- Recording behavior
- Output settings

Also includes supporting enums:
- `ResolutionMode`: Low (0.5x), Normal (1x), High (Native)
- `VideoQuality`: Low, Medium, High
- `VideoEncoder`: H.264, H.265
- `OutputFormat`: MOV, MP4
- `BackgroundType`: Various background color options

### RecordingMode.swift
Defines the `RecordingMode` enum with associated values for each capture type:
- `screen(display:)`: Capture entire display
- `screenArea(display:rect:)`: Capture specific area
- `window(window:)`: Capture single window
- `windows(windows:)`: Capture multiple windows
- `application(apps:)`: Capture application windows
- `systemAudio`: Audio-only recording
- `iOSDevice(device:)`: iOS device recording

### RecordingState.swift
Defines the `RecordingState` enum for the recording lifecycle state machine:
- `idle`: No active recording
- `preparing`: Initializing capture engines
- `ready`: Ready to start
- `recording(startTime:)`: Actively recording
- `paused(pauseTime:elapsed:)`: Recording paused
- `finalizing`: Writing file
- `completed(fileURL:)`: Successfully completed
- `failed(error:)`: Failed with error

### RecordingError.swift
Defines the `RecordingError` enum with localized error descriptions:
- `permissionDenied(type:)`: Missing permissions
- `captureDeviceUnavailable`: Device not available
- `encoderInitializationFailed`: Encoder setup failed
- `fileWriteError(underlying:)`: File write failed
- `invalidConfiguration(reason:)`: Invalid settings
- `streamInterrupted`: Stream was interrupted
- `insufficientDiskSpace`: Not enough disk space
- `outputDirectoryNotWritable`: Cannot write to directory
- `unknown(underlying:)`: Unknown error

Also includes `PermissionType` enum for permission types.

## Usage

These models are used throughout the application to:
1. Configure recording sessions
2. Track recording state
3. Handle errors with localized messages
4. Define capture targets and modes
