SageTV Community  

Go Back   SageTV Community > SageTV Development and Customizations > SageTV Studio
Forum Rules FAQs Community Downloads Today's Posts Search

Notices

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.

Reply
 
Thread Tools Search this Thread Display Modes
  #21  
Old 04-19-2007, 07:10 AM
beelzerob beelzerob is offline
Sage Advanced User
 
Join Date: May 2006
Posts: 163
Quote:
Originally Posted by nielm View Post
There are some mediafiles that are created and used internally (1 per tuner input) - the one at index 0 might have been one of these..
Ya, that's exactly what it was. I had one of the CQC'ers test out this code, and his show list came back with about 8 entires all relating to his PVR cards. A simple IsTVFile() will take care of that. I didn't see it on my end because my dev PC doesn't have any capture cards.
Reply With Quote
  #22  
Old 04-19-2007, 08:08 AM
nielm's Avatar
nielm nielm is offline
SageTVaholic
 
Join Date: Oct 2003
Location: Belgium
Posts: 4,496
Quote:
Originally Posted by beelzerob View Post
Stack trace?? You're able to step through your java code while it's talking to Sage?
no, I just log the stack traces of caught exceptions...
Code:
catch(Exception e) {
System.out.println(e);
e.printStackTrace(System.out);
}
__________________
Check out my enhancements for Sage in the Sage Customisations and Sageplugins Wiki
Reply With Quote
  #23  
Old 04-19-2007, 08:19 AM
beelzerob beelzerob is offline
Sage Advanced User
 
Join Date: May 2006
Posts: 163
Oh, ok...gotcha.
Reply With Quote
  #24  
Old 08-23-2008, 09:22 PM
Fonceur's Avatar
Fonceur Fonceur is offline
Sage Icon
 
Join Date: Jan 2008
Location: DDO, QC
Posts: 1,915
Quote:
Originally Posted by nielm View Post
My webserver does:
SageCommand("Home")
SageCommand("TV")
when initiating playback to go to the TV screen.
OK, so based on this thread, playing back a video/audio file is something like:

Code:
MediaFileAPI.MediaFile mf = sageApiMediaFile.GetMediaFileForID(showId);
Object mediaFile = sageApiMediaFile.Unwrap(mf);
sageApiGlobal.SageCommand("Home");
Thread.sleep(500);
sageApiMediaPlayer.Watch(mediaFile);
Thread.sleep(100);
sageApiGlobal.SageCommand("TV");
What would be the equivalent for displaying a photo (or a whole slideshow)? I tried variations on:

Code:
MediaFileAPI.MediaFile mf = sageApiMediaFile.GetMediaFileForID(showId);
sageApiGlobal.SageCommand("Home");
Thread.sleep(500);
sageUtility.LoadImage(mf.GetFullImage());
Thread.sleep(100);
sageApiGlobal.SageCommand("Browser");
and from the log I see the metaImage being loaded, but nothing is ever displayed... Is it just because I am missing the equivalent of "TV" for video/audio or am I missing something else?
Reply With Quote
  #25  
Old 08-24-2008, 10:12 AM
GKusnick's Avatar
GKusnick GKusnick is offline
SageTVaholic
 
Join Date: Dec 2005
Posts: 5,083
LoadImage() doesn't display anything. It just loads an image file into memory and returns a handle to the loaded resource. In widget code you can then feed that handle to an Image widget. You're just letting the handle drop, which won't accomplish much except to speed up future loads of that image.

Also, SageCommand() takes the name of any built-in command from the list in Chapter 5 of the manual. There's a "Picture Library" command in that list, but no "Browser" command that I can see.

Have you tried calling Watch() on the MediaFile? Note that you should be able to do this via mf.Watch() as well as via mediaFileAPI.Watch(mf).
__________________
-- Greg
Reply With Quote
  #26  
Old 08-24-2008, 01:31 PM
Fonceur's Avatar
Fonceur Fonceur is offline
Sage Icon
 
Join Date: Jan 2008
Location: DDO, QC
Posts: 1,915
Quote:
Originally Posted by GKusnick View Post
LoadImage() doesn't display anything.
I figured it wasn't what I wanted, just couldn't find better...

Quote:
Also, SageCommand() takes the name of any built-in command from the list in Chapter 5 of the manual.
Thanks, I knew they could be found from the command/infra-red list or such, but with regional settings of French (Canada), even if I install SageTV in English that list is still in French (I should bug that at some point)... I had searched the Studio manual, didn't think of searching the STV manual itself.

Quote:
Have you tried calling Watch() on the MediaFile? Note that you should be able to do this via mf.Watch() as well as via mediaFileAPI.Watch(mf).
While according to the logs it does ininiate a VideoFrame.Watch(), it doesn't start the picture viewer/slideshow in the UI. I looked at chapter 5 and couldn't find a direct command for the picture viewer/slideshow or anything similar to "TV" (which just end up starting Live TV when a picture is used). The result.tostring() of those watch commands is typically something like "sage.e$e@1c6866d", with the log:

Code:
VideoFrame.watch(A[174826,174824,"Glasgow_4",0@0816.19:24,0])
Sun 8/24 15:11:16.442 watchThisFile=MediaFile[id=174823 A[174826,174824,"Glasgow_4",0@0816.19:24,0] host=htpc encodedBy= format=JPEG 0:00:00 0 kbps [] F:\Photos\Glasgow_4.JPG, Seg0[Mon 12/1 18:25:13.999-Mon 12/1 18:25:14.000]]
While from the UI I get (different file, but same idea):

Code:
setUI(sage.b1@7ec028[Picture Slideshow]) histIdx=2 uiHistory=[sage.b1@1d32e45[Main Menu], sage.b1@179a49f[Browser - Photos], sage.b1@7ec028[Picture Slideshow]]
Creating DX9 texture from compressed resource MediaFile[id=174811 A[174814,174812,"Glasgow_1",0@0815.17:30,0] host=htpc encodedBy= format=JPEG 0:00:00 0 kbps [] F:\Photos\Glasgow_1.JPG, Seg0[Mon 12/1 18:21:43.999-Mon 12/1 18:21:44.000]]
So any idea what I am missing to get that setUI part?
Reply With Quote
  #27  
Old 08-25-2008, 02:01 AM
GKusnick's Avatar
GKusnick GKusnick is offline
SageTVaholic
 
Join Date: Dec 2005
Posts: 5,083
Quote:
Originally Posted by Fonceur View Post
So any idea what I am missing to get that setUI part?
I don't have an exact answer off the top of my head, but when doing this from Studio code you typically want to jump to the appropriate screen for displaying that type of content. So for instance in the video case, you call Watch() and then jump to the MediaPlayerOSD screen (i.e. the playback screen with the popup transport controls). That's basically what SageCommand("TV") is doing in your example. So for photos you need to figure out which screen is active during a photo slideshow (just hit Ctrl+Shift+F12 during a slideshow to open Studio on that screen), and then figure out a way to invoke that screen from Java, either via the appropriate SageCommand string (if there is one) or by locating the correct menu widget and calling LaunchMenuWidget() on it.

Basically, when in doubt, open up Studio and see how the stock STV does it.
__________________
-- Greg
Reply With Quote
  #28  
Old 12-02-2008, 11:44 AM
Fonceur's Avatar
Fonceur Fonceur is offline
Sage Icon
 
Join Date: Jan 2008
Location: DDO, QC
Posts: 1,915
I got sidetracked by other stuff, so back to trying to figure out how to display one photo (or more) in the slideshow...

Quote:
Originally Posted by GKusnick View Post
LoadImage() doesn't display anything. It just loads an image file into memory and returns a handle to the loaded resource. In widget code you can then feed that handle to an Image widget. You're just letting the handle drop, which won't accomplish much except to speed up future loads of that image.
OK, I am getting close. Based on the attached Studio image, the LoadImage part is good and the Widget that I want is "Picture Slideshow". So I guess I am supposed to send that image to the "photo viewer menu"...

Code:
MediaFileAPI.MediaFile mf = sageApiMediaFile.GetMediaFileForID(showId);
Object oneImage = sageUtility.LoadImage(mf.GetFullImage());
???
sageApiWidget.FindWidget("Menu", "Picture Slideshow").LaunchMenuWidget();
Alternatively, based on that image, is there anyway that I could do something like:

Vector SubFolderPhotos = new Vector [1]{image1};

and inject it back into the existing chain, so I don't need to reinvent the wheel? Or for multiple photos, maybe inject it back into the "view all photos" chain?
Attached Images
File Type: jpg Images.jpg (42.9 KB, 147 views)
__________________
SageTCPServer (2.3.5): Open source TCP interface to the SageTV API
MLSageTV (3.1.8)/Sage Media Server (1.13): SageTV plugin for MainLobby/CQC
TaSageTV (2.58)/TaSTVRemote (1.14): Monitor/control SageTV with an Android device
TbSageTV (1.02)/STVRemote (1.11): Monitor/control SageTV with a PlayBook 2
TiSageTV (1.64)/TiSTVRemote (1.09): Monitor/control SageTV with an iPhone/iPod/iPad
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Sage Client slowing HD playback simonen SageTV Software 2 02-01-2007 08:24 PM
Lost recording directory after starting Sage server judy2304 SageTV Software 1 01-30-2007 10:16 AM
Sage UI disappears during playback Keith SageTV Software 17 03-03-2006 03:31 AM
How To: In-place recompression of Sage Recordings nielm SageTV Customizations 39 02-18-2006 11:32 PM
Sage crashes rfutscher SageTV Software 0 01-23-2006 04:31 PM


All times are GMT -6. The time now is 02:26 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2023, vBulletin Solutions Inc.
Copyright 2003-2005 SageTV, LLC. All rights reserved.