Пример #1
0
void ColorThread::run()
{
	BC_DisplayInfo info;
//printf("ColorThread::run 1\n");
	char window_title[BCTEXTLEN];

	strcpy(window_title, PROGRAM_NAME ": ");
	if(title)
		strcat(window_title, title);
	else
		strcat(window_title, _("Color Picker"));


	mutex->lock("ColorThread::run 1");
	window = new ColorWindow(this, 
		info.get_abs_cursor_x() - 200, 
		info.get_abs_cursor_y() - 200,
		window_title);
	window->create_objects();
	mutex->unlock();
	window->run_window();
	mutex->lock("lorThread::run 2");
	delete window;
	window = 0;
	mutex->unlock();
	completion->unlock();
}
Пример #2
0
int CDRipMain::get_parameters()
{
	int result, result2;

	result = 0;
	result2 = 1;

	while(result2 && !result)
	{
		{
			BC_DisplayInfo info;
//printf("CDRipMain::get_parameters 1\n");
			CDRipWindow window(this, info.get_abs_cursor_x(), info.get_abs_cursor_y());
//printf("CDRipMain::get_parameters 2\n");
			window.create_objects();
//printf("CDRipMain::get_parameters 3\n");
			result = window.run_window();
//printf("CDRipMain::get_parameters 4\n");
		}
		if(!result) result2 = get_toc();
//printf("CDRipMain::get_parameters 5 %d\n", result);
	}
	PluginAClient::sample_rate = 44100;
	return result;
}
Пример #3
0
int NormalizeMain::get_parameters()
{
	BC_DisplayInfo info;
	NormalizeWindow window(info.get_abs_cursor_x(), info.get_abs_cursor_y());
	window.create_objects(&db_over, &separate_tracks);
	int result = window.run_window();
	return result;
}
Пример #4
0
int ReFrame::get_parameters()
{
	BC_DisplayInfo info;
	ReFrameWindow window(this, info.get_abs_cursor_x(), info.get_abs_cursor_y());
	window.create_objects();
	int result = window.run_window();
	
	return result;
}
Пример #5
0
void PianoThread::run()
{
	BC_DisplayInfo info;
	window = new PianoWindow(synth, 
		info.get_abs_cursor_x() - 125, 
		info.get_abs_cursor_y() - 115);
	window->create_objects();
	int result = window->run_window();
	completion.unlock();
// Last command executed in thread
	if(result) synth->client_side_close();
}
void BlurZoomThread::run()
{
    BC_DisplayInfo info;
    window = new BlurZoomWindow(client,
                                info.get_abs_cursor_x() - 105,
                                info.get_abs_cursor_y() - 100);
    window->create_objects();
    gui_started.unlock();
    int result = window->run_window();
    completion.unlock();
// Last command executed in thread
    if(result) client->client_side_close();
}
Пример #7
0
int CDRipMain::open_drive()
{
	if((cdrom = open(device, O_RDONLY)) < 0)
	{
		BC_DisplayInfo info;
		ErrorBox window(PROGRAM_NAME ": CD Ripper",
			info.get_abs_cursor_x(), 
			info.get_abs_cursor_y());
		window.create_objects(_("Can't open cdrom drive."));
		window.run_window();
		return 1;
	}

	ioctl(cdrom, CDROMSTART);         // start motor
	return 0;
}
Пример #8
0
void PluginClientThread::run()
{
	BC_DisplayInfo info;
	int result = 0;
	if(client->window_x < 0) client->window_x = info.get_abs_cursor_x();
	if(client->window_y < 0) client->window_y = info.get_abs_cursor_y();
	window = client->new_window();

	if(window)
	{
		window->lock_window("PluginClientThread::run");
		window->create_objects();
		window->unlock_window();

/* Only set it here so tracking doesn't update it until everything is created. */
 		client->thread = this;
		init_complete->unlock();

		result = window->run_window();
		window->lock_window("PluginClientThread::run");
//printf("PluginClientThread::run %p %d\n", this, __LINE__);
		window->hide_window(1);
		window->unlock_window();


// Can't save defaults in the destructor because it's not called immediately
// after closing.
		/* if(client->defaults) */ client->save_defaults_xml();
/* This is needed when the GUI is closed from itself */
		if(result) client->client_side_close();
	}
	else
// No window
	{
 		client->thread = this;
		init_complete->unlock();
	}
}
Пример #9
0
int CDRipMain::get_toc()
{
// test CD
	int result = 0, i, tracks;
	struct cdrom_tochdr hdr;
	struct cdrom_tocentry entry[100];
	BC_DisplayInfo info;
	
	result = open_drive();
	
	if(ioctl(cdrom, CDROMREADTOCHDR, &hdr) < 0)
	{
		close(cdrom);
 		ErrorBox window(PROGRAM_NAME ": CD Ripper",
			info.get_abs_cursor_x(), 
			info.get_abs_cursor_y());
		window.create_objects(_("Can't get total from table of contents."));
		window.run_window();
		result = 1;
  	}

  	for(i = 0; i < hdr.cdth_trk1; i++)
  	{
		entry[i].cdte_track = 1 + i;
		entry[i].cdte_format = CDROM_LBA;
		if(ioctl(cdrom, CDROMREADTOCENTRY, &entry[i]) < 0)
		{
			ioctl(cdrom, CDROMSTOP);
			close(cdrom);
 			ErrorBox window(PROGRAM_NAME ": CD Ripper",
				info.get_abs_cursor_x(), 
				info.get_abs_cursor_y());
			window.create_objects(_("Can't get table of contents entry."));
			window.run_window();
			result = 1;
			break;
		}
  	}

  	entry[i].cdte_track = CDROM_LEADOUT;
  	entry[i].cdte_format = CDROM_LBA;
	if(ioctl(cdrom, CDROMREADTOCENTRY, &entry[i]) < 0)
	{
		ioctl(cdrom, CDROMSTOP);
		close(cdrom);
 		ErrorBox window(PROGRAM_NAME ": CD Ripper",
			info.get_abs_cursor_x(), 
			info.get_abs_cursor_y());
		window.create_objects(_("Can't get table of contents leadout."));
		window.run_window();
		result = 1;
	}
			
			
  	tracks = hdr.cdth_trk1+1;

	if(track1 <= 0 || track1 > tracks)
	{
		ioctl(cdrom, CDROMSTOP);
		close(cdrom);
 		ErrorBox window(PROGRAM_NAME ": CD Ripper",
			info.get_abs_cursor_x(), 
			info.get_abs_cursor_y());
		window.create_objects(_("Start track is out of range."));
		window.run_window();
		result = 1;
	}

// Clamp to highest track
	if(track2 > tracks)
	{
		track2 = tracks;
	}
	
	if(track2 < track1 || track2 <= 0)
	{
		ioctl(cdrom, CDROMSTOP);
		close(cdrom);
 		ErrorBox window(PROGRAM_NAME ": CD Ripper",
			info.get_abs_cursor_x(), 
			info.get_abs_cursor_y());
		window.create_objects(_("End track is out of range."));
		window.run_window();
		result = 1;
	}
	
	if(track1 == track2 && min2 == 0 && sec2 == 0)
	{
		ioctl(cdrom, CDROMSTOP);
		close(cdrom);
 		ErrorBox window(PROGRAM_NAME ": CD Ripper",
			info.get_abs_cursor_x(), 
			info.get_abs_cursor_y());
		window.create_objects(_("End position is out of range."));
		window.run_window();
		result = 1;
	}

	startlba = endlba = 0;
	if(!result)
	{
		startlba = entry[track1 - 1].cdte_addr.lba;
		startlba += (min1 * 44100 * 4 * 60 + sec1 * 44100 * 4) / FRAMESIZE;

		endlba = entry[track2 - 1].cdte_addr.lba;
		if(track2 < tracks)
		{
			endlba += (min2 * 44100 * 4 * 60 + sec2 * 44100 * 4) / FRAMESIZE;
		}
	}

//printf("CDRipMain::get_toc %ld %ld\n", startlba, endlba);
	close_drive();
	return result;
}