Пример #1
0
        }        // -----------------------------------------

        /// <summary>
        /// Convert from bin/cue to encoded audio/cue
        /// </summary>
        /// <param name="_Input">Input file, must be `.cue`</param>
        /// <param name="_Output">Output folder, If null, it will be same as input file folder</param>
        /// <param name="_Audio">Audio Quality to encode the audio tracks with.</param>
        /// <param name="_Title">Title of the CD</param>
        /// <param name="onComplete">Completed (completeStatus,final Size)</param>
        /// <returns></returns>
        public static bool startJob_ConvertCue(string _Input, string _Output, Tuple <int, int> _Audio,
                                               string _Title, Action <bool, int> onComplete)
        {
            if (LOCKED)
            {
                ERROR = "Engine is working"; return(false);
            }
            if (!FFMPEG_OK)
            {
                ERROR = "FFmpeg is not set"; return(false);
            }

            LOCKED = true;

            var par = new CrushParams();                // CovertCue shares params with Crush job

            par.inputFile    = _Input;
            par.outputDir    = _Output;
            par.audioQuality = _Audio;
            par.cdTitle      = _Title;

            var j = new JobConvertCue(par);

            j.MAX_CONCURRENT = MAX_TASKS;
            j.onComplete     = (s) => {
                LOCKED = false;
                ERROR  = j.ERROR[1];
                onComplete(s, 0);                         // Disregard final filesize
            };

            j.onJobStatus = jobStatusHandler;                           // For status and progress updates
            j.start();

            return(true);
        }        // -----------------------------------------
Пример #2
0
        }        // -----------------------------------------

        /// <summary>
        /// Convert from bin/cue to encoded audio/cue
        /// </summary>
        /// <param name="_Input">Input file, must be `.cue`</param>
        /// <param name="_Output">Output folder, If null, it will be same as input file folder</param>
        /// <param name="_Audio">Audio Quality to encode the audio tracks with.</param>
        /// <param name="_Title">Title of the CD</param>
        /// <param name="onComplete">Completed (completeStatus,final Size)</param>
        /// <returns></returns>
        public static bool startJob_ConvertCue(string _Input, string _Output, Tuple <int, int> _Audio,
                                               string _Title, Action <bool, int, CueReader> onComplete)
        {
            if (LOCKED)
            {
                ERROR = "Engine is working"; return(false);
            }
            if (!FFMPEG_OK)
            {
                ERROR = "FFmpeg is not set"; return(false);
            }

            LOCKED = true;

            var par = new CrushParams {
                inputFile      = _Input,
                outputDir      = _Output,
                audioQuality   = _Audio,
                cdTitle        = _Title,
                expectedTracks = HACK_CD_TRACKS
            };              // CovertCue shares params with Crush job

            var j = new JobConvertCue(par);

            j.MAX_CONCURRENT = MAX_TASKS;
            j.onComplete     = (s) => {
                LOCKED = false;
                ERROR  = j.ERROR[1];
                onComplete(s, 0, j.jobData.cd);                         // Disregard final filesize, because it's not an archive
            };

            j.onJobStatus = jobStatusHandler;                           // For status and progress updates
            j.start();

            return(true);
        }        // -----------------------------------------