/// <summary>
        ///     This method is called when Sample save is requested, if it returns true
        ///		the calling method will stop illiterating through the SampleFactorys and
        ///		return success to the user.
        /// </summary>
        /// <param name="path">File path or object of the image to load.</param>
        /// <param name="sample">Sample to save.</param>
        /// <param name="flags">Bitmask of flags defining how the sample should be saved.</param>
        /// <returns>True if the save was successfull else false.</returns>
        protected override bool RequestSave(object path, Sample sample, SampleSaveFlags flags)
        {
            if (path.ToString().ToLower().EndsWith(".ogg") == false)
            {
                return(false);
            }

            throw new Exception("OGG save factory currently unfinished and as such unsupported.");
        }
Exemplo n.º 2
0
 /// <summary>
 ///     This method is called when a Sample save is requested, it illiterates through all
 ///     the registered SampleFactory instances to see if there is one capable of saving the
 ///     given format.
 /// </summary>
 /// <param name="sample">Sample to be saved.</param>
 /// <param name="path">File path or save sample to.</param>
 /// <param name="flags">Bitmask of flags to define how the sample should be saved.</param>
 /// <returns>True if save was successfull else false.</returns>
 public static bool SaveSample(object path, Sample sample, SampleSaveFlags flags)
 {
     foreach (SampleFactory factory in _loaderList)
     {
         if (factory.RequestSave(path, sample, flags) == true)
         {
             return(true);
         }
     }
     return(false);
 }
        /// <summary>
        ///     This method is called when Sample save is requested, if it returns true
        ///		the calling method will stop illiterating through the SampleFactorys and 
        ///		return success to the user.
        /// </summary>
        /// <param name="path">File path or object of the image to load.</param>
        /// <param name="sample">Sample to save.</param>
        /// <param name="flags">Bitmask of flags defining how the sample should be saved.</param>
        /// <returns>True if the save was successfull else false.</returns>
        protected override bool RequestSave(object path, Sample sample, SampleSaveFlags flags)
        {
            if (path.ToString().ToLower().EndsWith(".ogg") == false) return false;

            throw new Exception("OGG save factory currently unfinished and as such unsupported.");
        }
Exemplo n.º 4
0
 /// <summary>
 ///     This method is called when Sample save is requested, if it returns true
 ///		the calling method will stop illiterating through the SampleFactorys and
 ///		return success to the user.
 /// </summary>
 /// <param name="path">File path or object of the image to load.</param>
 /// <param name="sample">Sample to save.</param>
 /// <param name="flags">Bitmask of flags defining how the sample should be saved.</param>
 /// <returns>True if the save was successfull else false.</returns>
 protected abstract bool RequestSave(object path, Sample sample, SampleSaveFlags flags);
Exemplo n.º 5
0
 /// <summary>
 ///     This method is called when Sample save is requested, if it returns true
 ///		the calling method will stop illiterating through the SampleFactorys and 
 ///		return success to the user.
 /// </summary>
 /// <param name="path">File path or object of the image to load.</param>
 /// <param name="sample">Sample to save.</param>
 /// <param name="flags">Bitmask of flags defining how the sample should be saved.</param>
 /// <returns>True if the save was successfull else false.</returns>
 protected abstract bool RequestSave(object path, Sample sample, SampleSaveFlags flags);
Exemplo n.º 6
0
 /// <summary>
 ///     This method is called when a Sample save is requested, it illiterates through all
 ///     the registered SampleFactory instances to see if there is one capable of saving the
 ///     given format.
 /// </summary>
 /// <param name="sample">Sample to be saved.</param>
 /// <param name="path">File path or save sample to.</param>
 /// <param name="flags">Bitmask of flags to define how the sample should be saved.</param>
 /// <returns>True if save was successfull else false.</returns>
 public static bool SaveSample(object path, Sample sample, SampleSaveFlags flags)
 {
     foreach (SampleFactory factory in _loaderList)
     {
         if (factory.RequestSave(path, sample, flags) == true) return true;
     }
     return false;
 }