Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Kiste
xwax
Commits
97ecdb5c
Commit
97ecdb5c
authored
May 18, 2014
by
Mark Hills
Browse files
Make deck responsible for importer
parent
b9b98004
Changes
3
Hide whitespace changes
Inline
Side-by-side
deck.c
View file @
97ecdb5c
...
...
@@ -41,17 +41,15 @@ static const struct record no_record = {
* A deck is a logical grouping of the various components which
* reflects the user's view on a deck in the system.
*
* Pre: deck->device
, deck->importer are
valid
* Pre: deck->device
is
valid
*/
int
deck_init
(
struct
deck
*
d
,
struct
rt
*
rt
,
struct
timecode_def
*
timecode
,
struct
timecode_def
*
timecode
,
const
char
*
importer
,
double
speed
,
bool
phono
,
bool
protect
)
{
unsigned
int
rate
;
assert
(
d
->
importer
!=
NULL
);
if
(
rt_add_device
(
rt
,
&
d
->
device
)
==
-
1
)
return
-
1
;
...
...
@@ -59,6 +57,8 @@ int deck_init(struct deck *d, struct rt *rt,
d
->
record
=
&
no_record
;
d
->
punch
=
NO_PUNCH
;
d
->
protect
=
protect
;
assert
(
importer
!=
NULL
);
d
->
importer
=
importer
;
rate
=
device_sample_rate
(
&
d
->
device
);
assert
(
timecode
!=
NULL
);
timecoder_init
(
&
d
->
timecoder
,
timecode
,
speed
,
rate
,
phono
);
...
...
deck.h
View file @
97ecdb5c
...
...
@@ -52,7 +52,7 @@ struct deck {
};
int
deck_init
(
struct
deck
*
deck
,
struct
rt
*
rt
,
struct
timecode_def
*
timecode
,
struct
timecode_def
*
timecode
,
const
char
*
importer
,
double
speed
,
bool
phono
,
bool
protect
);
void
deck_clear
(
struct
deck
*
deck
);
...
...
xwax.c
View file @
97ecdb5c
...
...
@@ -308,7 +308,6 @@ int main(int argc, char *argv[])
ld
=
&
deck
[
ndeck
];
device
=
&
ld
->
device
;
ld
->
importer
=
importer
;
/* Work out which device type we are using, and initialise
* an appropriate device. */
...
...
@@ -348,7 +347,7 @@ int main(int argc, char *argv[])
/* Connect up the elements to make an operational deck */
r
=
deck_init
(
ld
,
&
rt
,
timecode
,
speed
,
phono
,
protect
);
r
=
deck_init
(
ld
,
&
rt
,
timecode
,
importer
,
speed
,
phono
,
protect
);
if
(
r
==
-
1
)
return
-
1
;
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment