File: reverse.c

package info (click to toggle)
gnusound 0.6.2-5
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 2,488 kB
  • ctags: 1,778
  • sloc: ansic: 21,146; sh: 2,505; xml: 527; makefile: 171; perl: 157
file content (35 lines) | stat: -rw-r--r-- 697 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
/*
 * Copyright (C) 2002,2003 Pascal Haakmat.
 */

#include "../modutils.h"

module modinfo;

module *
module_new() {
    MODULE_INIT(&modinfo, 
		"Reverse",
		"Pascal Haakmat",
		"Copyright (C) 2002,2003");
    return &modinfo;
}

action_group *
module_execute(shell *shl, 
               int undo) {
    int t, map = shl->select_channel_map;
    AFframecount start = shl->select_start, end = shl->select_end;

    rwlock_rlock(&shl->sr->rwl);
    for(t = 0; t < snd_track_count(shl->sr); t++) {
        if((1 << t) & map) {
            reverse(shl,
                    t,
                    start,
                    end);
        }
    }
    rwlock_runlock(&shl->sr->rwl);
    return NULL;
}