예제 #1
0
 public void Duplicate(IDiscVolume disc)
 {
     if (!RunBrasero (disc.DeviceNode) && !RunNcb (disc.DeviceNode)) {
         throw new ApplicationException (Catalog.GetString (
             "Neither Brasero nor Nautilus CD Burner could be found to duplicate this disc."));
     }
 }
예제 #2
0
        public AudioCdDiscModel (IDiscVolume volume)
        {
            this.volume = volume;
            disc_title = Catalog.GetString ("Audio CD");

            MusicBrainzService.UserAgent = Banshee.Web.Browser.UserAgent;
        }
예제 #3
0
        public AudioCdDiscModel(IDiscVolume volume)
            : base(volume)
        {
            disc_title = Catalog.GetString("Audio CD");

            MusicBrainzService.UserAgent = Banshee.Web.Browser.UserAgent;
        }
 public void Duplicate(IDiscVolume disc)
 {
     if (!RunBrasero(disc.DeviceNode) && !RunNcb(disc.DeviceNode))
     {
         throw new ApplicationException(Catalog.GetString(
                                            "Neither Brasero nor Nautilus CD Burner could be found to duplicate this disc."));
     }
 }
예제 #5
0
 protected override DiscSource GetDiscSource(IDiscVolume volume)
 {
     if (volume.HasVideo)
     {
         Log.Debug("Mapping dvd");
         return(new DvdSource(this, new DvdModel(volume)));
     }
     else
     {
         Log.Debug("Can not map to dvd source.");
         return(null);
     }
 }
예제 #6
0
 protected override DiscSource GetDiscSource(IDiscVolume volume)
 {
     if (volume.HasAudio)
     {
         Log.Debug("Mapping audio cd");
         return(new AudioCdSource(this, new AudioCdDiscModel(volume)));
     }
     else
     {
         Log.Debug("Can not map to audio cd source.");
         return(null);
     }
 }
예제 #7
0
        protected virtual void MapDiscVolume(IDiscVolume volume)
        {
            DiscSource source = null;

            lock (this) {
                if (Sources.ContainsKey(volume.Uuid))
                {
                    Log.Debug("Already mapped");
                    return;
                }

                source = GetDiscSource(volume);

                if (source == null)
                {
                    return;
                }

                Sources.Add(volume.Uuid, source);
                ServiceManager.SourceManager.AddSource(source);

                // If there are any queued device commands, see if they are to be
                // handled by this new volume (e.g. --device-activate-play=cdda://sr0/)
                try {
                    if (unhandled_device_commands != null)
                    {
                        foreach (DeviceCommand command in unhandled_device_commands)
                        {
                            if (DeviceCommandMatchesSource(source, command))
                            {
                                HandleDeviceCommand(source, command.Action);
                                unhandled_device_commands.Remove(command);
                                if (unhandled_device_commands.Count == 0)
                                {
                                    unhandled_device_commands = null;
                                }
                                break;
                            }
                        }
                    }
                } catch (Exception e) {
                    Log.Exception(e);
                }

                Log.DebugFormat("Mapping disc ({0})", volume.Uuid);
            }
        }
예제 #8
0
        private void MapDiscVolume(IDiscVolume volume)
        {
            lock (this) {
                if (!sources.ContainsKey(volume.Uuid) && volume.HasAudio)
                {
                    AudioCdSource source = new AudioCdSource(this, new AudioCdDiscModel(volume));
                    sources.Add(volume.Uuid, source);
                    ServiceManager.SourceManager.AddSource(source);

                    // If there are any queued device commands, see if they are to be
                    // handled by this new volume (e.g. --device-activate-play=cdda://sr0/)
                    try {
                        if (unhandled_device_commands != null)
                        {
                            foreach (DeviceCommand command in unhandled_device_commands)
                            {
                                if (DeviceCommandMatchesSource(source, command))
                                {
                                    HandleDeviceCommand(source, command.Action);
                                    unhandled_device_commands.Remove(command);
                                    if (unhandled_device_commands.Count == 0)
                                    {
                                        unhandled_device_commands = null;
                                    }
                                    break;
                                }
                            }
                        }
                    } catch (Exception e) {
                        Log.Exception(e);
                    }

                    Log.DebugFormat("Mapping audio CD ({0})", volume.Uuid);
                }
            }
        }
예제 #9
0
 public DvdModel(IDiscVolume volume) : base(volume)
 {
 }
예제 #10
0
 protected override DiscSource GetDiscSource(IDiscVolume volume)
 {
     if (volume.HasVideo) {
         Log.Debug ("Mapping dvd");
         return new DvdSource (this, new DvdModel (volume));
     } else {
         Log.Debug ("Can not map to dvd source.");
         return null;
     }
 }
예제 #11
0
        protected virtual void MapDiscVolume(IDiscVolume volume)
        {
            DiscSource source = null;

            lock (this) {
                if (Sources.ContainsKey (volume.Uuid)) {
                    Log.Debug ("Already mapped");
                    return;
                }

                source =  GetDiscSource (volume);

                if (source == null)
                    return;

                Sources.Add (volume.Uuid, source);
                ServiceManager.SourceManager.AddSource (source);

                // If there are any queued device commands, see if they are to be
                // handled by this new volume (e.g. --device-activate-play=cdda://sr0/)
                try {
                    if (unhandled_device_commands != null) {
                        foreach (DeviceCommand command in unhandled_device_commands) {
                            if (DeviceCommandMatchesSource (source, command)) {
                                HandleDeviceCommand (source, command.Action);
                                unhandled_device_commands.Remove (command);
                                if (unhandled_device_commands.Count == 0) {
                                    unhandled_device_commands = null;
                                }
                                break;
                            }
                        }
                    }
                } catch (Exception e) {
                    Log.Error (e);
                }

                Log.DebugFormat ("Mapping disc ({0})", volume.Uuid);
            }
        }
예제 #12
0
 protected abstract DiscSource GetDiscSource(IDiscVolume volume);
예제 #13
0
 protected override DiscSource GetDiscSource(IDiscVolume volume)
 {
     if  (volume.HasAudio) {
         Log.Debug ("Mapping audio cd");
         return new AudioCdSource (this, new AudioCdDiscModel (volume));
     } else {
         Log.Debug ("Can not map to audio cd source.");
         return null;
     }
 }
예제 #14
0
 public AudioCdDiscModel (IDiscVolume volume)
 {
     this.volume = volume;
     disc_title = Catalog.GetString ("Audio CD");
 }
예제 #15
0
 public AudioCdDiscModel(IDiscVolume volume)
 {
     this.volume = volume;
     disc_title  = Catalog.GetString("Audio CD");
 }
예제 #16
0
 protected abstract DiscSource GetDiscSource(IDiscVolume volume);
예제 #17
0
파일: DiscModel.cs 프로젝트: knocte/banshee
 public DiscModel(IDiscVolume volume)
 {
     Volume = volume;
 }
예제 #18
0
        private void MapDiscVolume (IDiscVolume volume)
        {
            lock (this) {
                if (!sources.ContainsKey (volume.Uuid) && volume.HasAudio) {
                    AudioCdSource source = new AudioCdSource (this, new AudioCdDiscModel (volume));
                    sources.Add (volume.Uuid, source);
                    ServiceManager.SourceManager.AddSource (source);

                    // If there are any queued device commands, see if they are to be
                    // handled by this new volume (e.g. --device-activate-play=cdda://sr0/)
                    try {
                        if (unhandled_device_commands != null) {
                            foreach (DeviceCommand command in unhandled_device_commands) {
                                if (DeviceCommandMatchesSource (source, command)) {
                                    HandleDeviceCommand (source, command.Action);
                                    unhandled_device_commands.Remove (command);
                                    if (unhandled_device_commands.Count == 0) {
                                        unhandled_device_commands = null;
                                    }
                                    break;
                                }
                            }
                        }
                    } catch (Exception e) {
                        Log.Exception (e);
                    }

                    Log.DebugFormat ("Mapping audio CD ({0})", volume.Uuid);
                }
            }
        }
예제 #19
0
 public DiscModel(IDiscVolume volume)
 {
     Volume = volume;
 }