Ejemplo n.º 1
0
        public AudioCdRipper(AudioCdSource source)
        {
            if (ripper_extension_node != null) {
                ripper = (IAudioCdRipper)ripper_extension_node.CreateInstance ();
                ripper.TrackFinished += OnTrackFinished;
                ripper.Progress += OnProgress;
                ripper.Error += OnError;
            } else {
                throw new ApplicationException ("No AudioCdRipper extension is installed");
            }

            this.source = source;
        }
Ejemplo n.º 2
0
        public AudioCdRipper(AudioCdSource source)
        {
            if (ripper_extension_node != null)
            {
                ripper = (IAudioCdRipper)ripper_extension_node.CreateInstance();
                ripper.TrackFinished += OnTrackFinished;
                ripper.Progress      += OnProgress;
                ripper.Error         += OnError;
            }
            else
            {
                throw new ApplicationException("No AudioCdRipper extension is installed");
            }

            this.source = source;
        }
Ejemplo n.º 3
0
        protected override bool DeviceCommandMatchesSource(DiscSource source, DeviceCommand command)
        {
            AudioCdSource cdSource = source as AudioCdSource;

            if (cdSource != null && command.DeviceId.StartsWith("cdda:"))
            {
                try {
                    Uri    uri = new Uri(command.DeviceId);
                    string match_device_node = String.Format("{0}{1}", uri.Host,
                                                             uri.AbsolutePath).TrimEnd('/', '\\');
                    string device_node = source.DiscModel.Volume.DeviceNode;
                    return(device_node.EndsWith(match_device_node));
                } catch {
                }
            }

            return(false);
        }
Ejemplo n.º 4
0
        private void ImportOrDuplicateDisc(bool import)
        {
            InterfaceActionService uia_service = ServiceManager.Get <InterfaceActionService> ();

            if (uia_service == null)
            {
                return;
            }

            AudioCdSource source = uia_service.SourceActions.ActionSource as AudioCdSource;

            if (source != null)
            {
                if (import)
                {
                    source.ImportDisc();
                }
                else
                {
                    source.DuplicateDisc();
                }
            }
        }