> ## Documentation Index
> Fetch the complete documentation index at: https://docs.liv.tv/llms.txt
> Use this file to discover all available pages before exploring further.

# Tablet Interface

> Overview of the LCKTablet virtual tablet interface for Unreal Engine, including ULCKService recording API, ULCKTabletDataModel reactive state management, camera modes, and recording profiles in the LIV Camera Kit (LCK) SDK.

<Info>
  **Module:** LCKTablet | **Version:** 1.0 | **Platforms:** All
</Info>

## Overview

LCKTablet provides a complete virtual tablet interface for in-game video capture, combining the LCK recording system with LCKUI components. It includes multiple camera modes, recording controls, and a reactive data model for state management.

## Key Components

<CardGroup cols={2}>
  <Card title="ULCKSubsystem" icon="circle-nodes">
    World subsystem managing ULCKService lifecycle
  </Card>

  <Card title="ULCKService" icon="gear">
    Central recording service with high-level API
  </Card>

  <Card title="ULCKTabletDataModel" icon="database">
    Reactive data store with UI binding delegates
  </Card>

  <Card title="ALCKTabletUI" icon="tablet">
    Complete tablet actor with UI and camera modes
  </Card>
</CardGroup>

## Architecture

```
┌─────────────────────────────────────────────────────────────┐
│                     ULCKSubsystem                           │
│                  (World Subsystem)                           │
├─────────────────────────────────────────────────────────────┤
│                      ULCKService                            │
│               (Recording Control API)                       │
├─────────────────────────────────────────────────────────────┤
│  ┌─────────────────┐  ┌─────────────────┐                  │
│  │ ULCKTabletData  │  │ ALCKTabletUI    │                  │
│  │     Model       │  │   (Actor)       │                  │
│  └────────┬────────┘  └────────┬────────┘                  │
│           │                    │                            │
│  Delegates│         ┌─────────┴─────────┐                  │
│           ▼         │                   │                   │
│  ┌────────────┐  ┌──▼────────┐  ┌──────▼──────┐           │
│  │ UI Binding │  │  Camera   │  │   LCKUI     │           │
│  │  Events    │  │  Modes    │  │ Components  │           │
│  └────────────┘  └───────────┘  └─────────────┘           │
└─────────────────────────────────────────────────────────────┘
```

## Quick Start

### Access the Service

```cpp theme={null}
#include "LCKSubsystem.h"
#include "LCKService.h"

// Get service from world subsystem
ULCKSubsystem* Subsystem = GetWorld()->GetSubsystem<ULCKSubsystem>();
ULCKService* Service = Subsystem->GetService();

// Check initialization
if (Service && Service->IsInitialized())
{
    // Service ready to use
}
```

### Basic Recording

```cpp theme={null}
// Configure recording settings
Service->ApplyRecordingSettings(
    1920, 1080,  // Resolution
    30,          // Framerate
    8000000,     // Video bitrate
    256000,      // Audio bitrate
    48000        // Sample rate
);

// Register capture component
Service->RegisterCaptureComponent(TEXT("MainCapture"), MyCaptureComponent);

// Start recording
Service->StartRecording();

// Stop recording
Service->StopRecording();
```

### Event Handling

```cpp theme={null}
// Subscribe to events
Service->OnRecordingError.AddDynamic(this, &AMyActor::HandleError);
Service->OnRecordingSaveFinished.AddDynamic(this, &AMyActor::HandleSaveFinished);
Service->OnRecordingSaveProgress.AddDynamic(this, &AMyActor::HandleProgress);

void AMyActor::HandleError(FString ErrorMessage, int32 ErrorCode)
{
    UE_LOG(LogTemp, Error, TEXT("Recording error %d: %s"), ErrorCode, *ErrorMessage);
}

void AMyActor::HandleSaveFinished(bool bSuccess)
{
    UE_LOG(LogTemp, Log, TEXT("Save %s"), bSuccess ? TEXT("succeeded") : TEXT("failed"));
}

void AMyActor::HandleProgress(float Progress)
{
    // Progress is 0.0 to 1.0
    UpdateProgressUI(Progress * 100.0f);
}
```

## Camera Modes

The tablet includes three camera modes:

| Mode             | Description         | Features                        |
| ---------------- | ------------------- | ------------------------------- |
| **Selfie**       | Front-facing camera | Follow mode, front/rear toggle  |
| **First Person** | POV camera          | Direct player view              |
| **Third Person** | Behind player       | Adjustable distance, front/back |

<Card title="Camera Modes" icon="camera" href="/unreal/tablet-interface/camera-modes">
  Learn more about camera mode configuration
</Card>

## Data Model

The `ULCKTabletDataModel` provides reactive state management with delegates for UI binding:

```cpp theme={null}
// Get data model
ULCKTabletDataModel* Model = Tablet->GetDataModel();

// Subscribe to changes
Model->OnMicStateChanged.AddLambda([](ELCKMicState NewState) {
    // Update UI when mic state changes
});

Model->OnVideoQualityChanged.AddLambda([](ELCKVideoQuality NewQuality) {
    // Update UI when quality changes
});

// Trigger state changes
Model->ToggleMicState();
Model->CycleVideoQuality();
```

## Recording Profiles

Pre-configured quality profiles:

| Profile      | Resolution  | Typical Use                 |
| ------------ | ----------- | --------------------------- |
| `Profile_SD` | 1280 x 720  | Mobile VR, performance mode |
| `Profile_HD` | 1920 x 1080 | Standard recording          |
| `Profile_2K` | 2560 x 1440 | High quality                |
| `Profile_4K` | 3840 x 2160 | Maximum quality (PC only)   |

## Log Category

```cpp theme={null}
DECLARE_LOG_CATEGORY_EXTERN(LogA2LCKTablet, Log, All);
```

## Next Steps

<CardGroup cols={2}>
  <Card title="Camera Modes" icon="camera" href="/unreal/tablet-interface/camera-modes">
    Camera mode configuration
  </Card>

  <Card title="Tablet API Reference" icon="code" href="/api-reference/unreal/tablet-interface">
    Complete API documentation
  </Card>
</CardGroup>
