This project is read-only.

Disable AutoPlay on Load

Nov 4, 2008 at 3:40 PM
Is there a way to do this in the config? Or would I have to edit the source? I read all of the documentation and I didn't see anything. Any help would be greatly appreciated!
Nov 5, 2008 at 4:58 PM
Hi,

The source would need to be edited to acheive this. There is no option available for configuration.


Cheers,
Liam
Nov 5, 2008 at 5:05 PM
Lame.
Nov 5, 2008 at 5:47 PM
I had been trying to figure out how to do that as well. Thanks. :-)
Nov 9, 2008 at 5:40 AM
Cross-posting from the thread "Starting the slideshow from Album View":

There's a pretty simple hack to the source code that will solve the problem.  Its more of a quick and dirty hack than a fix - I'll probably eventually get into it a little deeper and figure out the real fix.  In the mean time, this seems to work to put it in album mode at startup.  It is configured via the data.xml, not in config like Slide.Show v1 was, but...

I have also added the ability to turn off auto-start through the data.xml as well (still a hacky way of doing it):

data.cs
    ..
    public class Data
    {
        ..
        public static int StartAlbumIndex { get; set; }


        /// <summary>
        /// Gets or sets AlbumView startup mode
        /// </summary>
        /// <value><c>true</c> if start in album view, <c>false</c> otherwise.</value>
        public static bool StartInAlbumView { get; set; }

        /// <summary>
        /// Gets or sets whether to auto start slide playback.
        /// </summary>
        /// <value><c>true</c> if auto start, <c>false</c> otherwise.</value>
        public static bool AutoStart { get; set; }
        ..
    }


datahandler.cs
    ..
    public class DataHandler
    {
        ..
        public static bool IsPreloaded { get; set; }


        /// <summary>
        /// Gets or sets AlbumView startup mode
        /// </summary>
        /// <value><c>true</c> if start in album view, <c>false</c> otherwise.</value>
        public static bool StartInAlbumView { get; set; }

        /// <summary>
        /// Gets or sets whether to auto start slide playback.
        /// </summary>
        /// <value><c>true</c> if auto start, <c>false</c> otherwise.</value>
        public static bool AutoStart { get; set; }
        ..
    }
    ..
    public DataHandler()
    {
        CurrentAlbumIndex = Data.StartAlbumIndex;
        IsPreloaded = false;

        StartInAlbumView = Data.StartInAlbumView;
        AutoStart = Data.AutoStart;

        ..
    }

xmldataprovider.cs
    ..
    private void client_DownloadStringCompleted(object sender, DownloadStringCompletedEventArgs e)
    {
        XmlReader reader = XmlReader.Create(new StringReader(e.Result));

        while (reader.Read())
        {
            if(reader.IsStartElement() && reader.Name == "data")
            {
                Data.StartAlbumIndex = Convert.ToInt32(reader.GetAttribute("startalbumindex"), CultureInfo.InvariantCulture);

                Data.StartInAlbumView = Convert.ToBoolean(reader.GetAttribute("startinalbumview"), CultureInfo.InvariantCulture);
                Data.AutoStart = Convert.ToBoolean(reader.GetAttribute("autostart"), CultureInfo.InvariantCulture);
                ..
            }
        }
    }

navigation.cs
..
    public static void StartSlideShow()
    {
        SelectAlbum(DataHandler.CurrentAlbumIndex);

        if (DataHandler.StartInAlbumview)
            ToggleAlbumViewOn();
        If (!DataHandler.AutoStart)
            Pause();

    }


To use, edit your data.xml's <data> node to have:
    <data startalbumindex="1" startinalbumview="true" autostart="false" transition="CrossFadeTransition">

Hope this workaround is useful.  Please let me know if any of this doesn't make sense.