예제 #1
0
 public void Set(BluRayAPI.BluRayEvent data)
 {
     _buffer[_writePos] = data;
     _writePos          = (_writePos + 1) % SIZE;
     if (_readPos == _writePos)
     {
         ServiceRegistration.Get <ILogger>().Warn("BluRayPlayer: Event buffer full");
     }
 }
예제 #2
0
 public int OnBDevent(BluRayAPI.BluRayEvent bluRayEvent)
 {
     if (bluRayEvent.Event != BluRayAPI.BDEvents.None &&
         bluRayEvent.Event != BluRayAPI.BDEvents.Still &&
         bluRayEvent.Event != BluRayAPI.BDEvents.StillTime)
     {
         _eventBuffer.Set(bluRayEvent);
     }
     return(0);
 }
예제 #3
0
 public int OnBDevent(BluRayAPI.BluRayEvent bluRayEvent)
 {
     if (bluRayEvent.Event != 0 &&
         bluRayEvent.Event != (int)BluRayAPI.BDEvents.Still &&
         bluRayEvent.Event != (int)BluRayAPI.BDEvents.StillTime)
     {
         HandleBDEvent(bluRayEvent);
     }
     return(0);
 }
예제 #4
0
        protected void HandleBDEvent(BluRayAPI.BluRayEvent bdevent)
        {
            switch (bdevent.Event)
            {
            case BluRayAPI.BDEvents.AudioStream:
                BluRayPlayerBuilder.LogDebug("Audio changed to {0}", bdevent.Param);
                //if (bdevent.Param != 0xff)
                //  CurrentAudioStream = bdevent.Param - 1;
                break;

            case BluRayAPI.BDEvents.PgText:
                BluRayPlayerBuilder.LogDebug("Subtitles available {0}", bdevent.Param);
                break;

            case BluRayAPI.BDEvents.PgTextStream:
                BluRayPlayerBuilder.LogDebug("Subtitle changed to {0}", bdevent.Param);
                //if (bdevent.Param != 0xfff)
                //  CurrentSubtitleStream = bdevent.Param;
                break;

            case BluRayAPI.BDEvents.IgStream:
                BluRayPlayerBuilder.LogDebug("Interactive graphics available {0}", bdevent.Param);
                break;

            case BluRayAPI.BDEvents.Playlist:
                BluRayPlayerBuilder.LogDebug("Playlist changed to {0}", bdevent.Param);
                if (_forceTitle || (_currentTitle != (int)BluRayAPI.BluRayTitle.FirstPlay && _currentTitle != (int)BluRayAPI.BluRayTitle.TopMenu))
                {
                    EnumerateChapters();
                }
                break;

            case BluRayAPI.BDEvents.Playitem:
                BluRayPlayerBuilder.LogDebug("Playitem changed to {0}", bdevent.Param);
                //if (menuState == BluRayAPI.MenuState.Root && chapters != null && _currentTitle != BLURAY_TITLE_FIRST_PLAY && _currentTitle != BLURAY_TITLE_TOP_MENU)
                //  menuItems = MenuItems.All;
                UpdateMenuItems();
                CurrentStreamInfo();
                break;

            case BluRayAPI.BDEvents.Title:
                BluRayPlayerBuilder.LogDebug("Title changed to {0}", bdevent.Param);
                _currentTitle   = bdevent.Param;
                _currentChapter = 0xffff;
                if (bdevent.Param == 1)
                {
                    if (_menuState != BluRayAPI.MenuState.PopUp)
                    {
                        _menuState = BluRayAPI.MenuState.None;
                    }
                }
                break;

            case BluRayAPI.BDEvents.Chapter:
                BluRayPlayerBuilder.LogDebug("Chapter changed to {0}", bdevent.Param);
                if (bdevent.Param != 0xffff)
                {
                    _currentChapter = (uint)bdevent.Param - 1;
                }
                break;

            case BluRayAPI.BDEvents.Popup:
                BluRayPlayerBuilder.LogDebug("Popup available {0}", bdevent.Param);
                _isPopupMenuAvailable = bdevent.Param == 1;
                UpdateMenuItems();
                break;

            case BluRayAPI.BDEvents.Menu:
                BluRayPlayerBuilder.LogDebug("Menu visible {0}", bdevent.Param);
                if (bdevent.Param == 1)
                {
                    if (_menuState != BluRayAPI.MenuState.PopUp)
                    {
                        _menuState = BluRayAPI.MenuState.Root;
                    }
                }
                else
                {
                    _menuState = BluRayAPI.MenuState.None;
                }
                UpdateMenuItems();
                break;

            case BluRayAPI.BDEvents.CustomEventMenuVisibility:
                //if (bdevent.Param == 1)
                //{
                //  BluRayPlayerBuilder.LogDebug("Toggle menu on");
                //if (menuState == BluRayAPI.MenuState.PopUp)
                //  menuItems = MenuItems.All;
                //else
                //  menuItems = MenuItems.None;

                //_iMenuOffPendingCount = 0;
                //_bMenuOn = true;
                //}
                //else if (_iMenuOffPendingCount == 0)
                //{
                //  _iMenuOffPendingCount++;
                //}
                break;
            }
        }