import '../../../core/contracts/player_gestures.dart';

export '../../../core/contracts/player_gestures.dart' show GestureAction;

String gestureActionLabel(GestureAction a) => switch (a) {
  GestureAction.none => '无操作',
  GestureAction.playPause => '播放/暂停',
  GestureAction.fullscreen => '全屏',
  GestureAction.toggleControls => '显示/隐藏控制栏',
  GestureAction.seekBackward => '后退',
  GestureAction.seekForward => '前进',
  GestureAction.previousItem => '上一个',
  GestureAction.nextItem => '下一个',
  GestureAction.exit => '退出',
};

enum GestureKind { leftClick, leftDoubleClick, rightClick, rightDoubleClick }


List<GestureAction> allowedActionsFor(GestureKind kind) {
  switch (kind) {
    case GestureKind.leftClick:
    case GestureKind.rightClick:
      return const [
        GestureAction.playPause,
        GestureAction.toggleControls,
        GestureAction.none,
      ];
    case GestureKind.leftDoubleClick:
    case GestureKind.rightDoubleClick:
      return const [
        GestureAction.playPause,
        GestureAction.fullscreen,
        GestureAction.seekBackward,
        GestureAction.seekForward,
        GestureAction.previousItem,
        GestureAction.nextItem,
        GestureAction.exit,
        GestureAction.none,
      ];
  }
}
