int gSampleChannelButton::handle(int e)
{
	int ret = gClick::handle(e);
	switch (e) {
		case FL_DND_ENTER:
		case FL_DND_DRAG:
		case FL_DND_RELEASE: {
			ret = 1;
			break;
		}
		case FL_PASTE: {
      gSampleChannel *gch = (gSampleChannel*) parent();   
      SampleChannel  *ch  = gch->ch;
      int result = glue_loadChannel(ch, gTrim(gStripFileUrl(Fl::event_text())).c_str());
			if (result != SAMPLE_LOADED_OK)
				mainWin->keyboard->printChannelMessage(result);
			ret = 1;
			break;
		}
	}
	return ret;
}
Exemple #2
0
std::string gTrim(const char *f)
{
	std::string out = f;
	return gTrim(out);
}