forked from xwax/xwax
-
Notifications
You must be signed in to change notification settings - Fork 0
/
deck.h
70 lines (55 loc) · 1.79 KB
/
deck.h
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
/*
* Copyright (C) 2021 Mark Hills <mark@xwax.org>
*
* This file is part of "xwax".
*
* "xwax" is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License, version 3 as
* published by the Free Software Foundation.
*
* "xwax" is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, see <https://www.gnu.org/licenses/>.
*
*/
#ifndef DECK_H
#define DECK_H
#include <math.h>
#include "cues.h"
#include "device.h"
#include "index.h"
#include "player.h"
#include "realtime.h"
#include "timecoder.h"
#define NO_PUNCH (HUGE_VAL)
struct deck {
struct device device;
struct timecoder timecoder;
const char *importer;
bool protect;
struct player player;
const struct record *record;
struct cues cues;
/* Punch */
double punch;
/* A controller adds itself here */
size_t ncontrol;
struct controller *control[4];
};
int deck_init(struct deck *deck, struct rt *rt,
struct timecode_def *timecode, const char *importer,
double speed, bool phono, bool protect);
void deck_clear(struct deck *deck);
bool deck_is_locked(const struct deck *deck);
void deck_load(struct deck *deck, struct record *record);
void deck_recue(struct deck *deck);
void deck_clone(struct deck *deck, const struct deck *from);
void deck_unset_cue(struct deck *deck, unsigned int label);
void deck_cue(struct deck *deck, unsigned int label);
void deck_punch_in(struct deck *d, unsigned int label);
void deck_punch_out(struct deck *d);
#endif