Example #1
0
var getProcessBar = function () {
  var _bar = bar.create(process.stdout);
  _bar.format = '$bar; $percentage,2:0;% uploaded.';
  _bar.symbols.loaded = chalk.cyan('#');
  _bar.symbols.notLoaded = chalk.red('-');
  _bar.width = 50;
  return _bar;
};
				SC_DownloadInit : function (list, callback){
						var dc = this,
								download_report = [],
								bar = PG.create(process.stdout);

						dc.bind('EVENT_REPORT', function (ev){
								download_report.push(ev.data);
								bar.update(download_report.length / list.length);
								if( download_report.length === list.length){
										callback(null, download_report);
								}
						});

						list.forEach(function (element, index, array){
								dc._SC_MP3_Downloader(element);        
						});
				}
Example #3
0
		SC_TagInit : function (obj, callback){
			var tc =  this,
				tag_list = obj.tag_list,
				track = '',
				tag_report = [],
				ok_list = obj.ok_list,				
				bar = PG.create(process.stdout);

			tc.bind('EVENT_TAG_REPORT', function (ev){
				tag_report.push(ev.data);
				bar.update(tag_report.length / ok_list.length);
				if(tag_report.length ===  ok_list.length){
					callback(null,  tag_report);
				}				
			});

			ok_list.forEach(function (element, index, array){
				track = u.find(tag_list, {'id': element.track_id });	
				tc._SC_Tagger(track);
			});
		}
Example #4
0
var	ProgressBar	= require('progress-bar'),
	bar		= ProgressBar.create(process.stdout),
	progress	= -1;

function advance(){
	if (++progress > 100){
		console.log('\nDone.');
		return;
	}
	bar.update(progress / 100);
	setTimeout(advance, 100);
}

advance();