示例#1
0
        public bool UpdateSystem(PluginSystem.IOutPlugin system)
        {
            m_system = system;
            m_stream = system.CreateStream(m_path, true);



            return(m_stream != null);
        }
示例#2
0
        public bool FirstLoad(string path, PluginSystem.IOutPlugin system)
        {
            m_path = path;
            if (!UpdateSystem(system))
            {
                MessageBox.Show(string.Format("Stream: {0} wird nicht unterstüzt", path),
                                "Ramona Audio Player", MessageBoxButton.OK);

                return(false);
            }

            if (m_mustupdate)
            {
                if (path.Contains("http://"))
                {
                    this.Content = string.Format("Network: {0}", path);
                    oldTitle     = string.Format("Network: {0}", path);
                }
                else
                {
                    IntPtr iartist = m_stream.GetTag("ARTIST");
                    IntPtr ialbum  = m_stream.GetTag("ALBUM");
                    IntPtr ititle  = m_stream.GetTag("TITLE");

                    string title  = ititle != IntPtr.Zero ? Marshal.PtrToStringAnsi(ititle).Trim() : "Unknown title";
                    string artist = iartist != IntPtr.Zero ? Marshal.PtrToStringAnsi(iartist).Trim() : "Unknown artist";
                    string album  = ialbum != IntPtr.Zero ? Marshal.PtrToStringAnsi(ialbum).Trim() : "Unknown album";

                    title  = title != "" ? title : "Unknown title";
                    artist = artist != "" ? artist : "Unknown artist";
                    album  = album != "" ? album : "Unknown album";

                    if (title == "Unknown title" && artist == "Unknown artist" && album == "Unknown album")
                    {
                        this.Content = Path.GetFileName(path);
                    }
                    else
                    {
                        oldAlbum  = album != "" ? album : "Unknown album";
                        oldTitle  = title != "" ? title : "Unknown title";
                        oldArtist = artist != "" ? artist : "Unknown artist";

                        this.Content = string.Format("{0} {1} {2}",
                                                     oldTitle,
                                                     oldArtist,
                                                     oldAlbum);
                    }
                }
            }

            return(m_stream.CloseStream());
        }