import 'package:equatable/equatable.dart';

abstract class PtzEvent extends Equatable {
  const PtzEvent();

  @override
  List<Object?> get props => [];
}

/// Start panning
class PtzPanStart extends PtzEvent {
  final int cameraId;
  final String direction; // 'left' or 'right'
  final int speed;

  const PtzPanStart({
    required this.cameraId,
    required this.direction,
    this.speed = 50,
  });

  @override
  List<Object?> get props => [cameraId, direction, speed];
}

/// Start tilting
class PtzTiltStart extends PtzEvent {
  final int cameraId;
  final String direction; // 'up' or 'down'
  final int speed;

  const PtzTiltStart({
    required this.cameraId,
    required this.direction,
    this.speed = 50,
  });

  @override
  List<Object?> get props => [cameraId, direction, speed];
}

/// Start zooming
class PtzZoomStart extends PtzEvent {
  final int cameraId;
  final String direction; // 'in' or 'out'
  final int speed;

  const PtzZoomStart({
    required this.cameraId,
    required this.direction,
    this.speed = 50,
  });

  @override
  List<Object?> get props => [cameraId, direction, speed];
}

/// Stop all PTZ movement
class PtzStop extends PtzEvent {
  final int cameraId;

  const PtzStop(this.cameraId);

  @override
  List<Object?> get props => [cameraId];
}

/// Go to preset
class PtzGoToPreset extends PtzEvent {
  final int cameraId;
  final int preset;

  const PtzGoToPreset({
    required this.cameraId,
    required this.preset,
  });

  @override
  List<Object?> get props => [cameraId, preset];
}

/// Set camera for PTZ control
class PtzSetCamera extends PtzEvent {
  final int? cameraId;

  const PtzSetCamera(this.cameraId);

  @override
  List<Object?> get props => [cameraId];
}
