LinuxMCE Forums

General => Users => Topic started by: klanmce on March 31, 2011, 02:50:42 pm

Title: Adding New Media Scenario
Post by: klanmce on March 31, 2011, 02:50:42 pm
I am trying to add a new media scenario similar to the auto generated Video scenario to point to a directory - this is to separate my music videos. When I try adding through the web interface, I am not seeing the option to specify the file options that are shown for the Video scenario, what I see is the device, for eg. the xine player.

What are my options to accomplish this, right now my head space is manually adding to the DB, not sure how wise that is?

Thanks in advance.
Title: Re: Adding New Media Scenario
Post by: cafedumonde on March 31, 2011, 04:37:46 pm

This is a cool idea. I'd like to do this as well. Someone please suggest how this might be done..
Title: Re: Adding New Media Scenario
Post by: Marie.O on March 31, 2011, 04:50:51 pm
klanmce,

do you want to play a single directory, or do you want the media list to contain only contents from a specific directory?
Title: Re: Adding New Media Scenario
Post by: klanmce on March 31, 2011, 07:09:59 pm
I want to list all the contents in that specific directory.
Title: Re: Adding New Media Scenario
Post by: golgoj4 on March 31, 2011, 09:02:00 pm
why not just give them the media subtype of music videos and use the attributes browser?
Title: Re: Adding New Media Scenario
Post by: klanmce on March 31, 2011, 11:38:16 pm
I am presently doing that, but wanted to refine the process a bit more, is it, that this is not possible?
Title: Re: Adding New Media Scenario
Post by: Marie.O on March 31, 2011, 11:52:25 pm
at the moment I do not see a way of achieving this the way you want to.
Title: Re: Adding New Media Scenario
Post by: klanmce on April 01, 2011, 12:27:55 am
Cool thanks.

Which tables hold the data that influence the scenarios shown both auto and created?
Title: Re: Adding New Media Scenario
Post by: Marie.O on April 01, 2011, 08:34:16 am
klanmce,

best way to find out the relationship is the web admin. Look at the code of the scenario views and you should be able to find what you need.
Title: Re: Adding New Media Scenario
Post by: klanmce on April 02, 2011, 01:05:40 am
Ok, I tried looking at the database and found the following:

CommandGroup
CommandGroup_Command
Command
Template

The table CommandGroup has the scenarios and the room it belong to, my question thus far, is which table, if any, holds the actual directory that this  34 | Media Wiz - File/Disc (found in template), points to.

No luck with the web admin search yet to find the relationships.
Title: Re: Adding New Media Scenario
Post by: Marie.O on April 02, 2011, 10:08:48 am
klanmce,

there is no directory. That's why I said it is not possible atm.

You specify the media type. If you go into the scenarios in the webadmin, you will find all the media scenarios. Looking at it, you will find the Command it uses, as well as the parameter. At the moment, the parameter is a media type. LinuxMCE in its infinite wisdom goes out to the pluto_media database, and gets all media with that specific mediatype.
Title: Re: Adding New Media Scenario
Post by: klanmce on April 02, 2011, 02:59:03 pm
Got you.

I checked the MediaType table and realized that there is a subdirectory in that table which could possible relate to the directory to check for videos, see excerpt below, is this assumption correct or close?

Quote
mysql> select Define,Description,Subdirectory from MediaType where PK_MediaType = 5;
+-------------------+---------------------+--------------+
| Define            | Description         | Subdirectory |
+-------------------+---------------------+--------------+
| pluto_StoredVideo | LinuxMCE Video File | videos       |
+-------------------+---------------------+--------------+
1 row in set (0.00 sec)

 If I include in this table an entry to reflect my task, with the appropriate bits, would this break LMCE in any way?

Title: Re: Adding New Media Scenario
Post by: tschak909 on April 02, 2011, 04:06:39 pm
Right now, there's a whole chunk of code in Orbiter's screen handler, for the media file list...that deals with passing back grid parameters to the datagrid as to what is displayed. This parameter is not exposed at all...you would need to:

(1) expose this parameter as a command parameter by adding a new command parameter to show file list
(2) run DCEGen on the Orbiter device template, to get the new Show File List method inside Orbiter
(3) modify the method to check if this parameter is set, if so, set the appropriate sParams inside.

This would get you what you would need.
-Thom
Title: Re: Adding New Media Scenario
Post by: Marie.O on April 02, 2011, 07:26:21 pm
I checked the MediaType table and realized that there is a subdirectory in that table which could possible relate to the directory to check for videos, see excerpt below, is this assumption correct or close?

I do not know what that specific directory is used for, but I DO know, that video files are located outside of that directory as well.
Quote
If I include in this table an entry to reflect my task, with the appropriate bits, would this break LMCE in any way?

I don't think so. Feel free to play with it. If something breaks, and you want to revert, go into web admin / sqlCVS / diff - select the MediaType table - and check for diffs. Select the entry you made, click revert, and everything is back to normal
Title: Re: Adding New Media Scenario
Post by: klanmce on April 02, 2011, 10:55:40 pm
Just as indicated, the "ratch" did not work.

TSCHAK909
Title: Re: Adding New Media Scenario
Post by: klanmce on April 02, 2011, 10:57:13 pm
Did not finish the last post, son playing with keyboard.

The show file list, through what do I access this, a Template, etc?

Thanks
Title: Re: Adding New Media Scenario
Post by: tschak909 on April 02, 2011, 11:40:27 pm
hm? I do not follow.

-Thom
Title: Re: Adding New Media Scenario
Post by: klanmce on April 03, 2011, 01:58:16 am
Quote
(1) expose this parameter as a command parameter by adding a new command parameter to show file list

What template does this correspond to, so I can add the command, seem to have passed it?

My last two post were supposed to be one.
Title: Re: Adding New Media Scenario
Post by: tschak909 on April 03, 2011, 02:02:55 am
it needs to be added to the COMMAND, not the device template.. you can get to it by going into template #8 (the Orbiter template), and selecting the appropriate command group, and editing the command.. look under Orbiter Commands.

-Thom
Title: Re: Adding New Media Scenario
Post by: klanmce on May 09, 2011, 03:17:29 am
I have found the show file list and add a COMMAND to the parameter, there was a pk_Command, but simple added a COMMAND of type string.

Silly question

Is it safe to run DCEGen on my "production" system or I should I set up a test following
Quote
http://forum.linuxmce.org/index.php?topic=11279.0

Thanks
Title: Re: Adding New Media Scenario
Post by: Marie.O on May 09, 2011, 07:44:08 am
DCEGen is harmless, as it only creates source code.
Title: Re: Adding New Media Scenario
Post by: klanmce on May 09, 2011, 03:57:13 pm
Quick question

When you choose merge on running DCEGen -d 8, I am seeing the Orbiter_temp folder created but no time change in the Orbiter folder, is it that this is where my changes go, and not in the Orbiter original folder?
Title: Re: Adding New Media Scenario
Post by: tschak909 on May 09, 2011, 04:00:27 pm
If you choose M to merge, then your changes go into the src/Orbiter folder and are merged in with the existing code.

-Thom
Title: Re: Adding New Media Scenario
Post by: klanmce on May 09, 2011, 04:31:27 pm
I could assume then, that the m is case sensitive, as such, it did not merge in the original directory, and created it in the temp directory, based on the fact that the time-stamp for the original directory did not change.

Or

This is an invalid assumption, in that the time-stamp do not change and the m is not case sensitive.

Title: Re: Adding New Media Scenario
Post by: klanmce on July 28, 2011, 01:34:00 am
Got a bit occupied, re-attempting

I got the function shown below

Quote
void Orbiter::CMD_Show_File_List(int iPK_MediaType,string sCommand,string &sCMD_Result,Message *pMessage)
//<-dceag-c401-e->
{
   cout << "Need to implement command #401 - Show File List" << endl;
   cout << "Parm #29 - PK_MediaType=" << iPK_MediaType << endl;
   cout << "Parm #236 - Command=" << sCommand << endl;
}

tschak909, I am not going to lie to you, I am a little lost in where I am setting the parameter to check for the specific directory, step 3 below, as I was looking for similar actions in the Orbiter.cpp and not finding any; possible looking in the wrong location.

Quote
(1) expose this parameter as a command parameter by adding a new command parameter to show file list
(2) run DCEGen on the Orbiter device template, to get the new Show File List method inside Orbiter
(3) modify the method to check if this parameter is set, if so, set the appropriate sParams inside.

Thanks in advance
Title: Re: Adding New Media Scenario
Post by: tschak909 on July 28, 2011, 03:11:04 am
From the function prototype that you got, you didn't modify the command to add the additional command parameter.

You should get to the Show File List command either by going into the Orbiter device template (since it implements it), OR by using the Advanced > DCE > Commands menu in the web admin.

Seriously, this stuff is all there, if you just look around.

-Thom
Title: Re: Adding New Media Scenario
Post by: klanmce on August 29, 2011, 05:22:19 pm
I found the Show File List command, edited the PK_MediaType (reflect the entry made for this purpose) and place MusicVideo in the command and save, also did a reload and regen of orbitors.

I think I dropped the ball somewhere, as it did not generate the MusicVideo scenario for me. Also if I go to create the scenario manually, I am not seeing the option to specify my new command(MusicVideo), or the Show File List.

Thanks