Commit 97ecdb5c authored by Mark Hills's avatar Mark Hills
Browse files

Make deck responsible for importer

parent b9b98004
......@@ -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);
......
......@@ -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);
......
......@@ -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;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment