public void Begin(string device, bool enableErrorCorrection) { try { Profile profile = null; ProfileConfiguration config = ServiceManager.MediaProfileManager.GetActiveProfileConfiguration("cd-importing"); if (config != null) { profile = config.Profile; } else { profile = ServiceManager.MediaProfileManager.GetProfileForMimeType("audio/vorbis") ?? ServiceManager.MediaProfileManager.GetProfileForMimeType("audio/flac"); if (profile != null) { Log.InformationFormat("Using default/fallback encoding profile: {0}", profile.Name); ProfileConfiguration.SaveActiveProfile(profile, "cd-importing"); } } if (profile != null) { encoder_pipeline = profile.Pipeline.GetProcessById("gstreamer"); output_extension = profile.OutputFileExtension; } if (String.IsNullOrEmpty(encoder_pipeline)) { throw new ApplicationException(); } Hyena.Log.InformationFormat("Ripping using encoder profile `{0}' with pipeline: {1}", profile.Name, encoder_pipeline); } catch (Exception e) { throw new ApplicationException(Catalog.GetString("Could not find an encoder for ripping."), e); } try { int paranoia_mode = enableErrorCorrection ? 255 : 0; handle = new HandleRef(this, br_new(device, paranoia_mode, encoder_pipeline)); progress_handler = new RipperProgressHandler(OnNativeProgress); br_set_progress_callback(handle, progress_handler); mimetype_handler = new RipperMimeTypeHandler(OnNativeMimeType); br_set_mimetype_callback(handle, mimetype_handler); finished_handler = new RipperFinishedHandler(OnNativeFinished); br_set_finished_callback(handle, finished_handler); error_handler = new RipperErrorHandler(OnNativeError); br_set_error_callback(handle, error_handler); } catch (Exception e) { throw new ApplicationException(Catalog.GetString("Could not create CD ripping driver."), e); } }
public void Begin (string device, bool enableErrorCorrection) { try { Profile profile = null; ProfileConfiguration config = ServiceManager.MediaProfileManager.GetActiveProfileConfiguration ("cd-importing"); if (config != null) { profile = config.Profile; } else { profile = ServiceManager.MediaProfileManager.GetProfileForMimeType ("audio/mp3") ?? ServiceManager.MediaProfileManager.GetProfileForMimeType ("audio/flac"); if (profile != null) { Log.InformationFormat ("Using default/fallback encoding profile: {0}", profile.Name); ProfileConfiguration.SaveActiveProfile (profile, "cd-importing"); } } if (profile != null) { encoder_pipeline = profile.Pipeline.GetProcessById ("gstreamer"); output_extension = profile.OutputFileExtension; } if (String.IsNullOrEmpty (encoder_pipeline)) { throw new ApplicationException (); } Hyena.Log.InformationFormat ("Ripping using encoder profile `{0}' with pipeline: {1}", profile.Name, encoder_pipeline); } catch (Exception e) { throw new ApplicationException (Catalog.GetString ("Could not find an encoder for ripping."), e); } try { int paranoia_mode = enableErrorCorrection ? 255 : 0; handle = new HandleRef (this, br_new (device, paranoia_mode, encoder_pipeline)); progress_handler = new RipperProgressHandler (OnNativeProgress); br_set_progress_callback (handle, progress_handler); mimetype_handler = new RipperMimeTypeHandler (OnNativeMimeType); br_set_mimetype_callback (handle, mimetype_handler); finished_handler = new RipperFinishedHandler (OnNativeFinished); br_set_finished_callback (handle, finished_handler); error_handler = new RipperErrorHandler (OnNativeError); br_set_error_callback (handle, error_handler); } catch (Exception e) { throw new ApplicationException (Catalog.GetString ("Could not create CD ripping driver."), e); } }
private static extern void br_set_finished_callback (HandleRef handle, RipperFinishedHandler callback);
private static extern void br_set_finished_callback(HandleRef handle, RipperFinishedHandler callback);