Experimental real-time audio and signal processing application development framework.
Go to file
2020-10-11 17:18:58 -04:00
dns_sd Changes to support autotools build. 2020-03-24 08:51:51 -04:00
html html/ui/ui.css/js : Initial commit. 2020-05-18 12:23:41 -04:00
study/serial Many changes and additions. 2019-12-24 10:05:24 -05:00
.gitignore .gitignore : updates 2020-03-23 10:51:18 -04:00
cwAudioBuf.cpp cwAudioBuf,cwAudioDeviceAlsa : Test functions now return error codes. 2020-09-27 10:27:32 -04:00
cwAudioBuf.h cwAudioBuf,cwAudioDeviceAlsa : Test functions now return error codes. 2020-09-27 10:27:32 -04:00
cwAudioBufDecls.h Added 'decls' include files to hold public declarations for audio,midi,serial,socket, and websock modules. 2020-03-23 10:41:28 -04:00
cwAudioDevice.cpp Added 'decls' include files to hold public declarations for audio,midi,serial,socket, and websock modules. 2020-03-23 10:41:28 -04:00
cwAudioDevice.h Added 'decls' include files to hold public declarations for audio,midi,serial,socket, and websock modules. 2020-03-23 10:41:28 -04:00
cwAudioDeviceAlsa.cpp cwAudioBuf,cwAudioDeviceAlsa : Test functions now return error codes. 2020-09-27 10:27:32 -04:00
cwAudioDeviceAlsa.h cwAudioBuf,cwAudioDeviceAlsa : Test functions now return error codes. 2020-09-27 10:27:32 -04:00
cwAudioDeviceDecls.h Added 'decls' include files to hold public declarations for audio,midi,serial,socket, and websock modules. 2020-03-23 10:41:28 -04:00
cwAudioDeviceTest.cpp Added 'decls' include files to hold public declarations for audio,midi,serial,socket, and websock modules. 2020-03-23 10:41:28 -04:00
cwAudioDeviceTest.h Added cw::audio::device::report(); 2020-02-12 13:22:48 -05:00
cwAudioFile.cpp cwAudioFile : Fixed memory leak. Added alloc/freeFloatBuf(). 2020-10-04 10:46:19 -04:00
cwAudioFile.h cwAudioFile : Fixed memory leak. Added alloc/freeFloatBuf(). 2020-10-04 10:46:19 -04:00
cwAudioFileOps.cpp cwAudioFileOps.cpp : Fixed error message text. 2020-10-07 10:56:07 -04:00
cwAudioFileOps.h cwAudioFileOps : Added convolve(), transformApp(), and 'gain' to cutAndMix(). 2020-10-04 10:50:43 -04:00
cwAvahiSurface.cpp Updated dns_sd/ to match the Arduino build. 2020-02-13 11:29:52 -05:00
cwCommon.h cwVectOps.h : Initial commit. 2020-09-22 11:37:19 -04:00
cwCommonImpl.cpp Initial commit 2019-12-18 22:24:12 -05:00
cwCommonImpl.h Makefile.am,cwCommonImpl.h : Implement use of cwWEB 2020-10-04 20:05:31 +00:00
cwDataSets.cpp cwDataSets.h/cpp : Initial commit. MNIST dataset implementation. 2020-08-19 20:10:35 -04:00
cwDataSets.h cwDataSets.h/cpp : Initial commit. MNIST dataset implementation. 2020-08-19 20:10:35 -04:00
cwDnsSd.cpp cwTime.h/cpp,cwDnsSd.cpp,cwMdns.cpp : Changed cwTime interface to use all references rather than pointers as arguments. 2020-04-17 11:16:21 -04:00
cwDnsSd.h cwUtility, cwDnsSd, cwEuCon : Initial commit. 2020-02-12 13:43:00 -05:00
cwDsp.cpp Makefile.am,cwDsp,cwFFT: Updates to make FFTW optional. 2020-10-11 17:18:58 -04:00
cwDsp.h Makefile.am,cwDsp,cwFFT: Updates to make FFTW optional. 2020-10-11 17:18:58 -04:00
cwEuCon.cpp cwEuCon.cpp : Change mute id's to indicate source. 2020-05-19 20:51:20 -04:00
cwEuCon.h cwEuCon.h/cpp : Implemented sendMsg() and use cwEuConDecls.h. 2020-05-14 11:13:07 -04:00
cwEuConDecls.h cwEuConDecls.h : Changed kMuteEuconId to kEucMuteEuconId and added kFdrMuteEuconId. 2020-05-19 20:44:35 -04:00
cwFFT.cpp Makefile.am,cwDsp,cwFFT: Updates to make FFTW optional. 2020-10-11 17:18:58 -04:00
cwFFT.h Makefile.am,cwDsp,cwFFT: Updates to make FFTW optional. 2020-10-11 17:18:58 -04:00
cwFile.cpp cwFile.cpp : Changed fnToStr() to properly close() the source file handle. 2020-04-06 19:16:09 -04:00
cwFile.h cwFile.h : Set read/write???() cnt to default to 1. 2020-08-19 20:06:17 -04:00
cwFileSys.cpp cwFileSystem.cpp : Fixed but in exapndPath() that rejected paths with spaces. 2020-10-04 10:48:50 -04:00
cwFileSys.h cwFileSys.h/cpp : Added makeDir(). 2020-09-01 15:46:21 -04:00
cwIo.cpp cwObject.h/cpp : Added newPairObject(), typeid: kCStringTId, changed list_ele() to child_ele() 2020-04-06 19:15:03 -04:00
cwIo.h cwSocket.h/cpp : Changed name of cbId_t to cbOpId_t 2020-04-01 10:46:31 -04:00
cwIoTest.cpp cwIo* : Updates to include 'decl' files in header and initial sketch of interface. 2020-03-23 13:14:42 -04:00
cwIoTest.h cwIo.h/cpp, cwIoTest.h/cpp : Initial commit. 2020-01-27 17:53:44 -05:00
cwLex.cpp Standardized filesys and mem namespaces. 2019-12-27 21:51:28 -05:00
cwLex.h Initial implementation cwTcpSocket* 2019-12-27 16:52:45 -05:00
cwLib.cpp Changes to support autotools build. 2020-03-24 08:51:51 -04:00
cwLib.h cwLib.h/cpp, cwMutex.h/cpp : Initial commit. 2020-03-04 14:05:54 -05:00
cwLog.cpp cwFileSys.h/cpp : Added makeDir(). 2020-09-01 15:46:21 -04:00
cwLog.h cwFileSys.h/cpp : Added makeDir(). 2020-09-01 15:46:21 -04:00
cwMdns.cpp cwTime.h/cpp,cwDnsSd.cpp,cwMdns.cpp : Changed cwTime interface to use all references rather than pointers as arguments. 2020-04-17 11:16:21 -04:00
cwMdns.h cwMdns.h/cpp : Initial commit. 2020-01-27 17:51:38 -05:00
cwMem.cpp cwMem.h : Expanded allocDupl() interfaces. Added printp(),appendStr() 2020-08-19 20:08:14 -04:00
cwMem.h cwMem.h : Expanded allocDupl() interfaces. Added printp(),appendStr() 2020-08-19 20:08:14 -04:00
cwMidi.cpp Added 'decls' include files to hold public declarations for audio,midi,serial,socket, and websock modules. 2020-03-23 10:41:28 -04:00
cwMidi.h Added 'decls' include files to hold public declarations for audio,midi,serial,socket, and websock modules. 2020-03-23 10:41:28 -04:00
cwMidiAlsa.cpp Added 'decls' include files to hold public declarations for audio,midi,serial,socket, and websock modules. 2020-03-23 10:41:28 -04:00
cwMidiDecls.h Added 'decls' include files to hold public declarations for audio,midi,serial,socket, and websock modules. 2020-03-23 10:41:28 -04:00
cwMidiPort.cpp Added 'decls' include files to hold public declarations for audio,midi,serial,socket, and websock modules. 2020-03-23 10:41:28 -04:00
cwMidiPort.h Added 'decls' include files to hold public declarations for audio,midi,serial,socket, and websock modules. 2020-03-23 10:41:28 -04:00
cwMpScNbQueue.h cwMpScNbQueue.h : Added comments. 2020-01-27 17:50:02 -05:00
cwMtx.cpp cwMtx.h,cpp : Added slice() and derivatives. 2020-09-22 13:33:32 -04:00
cwMtx.h cwMtx.h,cpp : Added slice() and derivatives. 2020-09-22 13:33:32 -04:00
cwMutex.cpp cwLib.h/cpp, cwMutex.h/cpp : Initial commit. 2020-03-04 14:05:54 -05:00
cwMutex.h cwLib.h/cpp, cwMutex.h/cpp : Initial commit. 2020-03-04 14:05:54 -05:00
cwNbMem.cpp cwNbMem.h/cpp : Initial commit. 2020-01-27 17:51:56 -05:00
cwNbMem.h cwNbMem.h/cpp : Initial commit. 2020-01-27 17:51:56 -05:00
cwNN.cpp cwNN.h/cpp/Makefile.am : Initial commit. 2020-08-19 20:12:51 -04:00
cwNN.h cwNN.h/cpp/Makefile.am : Initial commit. 2020-08-19 20:12:51 -04:00
cwNumericConvert.h cwNumericConvert.h : min range limit in numeric_convert() changed from double.min() to 0. See note in source. 2020-04-28 16:38:43 -04:00
cwObject.cpp cwObject.cpp : Allow 'null' objects to be converted to a null ptr to a string. 2020-10-07 10:55:34 -04:00
cwObject.h cwVectOps.h : Initial commit. 2020-09-22 11:37:19 -04:00
cwObjectTemplate.h cwObject.h/cpp : Added newPairObject(), typeid: kCStringTId, changed list_ele() to child_ele() 2020-04-06 19:15:03 -04:00
cwSerialPort.cpp cwSerialPort.cpp : fix bug where the incorrect byte count could be sent on a receive callback. 2020-03-16 22:54:14 -04:00
cwSerialPort.h Added 'decls' include files to hold public declarations for audio,midi,serial,socket, and websock modules. 2020-03-23 10:41:28 -04:00
cwSerialPortDecls.h Added 'decls' include files to hold public declarations for audio,midi,serial,socket, and websock modules. 2020-03-23 10:41:28 -04:00
cwSerialPortSrv.cpp cwSerialPort.h/cpp,cwSerialPortSrv.h/cpp : serialPort now manages multiple ports. 2020-03-05 22:04:53 -05:00
cwSerialPortSrv.h cwSerialPort.h/cpp,cwSerialPortSrv.h/cpp : serialPort now manages multiple ports. 2020-03-05 22:04:53 -05:00
cwSocket.cpp cwSocket.cpp : Log a warning if the socket to destroy() is not found. 2020-04-17 14:05:14 -04:00
cwSocket.h cwSocket.h/cpp : Changed name of cbId_t to cbOpId_t 2020-04-01 10:46:31 -04:00
cwSocketDecls.h cwSocket.h/cpp : Changed name of cbId_t to cbOpId_t 2020-04-01 10:46:31 -04:00
cwSpScBuf.cpp cwSpScBuf.cpp : Fixed signed/unsigned compare. 2020-04-16 11:11:23 -04:00
cwSpScBuf.h cwSpScBuf.h/cpp, cwThreadMach.h/cpp : initial commit. 2020-04-09 21:06:44 -04:00
cwSpScQueueTmpl.cpp cwSpScQueueTmpl.cpp : _consumer() now reads all available records. 2020-04-19 15:43:07 -04:00
cwSpScQueueTmpl.h cwSpScQueueTmpl.h : Change operation such that get() ony returns empty records. 2020-04-19 15:17:11 -04:00
cwString.cpp cwString, cwDsp : Initial commit. 2020-10-04 10:48:27 -04:00
cwString.h cwString, cwDsp : Initial commit. 2020-10-04 10:48:27 -04:00
cwSvg.cpp cwSvg.h/cpp : Initial commit. 2020-08-19 20:11:29 -04:00
cwSvg.h cwSvg.h/cpp : Initial commit. 2020-08-19 20:11:29 -04:00
cwTcpSocket.cpp cwTcpSocket.cpp : Fixed signed/unsigned compare. 2020-04-16 11:11:09 -04:00
cwTcpSocket.h cwTcpSocket.h/cpp : Remove the handle_t argument in initAddr() 2020-03-16 22:52:21 -04:00
cwTcpSocketSrv.cpp Many changes and additions to cwTcpSocket* to support MDNS and DNS-SD operations. 2020-02-12 13:25:13 -05:00
cwTcpSocketSrv.h Many changes and additions to cwTcpSocket* to support MDNS and DNS-SD operations. 2020-02-12 13:25:13 -05:00
cwTcpSocketTest.cpp Many changes and additions to cwTcpSocket* to support MDNS and DNS-SD operations. 2020-02-12 13:25:13 -05:00
cwTcpSocketTest.h Many changes and additions to cwTcpSocket* to support MDNS and DNS-SD operations. 2020-02-12 13:25:13 -05:00
cwText.cpp cwText.h/cpp : Added textAppend() and textJoin(). 2020-08-19 20:12:19 -04:00
cwText.h cwText.h/cpp : Added textAppend() and textJoin(). 2020-08-19 20:12:19 -04:00
cwTextBuf.cpp Standardized filesys and mem namespaces. 2019-12-27 21:51:28 -05:00
cwTextBuf.h Many changes and additions. 2019-12-24 10:05:24 -05:00
cwThread.cpp cwThread.cpp : Made stateId and doFlags atomic. 2020-04-19 13:01:47 -04:00
cwThread.h cwThread.h/cpp : thread_id_t is changed form unsigned to unsigned long long. 2020-01-27 17:50:57 -05:00
cwThreadMach.cpp cwSpScBuf.cpp, cwThreadMach.cpp : Initial working version of spsc_buf and thread_mach. 2020-04-09 22:47:26 -04:00
cwThreadMach.h cwSpScBuf.h/cpp, cwThreadMach.h/cpp : initial commit. 2020-04-09 21:06:44 -04:00
cwTime.cpp cwVectOps.h : Initial commit. 2020-09-22 11:37:19 -04:00
cwTime.h cwVectOps.h : Initial commit. 2020-09-22 11:37:19 -04:00
cwUi.cpp cwUi.h/cpp : Added single element creation functions which take there values from the system rather than setting them from their default value. 2020-05-18 11:03:42 -04:00
cwUi.h cwUi.h/cpp : Added single element creation functions which take there values from the system rather than setting them from their default value. 2020-05-18 11:03:42 -04:00
cwUiDecls.h cwUi* : Initial implementation. 2020-03-23 10:50:10 -04:00
cwUiTest.cpp cwUi.h/cpp : Added single element creation functions which take there values from the system rather than setting them from their default value. 2020-05-18 11:03:42 -04:00
cwUiTest.h cwUi* : Initial implementation. 2020-03-23 10:50:10 -04:00
cwUtility.cpp cwUtility : Added powerOfTwo() functions. 2020-10-04 10:47:03 -04:00
cwUtility.h cwUtility : Added powerOfTwo() functions. 2020-10-04 10:47:03 -04:00
cwVectOps.h cwVectOps.h : Added new version of seq(), phasor(), and sine(). 2020-10-04 10:47:39 -04:00
cwWebSock.cpp cwWebSock.cpp : callExpandPath() on physRootDir. 2020-04-21 17:55:40 -04:00
cwWebSock.h cwWebSock.h/cpp : Added 'sessionId' to send() (and msg_t) to allow a message to be sent to a specific endpoint. 2020-03-31 12:53:14 -04:00
cwWebSockDecls.h Added 'decls' include files to hold public declarations for audio,midi,serial,socket, and websock modules. 2020-03-23 10:41:28 -04:00
cwWebSockSvr.cpp cwWebSock.h/cpp : Added 'sessionId' to send() (and msg_t) to allow a message to be sent to a specific endpoint. 2020-03-31 12:53:14 -04:00
cwWebSockSvr.h Implemented filesys::dirEntries() 2019-12-27 23:35:39 -05:00
Makefile.am Makefile.am,cwDsp,cwFFT: Updates to make FFTW optional. 2020-10-11 17:18:58 -04:00
README.md README.md : Updates 2020-04-28 16:38:54 -04:00

To Do

  • Any socket function which takes a IP/port address should have a version which also takes a sockaddr_in*.

  • Fix the time functions to make them more convenient and C++ish.

  • implement floating point UI numbers

  • UI needs a special UUID (not kInvalidId) to specify the 'root' UI element. See note in cwUi._createFromObj()

  • Look at 'BUG' warnings in cwNumericConvert.h.

  • cwObject must be able to parse without dynamic memory allocation into a fixed buffer

  • cwObject must be able to be composed without dynamic memory allocation or from a fixed buffer.

  • cwWebsock is allocating memory on send().

  • cwWebsock: if the size of the recv and xmt buffer, as passed form the protocolArray[], is too small send() will fail without an error message. This is easy to reproduce by simply decreasing the size of the buffers in the protocol array.

  • Clean up the cwObject namespace - add an 'object' namespace inside 'cw'

  • Add underscore to the member variables of object_t.

  • logDefaultFormatter() in cwLog.cpp uses stack allocated memory in a way that could easily be exploited.

  • lexIntMatcher() in cwLex.cpp doesn't handle 'e' notation correctly. See note in code.

  • numeric_convert() in cwNumericConvert.h could be made more efficient using type_traits.

  • numeric_convert() d_min is NOT zero, it's smallest positive number, this fails when src == 0. min value is now set to zero.

  • The UI app id map should be validated after the UI is created. In otherwords the parent/child pairs shoud actually exists.

  • Add an ui::appIdToUuId() that returns the first matching appId, and then optionally looks for duplicates as an error checking scheme.

  • thread needs setters and getters for internal variables

  • change cwMpScNbQueue so that it does not require 'new'.

  • cwAudioBuf.cpp - the ch->fn in update() does not have the correct memory fence.

  • change file names to match object names

  • (DONE) change all NULL's to nullptr

  • (DONE) implement kTcpFl in cwTcpSocket.cpp

UI Control Creation Protocol

The UI elements have four identifiers:

uuId - An integer which is unique among all identifiers for a given cwUi object. appId - A constant (enumerated) id assigned by the application. Unique among siblings. jsId - A string id used by Javascript to identify a control. Unique among siblings. jsUuId - An integer which is unique among all identifers for the browser representation of a given cwUi object.

The 'jsId' is selected by the application when the object is created. The 'jsUuId' is generated by the JS client when the UI element is created. The 'uuId' is generated by the UI server when the JS client registers the control. The 'appId' is assigned by the UI server when the JS client regsiters the control.

Client sends 'init' message.
Server sends 'create' messages.
Client sends 'register' messages.
Server send' 'id_assign' messages.

sockaddr_in reference

#include <netinet/in.h>

struct sockaddr_in {
    short            sin_family;   // e.g. AF_INET
    unsigned short   sin_port;     // e.g. htons(3490)
    struct in_addr   sin_addr;     // see struct in_addr, below
    char             sin_zero[8];  // zero this if you want to
};

struct in_addr { unsigned long s_addr; // load with inet_aton() };

Development Setup

  1. Install libwebsockets.
    sudo dnf install g++ openssl-devel cmake
    cd sdk
    git clone https://libwebsockets.org/repo/libwebsockets
    cd libwebsockets
    mkdir build
    cd build
    cmake -DCMAKE_INSTALL_PREFIX:PATH=/home/kevin/sdk/libwebsockets/build/out ..
  1. Environment setup:

    export LD_LIBRARY_PATH=~/sdk/libwebsockets/build/out/lib

Raspberry Pi Build Notes:

cd sdk
mkdir libwebsockets
cmake -DCMAKE_INSTALL_PREFIX:PATH=/home/pi/sdk/libwebsockets/build/out -DLWS_WITH_SSL=OFF ..
make
sudo make install

apt install libasound2-dev