Exemple #1
0
        public void CreateExampleMusicAndTimelineData(int accountid, List <Image> images)
        {
            try
            {
                // Copy the music for the example
                Music        music1 = CreateExampleMusic(accountid, "Music Example 1", "musicexample1.mp3", "1B36982F-4101-4D38-AF20-FAD88A0FA9B5.mp3", "Example Music");
                Music        music2 = CreateExampleMusic(accountid, "Music Example 2", "musicexample2.mp3", "ADA2DBFA-D8D9-49A8-8370-8329A830667E.mp3", "Example Music");
                Music        music3 = CreateExampleMusic(accountid, "Music Example 3", "musicexample3.mp3", "E4B660F0-ACD3-44F1-92EE-FA23110BE5C6.mp3", "Example Music");
                List <Music> musics = new List <Music> {
                    music1, music2, music3
                };

                // Create the example timeline
                ITimelineRepository tlrep    = new EntityTimelineRepository();
                Timeline            timeline = new Timeline();
                timeline.AccountID           = accountid;
                timeline.TimelineName        = "Timeline Example";
                timeline.Tags                = "Examples";
                timeline.IsActive            = true;
                timeline.MuteMusicOnPlayback = true;
                timeline.DurationInSecs      = 10;
                tlrep.CreateTimeline(timeline);

                // Create the timeline music xrefs
                ITimelineMusicXrefRepository mxrefrep = new EntityTimelineMusicXrefRepository();
                int i = 1;
                foreach (Music music in musics)
                {
                    TimelineMusicXref mxref = new TimelineMusicXref();
                    mxref.TimelineID = timeline.TimelineID;
                    mxref.MusicID    = music.MusicID;
                    mxref.PlayOrder  = i;
                    mxrefrep.CreateTimelineMusicXref(mxref);
                    i = +1;
                }

                // Create the timeline image xrefs
                ITimelineImageXrefRepository ixrefrep = new EntityTimelineImageXrefRepository();
                i = 1;
                foreach (Image image in images)
                {
                    TimelineImageXref ixref = new TimelineImageXref();
                    ixref.TimelineID   = timeline.TimelineID;
                    ixref.ImageID      = image.ImageID;
                    ixref.DisplayOrder = i;
                    ixrefrep.CreateTimelineImageXref(ixref);
                    i = +1;
                }
            }
            catch { }
        }
        public void CreateExampleMusicAndTimelineData(int accountid, List<Image> images)
        {
            try
            {
                // Copy the music for the example
                Music music1 = CreateExampleMusic(accountid, "Music Example 1", "musicexample1.mp3", "1B36982F-4101-4D38-AF20-FAD88A0FA9B5.mp3", "Example Music");
                Music music2 = CreateExampleMusic(accountid, "Music Example 2", "musicexample2.mp3", "ADA2DBFA-D8D9-49A8-8370-8329A830667E.mp3", "Example Music");
                Music music3 = CreateExampleMusic(accountid, "Music Example 3", "musicexample3.mp3", "E4B660F0-ACD3-44F1-92EE-FA23110BE5C6.mp3", "Example Music");
                List<Music> musics = new List<Music> { music1, music2, music3 };

                // Create the example timeline
                ITimelineRepository tlrep = new EntityTimelineRepository();
                Timeline timeline = new Timeline();
                timeline.AccountID = accountid;
                timeline.TimelineName = "Timeline Example";
                timeline.Tags = "Examples";
                timeline.IsActive = true;
                timeline.MuteMusicOnPlayback = true;
                timeline.DurationInSecs = 10;
                tlrep.CreateTimeline(timeline);

                // Create the timeline music xrefs
                ITimelineMusicXrefRepository mxrefrep = new EntityTimelineMusicXrefRepository();
                int i = 1;
                foreach (Music music in musics)
                {
                    TimelineMusicXref mxref = new TimelineMusicXref();
                    mxref.TimelineID = timeline.TimelineID;
                    mxref.MusicID = music.MusicID;
                    mxref.PlayOrder = i;
                    mxrefrep.CreateTimelineMusicXref(mxref);
                    i = +1;
                }

                // Create the timeline image xrefs
                ITimelineImageXrefRepository ixrefrep = new EntityTimelineImageXrefRepository();
                i = 1;
                foreach (Image image in images)
                {
                    TimelineImageXref ixref = new TimelineImageXref();
                    ixref.TimelineID = timeline.TimelineID;
                    ixref.ImageID = image.ImageID;
                    ixref.DisplayOrder = i;
                    ixrefrep.CreateTimelineImageXref(ixref);
                    i = +1;
                }

            }
            catch { }
        }
 public void CreateTimelineMusicXref(TimelineMusicXref xref)
 {
     db.TimelineMusicXrefs.Add(xref);
     db.SaveChanges();
 }
Exemple #4
0
 public void CreateTimelineMusicXref(TimelineMusicXref xref)
 {
     db.TimelineMusicXrefs.Add(xref);
     db.SaveChanges();
 }