private void DialogueView()
    {
        var oldType = dialogueType;

        dialogueType = (DialogueKeyType)EditorGUILayout.EnumPopup(new GUIContent("查找内容"), dialogueType);
        if (needInit || oldType != dialogueType)
        {
            strKeys  = new string[] { string.Empty };
            boolKeys = new bool[] { false };
            objKeys  = new ScriptableObject[1];
            results.Clear();
        }
        switch (dialogueType)
        {
        case DialogueKeyType.ID:
        case DialogueKeyType.Words:
        case DialogueKeyType.OptTitle:
        case DialogueKeyType.BraWords:
            type       = (SeekType)EditorGUILayout.EnumPopup(new GUIContent("查找方式"), type);
            strKeys[0] = EditorGUILayout.TextField(new GUIContent("关键字"), strKeys[0]);
            canSeek    = !string.IsNullOrEmpty(strKeys[0]);
            break;

        case DialogueKeyType.WordsSayer:
        case DialogueKeyType.BrWoSayer:
            boolKeys[0] = EditorGUILayout.Toggle("玩家说", boolKeys[0]);
            if (!boolKeys[0])
            {
                objKeys[0] = EditorGUILayout.ObjectField(new GUIContent("对话人"), objKeys[0], typeof(TalkerInformation), false);
                canSeek    = objKeys[0];
            }
            else
            {
                canSeek = true;
            }
            break;

        case DialogueKeyType.UniNPC:
            boolKeys[0] = EditorGUILayout.Toggle("使用当前对话人", boolKeys[0]);
            if (!boolKeys[0])
            {
                objKeys[0] = EditorGUILayout.ObjectField(new GUIContent("统一对话人"), objKeys[0], typeof(TalkerInformation), false);
                canSeek    = objKeys[0];
            }
            else
            {
                canSeek = true;
            }
            break;

        case DialogueKeyType.BraDialog:
            objKeys[0] = EditorGUILayout.ObjectField(new GUIContent("使用对话"), objKeys[0], typeof(Dialogue), false);
            canSeek    = objKeys[0];
            break;

        default:
            break;
        }
        seekCallback = SeekDialogue;
    }
    private void ProductView()
    {
        var oldType = productType;

        productType = (ProductKeyType)EditorGUILayout.EnumPopup(new GUIContent("查找内容"), productType);
        if (needInit || oldType != productType)
        {
            strKeys = new string[] { string.Empty };
            objKeys = new ScriptableObject[1];
            results.Clear();
        }
        switch (productType)
        {
        case ProductKeyType.Remark:
            type       = (SeekType)EditorGUILayout.EnumPopup(new GUIContent("查找方式"), type);
            strKeys[0] = EditorGUILayout.TextField(new GUIContent("关键字"), strKeys[0]);
            canSeek    = !string.IsNullOrEmpty(strKeys[0]);
            break;

        case ProductKeyType.Item:
            objKeys[0] = EditorGUILayout.ObjectField(new GUIContent("包含道具"), objKeys[0], typeof(ItemBase), false);
            canSeek    = objKeys[0];
            break;

        default:
            break;
        }
        seekCallback = SeekProduct;
    }
Esempio n. 3
0
 void HandleSeekEvent(SeekType type, Time start, float rate)
 {
     Config.GUIToolkit.Invoke(delegate {
         EmitLoadDrawings(null);
         /* We only use it for backwards framestepping for now */
         if (type == SeekType.StepDown || type == SeekType.StepUp)
         {
             if (player.Playing)
             {
                 Pause();
             }
             if (type == SeekType.StepDown)
             {
                 player.SeekToPreviousFrame();
             }
             else
             {
                 player.SeekToNextFrame();
             }
             Tick();
         }
         if (type == SeekType.Accurate || type == SeekType.Keyframe)
         {
             SetRate(rate);
             Seek(start, type == SeekType.Accurate, false, false);
         }
     });
 }
Esempio n. 4
0
 void HandleSeekEvent(SeekType type, float rate, bool inSegment, long start, long stop)
 {
     /* We only use it for backwards framestepping for now */
     if (type == SeekType.StepDown || type == SeekType.StepUp)
     {
         if (player.Playing)
         {
             player.Pause();
         }
         if (type == SeekType.StepDown)
         {
             player.SeekToPreviousFrame(rate, inSegment);
         }
         else
         {
             player.SeekToNextFrame(rate, inSegment);
         }
         if (SeekEvent != null)
         {
             SeekEvent((int)AccurateCurrentTime);
         }
     }
     if (type == SeekType.Accurate || type == SeekType.Keyframe)
     {
         player.SeekTime(start, rate, type == SeekType.Accurate);
         if (SeekEvent != null)
         {
             SeekEvent((int)start);
         }
     }
 }
Esempio n. 5
0
            internal long Seek(Native.SDL_RWops *_, long offset, SeekType whence)
            {
                var newIndex = _index;

                switch (whence)
                {
                case SeekType.Set:
                    newIndex = (int)offset;
                    break;

                case SeekType.Current:
                    newIndex += (int)offset;
                    break;

                case SeekType.End:
                    newIndex = _array.Length + (int)offset;
                    break;
                }

                if (newIndex < 0 || newIndex >= _array.Length)
                {
                    return(-1);
                }

                _index = newIndex;
                return(_index);
            }
Esempio n. 6
0
File: Seeker.cs Progetto: kuggaa/VAS
 public Seeker(uint timeoutMS = 80)
 {
     timeout       = timeoutMS;
     pendingSeek   = false;
     seekType      = SeekType.None;
     timer         = new ThreadingTimer(HandleSeekTimeout);
     TimerDisposed = new ManualResetEvent(false);
 }
Esempio n. 7
0
 public Seeker(uint timeoutMS = 80)
 {
     timeout = timeoutMS;
     pendingSeek = false;
     disposed = false;
     seekType = SeekType.None;
     timer = new Timer (HandleSeekTimeout);
     TimerDisposed = new ManualResetEvent (false);
 }
    private void ItemView()
    {
        var oldType = itemType;

        itemType = (ItemKeyType)EditorGUILayout.EnumPopup(new GUIContent("查找内容"), itemType);
        if (needInit || oldType != itemType)
        {
            strKeys = new string[] { string.Empty };
            intKeys = new int[1] {
                0
            };
            objKeys = new ScriptableObject[1];
            results.Clear();
        }
        switch (itemType)
        {
        case ItemKeyType.ID:
        case ItemKeyType.Name:
        case ItemKeyType.Desc:
            type       = (SeekType)EditorGUILayout.EnumPopup(new GUIContent("查找方式"), type);
            strKeys[0] = EditorGUILayout.TextField(new GUIContent("关键字"), strKeys[0]);
            canSeek    = !string.IsNullOrEmpty(strKeys[0]);
            break;

        case ItemKeyType.Type:
            intKeys[0] = (int)(ItemType)EditorGUILayout.EnumPopup("道具类型", (ItemType)intKeys[0]);
            canSeek    = true;
            break;

        case ItemKeyType.AsMater:
            intKeys[0] = (int)(MaterialType)EditorGUILayout.EnumPopup("材料类型", (MaterialType)intKeys[0]);
            canSeek    = true;
            break;

        case ItemKeyType.Formu:
            objKeys[0] = EditorGUILayout.ObjectField(new GUIContent("关联配方"), objKeys[0], typeof(Formulation), false);
            canSeek    = objKeys[0];
            break;

        case ItemKeyType.Mater:
            objKeys[0] = EditorGUILayout.ObjectField(new GUIContent("包含道具"), objKeys[0], typeof(ItemBase), false);
            canSeek    = objKeys[0];
            break;

        case ItemKeyType.MatType:
            intKeys[0] = (int)(MaterialType)EditorGUILayout.EnumPopup("包含类型", (MaterialType)intKeys[0]);
            canSeek    = true;
            break;

        default:
            break;
        }
        seekCallback = SeekItem;
    }
Esempio n. 9
0
        public IOStatus SeekPosition(long offset, SeekType type)
        {
            IntPtr   error;
            IOStatus ret = (IOStatus)g_io_channel_seek_position(Handle, offset, (int)type, out error);

            if (error != IntPtr.Zero)
            {
                throw new GException(error);
            }
            return(ret);
        }
Esempio n. 10
0
        bool Seek(SeekFlags flags, SeekType start_type, long start, SeekType stop_type, long stop)
        {
            var format = Format.Time;

            // Seeks without the GST_SEEK_FLAG_FLUSH should only be done when the pipeline is in the PLAYING state.
            // Executing a non-flushing seek in the PAUSED state might deadlock because the pipeline streaming threads might be blocked in the sinks.
            if (playbin.CurrentState == State.Paused /* || FEos || FSeeking*/)
            {
                flags |= SeekFlags.Flush;
            }
            return(FSeeking = playbin.Seek(FRate, format, flags, start_type, start, stop_type, stop));
        }
Esempio n. 11
0
 public bool HandleSeekTimeout()
 {
     pendingSeekId = -1;
     if (seekType != SeekType.None)
     {
         if (SeekEvent != null)
         {
             SeekEvent(seekType, rate, inSegment, start, stop);
         }
         seekType = SeekType.None;
     }
     return(false);
 }
Esempio n. 12
0
 bool Seek(SeekFlags seekFlags, SeekType start_type, long start, SeekType stop_type, long stop)
 {
     // Seeks without the GST_SEEK_FLAG_FLUSH should only be done when the pipeline is in the PLAYING state.
     // Executing a non-flushing seek in the PAUSED state might deadlock because the pipeline streaming threads might be blocked in the sinks.
     if (FCurrentState != State.Playing)
     {
         seekFlags |= SeekFlags.Flush;
     }
     if (videosink.Seek(1d, Format.Time, seekFlags | SeekFlags.Accurate, start_type, start, stop_type, stop))
     {
         FSeeking = seekFlags.HasFlag(SeekFlags.Flush);
         return(true);
     }
     return(false);
 }
Esempio n. 13
0
        public void Seek(SeekType seekType, Time start = null, float rate = 1)
        {
            this.seekType = seekType;
            this.start = start;
            this.rate = rate;

            pendingSeek = true;
            if (waiting) {
                return;
            }

            HandleSeekTimeout (this);
            waiting = true;
            timer.Change (timeout, Timeout.Infinite);
        }
Esempio n. 14
0
        public void Seek(SeekType seekType, float rate = 1, bool inSegment = false, long start = 0, long stop = 0)
        {
            this.seekType  = seekType;
            this.start     = start;
            this.stop      = stop;
            this.rate      = rate;
            this.inSegment = inSegment;

            if (pendingSeekId != -1)
            {
                return;
            }

            HandleSeekTimeout();
            pendingSeekId = (int)GLib.Timeout.Add(timeout, HandleSeekTimeout);
        }
Esempio n. 15
0
        public void Seek(SeekType seekType, Time start = null, float rate = 1)
        {
            this.seekType = seekType;
            this.start    = start;
            this.rate     = rate;

            pendingSeek = true;
            if (waiting)
            {
                return;
            }

            HandleSeekTimeout(this);
            waiting = true;
            timer.Change(timeout, Timeout.Infinite);
        }
Esempio n. 16
0
File: Seeker.cs Progetto: kuggaa/VAS
        /// <summary>
        /// Schedule a throttled seek of the specified seekType, start and rate. The seek won't happen right away, instead
        /// a timer will be put in place if none already exist and the seek value will be stored. When the timer is fired
        /// the latest seek value will be used to do the seek. This is mostly useful to avoid flooding the media engine with
        /// seek requests when the user is scrubbing the user interface.
        /// </summary>
        /// <param name="seekType">Seek type.</param>
        /// <param name="start">Start.</param>
        /// <param name="rate">Rate.</param>
        public void Seek(SeekType seekType, Time start = null, float rate = 1)
        {
            lock (lockObject) {
                this.seekType = seekType;
                this.start    = start;
                this.rate     = rate;

                // If a we are already waiting for the timer, return.
                if (waiting)
                {
                    return;
                }

                // Schedule timer
                timer.Change(timeout, Timeout.Infinite);
                // And remember we are waiting
                waiting = true;
            }
        }
Esempio n. 17
0
    private void QuestView()
    {
        var oldType = questType;

        questType = (QuestKeyType)EditorGUILayout.EnumPopup(new GUIContent("查找内容"), questType);
        if (needInit || oldType != questType)
        {
            strKeys = new string[] { string.Empty };
            objKeys = new ScriptableObject[1];
            results.Clear();
        }
        switch (questType)
        {
        case QuestKeyType.ID:
        case QuestKeyType.Title:
        case QuestKeyType.Desc:
        case QuestKeyType.ObjTitle:
            type       = (SeekType)EditorGUILayout.EnumPopup(new GUIContent("查找方式"), type);
            strKeys[0] = EditorGUILayout.TextField(new GUIContent("关键字"), strKeys[0]);
            canSeek    = !string.IsNullOrEmpty(strKeys[0]);
            break;

        case QuestKeyType.Reward:
            objKeys[0] = EditorGUILayout.ObjectField(new GUIContent("包含道具"), objKeys[0], typeof(ItemBase), false);
            canSeek    = objKeys[0];
            break;

        case QuestKeyType.ObjItem:
            objKeys[0] = EditorGUILayout.ObjectField(new GUIContent("关联道具"), objKeys[0], typeof(ItemBase), false);
            canSeek    = objKeys[0];
            break;

        case QuestKeyType.ObjTalker:
            objKeys[0] = EditorGUILayout.ObjectField(new GUIContent("谈话人"), objKeys[0], typeof(TalkerInformation), false);
            canSeek    = objKeys[0];
            break;

        default:
            break;
        }
        seekCallback = SeekQuest;
    }
Esempio n. 18
0
        void HandleSeekTimeout(object state)
        {
            if (disposed)
            {
                return;
            }

            waiting = false;
            if (pendingSeek)
            {
                if (seekType != SeekType.None)
                {
                    if (SeekEvent != null)
                    {
                        SeekEvent(seekType, start, rate);
                    }
                    seekType = SeekType.None;
                }
            }
            timer.Change(Timeout.Infinite, Timeout.Infinite);
        }
Esempio n. 19
0
    private void FormulationView()
    {
        var oldType = formulationType;

        formulationType = (FormulationKeyType)EditorGUILayout.EnumPopup(new GUIContent("查找内容"), formulationType);
        if (needInit || oldType != formulationType)
        {
            strKeys = new string[] { string.Empty };
            intKeys = new int[1] {
                0
            };
            objKeys = new ScriptableObject[1];
            results.Clear();
        }
        switch (formulationType)
        {
        case FormulationKeyType.Remark:
            type       = (SeekType)EditorGUILayout.EnumPopup(new GUIContent("查找方式"), type);
            strKeys[0] = EditorGUILayout.TextField(new GUIContent("关键字"), strKeys[0]);
            canSeek    = !string.IsNullOrEmpty(strKeys[0]);
            break;

        case FormulationKeyType.Mater:
            objKeys[0] = EditorGUILayout.ObjectField(new GUIContent("包含道具"), objKeys[0], typeof(ItemBase), false);
            canSeek    = objKeys[0];
            break;

        case FormulationKeyType.MatType:
            intKeys[0] = (int)(MaterialType)EditorGUILayout.EnumPopup("包含类型", (MaterialType)intKeys[0]);
            canSeek    = true;
            break;

        default:
            break;
        }
        seekCallback = SeekFormulation;
    }
Esempio n. 20
0
 public Seeker(uint timeoutMS = 80)
 {
     timeout       = timeoutMS;
     pendingSeekId = -1;
     seekType      = SeekType.None;
 }
Esempio n. 21
0
        void HandleSeekTimeout(object state)
        {
            if (disposed) {
                return;
            }

            waiting = false;
            if (pendingSeek) {
                if (seekType != SeekType.None) {
                    if (SeekEvent != null) {
                        SeekEvent (seekType, start, rate);
                    }
                    seekType = SeekType.None;
                }
            }
            timer.Change (Timeout.Infinite, Timeout.Infinite);
        }
Esempio n. 22
0
 public void Seek(SeekType seekType, Time start = null, float rate = 1)
 {
     SeekEvent?.Invoke(seekType, start, rate);
 }
Esempio n. 23
0
 public void Seek(SeekType seekType, Time start = null, float rate = 1)
 {
     this.seekType = seekType;
     this.start    = start;
     this.rate     = rate;
 }
Esempio n. 24
0
 /// <summary>
 /// Seeks to a point in the storage.
 /// </summary>
 /// <param name="offset">The offset.</param>
 /// <param name="type">The type of seek to perform.</param>
 /// <returns>The new location.</returns>
 public long Seek(long offset, SeekType type) =>
 SdlSharp.Native.SDL_RWseek(Native, offset, type);
Esempio n. 25
0
 /// <summary>
 /// Seeks to a point in the storage.
 /// </summary>
 /// <param name="offset">The offset.</param>
 /// <param name="type">The type of seek to perform.</param>
 /// <returns>The new location.</returns>
 public long Seek(long offset, SeekType type) =>
 Native.SDL_RWseek(Pointer, offset, type);
Esempio n. 26
0
    private void BuildingView()
    {
        var oldType = buildingType;

        buildingType = (BuildingKeyType)EditorGUILayout.EnumPopup(new GUIContent("查找内容"), buildingType);
        if (needInit || oldType != buildingType)
        {
            strKeys = new string[] { string.Empty };
            intKeys = new int[1] {
                0
            };
            switch (buildingType)
            {
            case BuildingKeyType.Prefab:
                objKeys = new Structure2D[1];
                break;

            case BuildingKeyType.Preview:
                objKeys = new StructurePreview2D[1];
                break;

            default:
                objKeys = new ScriptableObject[1];
                break;
            }
            results.Clear();
        }
        switch (buildingType)
        {
        case BuildingKeyType.ID:
        case BuildingKeyType.Name:
        case BuildingKeyType.Desc:
            type       = (SeekType)EditorGUILayout.EnumPopup(new GUIContent("查找方式"), type);
            strKeys[0] = EditorGUILayout.TextField(new GUIContent("关键字"), strKeys[0]);
            canSeek    = !string.IsNullOrEmpty(strKeys[0]);
            break;

        case BuildingKeyType.Formu:
            objKeys[0] = EditorGUILayout.ObjectField(new GUIContent("关联配方"), objKeys[0], typeof(Formulation), false);
            canSeek    = objKeys[0];
            break;

        case BuildingKeyType.Mater:
            objKeys[0] = EditorGUILayout.ObjectField(new GUIContent("包含道具"), objKeys[0], typeof(ItemBase), false);
            canSeek    = objKeys[0];
            break;

        case BuildingKeyType.MatType:
            intKeys[0] = (int)(MaterialType)EditorGUILayout.EnumPopup("包含类型", (MaterialType)intKeys[0]);
            canSeek    = true;
            break;

        case BuildingKeyType.Prefab:
            objKeys[0] = EditorGUILayout.ObjectField(new GUIContent("预制件"), objKeys[0], typeof(Structure2D), false);
            canSeek    = objKeys[0];
            break;

        case BuildingKeyType.Preview:
            objKeys[0] = EditorGUILayout.ObjectField(new GUIContent("预制件"), objKeys[0], typeof(StructurePreview2D), false);
            canSeek    = objKeys[0];
            break;

        default:
            break;
        }
        seekCallback = SeekBuilding;
    }
Esempio n. 27
0
		public IOStatus SeekPosition (long offset, SeekType type) 
		{
			IntPtr error;
			IOStatus ret = (IOStatus) g_io_channel_seek_position (Handle, offset, (int) type, out error);
			if (error != IntPtr.Zero) throw new GException (error);
			return ret;
		}
Esempio n. 28
0
 public void ChangeSeekType(int value)
 {
     seekType = (SeekType)value;
 }
		static extern IOStatus g_io_channel_seek_position (HandleRef handle, long offset, SeekType type, out IntPtr error);