syntax = "proto3";

package rv.data;

option cc_enable_arenas = true;
option csharp_namespace = "Pro.SerializationInterop.RVProtoData";
option swift_prefix = "RVData_";

import "action.proto";
import "color.proto";
import "cue.proto";
import "hotKey.proto";
import "musicKeyScale.proto";
import "planningCenter.proto";
import "url.proto";
import "uuid.proto";

message Playlist {
  message PlaylistArray {
    repeated .rv.data.Playlist playlists = 1;
  }

  message PlaylistItems {
    repeated .rv.data.PlaylistItem items = 1;
  }

  message FolderDirectory {
    enum ImportBehavior {
      IMPORT_BEHAVIOR_BACKGROUND = 0;
      IMPORT_BEHAVIOR_FOREGROUND = 1;
    }

    .rv.data.URL smart_directory = 1;
    .rv.data.Playlist.FolderDirectory.ImportBehavior import_behavior = 2;
  }

  message Tag {
    .rv.data.Color color = 1;
    string name = 2;
    .rv.data.UUID uuid = 3;
  }

  message StartupInfo {
    bool trigger_on_startup = 1;
  }

  enum Type {
    TYPE_UNKNOWN = 0;
    TYPE_PLAYLIST = 1;
    TYPE_GROUP = 2;
    TYPE_SMART = 3;
    TYPE_ROOT = 4;
  }

  enum TimingType {
    TIMING_TYPE_NONE = 0;
    TIMING_TYPE_TIMECODE = 1;
    TIMING_TYPE_TIME_OF_DAY = 2;
  }

  .rv.data.UUID uuid = 1;
  string name = 2;
  .rv.data.Playlist.Type type = 3;
  bool expanded = 4;
  .rv.data.UUID targeted_layer_uuid = 5;
  .rv.data.URL smart_directory_path = 6;
  .rv.data.HotKey hot_key = 7;
  repeated .rv.data.Cue cues = 8;
  repeated .rv.data.Playlist children = 9;
  bool timecode_enabled = 10;
  .rv.data.Playlist.TimingType timing = 11;
  .rv.data.Playlist.StartupInfo startup_info = 16;
  oneof ChildrenType {
    .rv.data.Playlist.PlaylistArray playlists = 12;
    .rv.data.Playlist.PlaylistItems items = 13;
  }
  oneof LinkData {
    .rv.data.Playlist.FolderDirectory smart_directory = 14;
    .rv.data.PlanningCenterPlan pco_plan = 15;
  }
}

message PlaylistItem {
  message Header {
    .rv.data.Color color = 1;
    repeated .rv.data.Action actions = 2;
  }

  message Presentation {
    .rv.data.URL document_path = 1;
    .rv.data.UUID arrangement = 2;
    .rv.data.Action.ContentDestination content_destination = 3;
    .rv.data.MusicKeyScale user_music_key = 4;
    string arrangement_name = 5;
  }

  message PlanningCenter {
    .rv.data.PlanningCenterPlan.PlanItem item = 1;
    .rv.data.PlaylistItem linked_data = 2;
  }

  message Placeholder {
    .rv.data.PlaylistItem linked_data = 1;
  }

  .rv.data.UUID uuid = 1;
  string name = 2;
  repeated .rv.data.UUID tags = 7;
  bool is_hidden = 9;
  oneof ItemType {
    .rv.data.PlaylistItem.Header header = 3;
    .rv.data.PlaylistItem.Presentation presentation = 4;
    .rv.data.Cue cue = 5;
    .rv.data.PlaylistItem.PlanningCenter planning_center = 6;
    .rv.data.PlaylistItem.Placeholder placeholder = 8;
  }
}

