GetFilterProperties() public méthode

public GetFilterProperties ( ) : FilterProperty[]
Résultat FilterProperty[]
Exemple #1
0
        // Update track and filter info when the user switches track
        void UpdateCurrentTrack()
        {
            _currentTrack = GATManager.DefaultPlayer.GetTrack(_recs[_currentRecIndex].trackNb);

            _selectedFilter = _currentTrack.FiltersHandler.GetFilterAtSlot(0);

            if (_selectedFilter != null)
            {
                _trackFilterProps = _selectedFilter.GetFilterProperties();
                _filterName       = AGATMonoFilter.FilterNameForType(_selectedFilter.GetType());
            }

            if (_micMode == MicMode.Track)              // if we're routing the mic through a track, we should update the streamToTrack object
            {
                streamToTrack.TargetTrack = _currentTrack;
            }
        }
        public void DrawFiltersToolbar()
        {
            int  i;
            int  slot;
            Rect boxRect;

            string[] allFilterNames;

            boxRect = EditorGUILayout.BeginVertical();

            GUI.backgroundColor = filterBgdColor;

            GUI.Box(boxRect, "");

            GUI.backgroundColor = Color.white;

            EditorGUILayout.Space();

            _handler.SelectedFilterSlot = GUILayout.Toolbar(_handler.SelectedFilterSlot, _filterNames);

            slot = _handler.SelectedFilterSlot;

            EditorGUILayout.Space();

            if (_filters[slot] != null)
            {
                GUI.color = Color.red;

                if (GUILayout.Button("Remove Filter", __filtersButtonOptions))
                {
                    RemoveFilter(slot);
                }

                GUI.color = Color.white;

                if (_selectedFilter != _filters[slot])
                {
                    _selectedFilter = _filters[slot];

                    _selectedFilterProperties = _selectedFilter.GetFilterProperties();
                }

                if (_selectedFilter != null)
                {
                    AGATFilter.FilterProperty filterProp;

                    GUI.enabled = !_selectedFilter.Bypass;
                    for (i = 0; i < _selectedFilterProperties.Length; i++)
                    {
                        filterProp = _selectedFilterProperties[i];
                        if (filterProp.IsGroupToggle)
                        {
                            filterProp.SetToggleValue(GUILayout.Toggle(filterProp.GroupToggleState, filterProp.LabelString));
                            if (filterProp.GroupToggleState == false)
                            {
                                i++;
                            }

                            continue;
                        }
                        GUILayout.BeginHorizontal();
                        GUILayout.Label(filterProp.LabelString, __filtersLabelOptions);
                        filterProp.SetValue(GUILayout.HorizontalSlider(filterProp.CurrentValue, filterProp.Range.Min, filterProp.Range.Max, __sliderOptions));
                        GUILayout.EndHorizontal();
                    }

                    GUI.enabled = true;

                    _selectedFilter.Bypass = GUILayout.Toggle(_selectedFilter.Bypass, "Bypass");
                }
            }
            else
            {
                allFilterNames = AGATMonoFilter.GetAllFilterNames();
                EditorGUILayout.BeginHorizontal();

                _selectedFilterIndexInOptions = EditorGUILayout.Popup(_selectedFilterIndexInOptions, allFilterNames, __filtersTypeOptions);

                GUI.color = Color.green;
                if (GUILayout.Button("Add Filter", __filtersButtonOptions))
                {
                    Type filterType = AGATMonoFilter.FilterTyperForName(allFilterNames[_selectedFilterIndexInOptions]);
                    AddFilter(filterType, slot);
                }

                GUI.color = Color.white;
                EditorGUILayout.EndHorizontal();
            }

            EditorGUILayout.Space();
            EditorGUILayout.EndVertical();
        }
Exemple #3
0
        public void DrawFiltersToolbar()
        {
            int  i;
            int  slot;
            Rect boxRect;
            string[] allFilterNames;

            boxRect = EditorGUILayout.BeginVertical();

            GUI.backgroundColor = filterBgdColor;

            GUI.Box( boxRect, "" );

            GUI.backgroundColor = Color.white;

            EditorGUILayout.Space();

            _handler.SelectedFilterSlot = GUILayout.Toolbar( _handler.SelectedFilterSlot, _filterNames );

            slot = _handler.SelectedFilterSlot;

            EditorGUILayout.Space();

            if( _filters[ slot ] != null )
            {
                GUI.color = Color.red;

                if( GUILayout.Button( "Remove Filter", __filtersButtonOptions ) )
                {
                    RemoveFilter( slot );

                }

                GUI.color = Color.white;

                if( _selectedFilter != _filters[ slot ] )
                {
                    _selectedFilter = _filters[ slot ];

                    _selectedFilterProperties = _selectedFilter.GetFilterProperties();
                }

                if( _selectedFilter != null )
                {
                    AGATFilter.FilterProperty filterProp;

                    GUI.enabled = ! _selectedFilter.Bypass;
                    for( i = 0; i < _selectedFilterProperties.Length; i++ )
                    {
                        filterProp = _selectedFilterProperties[ i ];
                        if( filterProp.IsGroupToggle )
                        {
                            filterProp.SetToggleValue( GUILayout.Toggle( filterProp.GroupToggleState, filterProp.LabelString ) );
                            if( filterProp.GroupToggleState == false )
                            {
                                i++;
                            }

                            continue;
                        }
                        GUILayout.BeginHorizontal();
                        GUILayout.Label( filterProp.LabelString, __filtersLabelOptions );
                        filterProp.SetValue( GUILayout.HorizontalSlider( filterProp.CurrentValue, filterProp.Range.Min, filterProp.Range.Max, __sliderOptions ) );
                        GUILayout.EndHorizontal();
                    }

                    GUI.enabled = true;

                    _selectedFilter.Bypass = GUILayout.Toggle( _selectedFilter.Bypass, "Bypass" );
                }
            }
            else
            {
                allFilterNames = AGATMonoFilter.GetAllFilterNames();
                EditorGUILayout.BeginHorizontal();

                _selectedFilterIndexInOptions = EditorGUILayout.Popup( _selectedFilterIndexInOptions, allFilterNames, __filtersTypeOptions );

                GUI.color = Color.green;
                if( GUILayout.Button( "Add Filter", __filtersButtonOptions ) )
                {
                    Type filterType = AGATMonoFilter.FilterTyperForName( allFilterNames[ _selectedFilterIndexInOptions ] );
                    AddFilter( filterType, slot );
                }

                GUI.color = Color.white;
                EditorGUILayout.EndHorizontal();
            }

            EditorGUILayout.Space();
            EditorGUILayout.EndVertical();
        }
Exemple #4
0
        // Update track and filter info when the user switches track
        void UpdateCurrentTrack()
        {
            _currentTrack = GATManager.DefaultPlayer.GetTrack( _recs[ _currentRecIndex ].trackNb );

            _selectedFilter = _currentTrack.FiltersHandler.GetFilterAtSlot( 0 );

            if( _selectedFilter != null )
            {
                _trackFilterProps = _selectedFilter.GetFilterProperties();
                _filterName = AGATMonoFilter.FilterNameForType( _selectedFilter.GetType() );
            }

            if( _micMode == MicMode.Track ) // if we're routing the mic through a track, we should update the streamToTrack object
            {
                streamToTrack.TargetTrack = _currentTrack;
            }
        }