public CaptionAssetBaseFilter(JToken node) : base(node) { if (node["captionParamsIdEqual"] != null) { this._CaptionParamsIdEqual = ParseInt(node["captionParamsIdEqual"].Value <string>()); } if (node["captionParamsIdIn"] != null) { this._CaptionParamsIdIn = node["captionParamsIdIn"].Value <string>(); } if (node["formatEqual"] != null) { this._FormatEqual = (CaptionType)StringEnum.Parse(typeof(CaptionType), node["formatEqual"].Value <string>()); } if (node["formatIn"] != null) { this._FormatIn = node["formatIn"].Value <string>(); } if (node["statusEqual"] != null) { this._StatusEqual = (CaptionAssetStatus)ParseEnum(typeof(CaptionAssetStatus), node["statusEqual"].Value <string>()); } if (node["statusIn"] != null) { this._StatusIn = node["statusIn"].Value <string>(); } if (node["statusNotIn"] != null) { this._StatusNotIn = node["statusNotIn"].Value <string>(); } }
protected override void SetProperties(Caption response) { if (response == null) { return; } _rawData = response; _id = response.Id; _kind = response.Kind; if (response.Snippet == null) { return; } _audioTrackType = response.Snippet.AudioTrackType.GetValueOrDefault(); _isAutoSynced = response.Snippet.IsAutoSynced.GetValueOrDefault(); _isCc = response.Snippet.IsCC.GetValueOrDefault(); _isEasyReader = response.Snippet.IsEasyReader.GetValueOrDefault(); _isLarge = response.Snippet.IsLarge.GetValueOrDefault(); _language = response.Snippet.Language; _lastUpdated = response.Snippet.LastUpdated.GetValueOrDefault(); _name = response.Snippet.Name; _type = response.Snippet.TrackKind.GetValueOrDefault(); _videoId = response.Snippet.VideoId; }
public void requestCaption(CaptionType caption_type) { if (m_RequestCaption != caption_type) { if (m_CurrentCaption != m_RequestCaption) { // 以前のリクエストが完了していなかったら、以前のリクエストを中止 GameObject request_caption = getCaptionObject(m_RequestCaption); if (request_caption != null) { if (m_RequestCaptionAnim) { m_RequestCaptionAnim = false; Animation anim = request_caption.GetComponent <Animation>(); if (anim != null) { anim.Stop(); } } request_caption.SetActive(false); } } m_RequestCaption = caption_type; } }
public static RawEntry Read(XmlReader xml) { xml.Read(); string audioFile = xml.GetAttribute("AudioFile"); string hack = xml.GetAttribute("Hack") ?? Hack.None.ToString(); string textArea = xml.GetAttribute("TextArea"); Console.WriteLine($"Read: {xml.Name} {audioFile} {hack} {textArea}"); byte[] content; CaptionType type = (CaptionType)Enum.Parse(typeof(CaptionType), xml.Name); switch (type) { case CaptionType.Static: content = (xml.ReadElementContentAsString() + "\0").ToUTF16(); break; case CaptionType.Dynamic: content = AssembleDynamicContent(xml); break; default: //shouldn't happen because of XSD validation throw new XmlException("Invalid subtitle type. How did this get through the XSD?"); } return(new RawEntry(audioFile, (Hack)Enum.Parse(typeof(Hack), hack), (TextArea)Enum.Parse(typeof(TextArea), textArea), type, content)); }
public CaptionParams(XmlElement node) : base(node) { foreach (XmlElement propertyNode in node.ChildNodes) { switch (propertyNode.Name) { case "language": this._Language = (Language)StringEnum.Parse(typeof(Language), propertyNode.InnerText); continue; case "isDefault": this._IsDefault = (NullableBoolean)ParseEnum(typeof(NullableBoolean), propertyNode.InnerText); continue; case "label": this._Label = propertyNode.InnerText; continue; case "format": this._Format = (CaptionType)StringEnum.Parse(typeof(CaptionType), propertyNode.InnerText); continue; case "sourceParamsId": this._SourceParamsId = ParseInt(propertyNode.InnerText); continue; } } }
private RawEntry(string audioFile, Hack hack, TextArea textArea, CaptionType captionType, byte[] content) { AudioFile = audioFile; Hack = hack; TextArea = textArea; CaptionType = captionType; Content = content; }
private void TryEndHostCaption(IVdShape caption, CaptionType type) { //inject caption if (_hostAwaitingCaption == null) { return; } RemovePreviousCaption(_hostAwaitingCaption, type); if (caption is VdFreeForm) { _hostAwaitingCaption.CapMgr().FreeDraw = (VdFreeForm)caption; //initial resize of free form _hostAwaitingCaption.CapMgr().InitialResizeOfFreeForm(); //send resized free form SendSyncState(_hostAwaitingCaption.CapMgr().FreeDraw); //cluster + title stats event _rt.clienRt.SendStatsEvent(StEvent.ClusterTitleAdded, _palette.GetOwnerId(), _doc.DiscussionId, _doc.TopicId, DeviceType.Wpf); } else if (caption is VdText) { _hostAwaitingCaption.CapMgr().text = (VdText)caption; //increase caption font //for(int i = 0; i<6; ++i) // _hostAwaitingCaption.CapMgr().text.ScaleInPlace(true); SendSyncState(_hostAwaitingCaption.CapMgr().text); //cluster + title stats event _rt.clienRt.SendStatsEvent(StEvent.ClusterTitleAdded, _palette.GetOwnerId(), _doc.DiscussionId, _doc.TopicId, DeviceType.Wpf); } else { throw new NotSupportedException(); } //update first time after build _hostAwaitingCaption.CapMgr().UpdateRelatives(); //send state of cluster to attach captions on other clients SendSyncState(_hostAwaitingCaption); _hostAwaitingCaption = null; }
void RemovePreviousCaption(VdCluster cluster, CaptionType type) { if (clusterAwaitingCaption.Captions.FreeDraw != null) { _doc.BeginRemoveSingleShape(clusterAwaitingCaption.Captions.FreeDraw.Id()); } if (clusterAwaitingCaption.Captions.text != null) { _doc.BeginRemoveSingleShape(clusterAwaitingCaption.Captions.text.Id()); } }
private void RemovePreviousCaption(ICaptionHost cluster, CaptionType type) { if (_hostAwaitingCaption.CapMgr().FreeDraw != null) { _doc.BeginRemoveSingleShape(_hostAwaitingCaption.CapMgr().FreeDraw.Id()); } if (_hostAwaitingCaption.CapMgr().text != null) { _doc.BeginRemoveSingleShape(_hostAwaitingCaption.CapMgr().text.Id()); } }
public CaptionParamsBaseFilter(JToken node) : base(node) { if (node["formatEqual"] != null) { this._FormatEqual = (CaptionType)StringEnum.Parse(typeof(CaptionType), node["formatEqual"].Value <string>()); } if (node["formatIn"] != null) { this._FormatIn = node["formatIn"].Value <string>(); } }
public CaptionAsset(JToken node) : base(node) { if (node["captionParamsId"] != null) { this._CaptionParamsId = ParseInt(node["captionParamsId"].Value <string>()); } if (node["language"] != null) { this._Language = (Language)StringEnum.Parse(typeof(Language), node["language"].Value <string>()); } if (node["languageCode"] != null) { this._LanguageCode = (LanguageCode)StringEnum.Parse(typeof(LanguageCode), node["languageCode"].Value <string>()); } if (node["isDefault"] != null) { this._IsDefault = (NullableBoolean)ParseEnum(typeof(NullableBoolean), node["isDefault"].Value <string>()); } if (node["label"] != null) { this._Label = node["label"].Value <string>(); } if (node["format"] != null) { this._Format = (CaptionType)StringEnum.Parse(typeof(CaptionType), node["format"].Value <string>()); } if (node["source"] != null) { this._Source = (CaptionSource)StringEnum.Parse(typeof(CaptionSource), node["source"].Value <string>()); } if (node["status"] != null) { this._Status = (CaptionAssetStatus)ParseEnum(typeof(CaptionAssetStatus), node["status"].Value <string>()); } if (node["parentId"] != null) { this._ParentId = node["parentId"].Value <string>(); } if (node["accuracy"] != null) { this._Accuracy = ParseInt(node["accuracy"].Value <string>()); } if (node["displayOnPlayer"] != null) { this._DisplayOnPlayer = ParseBool(node["displayOnPlayer"].Value <string>()); } if (node["associatedTranscriptIds"] != null) { this._AssociatedTranscriptIds = node["associatedTranscriptIds"].Value <string>(); } }
//---------------------------------------------------------------------------- /*! * @brief キャプションを強制的に非表示にする */ //---------------------------------------------------------------------------- public void outForce() { // 例外処理:PlayerPhaseCaption非表示化 GameObject caption = getCaptionObject(m_CurrentCaption); if (caption != null) { caption.GetComponent <Animation>().Stop(); caption.GetComponent <Animation>().Play(InGameDefine.ANIM_CAPTION_OUT); } m_CurrentCaption = CaptionType.NONE; m_RequestCaption = CaptionType.NONE; m_RequestCaptionAnim = false; }
public static Packet Caption(CaptionType type, string title, string script, string align, float offsetRateX, float offsetRateY, int duration, float scale) { PacketWriter pWriter = PacketWriter.Of(SendOp.CINEMATIC); pWriter.WriteEnum(CinematicPacketMode.Caption); pWriter.WriteUnicodeString(type.ToString() + "Caption"); pWriter.WriteUnicodeString(title); pWriter.WriteUnicodeString(script); pWriter.WriteUnicodeString(align); pWriter.WriteInt(duration); pWriter.WriteFloat(offsetRateX); pWriter.WriteFloat(offsetRateY); pWriter.WriteFloat(scale); return(pWriter); }
public CaptionParamsBaseFilter(XmlElement node) : base(node) { foreach (XmlElement propertyNode in node.ChildNodes) { switch (propertyNode.Name) { case "formatEqual": this._FormatEqual = (CaptionType)StringEnum.Parse(typeof(CaptionType), propertyNode.InnerText); continue; case "formatIn": this._FormatIn = propertyNode.InnerText; continue; } } }
void CaptionCreationRequested(CaptionType type, VdCluster cluster) { BeginClusterCaption(cluster, type); switch (type) { case CaptionType.FreeDraw: EnterShapeCreationMode(VdShapeType.FreeForm); break; case CaptionType.Text: //emulate text creation _palette.shapeType = VdShapeType.Text; EnterShapeCreationMode(VdShapeType.Text); var clustBounds = cluster.boundsProvider(); InpDeviceDown(new Point(clustBounds.X + 140, clustBounds.Y - 160), null); break; } }
public CaptionAsset(XmlElement node) : base(node) { foreach (XmlElement propertyNode in node.ChildNodes) { switch (propertyNode.Name) { case "captionParamsId": this._CaptionParamsId = ParseInt(propertyNode.InnerText); continue; case "language": this._Language = (Language)StringEnum.Parse(typeof(Language), propertyNode.InnerText); continue; case "languageCode": this._LanguageCode = (LanguageCode)StringEnum.Parse(typeof(LanguageCode), propertyNode.InnerText); continue; case "isDefault": this._IsDefault = (NullableBoolean)ParseEnum(typeof(NullableBoolean), propertyNode.InnerText); continue; case "label": this._Label = propertyNode.InnerText; continue; case "format": this._Format = (CaptionType)StringEnum.Parse(typeof(CaptionType), propertyNode.InnerText); continue; case "status": this._Status = (CaptionAssetStatus)ParseEnum(typeof(CaptionAssetStatus), propertyNode.InnerText); continue; case "parentId": this._ParentId = propertyNode.InnerText; continue; case "accuracy": this._Accuracy = ParseInt(propertyNode.InnerText); continue; } } }
private void CaptionCreationRequested(CaptionType type, ICaptionHost host) { BeginHostCaption(host, type); switch (type) { case CaptionType.FreeDraw: EnterShapeCreationMode(VdShapeType.FreeForm, -1); break; case CaptionType.Text: //emulate text creation _palette.shapeType = VdShapeType.Text; EnterShapeCreationMode(VdShapeType.Text, -1); var clickLocation = host.capOrgProvider(); InpDeviceDown(new Point(clickLocation.X, clickLocation.Y), null); break; } }
void TryEndClusterCaption(IVdShape caption, CaptionType type) { //inject caption if (clusterAwaitingCaption == null) { return; } RemovePreviousCaption(clusterAwaitingCaption, type); if (caption is VdFreeForm) { clusterAwaitingCaption.Captions.FreeDraw = (VdFreeForm)caption; //initial resize of free form clusterAwaitingCaption.Captions.InitialResizeOfFreeForm(); //send resized free form SendSyncState(clusterAwaitingCaption.Captions.FreeDraw); } else if (caption is VdText) { clusterAwaitingCaption.Captions.text = (VdText)caption; SendSyncState(clusterAwaitingCaption.Captions.text); } else { throw new NotSupportedException(); } //update first time after build clusterAwaitingCaption.Captions.UpdateRelatives(); //send state of cluster to attach captions on other clients SendSyncState(clusterAwaitingCaption); clusterAwaitingCaption = null; }
public CaptionParams(JToken node) : base(node) { if (node["language"] != null) { this._Language = (Language)StringEnum.Parse(typeof(Language), node["language"].Value <string>()); } if (node["isDefault"] != null) { this._IsDefault = (NullableBoolean)ParseEnum(typeof(NullableBoolean), node["isDefault"].Value <string>()); } if (node["label"] != null) { this._Label = node["label"].Value <string>(); } if (node["format"] != null) { this._Format = (CaptionType)StringEnum.Parse(typeof(CaptionType), node["format"].Value <string>()); } if (node["sourceParamsId"] != null) { this._SourceParamsId = ParseInt(node["sourceParamsId"].Value <string>()); } }
public CaptionAssetBaseFilter(XmlElement node) : base(node) { foreach (XmlElement propertyNode in node.ChildNodes) { switch (propertyNode.Name) { case "captionParamsIdEqual": this._CaptionParamsIdEqual = ParseInt(propertyNode.InnerText); continue; case "captionParamsIdIn": this._CaptionParamsIdIn = propertyNode.InnerText; continue; case "formatEqual": this._FormatEqual = (CaptionType)StringEnum.Parse(typeof(CaptionType), propertyNode.InnerText); continue; case "formatIn": this._FormatIn = propertyNode.InnerText; continue; case "statusEqual": this._StatusEqual = (CaptionAssetStatus)ParseEnum(typeof(CaptionAssetStatus), propertyNode.InnerText); continue; case "statusIn": this._StatusIn = propertyNode.InnerText; continue; case "statusNotIn": this._StatusNotIn = propertyNode.InnerText; continue; } } }
// Update is called once per frame void Update() { if (m_CurrentCaption != m_RequestCaption) { GameObject current_caption = getCaptionObject(m_CurrentCaption); if (current_caption != null) { // 表示中のものがあるので消す. if (m_RequestCaptionAnim == false) { Animation anim = current_caption.GetComponent <Animation>(); if (anim != null) { anim.Play(InGameDefine.ANIM_CAPTION_OUT); } m_RequestCaptionAnim = true; } else { if (current_caption.GetComponent <Animation>().isPlaying == false) { UnityUtil.SetObjectEnabledOnce(current_caption, false); m_CurrentCaption = CaptionType.NONE; m_RequestCaptionAnim = false; } } } else { // キャプション出現. GameObject request_caption = getCaptionObject(m_RequestCaption); if (request_caption != null) { if (m_RequestCaptionAnim == false) { UnityUtil.SetObjectEnabledOnce(request_caption, true); Animation anim = request_caption.GetComponent <Animation>(); if (anim != null) { anim.Play(InGameDefine.ANIM_CAPTION_IN); m_RequestCaptionAnim = true; } } else { UnityUtil.SetObjectEnabledOnce(request_caption, true); Animation anim = request_caption.GetComponent <Animation>(); if (anim == null || anim.isPlaying == false) { m_CurrentCaption = m_RequestCaption; m_RequestCaptionAnim = false; } } } else { m_CurrentCaption = m_RequestCaption; } // テンポアップ対応 add by tomioka. if (m_RequestCaption == CaptionType.PLAYER_PHASE || m_RequestCaption == CaptionType.PLAYER_HOLD_CARD_PHASE) { m_CurrentCaption = m_RequestCaption; m_RequestCaptionAnim = false; } } } }
void BeginClusterCaption(VdCluster cluster, CaptionType type) { clusterAwaitingCaption = cluster; RemovePreviousCaption(cluster, type); }
private void BeginHostCaption(ICaptionHost host, CaptionType type) { _hostAwaitingCaption = host; RemovePreviousCaption(host, type); }
public void SetRedBubbleNum(CaptionType type, int num) { player.redcaptions.GetRedCaption(type).captionNum = num; }
public RedCaption(CaptionType type, int captionNum) { this.type = type; this.captionNum = captionNum; }
private void TryEndHostCaption(IVdShape caption, CaptionType type) { //inject caption if (_hostAwaitingCaption == null) return; RemovePreviousCaption(_hostAwaitingCaption, type); if (caption is VdFreeForm) { _hostAwaitingCaption.CapMgr().FreeDraw = (VdFreeForm)caption; //initial resize of free form _hostAwaitingCaption.CapMgr().InitialResizeOfFreeForm(); //send resized free form SendSyncState(_hostAwaitingCaption.CapMgr().FreeDraw); //cluster + title stats event _rt.clienRt.SendStatsEvent(StEvent.ClusterTitleAdded, _palette.GetOwnerId(), _doc.DiscussionId, _doc.TopicId, DeviceType.Wpf); } else if (caption is VdText) { _hostAwaitingCaption.CapMgr().text = (VdText)caption; //increase caption font //for(int i = 0; i<6; ++i) // _hostAwaitingCaption.CapMgr().text.ScaleInPlace(true); SendSyncState(_hostAwaitingCaption.CapMgr().text); //cluster + title stats event _rt.clienRt.SendStatsEvent(StEvent.ClusterTitleAdded, _palette.GetOwnerId(), _doc.DiscussionId, _doc.TopicId, DeviceType.Wpf); } else throw new NotSupportedException(); //update first time after build _hostAwaitingCaption.CapMgr().UpdateRelatives(); //send state of cluster to attach captions on other clients SendSyncState(_hostAwaitingCaption); _hostAwaitingCaption = null; }
private void RemovePreviousCaption(ICaptionHost cluster, CaptionType type) { if (_hostAwaitingCaption.CapMgr().FreeDraw != null) _doc.BeginRemoveSingleShape(_hostAwaitingCaption.CapMgr().FreeDraw.Id()); if (_hostAwaitingCaption.CapMgr().text != null) _doc.BeginRemoveSingleShape(_hostAwaitingCaption.CapMgr().text.Id()); }
private void CaptionCreationRequested(CaptionType type, ICaptionHost host) { BeginHostCaption(host, type); switch (type) { case CaptionType.FreeDraw: EnterShapeCreationMode(VdShapeType.FreeForm, -1); break; case CaptionType.Text: //emulate text creation _palette.shapeType = VdShapeType.Text; EnterShapeCreationMode(VdShapeType.Text, -1); var clickLocation = host.capOrgProvider(); InpDeviceDown(new Point(clickLocation.X, clickLocation.Y), null); break; } }
private void BeginHostCaption(ICaptionHost host, CaptionType type) { _hostAwaitingCaption = host; RemovePreviousCaption(host, type); }
void CaptionCreationRequested(CaptionType type, VdCluster cluster) { BeginClusterCaption(cluster, type); switch (type) { case CaptionType.FreeDraw: EnterShapeCreationMode(VdShapeType.FreeForm); break; case CaptionType.Text: //emulate text creation _palette.shapeType = VdShapeType.Text; EnterShapeCreationMode(VdShapeType.Text); var clustBounds = cluster.boundsProvider(); InpDeviceDown(new Point(clustBounds.X + 140, clustBounds.Y- 160), null); break; } }
public RedCaption GetRedCaption(CaptionType type) { return(captions.Find(p => p.type == type)); }
private GameObject getCaptionObject(CaptionType caption_type) { return(m_CaptionObjs[(int)caption_type]); }
void TryEndClusterCaption(IVdShape caption, CaptionType type) { //inject caption if (clusterAwaitingCaption == null) return; RemovePreviousCaption(clusterAwaitingCaption, type); if (caption is VdFreeForm) { clusterAwaitingCaption.Captions.FreeDraw = (VdFreeForm)caption; //initial resize of free form clusterAwaitingCaption.Captions.InitialResizeOfFreeForm(); //send resized free form SendSyncState(clusterAwaitingCaption.Captions.FreeDraw); } else if (caption is VdText) { clusterAwaitingCaption.Captions.text = (VdText)caption; SendSyncState(clusterAwaitingCaption.Captions.text); } else throw new NotSupportedException(); //update first time after build clusterAwaitingCaption.Captions.UpdateRelatives(); //send state of cluster to attach captions on other clients SendSyncState(clusterAwaitingCaption); clusterAwaitingCaption = null; }
//RedCaption public int GetRedBubbleNum(CaptionType type) { return(player.redcaptions.GetRedCaption(type).captionNum); }
public void ShowCaption(CaptionType type, string title, string script, Align align, float offsetRateX, float offsetRateY, int duration, float scale) { }
void RemovePreviousCaption(VdCluster cluster, CaptionType type) { if (clusterAwaitingCaption.Captions.FreeDraw != null) _doc.BeginRemoveSingleShape(clusterAwaitingCaption.Captions.FreeDraw.Id()); if (clusterAwaitingCaption.Captions.text != null) _doc.BeginRemoveSingleShape(clusterAwaitingCaption.Captions.text.Id()); }
void BeginClusterCaption(VdCluster cluster, CaptionType type) { clusterAwaitingCaption = cluster; RemovePreviousCaption(cluster, type); }