|
SageTV Studio Discussion related to the SageTV Studio application produced by SageTV. Questions, issues, problems, suggestions, etc. relating to the Studio software application should be posted here. |
|
Thread Tools | Search this Thread | Display Modes |
#1
|
|||
|
|||
Start, Current and Stop times for different media types
I'm trying to get a grasp on how GetStartTime and GetStopTime and GetMediaTime all deal with the different forms of media. For instance, Live TV, recorded TV, imported video files, DVD's, music, etc.
My tests with imported media returned a start and stop time that appeared to be based off the file's creation date. Obviously, for live TV, the start, stop and current time are all clock times....so if you're watching a show at 6:45p, the current time returned for the media is 6:45p. But once that show is recorded, and you go play it back...does it still show the clock time, or does it convert to elapsed time? I ask this because I don't have the capability to test a lot of these different media types, but I want to try and come up with some standard way that I display start, stop and current times so that, no matter what the media, they are useful values. Is there a specific, standard way? Thanks! |
#2
|
||||
|
||||
Do you mean GetFileStartTime(), GetFileEndTime(), and GetMediaTime()?
Have you checked the descriptions of them in the API docs? It talks about where the the start/stop times come from and what GetMediaTime() represents. There is code using all these & other time calls in the "MediaPlayer OSD" menu, used for the playback time bar. - Andy
__________________
SageTV Open Source v9 is available. - Read the SageTV FAQ. Older PDF User's Guides mostly still apply: SageTV V7.0 & SageTV Studio v7.1. - Hauppauge remote help: 1) Basics/Extending it 2) Replace it 3) Use it w/o needing focus - HD Extenders: A) FAQs B) URC MX-700 remote setup Note: This is a users' forum; see the Rules. For official tech support fill out a Support Request. |
#3
|
|||
|
|||
Well, I think I was actually using the airing GetStart and GetStop times. So, I guess that if my media object HAS an airing, then I can use those times, and if it doesn't, then I can use the GetFileStart and Stop times.
As for GetMediaTime, though, this is where I was a little confused. Quote:
However, what about music files or imported media files? They do not have airings associated with them, but are not DVD's....so that's where some of my confusion comes in. How does the media player treat them? |
#4
|
||||
|
||||
Those are files, so just use the file start/stop time APIs I mentioned above. These are used below the "New Progress Panel with Padding Shown" panel widget in the OSD menu of the default STV. The widget chain below that panel deals with any media type being played.
- Andy
__________________
SageTV Open Source v9 is available. - Read the SageTV FAQ. Older PDF User's Guides mostly still apply: SageTV V7.0 & SageTV Studio v7.1. - Hauppauge remote help: 1) Basics/Extending it 2) Replace it 3) Use it w/o needing focus - HD Extenders: A) FAQs B) URC MX-700 remote setup Note: This is a users' forum; see the Rules. For official tech support fill out a Support Request. |
#5
|
|||
|
|||
I don't completely understand what you said, because none of this is for an STV. I'm gathering the data with my java code and then sending it over TCP to another app. So I don't deal with any of the OSD or STV widgets.
But I think I've got it then.....basically, if it has an airing object, then use that. Otherwise, use the file versions of them and just trust GetMediaTime() to always return something useful. Is that about right? |
#6
|
||||
|
||||
I pointed you to the code in the STV because that is easier to do than to try to describe it. You don't need to be using it in an STV, since the API calls will be similar either way -- the sample code shows how the data is being gathered for different situations. The STV also deals with padding time for TV recordings/files because the AiringStartTime() can be different from GetScheduleStartTime() or FileStartTime(). But, those times will be the same for imported media, so there will be no padding.
- Andy
__________________
SageTV Open Source v9 is available. - Read the SageTV FAQ. Older PDF User's Guides mostly still apply: SageTV V7.0 & SageTV Studio v7.1. - Hauppauge remote help: 1) Basics/Extending it 2) Replace it 3) Use it w/o needing focus - HD Extenders: A) FAQs B) URC MX-700 remote setup Note: This is a users' forum; see the Rules. For official tech support fill out a Support Request. |
#7
|
|||
|
|||
Ooooo. Ok. I'll try to learn enough about the STV then to take a look at that.
|
#8
|
||||
|
||||
All media files have an airing object and a show object -- even pictures. This is how Sage works internally.
Quote:
Note The Airing start/stop times for TV files may not correspond to the File start/stop times. This can be due to record padding, or the user starting the recording late, or it being a liveTV partial file. To get the relative playback position in milliseconds, for all media file types APART from DVDs, you are 'safe' with using: GetMediaTime()-GetFileStartTime(GetCurrentMediaFile()) For DVDs, simply use GetMediaTime().
__________________
Check out my enhancements for Sage in the Sage Customisations and Sageplugins Wiki |
#9
|
||||
|
||||
Quote:
You can also learn a lot by trying out API calls interactively using Studio's Expression Evaluator. This can help you zero in on correct usage a lot quicker than repeated edit/compile/debug cycles.
__________________
-- Greg |
#10
|
||||
|
||||
Quote:
Quote:
Quote:
Quote:
|
#11
|
|||
|
|||
Well, API docs partially answered that....the file end time is when it stopped recording, or the starttime + duration. So either way, if it's live tv, then I'm going to want to use the airing end time anyway.
Sooo..... If LiveTV: Use GetMediaTime, GetAiringStartTime, GetAiringEndTime Else Use GetMediaTime, GetFileStartTime, GetFileEndTime |
#12
|
||||
|
||||
Quote:
I'll suggest one more time that you check out the code in the STV that I referred you to & then I won't mentioning it again. - Andy
__________________
SageTV Open Source v9 is available. - Read the SageTV FAQ. Older PDF User's Guides mostly still apply: SageTV V7.0 & SageTV Studio v7.1. - Hauppauge remote help: 1) Basics/Extending it 2) Replace it 3) Use it w/o needing focus - HD Extenders: A) FAQs B) URC MX-700 remote setup Note: This is a users' forum; see the Rules. For official tech support fill out a Support Request. |
#13
|
||||
|
||||
You are really making things much more difficult for yourself by not using studio...
I can understand that the STV itself may be daunting, but if you just use the Studio window's Expression Evaluator to see what some functions return, it helps a lot in prototyping, especially for Java apps. For a LiveTV show where viewing started after the Airing has started, and is currently playing: PrintTimeLong(GetAiringStartTime(GetCurrentMediaFile())) =09:30:00 PrintTimeLong(GetAiringStopTime(GetCurrentMediaFile())) =09:55:00 PrintTimeLong(GetFileStartTime(GetCurrentMediaFile())) =09:31:03 PrintTimeLong(GetFileStartTime(GetCurrentMediaFile())) =09:34:05 (note that this value will increase as more of the show is being recorded) PrintTimeLong(GetMediaTime())=09:34:12
__________________
Check out my enhancements for Sage in the Sage Customisations and Sageplugins Wiki |
#14
|
|||
|
|||
Well, I'd be a complete idiot to not listen to the advice of people who have already helped me so much. (Now, I'm not saying I'm NOT a complete idiot.... ).
Before I post another question, then, I will get the STV up and going and play around with it. |
#15
|
||||
|
||||
Quote:
PrintTimeLong(GetScheduleStartTime(GetCurrentMediaFile())) PrintTimeLong(GetScheduleEndTime(GetCurrentMediaFile())) - Andy
__________________
SageTV Open Source v9 is available. - Read the SageTV FAQ. Older PDF User's Guides mostly still apply: SageTV V7.0 & SageTV Studio v7.1. - Hauppauge remote help: 1) Basics/Extending it 2) Replace it 3) Use it w/o needing focus - HD Extenders: A) FAQs B) URC MX-700 remote setup Note: This is a users' forum; see the Rules. For official tech support fill out a Support Request. |
#16
|
|||
|
|||
Well, my overriding goal in all of this is to represent the start, end, and current time of all types of media, in a Time (UTC) format. That gives the most flexibility for the client on the end to represent media dates and time however they want. For items that don't have a specific date (such as DVD's), then I'd just have to add the current time to 0 UTC (ya, it'd look like 1970 for date, but they'd just omit the date and only translate the time).
|
#17
|
|||
|
|||
Quote:
The function evaluator worked, and I can see some usefulness there. But I can't find this New Progress etc thing you talk about...the only thing with OSD I can find is the MediaPlayer OSD, and there's nothing under that about a progess panel. |
#18
|
||||
|
||||
Quote:
You don't really need to keep following the code down into the "Entire Progress Panel", unless you want to see a real mess. - Andy
__________________
SageTV Open Source v9 is available. - Read the SageTV FAQ. Older PDF User's Guides mostly still apply: SageTV V7.0 & SageTV Studio v7.1. - Hauppauge remote help: 1) Basics/Extending it 2) Replace it 3) Use it w/o needing focus - HD Extenders: A) FAQs B) URC MX-700 remote setup Note: This is a users' forum; see the Rules. For official tech support fill out a Support Request. |
#19
|
|||
|
|||
Ok, found it.
|
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
|
|