当前位置: 首页>>代码示例>>C#>>正文


C# MediaPortal.ToString方法代码示例

本文整理汇总了C#中MediaPortal.ToString方法的典型用法代码示例。如果您正苦于以下问题:C# MediaPortal.ToString方法的具体用法?C# MediaPortal.ToString怎么用?C# MediaPortal.ToString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在MediaPortal的用法示例。


在下文中一共展示了MediaPortal.ToString方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: OnClicked


//.........这里部分代码省略.........
            case (int)GUIControls.FieldButton5:
              if (matchingMode)
              {
            selectedComposer = selectComposer();
            GUIControl.SetControlLabel(windowID, (int)GUIControls.FieldButton5, "Composer: " + selectedComposer);
            genPlaylist(fullArtistList);
              }
              else
              {
            result = getFieldAndSearchValue(ref fieldSelected5, ref customSearchStr5, GUIControls.FieldButton5);
            if (result == FieldSetup.Success)
              GUIControl.EnableControl(windowID, (int)GUIControls.FieldButton6);

            if (result == FieldSetup.Clear)
              cleanAndReset(GUIControls.FieldButton5);

              }
              break;
            case (int)GUIControls.FieldButton6:
              if (matchingMode)
              {
            selectedKeyword = getKeyword();
            GUIControl.SetControlLabel(windowID, (int)GUIControls.FieldButton6, "Keyword: " + selectedKeyword);
            genPlaylist(fullArtistList);
              }
              else
              {
            result = getFieldAndSearchValue(ref fieldSelected6, ref customSearchStr6, GUIControls.FieldButton6);

            if (result == FieldSetup.Clear)
              cleanAndReset(GUIControls.FieldButton6);
              }
              break;
            case (int)GUIControls.PlayPlaylist:
              if (facadeLayout.Count > 0)
            playSmartDJPlaylist();

              break;
            case (int)GUIControls.SavePlaylist:
              if (facadeLayout.Count > 0)
            saveSmartDJPlaylist();

              break;
            case (int)GUIControls.Playlist:
              if (!Player.playlistPlayer.mvPlayer.Playing)
              {
            videoList.Clear();
            for (int i = 0; i < facadeLayout.ListLayout.Count; i++)
            {
              GUIListItem trackItem = facadeLayout.ListLayout[i];
              if (!trackItem.IsFolder && trackItem.MusicTag != null)
                videoList.Add((DBTrackInfo)trackItem.MusicTag);
            }
            addToPlaylist(videoList, false, true, smartDJ_ShufflePlaylist.Selected);
              }
              GUIWindowManager.ActivateWindow(Player.GetWindowId());
              break;

            case (int)GUIControls.ShufflePlaylist:
              mvCentralCore.Settings.SmartDJPlaylistShuffle = smartDJ_ShufflePlaylist.Selected;
              break;

            case (int)GUIControls.Facade:
              //Clicked on something in the facade
              logger.Debug("Hit Key : " + actionType.ToString());
              switch (actionType)
              {
            case Action.ActionType.ACTION_PLAY:
            case Action.ActionType.ACTION_PAUSE:
            case Action.ActionType.ACTION_QUEUE_ITEM:
            case Action.ActionType.ACTION_MUSIC_PLAY:
            case Action.ActionType.ACTION_SELECT_ITEM:

              if (facadeLayout.SelectedListItem != null)
              {
                GUIListItem selectedItem = facadeLayout.SelectedListItem;
                videoList.Clear();
                if (!selectedItem.IsFolder && selectedItem.MusicTag != null)
                {
                  // we have a track selected so add any other tracks which are on showing on the facade
                  for (int i = 0; i < facadeLayout.ListLayout.Count; i++)
                  {
                    GUIListItem trackItem = facadeLayout.ListLayout[i];
                    if (!trackItem.IsFolder && trackItem.MusicTag != null)
                      videoList.Add((DBTrackInfo)trackItem.MusicTag);
                  }
                  // Now create a Playlist
                  addToPlaylist(videoList, false, true, false);
                  // And play it
                  Player.playlistPlayer.Play(videoList.IndexOf((DBTrackInfo)selectedItem.MusicTag));
                  if (mvCentralCore.Settings.AutoFullscreen)
                    g_Player.ShowFullScreenWindow();
                  break;
                }
              }
              break;
              }
              break;
              }
        }
开发者ID:andrewjswan,项目名称:mvcentral,代码行数:101,代码来源:GUISmartDJ.cs

示例2: OnClicked

        /// <summary>
        /// Deal with user input
        /// </summary>
        /// <param name="controlId"></param>
        /// <param name="control"></param>
        /// <param name="actionType"></param>
        protected override void OnClicked(int controlId, GUIControl control, MediaPortal.GUI.Library.Action.ActionType actionType)
        {
            base.OnClicked(controlId, control, actionType);

              if (control == btnLayouts)
              {
            mvCentralCore.Settings.DefaultView = ((int)CurrentLayout).ToString();
              }

              switch (controlId)
              {
            case (int)GuiControls.PlayAllRandom:
              playRandomAll();
              break;
            case (int)GuiControls.PlaySmart:
              playSmart(ChooseSmartPlay());
              break;
            case (int)GuiControls.PlayList:
              GUIWindowManager.ActivateWindow(Player.GetWindowId());
              break;
            case (int)GuiControls.StatsAndInfo:
              GUIWindowManager.ActivateWindow(GUImvStatsAndInfo.GetWindowId());
              break;
            case (int)GuiControls.GenreConfig:
              SetFavoriteTags();
              break;
            case (int)GuiControls.Search:
              DoSearch();
              break;
            case (int)GuiControls.Facade:
              //Clicked on something in the facade
              logger.Debug("Hit Key : " + actionType.ToString());
              switch (actionType)
              {
            case Action.ActionType.ACTION_PLAY:
            case Action.ActionType.ACTION_PAUSE:
            case Action.ActionType.ACTION_QUEUE_ITEM:
            case Action.ActionType.ACTION_MUSIC_PLAY:
            case Action.ActionType.ACTION_SELECT_ITEM:

              if (facadeLayout.SelectedListItem.IsFolder && ((actionType == Action.ActionType.ACTION_MUSIC_PLAY) || (actionType == Action.ActionType.ACTION_PLAY) || (actionType == Action.ActionType.ACTION_PAUSE)))
              {
                // Are we on an Artist or Album, if Artist add all tracks by artist to playlist else if album add all tracks on album to playlist
                if (facadeLayout.SelectedListItem.MusicTag != null && facadeLayout.SelectedListItem.MusicTag.GetType() == typeof(DBAlbumInfo))
                  AlbumActions(actionType);
                else if (facadeLayout.SelectedListItem.MusicTag != null && facadeLayout.SelectedListItem.MusicTag.GetType() == typeof(DBArtistInfo))
                  ArtistActions(actionType);
                else if (facadeLayout.SelectedListItem.MusicTag != null && facadeLayout.SelectedListItem.MusicTag.GetType() == typeof(DBGenres))
                  GenreActions(actionType);
              }
              else
              {

                GUIListItem selectedItem = facadeLayout.SelectedListItem;

                if (selectedItem.MusicTag.GetType() == typeof(DBGenres))
                {
                  DisplayByGenre(facadeLayout.SelectedListItem.Label);
                  break;
                }

                if (!selectedItem.IsFolder && selectedItem.MusicTag != null)
                {
                  // we have a track selected so add any other tracks which are on showing on the facade
                  List<DBTrackInfo> list1 = new List<DBTrackInfo>();
                  for (int i = 0; i < facadeLayout.ListLayout.Count; i++)
                  {
                    GUIListItem trackItem = facadeLayout.ListLayout[i];

                    if (!trackItem.IsFolder && trackItem.MusicTag != null)
                    {
                      list1.Add((DBTrackInfo)trackItem.MusicTag);
                    }
                  }
                  AddToPlaylist(list1, false, true, false);
                  Player.playlistPlayer.Play(list1.IndexOf((DBTrackInfo)selectedItem.MusicTag));
                  if (mvCentralCore.Settings.AutoFullscreen)
                    g_Player.ShowFullScreenWindow();
                  break;
                }
                //return to previous level
                if (facadeLayout.SelectedListItem.Label == "..")
                {
                  loadCurrent();
                }
                else
                {
                  artistID = facadeLayout.SelectedListItem.ItemId;
                  _currentView = MvView.Video;
                  addToStack(_currentView, false);
                  loadCurrent();
                }
              }
              break;
//.........这里部分代码省略.........
开发者ID:andrewjswan,项目名称:mvcentral,代码行数:101,代码来源:GUIMain.cs


注:本文中的MediaPortal.ToString方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。