Commit 4b7509f1 authored by Mark Hills's avatar Mark Hills
Browse files

A dummy deck for testing

parent 9938300e
......@@ -50,6 +50,7 @@ OBJS = controller.o \
cues.o \
deck.o \
device.o \
dummy.o \
excrate.o \
external.o \
index.o \
......
/*
* Copyright (C) 2014 Mark Hills <mark@xwax.org>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* version 2, as published by the Free Software Foundation.
*
* This program 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 version 2 for more details.
*
* You should have received a copy of the GNU General Public License
* version 2 along with this program; if not, write to the Free
* Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
* MA 02110-1301, USA.
*
*/
#include "dummy.h"
static unsigned int sample_rate(struct device *d)
{
return 48000;
}
static struct device_ops dummy_ops = {
.sample_rate = sample_rate,
};
void dummy_init(struct device *d)
{
device_init(d, &dummy_ops);
}
/*
* Copyright (C) 2014 Mark Hills <mark@xwax.org>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* version 2, as published by the Free Software Foundation.
*
* This program 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 version 2 for more details.
*
* You should have received a copy of the GNU General Public License
* version 2 along with this program; if not, write to the Free
* Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
* MA 02110-1301, USA.
*
*/
#ifndef DUMMY_H
#define DUMMY_H
#include "device.h"
void dummy_init(struct device *d);
#endif
......@@ -79,6 +79,11 @@ Use the given importer executable for subsequent decks.
.B \-s \fIpath\fR
Use the given scanner executable to scan subsequent music libraries.
.TP
.B \-\-dummy
Create a deck which is not connected to any audio device, used
for testing.
.TP
.B \-k
Lock into RAM any memory required for real-time use.
......
......@@ -30,6 +30,7 @@
#include "controller.h"
#include "device.h"
#include "dicer.h"
#include "dummy.h"
#include "interface.h"
#include "jack.h"
#include "library.h"
......@@ -95,7 +96,8 @@ static void usage(FILE *fd)
" -u Allow all operations when playing\n"
" --line Line level signal (default)\n"
" --phono Tolerate cartridge level signal ('software pre-amp')\n"
" -i <program> Importer (default '%s')\n\n",
" -i <program> Importer (default '%s')\n"
" --dummy Build a dummy deck with no audio device\n\n",
DEFAULT_IMPORTER);
#ifdef WITH_OSS
......@@ -383,6 +385,20 @@ int main(int argc, char *argv[])
argv += 2;
argc -= 2;
} else if (!strcmp(argv[0], "--dummy")) {
struct device *v;
v = start_deck("dummy");
if (v == NULL)
return -1;
dummy_init(v);
commit_deck();
argv++;
argc--;
} else if (!strcmp(argv[0], "-t")) {
/* Set the timecode definition to use */
......
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