Exemple #1
0
        void IExtensionService.Initialize ()
        {
            Banshee.MediaEngine.IBpmDetector detector = BpmDetectJob.GetDetector ();
            if (detector == null) {
                throw new ApplicationException ("No BPM detector available");
            } else {
                detector.Dispose ();
            }

            if (!ServiceStartup ()) {
                ServiceManager.SourceManager.SourceAdded += OnSourceAdded;
            }
        }
Exemple #2
0
        public void Detect ()
        {
            if (!Enabled) {
                return;
            }

            lock (sync) {
                if (job != null) {
                    return;
                } else {
                    job = new BpmDetectJob ();
                }
            }

            job.Finished += delegate { job = null; };
        }
Exemple #3
0
        public BpmEntry()
        {
            detector = BpmDetectJob.GetDetector();
            if (detector != null)
            {
                detector.FileFinished += OnFileFinished;
            }

            BuildWidgets();

            Destroyed += delegate {
                if (detector != null)
                {
                    detector.Dispose();
                    detector = null;
                }
            };
        }
Exemple #4
0
        public void Detect()
        {
            if (!Enabled) {
                return;
            }

            lock (sync) {
                if (job != null) {
                    return;
                } else {
                    job = new BpmDetectJob ();
                }
            }

            job.Finished += delegate { job = null; };
        }