private static void UpdateConfiguration(SelectionConfigurationOption option)
        {
            var configuration = ComponentRegistry.Instance.GetComponent <IConfiguration>();
            var peaks         = configuration.GetElement <BooleanConfigurationElement>(
                SECTION,
                PEAKS_ELEMENT
                );
            var rms = configuration.GetElement <BooleanConfigurationElement>(
                SECTION,
                RMS_ELEMENT
                );

            switch (option.Id)
            {
            default:
            case VisualizationBehaviourConfiguration.QUALITY_HIGH_OPTION:
                Logger.Write(typeof(SpectrumBehaviourConfiguration), LogLevel.Debug, "Using high quality profile.");
                peaks.Value = true;
                rms.Value   = true;
                break;

            case VisualizationBehaviourConfiguration.QUALITY_LOW_OPTION:
                Logger.Write(typeof(SpectrumBehaviourConfiguration), LogLevel.Debug, "Using low quality profile.");
                peaks.Value = false;
                rms.Value   = false;
                break;
            }
        }
Ejemplo n.º 2
0
        private static void UpdateConfiguration(SelectionConfigurationOption option)
        {
            var configuration = ComponentRegistry.Instance.GetComponent <IConfiguration>();
            var smooth        = configuration.GetElement <BooleanConfigurationElement>(
                SECTION,
                SMOOTH_ELEMENT
                );
            var interval = configuration.GetElement <IntegerConfigurationElement>(
                SECTION,
                INTERVAL_ELEMENT
                );
            var fftSize = configuration.GetElement <SelectionConfigurationElement>(
                SECTION,
                FFT_SIZE_ELEMENT
                );

            switch (option.Id)
            {
            default:
            case QUALITY_HIGH_OPTION:
                Logger.Write(typeof(VisualizationBehaviourConfiguration), LogLevel.Debug, "Using high quality profile.");
                smooth.Value   = true;
                interval.Value = 20;
                fftSize.Value  = fftSize.GetOption(FFT_2048_OPTION);
                break;

            case QUALITY_LOW_OPTION:
                Logger.Write(typeof(VisualizationBehaviourConfiguration), LogLevel.Debug, "Using low quality profile.");
                smooth.Value   = false;
                interval.Value = 100;
                fftSize.Value  = fftSize.GetOption(FFT_512_OPTION);
                break;
            }
        }
Ejemplo n.º 3
0
        public static int GetFFTSize(SelectionConfigurationOption option)
        {
            switch (option.Id)
            {
            case FFT_512_OPTION:
                return(512);

            case FFT_1024_OPTION:
                return(1024);

            default:
            case FFT_2048_OPTION:
                return(2048);

            case FFT_4096_OPTION:
                return(4096);

            case FFT_8192_OPTION:
                return(8192);

            case FFT_16384_OPTION:
                return(16384);

            case FFT_32768_OPTION:
                return(32768);
            }
        }
Ejemplo n.º 4
0
        public static SoxChannelPhase GetPhase(SelectionConfigurationOption option)
        {
            var quality = default(SoxChannelPhase);

            if (!Enum.TryParse <SoxChannelPhase>(option.Id, out quality))
            {
                return(SoxChannelPhase.Linear);
            }
            return(quality);
        }
Ejemplo n.º 5
0
        public static SoxChannelQuality GetQuality(SelectionConfigurationOption option)
        {
            var quality = default(SoxChannelQuality);

            if (!Enum.TryParse <SoxChannelQuality>(option.Id, out quality))
            {
                return(SoxChannelQuality.VeryHigh);
            }
            return(quality);
        }
Ejemplo n.º 6
0
        public static int GetRate(SelectionConfigurationOption option)
        {
            var rate = default(int);

            if (int.TryParse(option.Id, out rate))
            {
                return(rate);
            }
            return(OutputRate.PCM_44100);
        }
Ejemplo n.º 7
0
        public static int GetBitrate(SelectionConfigurationOption option)
        {
            var bitrate = default(int);

            if (!int.TryParse(option.Id, out bitrate))
            {
                bitrate = 320;
            }
            return(bitrate);
        }
        public static Type GetControl(SelectionConfigurationOption option)
        {
            var component = LayoutManager.Instance.GetComponent(option.Id);

            if (component == null)
            {
                return(LayoutManager.PLACEHOLDER);
            }
            return(component.Type);
        }
        public static SearchCommitBehaviour GetCommitBehaviour(SelectionConfigurationOption option)
        {
            var result = default(SearchCommitBehaviour);

            if (Enum.TryParse <SearchCommitBehaviour>(option.Id, out result))
            {
                return(result);
            }
            return(SearchCommitBehaviour.Replace);
        }
Ejemplo n.º 10
0
        public static MiniPlayerDropBehaviour GetDropBehaviour(SelectionConfigurationOption option)
        {
            var result = default(MiniPlayerDropBehaviour);

            if (Enum.TryParse <MiniPlayerDropBehaviour>(option.Id, out result))
            {
                return(result);
            }
            return(MiniPlayerDropBehaviour.Replace);
        }
        private static IEnumerable <SelectionConfigurationOption> GetLayoutOptions()
        {
            var releaseType = StandardComponents.Instance.Configuration.ReleaseType;
            var option      = new SelectionConfigurationOption(ID, "Minimal");

            if (releaseType == ReleaseType.Minimal)
            {
                option.Default();
            }
            yield return(option);
        }
Ejemplo n.º 12
0
        public static ReplayGainMode GetMode(SelectionConfigurationOption option)
        {
            switch (option.Id)
            {
            default:
            case MODE_ALBUM:
                return(ReplayGainMode.Album);

            case MODE_TRACK:
                return(ReplayGainMode.Track);
            }
        }
        public static BassCrossfadeMode GetMode(SelectionConfigurationOption option)
        {
            switch (option.Id)
            {
            case MODE_ALWAYS_OPTION:
                return(BassCrossfadeMode.Always);

            default:
            case MODE_MANUAL_OPTION:
                return(BassCrossfadeMode.Manual);
            }
        }
Ejemplo n.º 14
0
        public static bool GetFloat(SelectionConfigurationOption option)
        {
            switch (option.Id)
            {
            default:
            case DEPTH_16_OPTION:
                return(false);

            case DEPTH_32_OPTION:
                return(true);
            }
        }
        public static OscilloscopeRendererMode GetMode(SelectionConfigurationOption option)
        {
            switch (option.Id)
            {
            default:
            case MODE_MONO_OPTION:
                return(OscilloscopeRendererMode.Mono);

            case MODE_SEPERATE_OPTION:
                return(OscilloscopeRendererMode.Seperate);
            }
        }
        public static LibraryBrowserImageMode GetLibraryImage(SelectionConfigurationOption option)
        {
            switch (option.Id)
            {
            case LIBRARY_BROWSER_TILE_IMAGE_FIRST:
                return(LibraryBrowserImageMode.First);

            default:
            case LIBRARY_BROWSER_TILE_IMAGE_COMPOUND:
                return(LibraryBrowserImageMode.Compound);
            }
        }
        public static Orientation GetOrientation(SelectionConfigurationOption option)
        {
            switch (option.Id)
            {
            default:
            case ORIENTATION_HORIZONTAL:
                return(Orientation.Horizontal);

            case ORIENTATION_VERTICAL:
                return(Orientation.Vertical);
            }
        }
        public static LibraryBrowserViewMode GetLibraryView(SelectionConfigurationOption option)
        {
            switch (option.Id)
            {
            default:
            case LIBRARY_BROWSER_VIEW_GRID:
                return(LibraryBrowserViewMode.Grid);

            case LIBRARY_BROWSER_VIEW_LIST:
                return(LibraryBrowserViewMode.List);
            }
        }
Ejemplo n.º 19
0
 public static IEnumerable <SelectionConfigurationOption> GetRateOptions()
 {
     foreach (var rate in OutputRate.PCM)
     {
         var option = new SelectionConfigurationOption(rate.ToString(), rate.ToString());
         if (rate == OutputRate.PCM_88200)
         {
             option.Default();
         }
         yield return(option);
     }
 }
 public static int GetDrive(SelectionConfigurationOption option)
 {
     for (int a = 0, b = BassCd.DriveCount; a < b; a++)
     {
         var cdInfo = default(CDInfo);
         BassUtils.OK(BassCd.GetInfo(a, out cdInfo));
         if (string.Equals(cdInfo.Name, option.Id, StringComparison.OrdinalIgnoreCase))
         {
             return(a);
         }
     }
     return(CD_NO_DRIVE);
 }
Ejemplo n.º 21
0
 public static int GetAsioDevice(SelectionConfigurationOption option)
 {
     for (int a = 0, b = BassAsio.DeviceCount; a < b; a++)
     {
         var deviceInfo = default(AsioDeviceInfo);
         BassAsioUtils.OK(BassAsio.GetDeviceInfo(a, out deviceInfo));
         if (string.Equals(deviceInfo.Name, option.Id, StringComparison.OrdinalIgnoreCase))
         {
             return(a);
         }
     }
     return(ASIO_NO_DEVICE);
 }
Ejemplo n.º 22
0
        private static void UpdateConfiguration(SelectionConfigurationOption option)
        {
            switch (option.Id)
            {
            case DESTINATION_BROWSE_OPTION:
            case DESTINATION_SOURCE_OPTION:
                StandardComponents.Instance.Configuration.GetElement(SECTION, DESTINATION_LOCATION_ELEMENT).Hide();
                break;

            case DESTINATION_SPECIFIC_OPTION:
                StandardComponents.Instance.Configuration.GetElement(SECTION, DESTINATION_LOCATION_ELEMENT).Show();
                break;
            }
        }
Ejemplo n.º 23
0
        private static IEnumerable <SelectionConfigurationOption> GetThemeOptions()
        {
            var themes = ComponentRegistry.Instance.GetComponents <ITheme>();

            foreach (var theme in themes)
            {
                var option = new SelectionConfigurationOption(theme.Id, theme.Name, theme.Description);
                if (ComponentRegistry.Instance.IsDefault(theme))
                {
                    option.Default();
                }
                yield return(option);
            }
        }
Ejemplo n.º 24
0
        public static IEnumerable <SelectionConfigurationOption> GetLayoutOptions()
        {
            var layoutProviders = ComponentRegistry.Instance.GetComponents <IUILayoutProvider>();

            foreach (var layoutProvider in layoutProviders)
            {
                var option = new SelectionConfigurationOption(layoutProvider.Id, layoutProvider.Name, layoutProvider.Description);
                if (ComponentRegistry.Instance.IsDefault(layoutProvider))
                {
                    option.Default();
                }
                yield return(option);
            }
        }
        private static IEnumerable <SelectionConfigurationOption> GetControlOptions(string id)
        {
            yield return(new SelectionConfigurationOption(UIComponent.PLACEHOLDER, "Empty"));

            foreach (var component in LayoutManager.Instance.Components)
            {
                var option = new SelectionConfigurationOption(component.Id, component.Name, component.Description);
                if (string.Equals(component.Slot, id, StringComparison.OrdinalIgnoreCase))
                {
                    option.Default();
                }
                yield return(option);
            }
        }
        public static BassEncoderOutputDestination GetDestination(SelectionConfigurationOption option)
        {
            switch (option.Id)
            {
            default:
            case DESTINATION_BROWSE_OPTION:
                return(BassEncoderOutputDestination.Browse);

            case DESTINATION_SOURCE_OPTION:
                return(BassEncoderOutputDestination.Source);

            case DESTINATION_SPECIFIC_OPTION:
                return(BassEncoderOutputDestination.Specific);
            }
        }
        public static int GetFFTSize(SelectionConfigurationOption option)
        {
            switch (option.Id)
            {
            case FFT_512_OPTION:
                return(512);

            case FFT_1024_OPTION:
                return(1024);

            default:
            case FFT_2048_OPTION:
                return(2048);
            }
        }
Ejemplo n.º 28
0
        public static EXECUTION_STATE GetExecutionState(SelectionConfigurationOption option)
        {
            switch (option.Id)
            {
            default:
            case SLEEP_NONE_OPTION:
                return(EXECUTION_STATE.ES_CONTINUOUS);

            case SLEEP_SYSTEM_OPTION:
                return(EXECUTION_STATE.ES_CONTINUOUS | EXECUTION_STATE.ES_SYSTEM_REQUIRED);

            case SLEEP_DISPLAY_OPTION:
                return(EXECUTION_STATE.ES_CONTINUOUS | EXECUTION_STATE.ES_SYSTEM_REQUIRED | EXECUTION_STATE.ES_DISPLAY_REQUIRED);
            }
        }
        private static IEnumerable <SelectionConfigurationOption> GetThemeOptions()
        {
            var themes      = ComponentRegistry.Instance.GetComponents <ITheme>();
            var releaseType = StandardComponents.Instance.Configuration.ReleaseType;

            foreach (var theme in themes)
            {
                var option = new SelectionConfigurationOption(theme.Id, theme.Name, theme.Description);
                if (theme.ReleaseType == releaseType)
                {
                    option.Default();
                }
                yield return(option);
            }
        }
Ejemplo n.º 30
0
 public static int GetWasapiDevice(SelectionConfigurationOption option)
 {
     if (!string.Equals(option.Id, BassWasapi.DefaultDevice.ToString()))
     {
         for (int a = 0, b = BassWasapi.DeviceCount; a < b; a++)
         {
             var deviceInfo = default(WasapiDeviceInfo);
             BassUtils.OK(BassWasapi.GetDeviceInfo(a, out deviceInfo));
             if (string.Equals(deviceInfo.ID, option.Id, StringComparison.OrdinalIgnoreCase))
             {
                 return(a);
             }
         }
     }
     return(BassWasapi.DefaultDevice);
 }