Beispiel #1
0
 public void LoadTrackVstPlugin(string location)
 {
     try
     {
         if (location == CurrentTrackVstPluginLocation)
         {
             return;
         }
         BassPlayer.ClearTracksVstPlugin(0);
         if (location != "")
         {
             BassPlayer.LoadTracksVstPlugin(location, 0);
         }
     }
     catch (Exception e)
     {
         HandleException(e);
     }
 }
Beispiel #2
0
        /// <summary>
        ///     Loads the settings.
        /// </summary>
        public void LoadSettings()
        {
            var settings = Settings.Default;

            Library.LibraryFolder = settings.LibraryFolder;

            ExtenedAttributesHelper.ShufflerFolder = settings.ShufflerFolder;
            PluginHelper.WaPluginsFolder           = settings.WaPluginsFolder;
            PluginHelper.VstPluginsFolder          = settings.VstPluginsFolder;
            BassPlayer.TrackFxAutomationEnabled    = settings.EnableTrackFxAutomation;
            BassPlayer.SampleAutomationEnabled     = settings.EnableSampleAutomation;
            KeyHelper.SetApplicationFolder(settings.KeyFinderFolder);


            if (settings.WaPlugin != "")
            {
                try
                {
                    BassPlayer.LoadWaPlugin(settings.WaPlugin);
                }
                catch
                {
                    // ignored
                }
            }

            if (settings.MainMixerVstPlugin != "")
            {
                try
                {
                    BassPlayer.LoadMainVstPlugin(settings.MainMixerVstPlugin, 0);
                }
                catch
                {
                    // ignored
                }
            }

            if (settings.MainMixerVstPlugin2 != "")
            {
                try
                {
                    BassPlayer.LoadMainVstPlugin(settings.MainMixerVstPlugin2, 1);
                }
                catch
                {
                    // ignored
                }
            }

            if (settings.MainMixerVstPluginParameters != "" && BassPlayer.MainVstPlugin != null)
            {
                try
                {
                    PluginHelper.SetVstPluginParameters(BassPlayer.MainVstPlugin,
                                                        settings.MainMixerVstPluginParameters);
                }
                catch
                {
                    // ignored
                }
            }

            if (settings.MainMixerVstPlugin2Parameters != "" && BassPlayer.MainVstPlugin2 != null)
            {
                try
                {
                    PluginHelper.SetVstPluginParameters(BassPlayer.MainVstPlugin2,
                                                        settings.MainMixerVstPlugin2Parameters);
                }
                catch
                {
                    // ignored
                }
            }

            if (settings.SamplerVstPlugin != "")
            {
                try
                {
                    BassPlayer.LoadSamplerVstPlugin(settings.SamplerVstPlugin, 0);
                }
                catch
                {
                    // ignored
                }
            }

            if (settings.SamplerVstPluginParameters != "" && BassPlayer.SamplerVstPlugin != null)
            {
                try
                {
                    PluginHelper.SetVstPluginParameters(BassPlayer.SamplerVstPlugin,
                                                        settings.SamplerVstPluginParameters);
                }
                catch
                {
                    // ignored
                }
            }

            if (settings.SamplerVstPlugin2 != "")
            {
                try
                {
                    BassPlayer.LoadSamplerVstPlugin(settings.SamplerVstPlugin2, 1);
                }
                catch
                {
                    // ignored
                }
            }

            if (settings.SamplerVstPlugin2Parameters != "" && BassPlayer.SamplerVstPlugin2 != null)
            {
                try
                {
                    PluginHelper.SetVstPluginParameters(BassPlayer.SamplerVstPlugin2,
                                                        settings.SamplerVstPlugin2Parameters);
                }
                catch
                {
                    // ignored
                }
            }

            if (settings.TrackVstPlugin != "")
            {
                try
                {
                    BassPlayer.LoadTracksVstPlugin(settings.TrackVstPlugin, 0);
                }
                catch
                {
                    // ignored
                }
            }

            if (settings.TrackVstPluginParameters != "" && BassPlayer.TrackVstPlugin != null)
            {
                try
                {
                    PluginHelper.SetVstPluginParameters(BassPlayer.TrackVstPlugin, settings.TrackVstPluginParameters);
                }
                catch
                {
                    // ignored
                }
            }

            if (settings.TrackFxvstPlugin != "")
            {
                try
                {
                    BassPlayer.LoadTrackSendFxvstPlugin(settings.TrackFxvstPlugin, 0);
                }
                catch
                {
                    // ignored
                }
            }

            if (settings.TrackFxvstPluginParameters != "" && BassPlayer.TrackSendFxVstPlugin != null)
            {
                try
                {
                    PluginHelper.SetVstPluginParameters(BassPlayer.TrackSendFxVstPlugin,
                                                        settings.TrackFxvstPluginParameters);
                }
                catch
                {
                    // ignored
                }
            }

            if (settings.TrackFxvstPlugin2 != "")
            {
                try
                {
                    BassPlayer.LoadTrackSendFxvstPlugin(settings.TrackFxvstPlugin2, 1);
                }
                catch
                {
                    // ignored
                }
            }

            if (settings.TrackFxvstPlugin2Parameters != "" && BassPlayer.TrackSendFxVstPlugin2 != null)
            {
                try
                {
                    PluginHelper.SetVstPluginParameters(BassPlayer.TrackSendFxVstPlugin2,
                                                        settings.TrackFxvstPlugin2Parameters);
                }
                catch
                {
                    // ignored
                }
            }

            BassPlayer.LimitSongLength = settings.LimitSongLength;
            BassPlayer.SetMonitorVolume(settings.MonitorVolume);

            UseConservativeFadeOut = settings.LimitSongLength;

            LoopLibrary.Initialize(settings.LoopLibraryFolder);
            BassPlayer.LoopFolder = settings.LoopLibraryFolder;
        }