main.cpp.cfg : Initial 'preset_sel' app.

This commit is contained in:
kevin 2021-10-11 10:31:59 -04:00
parent 563d8a3ef8
commit 7bc3653262
2 changed files with 122 additions and 13 deletions

View File

@ -72,18 +72,21 @@
}, },
serial: [ serial: {
pollPeriodMs: 50,
recvBufByteN: 512,
array: [
{ {
label: "port1", // User label label: "port1", // User label
device: "/dev/ttyACM0", // Serial device name device: "/dev/ttyUSB0", // Serial device name
baud: 38400, baud: 115200,
bits: 8, bits: 8,
stop: 1, stop: 1,
parity: no, parity: no
pollPeriodMs: 50
} }
], ],
},
midi: { midi: {
@ -205,7 +208,9 @@
bits: 8, bits: 8,
stop: 1, stop: 1,
parity: no, parity: no,
pollPeriodMs: 50 pollPeriodMs: 50,
recvBufByteN: 512
} }
], ],
@ -1148,4 +1153,103 @@
} }
preset_sel: {
params: {
score_fn: "/home/kevin/src/currawong/projects/score_proc/data/play_file.cfg",
record_dir: "/home/kevin/temp/preset_sel_app",
record_folder: "record",
record_fn_ext: "am",
max_midi_msg_count: 32768,
midi_timer_period_micro_sec: 15000,
midi_out_device: "Fastlane"
midi_out_port: "Fastlane MIDI A",
audio_in_ch_map: [0, 1 ],
audio_out_ch_map: [0, 1 ]
},
ui: {
physRootDir: "/home/kevin/src/cwtest/src/libcw/html/preset_sel",
dfltPageFn: "index.html",
port: 5687,
rcvBufByteN: 2048,
xmtBufByteN: 2048,
fmtBufByteN: 4096,
websockTimeOutMs: 50, // max time out while blocking for a websock event
uiCfgFn: "ui.cfg" // default UI resource description
},
serial: [
{
pollPeriodMs: 50,
recvBufByteN: 512,
array: [
{
enable_flag: false,
label: "port1", // User label
device: "/dev/ttyUSB0", // Serial device name
baud: 115200,
bits: 8,
stop: 1,
parity: "no",
}
]
}
],
midi: {
parserBufByteN: 1024,
},
audio: {
meterMs: 50, // audio meter filter length and meter callback period
threadTimeOutMs: 50, // audio thread cond var time out
groupL: [
{
enableFl: true, // (req)
label: "main", // (req) User label
id: 0, // (req) User id (can also be set at runtime)
srate: 48000, // (req) Sample rate used by all devices in this group
dspFrameCnt: 64 // (req) Size of DSP processing buffers
}
],
deviceL: [
{
// System device name
//device: "Scarlett 18i20 USB USB Audio",
//device: "USB Audio CODEC USB Audio",
device: "HDA Intel PCH CS4208 Analog",
enableFl: true, // (req)
label: "main", // (req) User label
userId: 0, // (opt) User id (can also be set at runtime)
framesPerCycle: 512, // (req) Samples per audio device cycle
cycleCnt: 3, // (req) Count of device cycle buffers.
inGroup: "main", // (opt) All devices in a group must be 'ready' to source
outGroup: "main", // (opt) or sink data before an audio callback is made for that group
}
]
},
socket: {
maxSocketCnt: 10,
recvBufByteCnt: 4096,
threadTimeOutMs: 50,
socketL: [],
}
}
} }

View File

@ -26,6 +26,7 @@
#include "cwAudioFileProc.h" #include "cwAudioFileProc.h"
#include "cwPvAudioFileProc.h" #include "cwPvAudioFileProc.h"
#include "cwFlow.h" #include "cwFlow.h"
#include "cwIoPresetSelApp.h"
#if defined(cwWEBSOCK) #if defined(cwWEBSOCK)
#include "cwWebSock.h" #include "cwWebSock.h"
@ -392,10 +393,12 @@ cw::rc_t uiTest( const cw::object_t* cfg, const cw::object_t* args, int argc, co
#if defined(cwALSA) #if defined(cwALSA)
cw::rc_t ioTest( const cw::object_t* cfg, const cw::object_t* args, int argc, const char* argv[] ) { return cw::io::test(args); } cw::rc_t ioTest( const cw::object_t* cfg, const cw::object_t* args, int argc, const char* argv[] ) { return cw::io::test(args); }
cw::rc_t ioAudioMidiTest( const cw::object_t* cfg, const cw::object_t* args, int argc, const char* argv[] ) { return cw::audio_midi_app::main(args); } cw::rc_t ioAudioMidiTest( const cw::object_t* cfg, const cw::object_t* args, int argc, const char* argv[] ) { return cw::audio_midi_app::main(args); }
cw::rc_t ioPresetSelTest( const cw::object_t* cfg, const cw::object_t* args, int argc, const char* argv[] ) { return cw::preset_sel_app::main(args); }
#else #else
cw::rc_t _no_alsa_websock() { return cwLogError(cw::kResourceNotAvailableRC,"Websock or ALSA functionality not included in this build."); } cw::rc_t _no_alsa_websock() { return cwLogError(cw::kResourceNotAvailableRC,"Websock or ALSA functionality not included in this build."); }
cw::rc_t ioTest( const cw::object_t* cfg, const cw::object_t* args, int argc, const char* argv[] ) { return _no_alsa_websock(); } cw::rc_t ioTest( const cw::object_t* cfg, const cw::object_t* args, int argc, const char* argv[] ) { return _no_alsa_websock(); }
cw::rc_t ioAudioMidiTest( const cw::object_t* cfg, const cw::object_t* args, int argc, const char* argv[] ) { return _no_alsa_websock(); } cw::rc_t ioAudioMidiTest( const cw::object_t* cfg, const cw::object_t* args, int argc, const char* argv[] ) { return _no_alsa_websock(); }
cw::rc_t ioPresetSelTest( const cw::object_t* cfg, const cw::object_t* args, int argc, const char* argv[] ) { return _no_alsa_websock(); }
#endif #endif
#else #else
cw::rc_t _no_websock() { return cwLogError(cw::kResourceNotAvailableRC,"Websocket functionality not included in this build."); } cw::rc_t _no_websock() { return cwLogError(cw::kResourceNotAvailableRC,"Websocket functionality not included in this build."); }
@ -403,6 +406,7 @@ cw::rc_t websockSrvTest( const cw::object_t* cfg, const cw::object_t* args, i
cw::rc_t uiTest( const cw::object_t* cfg, const cw::object_t* args, int argc, const char* argv[] ) { return _no_websock(); } cw::rc_t uiTest( const cw::object_t* cfg, const cw::object_t* args, int argc, const char* argv[] ) { return _no_websock(); }
cw::rc_t ioTest( const cw::object_t* cfg, const cw::object_t* args, int argc, const char* argv[] ) { return _no_websock(); } cw::rc_t ioTest( const cw::object_t* cfg, const cw::object_t* args, int argc, const char* argv[] ) { return _no_websock(); }
cw::rc_t ioAudioMidiTest( const cw::object_t* cfg, const cw::object_t* args, int argc, const char* argv[] ) { return _no_websock(); } cw::rc_t ioAudioMidiTest( const cw::object_t* cfg, const cw::object_t* args, int argc, const char* argv[] ) { return _no_websock(); }
cw::rc_t ioPresetSelTest( const cw::object_t* cfg, const cw::object_t* args, int argc, const char* argv[] ) { return _no_websock(); }
#endif #endif
@ -746,6 +750,7 @@ int main( int argc, const char* argv[] )
{ "flow_test", flowTest }, { "flow_test", flowTest },
{ "flow_pv", flowTest }, { "flow_pv", flowTest },
{ "flow_spec_dist", flowTest }, { "flow_spec_dist", flowTest },
{ "preset_sel", ioPresetSelTest },
{ "stub", stubTest }, { "stub", stubTest },
{ nullptr, nullptr } { nullptr, nullptr }
}; };