From 7bc3653262a155abce1060a8a8b465ede0212b90 Mon Sep 17 00:00:00 2001 From: kevin Date: Mon, 11 Oct 2021 10:31:59 -0400 Subject: [PATCH] main.cpp.cfg : Initial 'preset_sel' app. --- src/cwtest/cfg/main.cfg | 130 ++++++++++++++++++++++++++++++++++++---- src/cwtest/main.cpp | 5 ++ 2 files changed, 122 insertions(+), 13 deletions(-) diff --git a/src/cwtest/cfg/main.cfg b/src/cwtest/cfg/main.cfg index cf257b3..19bd2db 100644 --- a/src/cwtest/cfg/main.cfg +++ b/src/cwtest/cfg/main.cfg @@ -72,18 +72,21 @@ }, - serial: [ - { - label: "port1", // User label - device: "/dev/ttyACM0", // Serial device name - baud: 38400, - bits: 8, - stop: 1, - parity: no, - pollPeriodMs: 50 - } - ], - + serial: { + + pollPeriodMs: 50, + recvBufByteN: 512, + array: [ + { + label: "port1", // User label + device: "/dev/ttyUSB0", // Serial device name + baud: 115200, + bits: 8, + stop: 1, + parity: no + } + ], + }, midi: { @@ -205,7 +208,9 @@ bits: 8, stop: 1, 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: [], + + } + + + } + + } diff --git a/src/cwtest/main.cpp b/src/cwtest/main.cpp index 69f0501..5a98178 100644 --- a/src/cwtest/main.cpp +++ b/src/cwtest/main.cpp @@ -26,6 +26,7 @@ #include "cwAudioFileProc.h" #include "cwPvAudioFileProc.h" #include "cwFlow.h" +#include "cwIoPresetSelApp.h" #if defined(cwWEBSOCK) #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) 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 ioPresetSelTest( const cw::object_t* cfg, const cw::object_t* args, int argc, const char* argv[] ) { return cw::preset_sel_app::main(args); } #else 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 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 #else 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 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 ioPresetSelTest( const cw::object_t* cfg, const cw::object_t* args, int argc, const char* argv[] ) { return _no_websock(); } #endif @@ -746,6 +750,7 @@ int main( int argc, const char* argv[] ) { "flow_test", flowTest }, { "flow_pv", flowTest }, { "flow_spec_dist", flowTest }, + { "preset_sel", ioPresetSelTest }, { "stub", stubTest }, { nullptr, nullptr } };