The Media Center Sandbox

Resources and discussion for developing experiences in the Windows Media Center platform.
Welcome to The Media Center Sandbox Sign in | Join | Help
in Search

Find out filename of recorded TV-show currently being watched?

Last post 03-10-2008, 7:22 PM by babgvant. 24 replies.
Page 1 of 2 (25 items)   1 2 Next >
Sort Posts: Previous Next
  •  04-20-2007, 2:07 AM 2854

    Find out filename of recorded TV-show currently being watched?

    Hi,

    is it possible for a background add-in (for example in response to a button pressed on the remote) to find out that the user is currently watching a recorded TV-show, and the filename of that show?

    More precisely: I know how to do a background add-in and I know how to detect buttons pressed on the remote. What I don't know is the part about finding out the filename of the recorded show that is currently being watched.

    I would be thankful for any pointers!

    Bye,

    Doc

  •  04-20-2007, 3:05 AM 2855 in reply to 2854

    Re: Find out filename of recorded TV-show currently being watched?

    If you look at my complete background app (for VMCMusicLister you will see how I access the vmcMetaData = vmcHost.MediaCenterEnvironment.MediaExperience.MediaMetadata; to get at info on a music track. Although it's a different object for tv, the Microsoft.MediaCenter.Samples.MediaState Namespace should provide some pointers, e.g.

    MediaState.TV Property

    Gets the live TV session

    and just noted

    TVSessionState Class

    Contains the TV (live, recorded, recording) session state information.

    Whether it contains the filename though? Might have to go about it a round about way like i did to get the music filename!



    Gordon: Has reached the end!
  •  04-21-2007, 9:28 AM 2890 in reply to 2855

    Re: Find out filename of recorded TV-show currently being watched?

    Hi,

    thanks for your reply!

    I fear that vmcHost.MediaCenterEnvironment.MediaExperience.MediaMetadata won't help me, because it is null during live-TV and when watching recorded TV.

    I was hopening that there would be someting simpler then MSAS, which doesn't give me the filename anyway, if I am correct?

    Doc

  •  04-21-2007, 10:40 AM 2893 in reply to 2890

    Re: Find out filename of recorded TV-show currently being watched?

    There isn't an easy way to do this unfortunately - hopefully this info will be available to developers in the next iteration of Media Center.

    Cheers,
    Andrew

  •  04-21-2007, 3:49 PM 2895 in reply to 2893

    Re: Find out filename of recorded TV-show currently being watched?

    This sounds like a huge problem???

    Isn't the sdk correct then, or have I misread it. How can the sdk not provide such info? Charlie?

    Does the SQLServerLite file not contain any useful info, re: Olcay http://mcedev.com/News.aspx?nwid=9fe35775-178a-44e7-b45d-8e0c0f9f7f62
    in thread http://discuss.mediacentersandbox.com/forums/post/1966.aspx

    just thoughts.



    Gordon: Has reached the end!
  •  04-21-2007, 10:32 PM 2903 in reply to 2895

    Re: Find out filename of recorded TV-show currently being watched?

    I don't believe that the EPG database holds details of what you are currently watching, but I haven't checked.

    The reason the SDK doesn't provide it is most likely it is way out of the scope of the type of application the eHome team were envisaging people would write (or they want people to write) for Media Center.  You've got to remember that Media Center is an application first and a platform second, and the platform is designed around Microsoft's vision, not ours as developers of wacky add-ons!

    Cheers,
    Andrew

  •  04-22-2007, 2:36 PM 2919 in reply to 2893

    Re: Find out filename of recorded TV-show currently being watched?

    AndyC:
    There isn't an easy way to do this unfortunately

    I feared as much. Well, I'll put my litte add-in idea on the shelf for the future (if this information should become available in a future version).

    Thanks for the replies!

    Doc

  •  04-23-2007, 2:20 PM 2955 in reply to 2919

    Re: Find out filename of recorded TV-show currently being watched?

    But the epg database would hold details of what might be being watched at that particular time. So now the question becomes can you narrow it down, perhaps by reading keys on startup and decoding the possible options and paths taken? You'd have to build a tree and then see if you might be on the tv and what channel. This would have to be maintained from startup?

    Just thoughts.


    Gordon: Has reached the end!
  •  04-24-2007, 9:05 PM 3022 in reply to 2955

    Re: Find out filename of recorded TV-show currently being watched?

    You might try experimenting with the Microsoft.MediaCenter.TV namespace, particularly the ScheduleEvent.GetExtendedProperty Method. Things were much improved in the general area of TV / EPG for Diamond, although we haven't bubbled it up as much as we perhaps should have by now.
    Charlie Owen (Microsoft)
  •  04-25-2007, 10:45 AM 3036 in reply to 2854

    Re: Find out filename of recorded TV-show currently being watched?

    @Gordon: Thanks for the help, but I was looking for the file information for a recorded TV-show that is currently being watched. I don't think that the EPG info will help here, as the actual airing of that show will have been way in the past.

    @Charlie: Thanks! I can see that the ScheduleEvent has a property "FileName" which holds the filename of the recording (obviously) and where the docs say that this is null until the recording starts, which implies that it will be non-null once the recording has been finished (or started).
    So the question would be: Is there a way to find out which ScheduleEvent is the one that matches the recorded TV-show that the user is currently watching (assuming a background add-in that reacts to a certain key-press on the remote while the show is being played)?
    As possibilities to access ScheduleEvents I can only find EventSchedule.GetScheduleEvents (gets events by time-boundary and type) and EventSchedule.GetScheduleEventWithId (gets event by ID), and I can't see how they could help me in my situation, since I have neither of this information about the show currently being played.

    Or am I missing something?

    Doc

  •  04-25-2007, 12:30 PM 3040 in reply to 3036

    Re: Find out filename of recorded TV-show currently being watched?

    Would any attribute of the file be set when it was being played, or would windows itself contain a handle or whatever to the actual file as it is being played. For instance could I delete a playing file? if so you could scan each file in the folder(s)? and delete them, the one that remains is the one that is being played!!! hahaha

    But the germ of an idea?


    Gordon: Has reached the end!
  •  04-25-2007, 2:01 PM 3043 in reply to 3036

    Re: Find out filename of recorded TV-show currently being watched?

    I'm not aware of any way we give you to find this out via an API -- like I said, thought it *might* be useful to poke around to see if you could find a solution.
    Charlie Owen (Microsoft)
  •  04-26-2007, 12:00 AM 3053 in reply to 3043

    Re: Find out filename of recorded TV-show currently being watched?

    The only way I've found of dealing with this is to check what open files that ehshell.exe has using the undocumented "NtGetSystemInformation".  If there is a video type file, then by deduction that is the currently viewed file (as recordings aren't handled by ehshell.exe).

    To see a demo of this, download handle.exe from www.sysinternals.com and run it against the ehshell.exe process while watching TV.

    Cheers,
    Andrew

  •  05-13-2007, 1:02 PM 3281 in reply to 3053

    Re: Find out filename of recorded TV-show currently being watched?

    I'm fairly certain using NtGetSystemInformation will only work if you have disabled UAC otherwise it will fail due to lack of permission :(
  •  05-13-2007, 11:57 PM 3294 in reply to 3281

    Re: Find out filename of recorded TV-show currently being watched?

    Yes - you'd need to create a service running under the system account and then communicate with the service via remoting, WCF,  or something similar.

    Cheers,
    Andrew

Page 1 of 2 (25 items)   1 2 Next >
View as RSS news feed in XML
Powered by Community Server, by Telligent Systems