import 'package:get/get.dart';

class WxImagePreviewState {
  // 是否正在加载
  final _isLoading = false.obs;

  // 是否为单帧图像
  final _isSingleFrame = false.obs;

  // 是否为Png图像
  final _isPng = false.obs;

  // 当前播放进度
  final _processValue = 0.0.obs;

  // 总帧数
  final _totalFramesCount = 0.obs;

  // 视频宽高比
  final _aspectRatio = 1.0.obs;

  // 是否正在播放
  final _isPlaying = false.obs;

  // 控制器初始化完成
  final _isControllerInitialized = false.obs;

  set isLoading(bool value) => _isLoading.value = value;
  bool get isLoading => _isLoading.value;

  set isSingleFrame(bool value) => _isSingleFrame.value = value;
  bool get isSingleFrame => _isSingleFrame.value;

  set isPng(bool value) => _isPng.value = value;
  bool get isPng => _isPng.value;

  set processValue(double value) => _processValue.value = value;
  double get processValue => _processValue.value;

  set totalFramesCount(int value) => _totalFramesCount.value = value;
  int get totalFramesCount => _totalFramesCount.value;

  set aspectRatio(double value) => _aspectRatio.value = value;
  double get aspectRatio => _aspectRatio.value;

  set isPlaying(bool value) => _isPlaying.value = value;
  bool get isPlaying => _isPlaying.value;

  set isControllerInitialized(bool value) =>
      _isControllerInitialized.value = value;
  bool get isControllerInitialized => _isControllerInitialized.value;
}
