示例#1
0
        public ProfileComboBox(MediaProfileManager manager)
        {
            this.manager = manager;

            BuildWidget();
            ReloadProfiles();
        }
        public ProfileComboBoxConfigurable(MediaProfileManager manager, string configurationId, Box parent)
        {
            HBox editor = new HBox();

            configuration_id = configurationId;
            combo            = new ProfileComboBox(manager);
            combo.Show();

            button          = new ProfileConfigureButton(configurationId);
            button.ComboBox = combo;
            button.Show();

            editor.Spacing = 5;
            editor.PackStart(combo, true, true, 0);
            editor.PackStart(button, false, false, 0);
            editor.Show();

            ProfileConfiguration config = manager.GetActiveProfileConfiguration(configurationId);

            if (config != null)
            {
                Combo.SetActiveProfile(config.Profile);
            }

            description = new DescriptionLabel(delegate {
                var profile = Combo.ActiveProfile;
                return(profile != null ? profile.Description : "");
            });

            Combo.Changed += delegate {
                if (Combo.ActiveProfile != null)
                {
                    Hyena.Log.DebugFormat("Setting active encoding profile: {0} (saved to {1})",
                                          Combo.ActiveProfile.Name, configurationId);
                    ProfileConfiguration.SaveActiveProfile(Combo.ActiveProfile, configurationId);
                    description.Update();
                }
            };

            Combo.StateChanged += delegate {
                if (Combo.State == StateType.Insensitive && description.Parent != null)
                {
                    ((Container)parent ?? this).Remove(description);
                }
                else if (description.Parent == null)
                {
                    description.PackInto(parent ?? this, parent != null);
                }
            };

            Spacing = 5;
            PackStart(editor, true, true, 0);
            description.PackInto(parent ?? this, parent != null);
        }
示例#3
0
        internal Profile(MediaProfileManager manager, XmlNode node)
        {
            id = node.Attributes["id"].Value.Trim();
            name = Banshee.Base.Localization.SelectSingleNode(node, "name").InnerText.Trim();
            description = Banshee.Base.Localization.SelectSingleNode(node, "description").InnerText.Trim();
            output_file_extension = node.SelectSingleNode("output-file-extension").InnerText.Trim();

            foreach(XmlNode mimetype_node in node.SelectNodes("mimetype")) {
                mimetypes.Add(mimetype_node.InnerText.Trim());
            }

            pipeline = new Pipeline(manager, node.SelectSingleNode("pipeline"));
        }
        public ProfileComboBoxConfigurable(MediaProfileManager manager, string configurationId, Box parent)
        {
            HBox editor = new HBox();

            configuration_id = configurationId;
            combo = new ProfileComboBox(manager);
            combo.Show();

            button = new ProfileConfigureButton(configurationId);
            button.ComboBox = combo;
            button.Show();

            editor.Spacing = 5;
            editor.PackStart(combo, true, true, 0);
            editor.PackStart(button, false, false, 0);
            editor.Show();

            ProfileConfiguration config = manager.GetActiveProfileConfiguration (configurationId);

            if (config != null) {
                Combo.SetActiveProfile(config.Profile);
            }

            description = new DescriptionLabel (delegate {
                var profile = Combo.ActiveProfile;
                return profile != null ? profile.Description : "";
            });

            Combo.Changed += delegate {
                if(Combo.ActiveProfile != null) {
                    Hyena.Log.DebugFormat ("Setting active encoding profile: {0} (saved to {1})",
                        Combo.ActiveProfile.Name, configurationId);
                    ProfileConfiguration.SaveActiveProfile (Combo.ActiveProfile, configurationId);
                    description.Update ();
                }
            };

            Combo.StateChanged += delegate {
                if (Combo.State == StateType.Insensitive && description.Parent != null) {
                    ((Container)parent ?? this).Remove (description);
                } else if (description.Parent == null) {
                    description.PackInto (parent ?? this, parent != null);
                }
            };

            Spacing = 5;
            PackStart (editor, true, true, 0);
            description.PackInto (parent ?? this, parent != null);
        }
        private void OnMediaProfileManagerInitialized(object o, EventArgs args)
        {
            MediaProfileManager profile_manager = ServiceManager.MediaProfileManager;

            if (profile_manager != null)
            {
                Pipeline.AddSExprFunction("gst-element-is-available", SExprTestElement);
                Pipeline.AddSExprFunction("gst-construct-pipeline", SExprConstructPipeline);
                Pipeline.AddSExprFunction("gst-construct-caps", SExprConstructCaps);
                Pipeline.AddSExprFunction("gst-construct-element", SExprConstructElement);

                profile_manager.TestProfile += OnTestMediaProfile;
                profile_manager.TestAll();
            }
        }
 public ProfileComboBoxConfigurable(MediaProfileManager manager, string configurationId)
     : this(manager, configurationId, null)
 {
 }
 public ProfileComboBoxConfigurable(MediaProfileManager manager, string configurationId)
     : this(manager, configurationId, null)
 {
 }