Ejemplo n.º 1
0
        public InternetFeeds()
        {
            XPathNodeIterator xpathINode;
            pdamxUrlReader    mxUrlReader = new pdamxUrlReader();

            String sRSSExt;
            String sFeedDirectory;

            sRSSExt        = GetSettings("/Feeds/RSS/RSSExtension");
            sFeedDirectory = GetSettings("/Feeds/RSS/RSSFeedDirectory");

            xpathINode = SettingsObject.GetNodePath("/Feeds/RSS/*");
            while (xpathINode.MoveNext())
            {
                if (xpathINode.Current.Name.Equals("Feed"))
                {
                    String sFileName = "";
                    String sUrl      = "";
                    xpathINode.Current.MoveToFirstChild();

                    do
                    {
                        if (xpathINode.Current.Name.Equals("Name"))
                        {
                            sFileName = sFeedDirectory + xpathINode.Current.Value + "." + sRSSExt;
                        }
                        if (xpathINode.Current.Name.Equals("Url"))
                        {
                            sUrl = xpathINode.Current.Value;
                        }
                    }while (xpathINode.Current.MoveToNext());
                    xpathINode.Current.MoveToParent();
                    mxUrlReader.Url         = sUrl;
                    mxUrlReader.WriteToFile = sFileName;
                    mxUrlReader.OpenUrl();
                }
            }
        }
Ejemplo n.º 2
0
        public MediaPlayerListGen()
        {
            XPathNodeIterator xpathINode = null;

            String sServerUrl         = "";
            String sPlayListFileXT    = "";
            String sPlayListFile      = "";
            String sPlayListDirectory = "";
            String sGenre             = "";

            int nPlayListRead             = 0;
            int nPlayListRecordsProcessed = 0;

            TextWriter tfwOutFile = null;

            // Configuration based on file name + Config.xml automatically loaded...

            // Get playlist file extension...
            //sPlayListFileXT = GetSettings("/WMPlayer/IISServer/PlayListFileExtension");

            // Get playlist directory...
            sPlayListDirectory = GetSettings("/WMPlayer/IISServer/PlayListFolder");

            // Get Windows Stream Media...
            sServerUrl      = "mms://" + GetSettings("/WMPlayer/IISServer/PlayerUrl");
            sPlayListFileXT = "asx";
            // Get directories to scan for MP3's...
            xpathINode = SettingsObject.GetNodePath("/WMPlayer/Catalog/ScanFolder/*");
            while (xpathINode.MoveNext())
            {
                if (xpathINode.Current.Name.Equals("Genre"))
                {
                    sPlayListFile = xpathINode.Current.Value + "." + sPlayListFileXT;
                    sGenre        = xpathINode.Current.Value;
                }
                if (xpathINode.Current.Name.Equals("Location"))
                {
                    writePlayEntries(null, xpathINode.Current.Value, sPlayListDirectory, sServerUrl, sPlayListFile, sGenre, null);
                }
            }
            // Get favorites playlist....
            xpathINode = SettingsObject.GetNodePath("/WMPlayer/Playlist/Favorite/*");
            while (xpathINode.MoveNext())
            {
                if (xpathINode.Current.Name.Equals("ListName"))
                {
                    if (tfwOutFile != null)
                    {
                        tfwOutFile.Close();
                    }
                    tfwOutFile = new StreamWriter(sPlayListDirectory + "\\" + xpathINode.Current.Value + "." + sPlayListFileXT);
                    nPlayListRead++;
                }
                if (xpathINode.Current.Name.Equals("MusicFile"))
                {
                    sPlayListFile = xpathINode.Current.Value + ".mp3";
                    tfwOutFile.WriteLine(sServerUrl + "/OnDemand" + sPlayListFile);
                    nPlayListRecordsProcessed++;
                }
            }
            if (tfwOutFile != null)
            {
                tfwOutFile.Close();
            }

            // Get Windows Stream Media...
            sServerUrl      = "rtsp://" + GetSettings("/WMPlayer/IISServer/PlayerUrl");
            sPlayListFileXT = "ram";
            // Get directories to scan for MP3's...
            xpathINode = SettingsObject.GetNodePath("/WMPlayer/Catalog/ScanFolder/*");
            while (xpathINode.MoveNext())
            {
                if (xpathINode.Current.Name.Equals("Genre"))
                {
                    sPlayListFile = xpathINode.Current.Value + "." + sPlayListFileXT;
                    sGenre        = xpathINode.Current.Value;
                }
                if (xpathINode.Current.Name.Equals("Location"))
                {
                    writePlayEntries(null, xpathINode.Current.Value, sPlayListDirectory, sServerUrl, sPlayListFile, sGenre, null);
                }
            }
            // Get favorites playlist....
            xpathINode = SettingsObject.GetNodePath("/WMPlayer/Playlist/Favorite/*");
            while (xpathINode.MoveNext())
            {
                if (xpathINode.Current.Name.Equals("ListName"))
                {
                    if (tfwOutFile != null)
                    {
                        tfwOutFile.Close();
                    }
                    tfwOutFile = new StreamWriter(sPlayListDirectory + "\\" + xpathINode.Current.Value + "." + sPlayListFileXT);
                    nPlayListRead++;
                }
                if (xpathINode.Current.Name.Equals("MusicFile"))
                {
                    sPlayListFile = xpathINode.Current.Value + ".mp3";
                    tfwOutFile.WriteLine(sServerUrl + "/OnDemand" + sPlayListFile);
                    nPlayListRecordsProcessed++;
                }
            }
            if (tfwOutFile != null)
            {
                tfwOutFile.Close();
            }

            WriteEndofJobSummaryToFile = true;
            AddSummaryExtra("");
            AddSummaryExtra("Windows Streaming Media Playlist Generator Processing Summary");
            AddSummaryExtra("");
            AddSummaryExtra("  Number of Music Files Read:                " + nRecordsRead);
            AddSummaryExtra("  Number of Music Files Processed:           " + nRecordsProcessed);
            AddSummaryExtra("  Number of Playlist Read:                   " + nPlayListRead);
            AddSummaryExtra("  Number of Playlist Music Files Processed:  " + nPlayListRecordsProcessed);
            PrintEndofJobSummary();
        }