internal static bool Validate(TranscodeOptions transcode) { bool valid = true; Plugin.FileCodec[] distinctFormats = transcode.formats.Distinct().ToArray(); if (distinctFormats.Length != transcode.formats.Count || distinctFormats.Length > Enum.GetNames(typeof(Plugin.FileCodec)).Length || transcode.formats.Exists(format => !Enum.IsDefined(typeof(Plugin.FileCodec), format))) { valid = false; } return(valid); }
public BASSStream(string file, TranscodeOptions options) { handle = Plugin.mbApi.Player_OpenStreamHandle(file, options.useMusicBeeSettings, options.enableDSP, options.replayGainMode); if (handle == 0) { int status = BASS_ErrorGetCode(); throw new FormatException(String.Format("Opening {0} stream returned error code: {1}", file, status)); } BASS_ChannelGetInfo(handle, out info); // If we're responsible for PCM conversion all indexing into the underlying stream must be doubled convertFloatToPCM = FloatingPointBassStream && options.usePCM; if (convertFloatToPCM) { pcmBuffer = new float[] { }; } }
internal static TranscodeOptions WithDefaultTranscodeFormats() { TranscodeOptions result = new TranscodeOptions { }; result.formats = new List <Plugin.FileCodec> { Plugin.FileCodec.Unknown, Plugin.FileCodec.Flac, Plugin.FileCodec.Ogg, Plugin.FileCodec.WavPack, Plugin.FileCodec.Wma, Plugin.FileCodec.Tak, Plugin.FileCodec.Mpc, Plugin.FileCodec.Asx, Plugin.FileCodec.Pcm, Plugin.FileCodec.Opus, Plugin.FileCodec.Spx, Plugin.FileCodec.Dsd, Plugin.FileCodec.AacNoContainer }; return(result); }