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

New MCML App + Preview Video.. Big Screen Photos v2

Last post 05-02-2007, 3:47 PM by mobilewares. 14 replies.
Sort Posts: Previous Next
  •  04-25-2007, 7:48 PM 3048

    New MCML App + Preview Video.. Big Screen Photos v2

    Hi,

    Just thought I'd shamelessly plug a new MCML product I'm working on - 'Big Screen Photos v2'... So yes ...  I have switched from WPF (used for v1 of this product) - which should make Charlie and others happy too..8).

    I have put up a Video Preview (and some notes) on my blog - (soapbox hosted) - so take a look and see what you think. For some nice eye candy the new 'Geo Browsing' (sortof google 'flat' earth 3d) bit is around the 55 sec mark.

    Click here for the Video/Blog post...   The screenshots on the post got all messed up in the post - so will replace these later with proper unmunted pics.

    I have for the most part gone with my own layouts/UX - however, I have reproduced most of the functionality of the My Photos style browse screen (something which has been discussed here) - so this might be of interest to developers.

    Please feel free to ask any 'how to do that' type questions if you are curious (happy to share some of the discoveries).

    cheers

    Niall

     

  •  04-25-2007, 9:06 PM 3050 in reply to 3048

    Re: New MCML App + Preview Video.. Big Screen Photos v2

    Insanely pretty - very, very nice indeed.

    I don't suppose you'd have any tips for making videos like this, would you? Did you just hook your PC up to a digital video camera/media center and hit 'record'? Or was there another technique?

    Man...now I'm going to have to look at Yougle 2 and sigh...I've got a lot of work to do if I'm going to get it anywhere near THAT.


    100 downloads a day for Yougle Vista - goin' allright!

    Check out http://www.thedigitallifestyle.com/cs/Blogs/developer/default.aspx and http://www.push-a-button.com.au/products/mce
  •  04-25-2007, 9:13 PM 3051 in reply to 3050

    Re: New MCML App + Preview Video.. Big Screen Photos v2

    Thanks!

    Hey i put some notes down the bottom of the blog post on how I captured and put the video together (Windows Movie Maker did all the titling). There's a few free+commercial screen capturing apps around that you can use (sangit/camtasia is another good one) - but found it was best to capture on the pc (rather than hooking up external video camera/digital camera). The uploading to soapbox/youtube etc is generally the bit that screws the quality (however the original has 25fps at full color depth).

    Niall

     

  •  04-26-2007, 12:32 AM 3056 in reply to 3051

    Re: New MCML App + Preview Video.. Big Screen Photos v2

    Awesome Niall. The vid worked fine for me on explorer on my vista laptop, no plugins etc needed, no good on firefox though.

    I was interested by your comment on using code to do a lot of things, rather than the mcml. I too had kinda thought that doing it that way might be better as for one thing the number of "names" required in mcml overpowers my meager brain and I just prefer to procedurise my code more than mcml seems to allow. However, I suspect you had different reasons for doing it that way. Care to elaborate a little more?

    Congrats. I hope it makes you wealthy beyond measure! :) or at least happy :()



    Gordon: Has reached the end!
  •  04-26-2007, 6:12 AM 3062 in reply to 3048

    Re: New MCML App + Preview Video.. Big Screen Photos v2

    Wow, that looks amazing Niall.  That looks nicer than anything I have seen on Vista MCE yet.
  •  04-26-2007, 5:15 PM 3066 in reply to 3056

    Re: New MCML App + Preview Video.. Big Screen Photos v2

    Hi Gordon,

    Just to elaborate on the use of code over mcml -

    There's quite a few ways this can be used - but the idea in general is that instead of instantiating some of the MCML UI classes from the MCML layer - I instantiate them via managed code.  Additionally instead of handling Command.Invoked, ViewChoice.Changed etc events via MCML Rules - again these events are handled in managed code.

    For a simple usage  - instead of creating a Command Object in the <Properties> section of a UI - my managed code class would create and return a Command object as a property (and retain a reference) - which is read in by the MCML layer. This would then give me the ability to handle the Invoked() events from within my managed code (by adding eventhandler for the Invoked method) - instead of having to create complex rules sections in MCML. This has the additional benefit that it then eliminates the requirement to pass a lot of classes into child UI's - ie. we can then send just the Command to a child UI, and when invoked - it can make changes to the parent ModelItem class behind the scenes (which may be then reflected in the parent class and delivered to the UI by firepropertychanged event or manipulating an existing ArrayListDataSet).

    For a more advanced usage scenario - instead of calling new MCML Pages with native .NET parameters (ie. Strings, Int32's etc) - I instantiate an entire class and send that to the new Page as a single parameter. This way I don't have to mess around with instantiating a new Managed Class and loading it with the Page Properties before it can be used. (and there are many other benefits such as being able to track page enter/leave state etc.).

    <UI Name="MyPage">
      <Properties>
         <a:MyClass Name="MyClass" MyClass="$Required"/>
      </Properties>
    etc etc..
      <Content>  etc.. etc..
        <Text Content="[MyClass.PageTitle]" .... > ....
        <Repeater Source="[MyClass.HeaderItems]" ... > ....
      <Content>
    </UI>

    So anyhow there's a huge amount of cool stuff you can do - as well as overcome many of the restrictions of MCML (and replace it with more predictable/simpler .NET code) - and drastically reduce MCML page size/complexity (which becomes a really big win doing the sort of stuff seen in the video).

    Anyhow - hope this explains it a little better.

    cheers

    Niall

     

  •  04-27-2007, 6:00 AM 3068 in reply to 3066

    Re: New MCML App + Preview Video.. Big Screen Photos v2

    Thanks for that. I think I understand what you are doing, So you are using the session object in code? with the instantiated class as a parameter.

    If so I worked out how to go to a page:

    (from the click event handler of another class! - VMCMusicArtistListerClasses)
                VMCMusicArtistLister.S_Session.GoToPage("resx://VMCMusicArtistLister/gfmApps.VMC.Resources/VMCMusicArtistListerSongs");

    but I had to add an accessor to my main class - VMCMusicArtistLister re:

    public static HistoryOrientedPageSession S_Session
    {
        get {return (s_session); }
    }


    but I don't understand how you send the instantiated class as a parameter?

    The SDK has these two additional declarations for the PageSession.GoToPage method:

    public void GoToPage( string source, IDictionary<string, object> uiProperties );

    public virtual void GoToPage( string source, IDictionary<string, object> sourceData, IDictionary<string, object> uiProperties );

    but I'm not sure how to implement these?

    So if I had this in my VMCMusicArtistListerClasses click event handler

    MyClass myownclass = new MyClass();

    myownclass.property = whatever;

    VMCMusicArtistLister.S_Session.GoToPage("resx://VMCMusicArtistLister/gfmApps.VMC.Resources/MyPage", ???);

    }

    and your

    <mcml>

    <!--does anything go here? apart from the xmlns reference, wondering how myownclass matches up with "MyClass" or should they have the same name?-->


    <UI Name="MyPage">
      <Properties>
         <a:MyClass Name="MyClass" MyClass="$Required"/>
      </Properties>
    etc etc..

    </UI>


    I guess I'm showing my ingorance again, but this approach has a lot of appeal to me, since it keeps the presentation and animation really separate.

    Sorry if I'm being thick, I'm starting to get it, but I'm still struggling at times with the paradigm.




    Gordon: Has reached the end!
  •  04-27-2007, 7:48 AM 3070 in reply to 3068

    Re: New MCML App + Preview Video.. Big Screen Photos v2

    Gordon, there are a couple of examples for using properties with GoToPage in the Z sample application and the Step By Step docs / source, excerpted here with color highlights. This is essentially the 'glue' which ties your View to the Code / Data:

            public void GoToMenu()
            {
                Dictionary<string, object> properties = new Dictionary<string, object>();
                properties["Application"] = this;

                if (session != null)
                {
                    session.GoToPage("resx://MyProject/MyProject.Resources/Menu", properties);
                }
                else
                {
                    Debug.WriteLine("GoToMenu");
                }
            }

            <Mcml xmlns="http://schemas.microsoft.com/2006/mcml"
                  xmlns:cor="assembly://MsCorLib/System"
                  xmlns:a="assembly://MyProject/MyProject"
                  xmlns:s="resx://MyProject/MyProject.Resources/Styles"
                  xmlns:r="resx://MyProject/MyProject.Resources/RepeatItem">

             <UI Name="Default">

              <Properties>
               <a:Application Name="Application" Application="$Required"/>
               ...


    Charlie Owen (Microsoft)
  •  04-28-2007, 9:13 AM 3088 in reply to 3070

    Re: New MCML App + Preview Video.. Big Screen Photos v2

    That's great.


    Gordon: Has reached the end!
  •  05-02-2007, 5:52 AM 3121 in reply to 3070

    Re: New MCML App + Preview Video.. Big Screen Photos v2

    Dear Charlie,

    thanks for the great StepByStep-Example. It really helped me a lot. But there is a problem that occurs every time I try to work with references on C#-Classes(e.g. Invoking C#-Methods). MCMLPad shows the following exception if I try to run your example:

    Exception: Error evaluating path 'Application.MyData'. The 'Application' member on 'Microsoft.MediaCenter.UI.View' returned 'null' and evaluation could not continue. (InvalidOperationException)
    Stack:...

    Is there something that I do wrong?


  •  05-02-2007, 7:11 AM 3122 in reply to 3066

    Re: New MCML App + Preview Video.. Big Screen Photos v2

    Wow,

    Amazing! I was wondering how to achive reflections and blurring as you did in your main menu... They look really great !!!

  •  05-02-2007, 7:14 AM 3123 in reply to 3122

    Re: New MCML App + Preview Video.. Big Screen Photos v2

    mmm.... poor creativity from my side... Let's see if I guess... Another image in the same panel, rotated and with alpha < 1....

    Sorry, stupid question... I was just frozen by you eye candy... hehe

  •  05-02-2007, 10:01 AM 3132 in reply to 3121

    Re: New MCML App + Preview Video.. Big Screen Photos v2

    cojones, I answered this question over in the managed code forum.
    Charlie Owen (Microsoft)
  •  05-02-2007, 2:49 PM 3134 in reply to 3123

    Re: New MCML App + Preview Video.. Big Screen Photos v2

    mtk:

    mmm.... poor creativity from my side... Let's see if I guess... Another image in the same panel, rotated and with alpha < 1....

    Sorry, stupid question... I was just frozen by you eye candy... hehe

    You forgot a clip and fade but we wont hold that against you ;-)


    blog.manghera.com
  •  05-02-2007, 3:47 PM 3137 in reply to 3134

    Re: New MCML App + Preview Video.. Big Screen Photos v2

    lol.. it's all 'smoke and mirrors'....

    Yes its a done with the same panel - using a Scale 1,-1,1 at Centerpoint 0.5,1,0.5 (rotate will flip the image horizontally so no good) - and a Clip (with full strength fade covering entire height and ShowNear=false).

    On the main menu (not in other places with reflections) - I did actually "cheat" slightly  - and the reflected image is a seperate graphic which has a severe 'Gaussion Blur' effect applied to it (in a Image Editing software) - but using the above transformations. This Blur can't be done on the fly by MCML as it requires actual pixel displacement (so can't be fudged with overlaying blurry gradients etc - but you can get pretty close if you don't want the extra graphics).

    ps - I've now completely replaced the simplistic main menu icons (and other) with some proper 'photographic' versions - so looks a lot nicer - not sure if I even need the blur anymore.

    Niall

     

View as RSS news feed in XML
Powered by Community Server, by Telligent Systems