コード例 #1
0
 public void Dispose( )
 {
     DataSender.Dispose();
     MetadataSender.Dispose();
     UnsetRhinoEvents();
     Client.Dispose();
 }
コード例 #2
0
 public void Dispose()
 {
     DataSender.Dispose();
     MetadataSender.Dispose();
     //TODO: What events do we track if any?
     //UnsetRhinoEvents();
     Client.Dispose();
 }
コード例 #3
0
        public void Dispose(bool delete = false)
        {
            if (delete)
            {
                //TODO: Fix this!
                //var objs = RhinoDoc.ActiveDoc.Objects.FindByUserString("spk_" + StreamId, "*", false);
                //foreach (var o in objs)
                //    o.Attributes.SetUserString("spk_" + StreamId, null);
            }

            DataSender.Dispose();
            MetadataSender.Dispose();
            //UnsetRhinoEvents();
            Client.Dispose(delete);
        }
コード例 #4
0
 private void MetadataSender_Elapsed(object sender, ElapsedEventArgs e)
 {
     Debug.WriteLine("Ping! Ping!");
     MetadataSender.Stop();
     Context.NotifySpeckleFrame("client-log", StreamId, JsonConvert.SerializeObject("Update Sent."));
 }
コード例 #5
0
ファイル: Backend.cs プロジェクト: BackupTheBerlios/tamjb
        ///
        /// \warning When creating an object for remoting, call Init() and
        ///   access the singleton returned by theBackend. This constructor
        ///   is public only for use by non-remoting configurations.
        /// 
        public Backend( int desiredQueueSize, 
                      string connectionString,
                      Quality qualityLevel,
                      Backend.CompressionType compressionType,
                      string metadataFileName )
        {
            _Trace( "[Backend]" );

             _qualityLevel = qualityLevel;
             _compressionType = compressionType;
             _desiredQueueSize = desiredQueueSize;
             _connectionString = connectionString;

             if (null == _connectionString)
            throw new ApplicationException( "Engine is not properly initialized by the server" );

             _database = new StatusDatabase( _connectionString );

             _metadataSender = new MetadataSender( metadataFileName );

             // Todo: initialize compressor from stored settings in database
             _compressor = _LoadCompressor();

             // Get defaults from this kind of thing?
             // string bufferSize =
             //    ConfigurationSettings.AppSettings ["BufferSize"];

             // Set up default buffering for the audio engine
             _player = new Player();
             _player.bufferSize = 44100 / 8 ;
             _player.buffersInQueue = 40;
             _player.buffersToPreload = 20;

             // Set up callbacks
             _player.OnTrackFinished +=
            new TrackFinishedHandler( _TrackFinishedCallback );

             _player.OnTrackPlayed +=
            new TrackStartingHandler( _TrackStartingCallback );

             _player.OnReadBuffer +=
            new ReadBufferHandler( _TrackReadCallback );
        }