コード例 #1
0
ファイル: PluginManager.cs プロジェクト: Shtong/player
        /// <summary>
        /// Registers the specified plugin.
        /// </summary>
        /// <param name="pluginName">The plugin name (do not provide any extension)</param>
        public void Register(string pluginName)
        {
            string fullPath = Path.Combine(BaseDirectory, pluginName + ".dll");

            if (!File.Exists(fullPath))
            {
                throw new FileNotFoundException("Could not find the plugin file.", fullPath);
            }
            SafePluginHandle pluginHandle = BassException.CheckHandleResult(NativeMethods.BASS_PluginLoad(fullPath, BassFlags.Unicode));

            _registeredPlugins.Add(fullPath, pluginHandle);
        }
コード例 #2
0
ファイル: MediaPlayer.cs プロジェクト: Shtong/player
        /// <summary>
        /// Loads the specified media file.
        /// </summary>
        /// <param name="fileName">Name of the file to load.</param>
        public void Load(string fileName)
        {
            CheckNotDisposed();
            InitializeBass();

            if (_currentStream != null)
            {
                // Unload previous stream
                _currentStream.Dispose();
                _currentStream = null;
            }

            _currentStream = BassException.CheckHandleResult(NativeMethods.BASS_StreamCreateFile(false, fileName, 0, 0, BassFlags.Unicode));
        }