Example #1
0
        public Upnp.upnpObject GetUpnpMusicTrack(OptionPageSetup aUserOptionsSetup, HelperKinskyJukebox aHelper)
        {
            Upnp.upnpObject upnpMusicTrack = null;

            if (DiscCount > 0)
            {
                upnpMusicTrack = new Upnp.musicTrack();
            }
            else
            {
                upnpMusicTrack = new Upnp.musicTrack();
            }
            upnpMusicTrack.Id    = FilePath;
            upnpMusicTrack.Title = Title;
            ((Upnp.musicTrack)upnpMusicTrack).Album.Add(Album);
            ((Upnp.musicTrack)upnpMusicTrack).Genre.Add(Genre);
            ((Upnp.musicTrack)upnpMusicTrack).OriginalTrackNumber = (int)Track;
            if (upnpMusicTrack is Upnp.musicTrack)
            {
                ((Upnp.musicTrack)upnpMusicTrack).OriginalDiscNumber = (int)Disc;
                ((Upnp.musicTrack)upnpMusicTrack).OriginalDiscCount  = (int)DiscCount;
            }
            ((Upnp.musicTrack)upnpMusicTrack).Date = Year;

            Upnp.artist performer = new Upnp.artist();
            performer.Artist = Artist;
            performer.Role   = "Performer";
            ((Upnp.musicTrack)upnpMusicTrack).Artist.Add(performer);

            Upnp.artist composer = new Upnp.artist();
            composer.Role   = "Composer";
            composer.Artist = Composer;
            ((Upnp.musicTrack)upnpMusicTrack).Artist.Add(composer);

            Upnp.artist albumArtist = new Upnp.artist();
            albumArtist.Artist = AlbumArtist;
            albumArtist.Role   = "AlbumArtist";
            ((Upnp.musicTrack)upnpMusicTrack).Artist.Add(albumArtist);

            Upnp.artist conductor = new Upnp.artist();
            conductor.Artist = Conductor;
            conductor.Role   = "Conductor";
            ((Upnp.musicTrack)upnpMusicTrack).Artist.Add(conductor);

            Upnp.resource resource = new Upnp.resource();
            resource.Duration     = Duration;
            resource.Uri          = GetUri(FilePath, aHelper);
            resource.ProtocolInfo = "http-get:*:" + MimeType + ":*";
            upnpMusicTrack.Res.Add(resource);

            try {
                string art = GetUri(AlbumArtPath, aHelper);
                upnpMusicTrack.AlbumArtUri.Add(art);
                upnpMusicTrack.ArtworkUri.Add(art);
            }
            catch (Exception) { // if AlbumArtPath is invalid, just don't add artwork
            }

            return(upnpMusicTrack);
        }
Example #2
0
        public HelperKinskyJukebox(string[] aArgs) : base(aArgs)
        {
            iHttpServer = new HttpServer(HttpServer.kPortKinskyJukebox);

            // add application specific user options
            iOptionPageSetup        = new OptionPageSetup(this);
            iOptionPageOrganisation = new OptionPageOrganisation();
            iOptionPageWizard       = new OptionPageWizard();
            iOptionPageUpdates      = new OptionPageUpdates(this);
            iApplicationOptions     = new ApplicationOptions(this);

            AddOptionPage(iOptionPageSetup);
            AddOptionPage(iOptionPageOrganisation);
            AddOptionPage(iOptionPageWizard);
            AddOptionPage(iOptionPageUpdates);

            Stack.SetStack(this);
        }
Example #3
0
 public static string DirectoryPath(OptionPageSetup aUserOptionsSetup)
 {
     return(Path.GetFullPath(aUserOptionsSetup.CollectionLocation + kPresetDirectory));
 }