Skip to content

Commit

Permalink
added d to visual line mode
Browse files Browse the repository at this point in the history
  • Loading branch information
Nik Nyby committed May 17, 2009
1 parent 9518c3d commit e4fc68d
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 26 deletions.
52 changes: 27 additions & 25 deletions actions.c
Original file line number Diff line number Diff line change
Expand Up @@ -607,8 +607,7 @@ void act_clronething(void){

void act_clritall(void){
if(currtab == 0){
int ci;
for(ci = 0; ci < 4; ci++){
for(int ci = 0; ci < 4; ci++){
song[songy].track[ci] = 0;
song[songy].transp[ci] = 0;
}
Expand All @@ -630,28 +629,31 @@ void act_clritall(void){
saved = 0;
}

// clritall, parameterized
/*void act_clritall_p(){
if(currtab == 0){
int ci;
for(ci = 0; ci < 4; ci++){
song[songy].track[ci] = 0;
song[songy].transp[ci] = 0;
}
}else if(currtab == 1){
track[currtrack].line[tracky].note = 0;
track[currtrack].line[tracky].instr = 0;
SETHI(track[currtrack].line[tracky].instr, 0);
SETLO(track[currtrack].line[tracky].instr, 0);
track[currtrack].line[tracky].cmd[0] = 0;
SETHI(track[currtrack].line[tracky].param[0],0);
SETLO(track[currtrack].line[tracky].param[0],0);
track[currtrack].line[tracky].cmd[1] = 0;
SETHI(track[currtrack].line[tracky].param[1],0);
SETLO(track[currtrack].line[tracky].param[1],0);
}else if(currtab == 2){
instrument[currinstr].line[instry].cmd = '0';
instrument[currinstr].line[instry].param = 0;
// clear line y in the song tab
void act_clrinsongtab(int y){
for(int ci = 0; ci < 4; ci++){
song[songy].track[ci] = 0;
song[songy].transp[ci] = 0;
}
saved = 0;
}*/
}

void act_clrintracktab(int t, int y){
track[t].line[y].note = 0;
track[t].line[y].instr = 0;
SETHI(track[t].line[y].instr, 0);
SETLO(track[t].line[y].instr, 0);
track[t].line[y].cmd[0] = 0;
SETHI(track[t].line[y].param[0],0);
SETLO(track[t].line[y].param[0],0);
track[t].line[y].cmd[1] = 0;
SETHI(track[t].line[y].param[1],0);
SETLO(track[t].line[y].param[1],0);
saved = 0;
}

void act_clrininstrtab(int instr, int y){
instrument[instr].line[y].cmd = '0';
instrument[instr].line[y].param = 0;
saved = 0;
}
17 changes: 16 additions & 1 deletion modes.c
Original file line number Diff line number Diff line change
Expand Up @@ -1163,6 +1163,7 @@ void visualmode(void){
/* visual line mode */
void visuallinemode(void){
int c;
int min, max;
char buf[1024];
//NODE *firstnode, *lastnode;

Expand Down Expand Up @@ -1241,11 +1242,25 @@ void visuallinemode(void){
break;
// d: copy every line that is highlighted to the paste buffer and clear them, too
case 'd':
// TODO: call act_clritall_p() here
min = (highlight_firstline < highlight_lastline)?
highlight_firstline
: highlight_lastline;
max = (highlight_firstline < highlight_lastline)?
highlight_lastline
: highlight_firstline;
if(currtab == 0){
for(int i=min; i<=max; i++)
act_clrinsongtab(i);
}else if(currtab == 1){
for(int i=min; i<=max; i++)
act_clrintracktab(currtrack, i);
}else if(currtab == 2){
for(int i=min; i<=max; i++)
act_clrininstrtab(currinstr, i);
}
//snprintf(buf, sizeof(buf), "%d fewer lines", highlight_lineamount);
//infinitemsg = buf;
currmode = PM_NORMAL;
break;
// y: copy every line that is highlighted to the paste buffer
case 'y':
Expand Down
3 changes: 3 additions & 0 deletions pineapple.h
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,9 @@ void act_bigmvdown(void);
void act_bigmvup(void);
void act_clritall(void);
void act_clronething(void);
void act_clrinsongtab(int y);
void act_clrintracktab(int t, int y);
void act_clrininstrtab(int instr, int y);
void act_fxdec(void);
void act_fxinc(void);
void act_instrdec(void);
Expand Down

0 comments on commit e4fc68d

Please sign in to comment.