Beispiel #1
0
        /// <summary>
        /// Deep clone
        /// </summary>
        public object Clone()
        {
            AudioMetaData clone = new AudioMetaData();

            clone.Valid              = Valid;
            clone.SongTitle          = SongTitle;
            clone.LeadArtist         = LeadArtist;
            clone.AlbumTitle         = AlbumTitle;
            clone.YearReleased       = YearReleased;
            clone.SongComment        = SongComment;
            clone.SongGenre          = SongGenre;
            clone.TrackNumberOnAlbum = TrackNumberOnAlbum;

            return(clone);
        }
        virtual protected bool NetStreamInitialize()
        {
            // InitVars is already called by empty constructor!
            if (netConnection != null)
            {
                audioMetaData = new AudioMetaData();
                audioMetaData.Clear();

                if (netConnection != null)
                {
                    // Set buffer time
                    netConnection.SendPing(3, 0, 300); // why everytime on stream_id 0??
                    // Create Stream for this NetStream
                    netConnection.CreateStream(this);

                    return true;
                }
            }

            return false;
        }
        private void InitVars()
        {
            lock (lockVAR)
            {
                stream_id = -1; // -1=no stream associated with this object, 0=command channel so also not used
                mediaChannel = -1; // -1=nochannel
                commandChannel = -1; // -1=nochannel

                contentBufferTime = -1; // buffer time of content data in milliseconds, will be set to 15000 when connectie is made (ig streamID is valid)

                liveStream = true; // default is false, controle message 0x04 is send when it's recorded
                audioDatarate = 0;
                videoDatarate = 0;
                combinedTracksLength = 0;

                audioMetaData = new AudioMetaData();

                TimeStamp = TimeSpan.Zero;
                LastMediaPacket = null;
                msAudioBuffer = new MemoryStream(INITIAL_AUDIO_STREAMBUFFER);
                msVideoBuffer = new MemoryStream();
                lastAudioPacket = null;
                savedPackets = null;
                atBeginOfAudio = true; // for compress audio we need a minimum of data before you can begin to play (mp3 for example)

                mediaBytesReceived = 0;
                blockMediaPackets = 0; // when playlist is running and we reset the list ("NetStream.Play.Switch") we wait until we get a "NetStream.Play.Start" before we deblock
                syncAfterPauseNeeded = false;
                pauseIsActive = false;
                seekIsActive = false;
                deltaTimeStampInMS = 0;
                metaDataDurationInMS = 0; // Duration of stream in milliseconds returned by Metadata                
            } //lock
        }
        /// <summary>
        /// Deep clone
        /// </summary>
        public object Clone()
        {
            AudioMetaData clone = new AudioMetaData();

            clone.Valid = Valid;
            clone.SongTitle = SongTitle;
            clone.LeadArtist = LeadArtist;
            clone.AlbumTitle = AlbumTitle;
            clone.YearReleased = YearReleased;
            clone.SongComment = SongComment;
            clone.SongGenre = SongGenre;
            clone.TrackNumberOnAlbum = TrackNumberOnAlbum;

            return clone;
        }