public FlacReader(string input, WavWriter output) { if (output == null) { throw new ArgumentNullException("WavWriter"); } stream = File.OpenRead(input); reader = new BinaryReader(stream); writer = output; context = FLAC__stream_decoder_new(); if (context == IntPtr.Zero) { throw new ApplicationException("FLAC: Could not initialize stream decoder!"); } write = new WriteCallback(Write); metadata = new MetadataCallback(Metadata); error = new ErrorCallback(Error); if (FLAC__stream_decoder_init_file(context, input, write, metadata, error, IntPtr.Zero) != 0) { throw new ApplicationException("FLAC: Could not open stream for reading!"); } }
/// <summary> /// Detect a text /// </summary> /// <param name="callback">Callback to be invoked with the detected text</param> /// <param name="detectOnce">If true, at most one text will be detected</param> public static void DetectText(MetadataCallback <Text> callback, bool detectOnce = true) // NCDOC { if (!Implementation.SupportsMetadata) { Util.LogError("Current platform does not support metadata detection"); return; } if (callback == null) { Util.LogError("Cannot detect text with no callback"); return; } MetadataCallback <IMetadata> callbackWrapper = null; callbackWrapper = text => { if (!(text is Text)) { return; } if (detectOnce) { Implementation.OnMetadata -= callbackWrapper; } callback((Text)text); }; Implementation.OnMetadata += callbackWrapper; }
public FlacReader(Stream input, WavWriter output) { if (output == null) { throw new ArgumentNullException("output"); } stream = input; writer = output; context = _flacStreamDecoderNew(); if (context == IntPtr.Zero) { throw new ApplicationException("FLAC: Could not initialize stream decoder!"); } write = Write; metadata = Metadata; error = Error; read = Read; seek = Seek; tell = Tell; length = Length; eof = Eof; if (_flacStreamDecoderInitStream(context, read, seek, tell, length, eof, write, metadata, error, IntPtr.Zero) != 0) { throw new ApplicationException("FLAC: Could not open stream for reading!"); } }
public static void DetectBarcode(MetadataCallback <Barcode> callback, BarcodeFormat format = BarcodeFormat.ALL, bool detectOnce = true) { if (!Implementation.SupportsMetadata) { Util.LogError("Current platform does not support metadata detection"); return; } if (callback == null) { Util.LogError("Cannot detect barcode with no callback"); return; } MetadataCallback <IMetadata> callbackWrapper = null; callbackWrapper = barcode => { if (!(barcode is Barcode)) { return; } if ((((Barcode)barcode).format & format) == 0) { return; } if (detectOnce) { Implementation.OnMetadata -= callbackWrapper; } callback((Barcode)barcode); }; Implementation.OnMetadata += callbackWrapper; }
/// <summary> /// Detect a face /// </summary> /// <param name="callback">Callback to be invoked with the detected face</param> public static void DetectFace(MetadataCallback <Face> callback) // NCDOC { if (!Implementation.SupportsMetadata) { Util.LogError("Current platform does not support metadata detection"); return; } if (callback == null) { Util.LogError("Cannot detect face with no callback"); return; } MetadataCallback <IMetadata> callbackWrapper = null; callbackWrapper = face => { if (face is Face) { callback((Face)face); } }; Implementation.OnMetadata += callbackWrapper; }
public FlacReader(string input, WavWriter output) { if (output == null) throw new ArgumentNullException("WavWriter"); stream = File.OpenRead(input); reader = new BinaryReader(stream); writer = output; context = FLAC__stream_decoder_new(); if (context == IntPtr.Zero) throw new ApplicationException("FLAC: Could not initialize stream decoder!"); write = new WriteCallback(Write); metadata = new MetadataCallback(Metadata); error = new ErrorCallback(Error); if (FLAC__stream_decoder_init_file(context, input, write, metadata, error, IntPtr.Zero) != 0) throw new ApplicationException("FLAC: Could not open stream for reading!"); }
public void getMetadata(MetadataCallback successCallback) {}
public void SetMetadata(MetadataCallback successCallback, FileErrorCallback errorCallback, Metadata metadataObject) { }
public void GetMetadata(MetadataCallback successCallback, FileErrorCallback errorCallback) { }
public void GetMetadata(MetadataCallback successCallback) { }
public void getMetadata(MetadataCallback successCallback, ErrorCallback errorCallback) { }
static extern int FLAC__stream_encoder_init_stream(IntPtr context, WriteCallback write, SeekCallback seek, TellCallback tell, MetadataCallback metadata, IntPtr userData);
public void getMetadata(MetadataCallback successCallback, ErrorCallback errorCallback) {}
private void OnDestroy() { callbacks = (MetadataCallback)Delegate.Remove(callbacks, new MetadataCallback(MetadataChangedInternal)); }
private void Awake() { callbacks = (MetadataCallback)Delegate.Combine(callbacks, new MetadataCallback(MetadataChangedInternal)); }
static extern int FLAC__stream_decoder_init_file(IntPtr context, string filename, WriteCallback write, MetadataCallback metadata, ErrorCallback error, IntPtr userData);
public static void DetectBarcode(Color32[] frame, int width, int height, IDispatch dispatch, MetadataCallback <IMetadata> callback) { if (frame == null || dispatch == null || callback == null) { return; } #if ZXING_API var results = reader.DecodeMultiple(frame, width, height); dispatch.Dispatch(() => results.ForEach(result => callback(NatCamBarcode(result)))); #endif }