Exemplo n.º 1
0
 private void DoSpell(MediaPortal.GUI.Library.Action.ActionType remoteNum)
 {
     switch (remoteNum)
     {
         case MediaPortal.GUI.Library.Action.ActionType.REMOTE_2:
             GetSortChar("ABC");
             break;
         case MediaPortal.GUI.Library.Action.ActionType.REMOTE_3:
             GetSortChar("DEF");
             break;
         case MediaPortal.GUI.Library.Action.ActionType.REMOTE_4:
             GetSortChar("GHI");
             break;
         case MediaPortal.GUI.Library.Action.ActionType.REMOTE_5:
             GetSortChar("JKL");
             break;
         case MediaPortal.GUI.Library.Action.ActionType.REMOTE_6:
             GetSortChar("MNO");
             break;
         case MediaPortal.GUI.Library.Action.ActionType.REMOTE_7:
             GetSortChar("PQRS");
             break;
         case MediaPortal.GUI.Library.Action.ActionType.REMOTE_8:
             GetSortChar("TUV");
             break;
         case MediaPortal.GUI.Library.Action.ActionType.REMOTE_9:
             GetSortChar("WXYZ");
             break;
     }
     doFacadeSort();
 }
Exemplo n.º 2
0
 protected override void OnClicked(int controlId, GUIControl control, MediaPortal.GUI.Library.Action.ActionType actionType)
 {
     if (control == serverListGUI)
     {
         onServerListGUI();
     }
 }
Exemplo n.º 3
0
 protected override void OnClicked(int controlId, GUIControl control, MediaPortal.GUI.Library.Action.ActionType actionType)
 {
     if (control == btDoUpdate)
       {
     //install the patch(s)
     installUpdateGUI();
     // tell the user what has been done
     cmc_ChangeLog.Visible = false;
     btDoUpdate.Visible = false;
     if (StreamedMPConfig.manualInstallNeeded)
     {
       GUIDialogOK dlgDone = (GUIDialogOK)GUIWindowManager.GetWindow((int)GUIWindow.Window.WINDOW_DIALOG_OK);
       dlgDone.SetHeading(Translation.mupdateheader);
       dlgDone.SetLine(1, Translation.mupdateline1);
       dlgDone.SetLine(2, Translation.mupdateline2);
       dlgDone.SetLine(3, string.Format(Translation.mupdateline3, Path.GetFileName(optionDownloadPath)));
       dlgDone.SetLine(4, Translation.mupdateline4);
       dlgDone.DoModal(GUIWindowManager.ActiveWindow);
     }
     else
     {
       if (!updateCancelled)
       {
     GUIDialogOK dlgDone = (GUIDialogOK)GUIWindowManager.GetWindow((int)GUIWindow.Window.WINDOW_DIALOG_OK);
     dlgDone.SetHeading(Translation.SkinUpdate);
     dlgDone.SetLine(1, string.Format(Translation.NumPatchesInstalled, updateCheck.patchList.Count.ToString()));
     dlgDone.SetLine(2, String.Empty);
     dlgDone.SetLine(3, string.Format(Translation.PatchUpdateComplete, updateCheck.SkinVersion()));
     dlgDone.DoModal(GUIWindowManager.ActiveWindow);
       }
     }
     GUIWindowManager.ShowPreviousWindow();
     StreamedMPConfig.updateAvailable = false;
       }
 }
Exemplo n.º 4
0
        public override void OnAction(MediaPortal.GUI.Library.Action action)
        {
            if (action.wID == MediaPortal.GUI.Library.Action.ActionType.ACTION_VOLUME_UP ||
              action.wID == MediaPortal.GUI.Library.Action.ActionType.ACTION_VOLUME_DOWN ||
              action.wID == MediaPortal.GUI.Library.Action.ActionType.ACTION_VOLUME_MUTE)
              {
            // MediaPortal core sends this message to the Fullscreenwindow, we need to do it ourselves to make the Volume OSD show up
            base.OnAction(new MediaPortal.GUI.Library.Action(MediaPortal.GUI.Library.Action.ActionType.ACTION_SHOW_VOLUME, 0, 0));
            return;
              }
              else if (action.wID == MediaPortal.GUI.Library.Action.ActionType.ACTION_CONTEXT_MENU)
              {
            OnShowContextMenu();
            return;
              }
              else
              {
            var translatedAction = new MediaPortal.GUI.Library.Action();
            if (ActionTranslator.GetAction((int) GUIWindow.Window.WINDOW_FULLSCREEN_VIDEO, action.m_key,
                                       ref translatedAction))
            {
              if (translatedAction.wID == MediaPortal.GUI.Library.Action.ActionType.ACTION_SHOW_OSD)
              {
            GUIPropertyManager.SetProperty("#Youtube.fm.FullScreen.ShowTitle", "false");
            GUIPropertyManager.SetProperty("#Youtube.fm.FullScreen.ShowNextTitle", "false");
            base.OnAction(translatedAction);
            if (GUIWindowManager.VisibleOsd == GUIWindow.Window.WINDOW_OSD)
            {
              GUIWindowManager.VisibleOsd = (GUIWindow.Window) MyFilms.ID_MyFilmsTrailerOSD;
            }
            return;
              }
              if (translatedAction.wID == MediaPortal.GUI.Library.Action.ActionType.ACTION_ASPECT_RATIO)
              {
            base.OnAction(translatedAction);
            return;
              }
            }
              }
              if (action.wID == MediaPortal.GUI.Library.Action.ActionType.ACTION_NEXT_ITEM || action.wID == MediaPortal.GUI.Library.Action.ActionType.ACTION_NEXT_CHAPTER)
              {
            if (MyFilms.currentTrailerMoviesList.Count > 1)
            {
              // MyFilms.player.PlayNext();
              return;
            }
              }

              if (action.wID == MediaPortal.GUI.Library.Action.ActionType.ACTION_PREV_ITEM || action.wID == MediaPortal.GUI.Library.Action.ActionType.ACTION_PREV_CHAPTER)
              {
            if (MyFilms.currentTrailerMoviesList.Count > 1)
            {
              // MyFilms.player.PlayPrevious();
              return;
            }
              }

              base.OnAction(action);
        }
Exemplo n.º 5
0
 public MpDialogSelect(MediaPortal.Dialogs.GUIDialogSelect menu)
     : base(menu)
 {
     this.DialogType = menu.GetModuleName();
     this.DialogId = menu.GetID;
     this.AvailableActions.Add("ok");
     this.AvailableActions.Add("cancel");
 }
		public void EnterModelContext(MediaPortal.UI.Presentation.Workflow.NavigationContext oldContext, MediaPortal.UI.Presentation.Workflow.NavigationContext newContext)
		{
			// reset the properties
			UpdateInfo = string.Empty;
			UpdateProgress = 0;
			// start the update in a background thread
			RunUpdate(newContext);
		}
Exemplo n.º 7
0
 /// <summary>
 /// Check if a dialog is a trakt rating dialog
 /// </summary>
 /// <param name="dialog">Dialog</param>
 /// <returns>true/false ;)</returns>
 internal static bool IsTraktRatingDialog(MediaPortal.Dialogs.GUIDialogWindow dialog)
 {
     if (dialog.GetType().Equals(typeof(TraktPlugin.GUI.GUIRateDialog)))
     {
         return true;
     }
     else
     {
         return false;
     }
 }
        public override void OnAction(MediaPortal.GUI.Library.Action action)
        {
            if (facadeControl.Focus == true)
            {
                if (action.wID == MediaPortal.GUI.Library.Action.ActionType.ACTION_MOVE_DOWN || action.wID == MediaPortal.GUI.Library.Action.ActionType.ACTION_MOVE_UP)
                {

                }
            }
            base.OnAction(action);
        }
Exemplo n.º 9
0
        public MpDialogNotify(MediaPortal.Dialogs.GUIDialogNotify menu)
            : base(menu)
        {
            this.dialogMenu = menu;
            this.DialogType = menu.GetModuleName();
            this.DialogId = menu.GetID;
            this.AvailableActions.Add("ok");
            this.AvailableActions.Add("cancel");

            GetHeading(menu, 4);
        }
Exemplo n.º 10
0
 protected override void OnClicked(int controlId, GUIControl control, MediaPortal.GUI.Library.Action.ActionType actionType)
 {
     if (control == hidePlaylistButton)
     {
         WindowManager.ShowPlayList();
     }
     if (control == playlistControl)
     {
         onPlaylistControl();
     }
 }
Exemplo n.º 11
0
 public override void OnAction(MediaPortal.GUI.Library.Action action)
 {
     if (action.wID == MediaPortal.GUI.Library.Action.ActionType.ACTION_PREVIOUS_MENU)
     {
         WindowManager.GoBack();
     }
     else
     {
         base.OnAction(action);
     }
 }
Exemplo n.º 12
0
        public MpDialogProgress(MediaPortal.Dialogs.GUIDialogProgress menu)
            : base(menu)
        {
            this.dialogMenu = menu;
            this.DialogType = menu.GetModuleName();
            this.DialogId = menu.GetID;
            this.AvailableActions.Add("cancel");
            this.AvailableActions.Add("progress");

            UpdateValues();
        }
Exemplo n.º 13
0
 protected override void OnClicked(int controlId, GUIControl control, MediaPortal.GUI.Library.Action.ActionType actionType)
 {
     if (control == checkControl)
     {
         onCheckControl();
     }
     if (control == addButton)
     {
         onAddButton();
     }
     base.OnClicked(controlId, control, actionType);
 }
Exemplo n.º 14
0
        public MpDialogOk(MediaPortal.Dialogs.GUIDialogOK menu)
            : base(menu)
        {
            this.dialogMenu = menu;
            this.DialogType = menu.GetModuleName();
            this.DialogId = menu.GetID;
            this.AvailableActions.Add("ok");
            this.AvailableActions.Add("cancel");

            GetHeading(menu, 1);
            GetText(menu, 2, 3, 4, 5);
        }
Exemplo n.º 15
0
 public override void OnAction(MediaPortal.GUI.Library.Action action)
 {
     if (action.wID == MediaPortal.GUI.Library.Action.ActionType.ACTION_CONTEXT_MENU)
       {
     var videoWindow = (MyFilmsGUIVideoFullscreen)GUIWindowManager.GetWindow(29054);
     videoWindow.OnAction(new MediaPortal.GUI.Library.Action(MediaPortal.GUI.Library.Action.ActionType.ACTION_SHOW_OSD, 0, 0));
     videoWindow.OnAction(action);
       }
       else
       {
     base.OnAction(action);
       }
 }
Exemplo n.º 16
0
        public MpDialogMenu(MediaPortal.Dialogs.GUIDialogMenu menu)
            : base(menu)
        {
            this.DialogType = menu.GetModuleName();
            this.DialogId = menu.GetID;
            this.menu = menu;
            this.ListItems = new List<FacadeItem>();

            this.AvailableActions.Add("listselect");
            this.AvailableActions.Add("cancel");

            GetHeading(menu, 4);
        }
		public void ExitModelContext(MediaPortal.UI.Presentation.Workflow.NavigationContext oldContext, MediaPortal.UI.Presentation.Workflow.NavigationContext newContext)
		{
			// set a flag to stop the update if the thread is still running
			lock (syncObject)
			{
				if (currentBackgroundTask != null) currentBackgroundTask.State = WorkState.CANCELED;
			}
			// wait until the update background thread has ended
			while (currentBackgroundTask != null)
			{
				System.Threading.Thread.Sleep(20);
			}
		}
Exemplo n.º 18
0
        protected override void OnClicked(int controlId, GUIControl control, MediaPortal.GUI.Library.Action.ActionType actionType)
        {
            if (control == facadeView)
            {
                GUIListItemActor actorItem = _currentSelection as GUIListItemActor;
                if (actorItem != null)
                {
                    Movies.Actor = actorItem.ItemId;
                    GUIWindowManager.ActivateWindow((int)MyMovies.GUIWindowID.Main);
                }
            }

            base.OnClicked(controlId, control, actionType);
        }
Exemplo n.º 19
0
        public MpDialogRating(MediaPortal.Dialogs.GUIDialogSetRating dialog)
            : base(dialog)
        {
            this.mpDialog = dialog;
            this.DialogType = dialog.GetModuleName();
            this.DialogId = dialog.GetID;
            this.Rating = dialog.Rating;
            GetHeading(dialog, 2);
            GetText(dialog, 4);

            this.AvailableActions.Add("ok");
            this.AvailableActions.Add("cancel");
            this.AvailableActions.Add("setrating");
        }
Exemplo n.º 20
0
        public override void OnAction(MediaPortal.GUI.Library.Action action)
        {
            //if (switchSearchTypeButton.Focus)
            //{
            //    if (action.wID == MediaPortal.GUI.Library.Action.ActionType.)
            //    {

            //    }
            //    if (action.wID == MediaPortal.GUI.Library.Action.ActionType.ACTION_MOVE_LEFT)
            //    {
            //        if (currentitem -1 == -1)
            //        {
            //            currentitem = searcharray.Length - 1;
            //            switchSearchTypeButton.SelectedItem = currentitem;
            //            //switchSearchTypeButton.Label = "SearchType: " + switchSearchTypeButton.SelectedLabel;
            //        }
            //        else
            //        {
            //            currentitem--;
            //            switchSearchTypeButton.SelectedItem = currentitem;
            //        }
            //        switchSearchTypeButton.Label = "SearchType: " + switchSearchTypeButton.SelectedLabel;
            //    }
            //    if (action.wID == MediaPortal.GUI.Library.Action.ActionType.ACTION_MOVE_RIGHT)
            //    {
            //        if (currentitem + 1 == searcharray.Length - 1)
            //        {
            //            currentitem = 0;
            //            switchSearchTypeButton.SelectedItem = currentitem;
            //            //switchSearchTypeButton.Label = "SearchType: " + switchSearchTypeButton.SelectedLabel;
            //        }
            //        else
            //        {
            //            currentitem++;
            //            switchSearchTypeButton.SelectedItem = currentitem;
            //        }
            //        switchSearchTypeButton.Label = "SearchType: " + switchSearchTypeButton.SelectedLabel;
            //    }
            //}
            if (action.wID == MediaPortal.GUI.Library.Action.ActionType.ACTION_PREVIOUS_MENU)
            {
                WindowManager.GoBack();
            }
            else
            {
                base.OnAction(action);
            }
        }
Exemplo n.º 21
0
        public override void OnAction(MediaPortal.GUI.Library.Action action)
        {
            switch (action.wID)
            {
                case MediaPortal.GUI.Library.Action.ActionType.ACTION_MOVE_DOWN:
                case MediaPortal.GUI.Library.Action.ActionType.ACTION_MOVE_LEFT:
                case MediaPortal.GUI.Library.Action.ActionType.ACTION_MOVE_RIGHT:
                case MediaPortal.GUI.Library.Action.ActionType.ACTION_MOVE_UP:

                    base.OnAction(action);
                    break;
                default:
                    base.OnAction(action);
                    break;
            }
        }
Exemplo n.º 22
0
        /// <summary>
        /// Add MpExtended information to playlist item
        /// </summary>
        /// <param name="item">MediaPortal playlist item</param>
        /// <param name="message">Playlist message item that is sent to client</param>
        internal static void AddMpExtendedInfo(MediaPortal.Playlists.PlayListItem item, PlaylistEntry message)
        {
            MusicDatabase mpMusicDb = MusicDatabase.Instance;
            Song song = new Song();
            bool inDb = mpMusicDb.GetSongByFileName(item.FileName, ref song);

            if (inDb)
            {
                message.Name2 = song.Album;
                message.AlbumArtist = song.AlbumArtist;
                message.Title = song.Title;
                message.MpExtId = song.Id.ToString();
                message.MpExtMediaType = (int)MpExtended.MpExtendedMediaTypes.MusicTrack;
                message.MpExtProviderId = (int)MpExtended.MpExtendedProviders.MPMusic;
            }
        }
Exemplo n.º 23
0
 void GUIWindowManager_OnNewAction(MediaPortal.GUI.Library.Action action)
 {
     if (Playing)
     {
         // IPlayer.Volume Property is never set by MediaPortal -> need to trap volume changes this way
         switch (action.wID)
         {
             case MediaPortal.GUI.Library.Action.ActionType.ACTION_VOLUME_MUTE:
                 wmpCtrl.settings.mute = VolumeHandler.Instance.IsMuted;
                 break;
             case MediaPortal.GUI.Library.Action.ActionType.ACTION_VOLUME_DOWN:
                 wmpCtrl.settings.volume = (int)((double)MediaPortal.Player.VolumeHandler.Instance.Previous / MediaPortal.Player.VolumeHandler.Instance.Maximum * 100);
                 break;
             case MediaPortal.GUI.Library.Action.ActionType.ACTION_VOLUME_UP:
                 wmpCtrl.settings.volume = (int)((double)VolumeHandler.Instance.Next / MediaPortal.Player.VolumeHandler.Instance.Maximum * 100);
                 break;
         }
     }
 }
Exemplo n.º 24
0
 private void AlbumActions(MediaPortal.GUI.Library.Action.ActionType actionType)
 {
     if ((actionType == Action.ActionType.ACTION_MUSIC_PLAY) || (actionType == Action.ActionType.ACTION_PLAY) || (actionType == Action.ActionType.ACTION_PAUSE))
       {
     if ((actionType == Action.ActionType.ACTION_MUSIC_PLAY) || (actionType == Action.ActionType.ACTION_PLAY) || (actionType == Action.ActionType.ACTION_PAUSE && !g_Player.HasVideo))
     {
       DBArtistInfo currArtist = DBArtistInfo.Get(facadeLayout.SelectedListItem.Label);
       List<DBTrackInfo> allTracksOnAlbum = DBTrackInfo.GetEntriesByAlbum((DBAlbumInfo)facadeLayout.SelectedListItem.MusicTag);
       AddToPlaylist(allTracksOnAlbum, true, mvCentralCore.Settings.ClearPlaylistOnAdd, mvCentralCore.Settings.GeneratedPlaylistAutoShuffle);
     }
     else
     {
       _currentView = MvView.Artist;
       artistID = facadeLayout.SelectedListItem.ItemId;
       logger.Debug("Calling loadCurrent from AlbumActions");
       loadCurrent();
     }
       }
 }
Exemplo n.º 25
0
        private void GenreActions(MediaPortal.GUI.Library.Action.ActionType actionType)
        {
            if ((actionType == Action.ActionType.ACTION_MUSIC_PLAY) || (actionType == Action.ActionType.ACTION_PLAY) || (actionType == Action.ActionType.ACTION_PAUSE))
              {
            if ((actionType == Action.ActionType.ACTION_MUSIC_PLAY) || (actionType == Action.ActionType.ACTION_PLAY) || (actionType == Action.ActionType.ACTION_PAUSE && !g_Player.HasVideo))
            {

              List<DBArtistInfo> artistList = new List<DBArtistInfo>();
              List<DBArtistInfo> artistFullList = DBArtistInfo.GetAll();

              logger.Debug("Checking for matches for Genre : " + facadeLayout.SelectedListItem.Label);
              foreach (DBArtistInfo artistInfo in artistFullList)
              {
            if (tagMatched(facadeLayout.SelectedListItem.Label, artistInfo))
            {
              logger.Debug("Matched Artist {0} with Tag {1}", artistInfo.Artist, facadeLayout.SelectedListItem.Label);
              if (!artistList.Contains(artistInfo))
                artistList.Add(artistInfo);
            }
              }

              if (mvCentralCore.Settings.ClearPlaylistOnAdd)
            ClearPlaylist();

              foreach (DBArtistInfo currArtist in artistList)
              {
            List<DBTrackInfo> artistTracks = DBTrackInfo.GetEntriesByArtist(currArtist);
            AddToPlaylist(artistTracks, false, false, mvCentralCore.Settings.GeneratedPlaylistAutoShuffle);
              }
              Player.playlistPlayer.Play(0);
              if (mvCentralCore.Settings.AutoFullscreen)
            GUIWindowManager.ActivateWindow((int)GUIWindow.Window.WINDOW_FULLSCREEN_VIDEO);
            }
            else
            {
              _currentView = MvView.Genres;
              artistID = facadeLayout.SelectedListItem.ItemId;
              logger.Debug("Calling loadCurrent from GenreActions");
              loadCurrent();
            }
              }
        }
Exemplo n.º 26
0
    public bool Transcode(TranscodeInfo info, MediaPortal.Core.Transcoding.VideoFormat format,
                          MediaPortal.Core.Transcoding.Quality quality, Standard standard)
    {
      if (!Supports(format)) return false;
      string ext = System.IO.Path.GetExtension(info.file);
      if (ext.ToLower() != ".dvr-ms" && ext.ToLower() != ".sbe") return false;

      //Type comtype = null;
      //object comobj = null;
      try
      {
        Log.Info("DVR2MPG: create graph");
        graphBuilder = (IGraphBuilder)new FilterGraph();

        _rotEntry = new DsROTEntry((IFilterGraph)graphBuilder);

        Log.Info("DVR2MPG: add streambuffersource");
        bufferSource = (IStreamBufferSource)new StreamBufferSource();


        IBaseFilter filter = (IBaseFilter)bufferSource;
        graphBuilder.AddFilter(filter, "SBE SOURCE");

        Log.Info("DVR2MPG: load file:{0}", info.file);
        IFileSourceFilter fileSource = (IFileSourceFilter)bufferSource;
        int hr = fileSource.Load(info.file, null);


        Log.Info("DVR2MPG: Add Cyberlink MPEG2 multiplexer to graph");
        string monikerPowerDvdMuxer =
          @"@device:sw:{083863F1-70DE-11D0-BD40-00A0C911CE86}\{7F2BBEAF-E11C-4D39-90E8-938FB5A86045}";
        powerDvdMuxer = Marshal.BindToMoniker(monikerPowerDvdMuxer) as IBaseFilter;
        if (powerDvdMuxer == null)
        {
          Log.Warn("DVR2MPG: FAILED:Unable to create Cyberlink MPEG Muxer (PowerDVD)");
          Cleanup();
          return false;
        }

        hr = graphBuilder.AddFilter(powerDvdMuxer, "PDR MPEG Muxer");
        if (hr != 0)
        {
          Log.Warn("DVR2MPG: FAILED:Add Cyberlink MPEG Muxer to filtergraph :0x{0:X}", hr);
          Cleanup();
          return false;
        }

        //add filewriter 
        Log.Info("DVR2MPG: Add FileWriter to graph");
        string monikerFileWrite =
          @"@device:sw:{083863F1-70DE-11D0-BD40-00A0C911CE86}\{3E8868CB-5FE8-402C-AA90-CB1AC6AE3240}";
        IBaseFilter fileWriterbase = Marshal.BindToMoniker(monikerFileWrite) as IBaseFilter;
        if (fileWriterbase == null)
        {
          Log.Warn("DVR2MPG: FAILED:Unable to create FileWriter");
          Cleanup();
          return false;
        }


        fileWriterFilter = fileWriterbase as IFileSinkFilter;
        if (fileWriterFilter == null)
        {
          Log.Warn("DVR2MPG: FAILED:Add unable to get IFileSinkFilter for filewriter");
          Cleanup();
          return false;
        }

        hr = graphBuilder.AddFilter(fileWriterbase, "FileWriter");
        if (hr != 0)
        {
          Log.Warn("DVR2MPG: FAILED:Add FileWriter to filtergraph :0x{0:X}", hr);
          Cleanup();
          return false;
        }


        //connect output #0 of streambuffer source->powerdvd audio in
        //connect output #1 of streambuffer source->powerdvd video in
        Log.Info("DVR2MPG: connect streambuffer->multiplexer");
        IPin pinOut0, pinOut1;
        IPin pinIn0, pinIn1;
        pinOut0 = DsFindPin.ByDirection((IBaseFilter)bufferSource, PinDirection.Output, 0);
        pinOut1 = DsFindPin.ByDirection((IBaseFilter)bufferSource, PinDirection.Output, 1);

        pinIn0 = DsFindPin.ByDirection(powerDvdMuxer, PinDirection.Input, 0);
        pinIn1 = DsFindPin.ByDirection(powerDvdMuxer, PinDirection.Input, 1);
        if (pinOut0 == null || pinOut1 == null || pinIn0 == null || pinIn1 == null)
        {
          Log.Warn("DVR2MPG: FAILED:unable to get pins of muxer&source");
          Cleanup();
          return false;
        }

        bool usingAc3 = false;
        AMMediaType amAudio = new AMMediaType();
        amAudio.majorType = MediaType.Audio;
        amAudio.subType = MediaSubType.Mpeg2Audio;
        hr = pinOut0.Connect(pinIn1, amAudio);
        if (hr != 0)
        {
          amAudio.subType = MediaSubType.DolbyAC3;
          hr = pinOut0.Connect(pinIn1, amAudio);
          usingAc3 = true;
        }
        if (hr != 0)
        {
          Log.Warn("DVR2MPG: FAILED: unable to connect audio pins: 0x{0:X}", hr);
          Cleanup();
          return false;
        }

        if (usingAc3)
          Log.Info("DVR2MPG: using AC3 audio");
        else
          Log.Info("DVR2MPG: using MPEG audio");

        AMMediaType amVideo = new AMMediaType();
        amVideo.majorType = MediaType.Video;
        amVideo.subType = MediaSubType.Mpeg2Video;
        hr = pinOut1.Connect(pinIn0, amVideo);
        if (hr != 0)
        {
          Log.Warn("DVR2MPG: FAILED: unable to connect video pins: 0x{0:X}", hr);
          Cleanup();
          return false;
        }


        //connect output of powerdvd muxer->input of filewriter
        Log.Info("DVR2MPG: connect multiplexer->filewriter");
        IPin pinOut, pinIn;
        pinOut = DsFindPin.ByDirection(powerDvdMuxer, PinDirection.Output, 0);
        if (pinOut == null)
        {
          Log.Warn("DVR2MPG: FAILED:cannot get output pin of Cyberlink MPEG muxer :0x{0:X}", hr);
          Cleanup();
          return false;
        }
        pinIn = DsFindPin.ByDirection(fileWriterbase, PinDirection.Input, 0);
        if (pinIn == null)
        {
          Log.Warn("DVR2MPG: FAILED:cannot get input pin of Filewriter :0x{0:X}", hr);
          Cleanup();
          return false;
        }
        AMMediaType mt = new AMMediaType();
        hr = pinOut.Connect(pinIn, mt);
        if (hr != 0)
        {
          Log.Warn("DVR2MPG: FAILED:connect muxer->filewriter :0x{0:X}", hr);
          Cleanup();
          return false;
        }

        //set output filename
        string outputFileName = System.IO.Path.ChangeExtension(info.file, ".mpg");
        Log.Info("DVR2MPG: set output file to :{0}", outputFileName);
        mt.majorType = MediaType.Stream;
        mt.subType = MediaSubTypeEx.MPEG2;

        hr = fileWriterFilter.SetFileName(outputFileName, mt);
        if (hr != 0)
        {
          Log.Warn("DVR2MPG: FAILED:unable to set filename for filewriter :0x{0:X}", hr);
          Cleanup();
          return false;
        }
        mediaControl = graphBuilder as IMediaControl;
        mediaSeeking = graphBuilder as IMediaSeeking;
        mediaEvt = graphBuilder as IMediaEventEx;
        Log.Info("DVR2MPG: start transcoding");
        hr = mediaControl.Run();
        if (hr != 0)
        {
          Log.Warn("DVR2MPG: FAILED:unable to start graph :0x{0:X}", hr);
          Cleanup();
          return false;
        }
      }
      catch (Exception ex)
      {
        Log.Error("DVR2MPG: Unable create graph: {0}", ex.Message);
        Cleanup();
        return false;
      }
      return true;
    }
Exemplo n.º 27
0
 public bool Supports(MediaPortal.Core.Transcoding.VideoFormat format)
 {
   if (format == VideoFormat.Mpeg2) return true;
   return false;
 }
Exemplo n.º 28
0
        //GUI clicked
        protected override void OnClicked(int controlId, GUIControl control, MediaPortal.GUI.Library.Action.ActionType actionType)
        {
            Log.Debug("[TVWishListMP GUI_Edit]:OnClicked");


            if (control == myfacade)
            {
                ItemSelectionChanged(); 
            }
            else if (control == buttonNew)
            {
                OnButtonNew();
            }
            else if (control == buttonCancel)
            {
                OnButtonCan();
            }
            else if (control == buttonNext)
            {
                OnButtonNext();
            }
            else if (control == buttonPrev)
            {
                OnButtonPrevious();
            }
            else if (control == buttonSave)
            {
                OnButtonSave();
            }
            else if (control == buttonDelete)
            {
                Main_GUI mymainwindow = (Main_GUI)GUIWindowManager.GetWindow(_guimainwindowid);              
                OnButtonDelete();  
            }
            else if (control == buttonMore)
            {
                OnButtonMore();
            }
            
            base.OnClicked(controlId, control, actionType);
        }
Exemplo n.º 29
0
 protected override void OnClicked(int controlId, GUIControl control, MediaPortal.GUI.Library.Action.ActionType actionType)
 {
     if (control == playlistButton)
     {
         WindowManager.ShowPlayList();
     }
     if (control == goBackButton)
     {
         WindowManager.GoBack();
     }
     if (control == searchButton)
     {
         onSearchButton();
     }
 }
Exemplo n.º 30
0
 /// OnAction handler; if any action is received then last busy time is reset (i.e. idletimeout is reset)
 /// </summary>
 /// <param name="action">action message sent by the system</param>
 private void OnAction(MediaPortal.GUI.Library.Action action)
 {
   if (action.IsUserAction())
   {
     // Log.Debug("PS: Action {0} detected - reset time of last user activity and system idle timer", action.wID);
     _lastUserTime = DateTime.Now;
     PowerManager.ResetIdleTimer();
   }
 }