Example #1
0
static bool co_CB_PasteTrackFX(
	struct WBlocks *wblock,
	struct WTracks *wtrack,
	struct WTracks *towtrack
){
	struct Tracks *totrack;
	struct Tracks *track;
	Place *p1,p2;

        R_ASSERT_RETURN_IF_FALSE2(towtrack!=NULL, false);

	totrack=towtrack->track;
	track=wtrack->track;

        make_patches_usable(track);

        if (totrack->patch == NULL)
          totrack->patch = track->patch;
                      
	if(track->midi_instrumentdata!=NULL){
          totrack->midi_instrumentdata=MIDI_CopyInstrumentData(track);
	}

	VECTOR_clean(&totrack->fxs);

	p1=PlaceGetFirstPos();
	PlaceSetLastPos(wblock->block,&p2);

	CopyRange_fxs(&totrack->fxs,&track->fxs,p1,&p2);

	LegalizeFXlines(wblock->block,totrack);

	return true;
}
Example #2
0
bool CB_PasteTrack(
	struct WBlocks *wblock,
	struct WTracks *wtrack,
	struct WTracks *towtrack
){
	struct Tracks *totrack;
	struct Tracks *track;
	Place *p1,p2;

	if(towtrack==NULL){
		RError("Error in function CB_PasteTrack in file clipboard_track_paste.c; towtrack=NULL\n");
		return false;
	}

	totrack=towtrack->track;
	track=wtrack->track;

	towtrack->notelength=wtrack->notelength;
	towtrack->fxwidth=wtrack->fxwidth;

	totrack->patch=track->patch;
	totrack->onoff=track->onoff;
	totrack->pan=track->pan;
	totrack->volume=track->volume;
	totrack->panonoff=track->panonoff;
	totrack->volumeonoff=track->volumeonoff;

	if(track->midi_instrumentdata!=NULL){
          totrack->midi_instrumentdata=MIDI_CopyInstrumentData(track);
	}

	totrack->trackname=talloc_strdup(track->trackname);

	totrack->notes=NULL;
	totrack->stops=NULL;
	totrack->fxs=NULL;

	p1=PlaceGetFirstPos();
	PlaceSetLastPos(wblock->block,&p2);

	CopyRange_notes(&totrack->notes,track->notes,p1,&p2);
	CopyRange_stops(&totrack->stops,track->stops,p1,&p2);
	CopyRange_fxs(&totrack->fxs,track->fxs,p1,&p2);

	LegalizeFXlines(wblock->block,totrack);
	LegalizeNotes(wblock->block,totrack);

	return true;
}
Example #3
0
static bool paste_track(
                        struct WBlocks *wblock,
                        struct WTracks *wtrack,
                        struct WTracks *towtrack
                        )
{
        struct Tracks *totrack = towtrack->track;
        struct Tracks *track = wtrack->track;
        Place *p1,p2;

	towtrack->notelength=wtrack->notelength;
	towtrack->fxwidth=wtrack->fxwidth;

	totrack->onoff=track->onoff;
	totrack->pan=track->pan;
	totrack->volume=track->volume;
	totrack->panonoff=track->panonoff;
	totrack->volumeonoff=track->volumeonoff;
        ATOMIC_SET(totrack->midi_channel, ATOMIC_GET(track->midi_channel));
        
	if(track->midi_instrumentdata!=NULL){
          totrack->midi_instrumentdata=MIDI_CopyInstrumentData(track);
	}

	totrack->trackname=talloc_strdup(track->trackname);

	totrack->notes=NULL;
	totrack->stops=NULL;
	VECTOR_clean(&totrack->fxs);

	p1=PlaceGetFirstPos();
	PlaceSetLastPos(wblock->block,&p2);

	CopyRange_notes(&totrack->notes,track->notes,p1,&p2);
	CopyRange_stops(&totrack->stops,track->stops,p1,&p2);

        if (totrack->patch != NULL)
          CopyRange_fxs(&totrack->fxs,&track->fxs,p1,&p2);

	LegalizeFXlines(wblock->block,totrack);
	LegalizeNotes(wblock->block,totrack);

	return true;

}
Example #4
0
bool CB_PasteTrackFX(
                     struct WBlocks *wblock,
                     struct WTracks *wtrack,
                     struct WTracks *towtrack
){
	struct Tracks *totrack;
	struct Tracks *track;
	Place *p1,p2;

	if(towtrack==NULL){
		RError("Error in function CB_PasteTrack in file clipboard_track_paste.c; towtrack=NULL\n");
		return false;
	}

	totrack=towtrack->track;
	track=wtrack->track;

	if(totrack->patch==NULL){
		totrack->patch=track->patch;
	}

	totrack->patch=track->patch;

	if(track->midi_instrumentdata!=NULL){
          totrack->midi_instrumentdata=MIDI_CopyInstrumentData(track);
	}

	totrack->fxs=NULL;

	p1=PlaceGetFirstPos();
	PlaceSetLastPos(wblock->block,&p2);

	CopyRange_fxs(&totrack->fxs,track->fxs,p1,&p2);

	LegalizeFXlines(wblock->block,totrack);

	return true;
}