9bdc4fc6f1
to support cwIoPresetSelApp. |
||
---|---|---|
dns_sd | ||
html | ||
study | ||
.gitignore | ||
cwAudioBuf.cpp | ||
cwAudioBuf.h | ||
cwAudioBufDecls.h | ||
cwAudioDevice.cpp | ||
cwAudioDevice.h | ||
cwAudioDeviceAlsa.cpp | ||
cwAudioDeviceAlsa.h | ||
cwAudioDeviceDecls.h | ||
cwAudioDeviceTest.cpp | ||
cwAudioDeviceTest.h | ||
cwAudioFile.cpp | ||
cwAudioFile.h | ||
cwAudioFileOps.cpp | ||
cwAudioFileOps.h | ||
cwAudioFileProc.cpp | ||
cwAudioFileProc.h | ||
cwAudioTransforms.cpp | ||
cwAudioTransforms.h | ||
cwAvahiSurface.cpp | ||
cwCommon.h | ||
cwCommonImpl.cpp | ||
cwCommonImpl.h | ||
cwDataSets.cpp | ||
cwDataSets.h | ||
cwDnsSd.cpp | ||
cwDnsSd.h | ||
cwDsp.cpp | ||
cwDsp.h | ||
cwDspTransforms.cpp | ||
cwDspTransforms.h | ||
cwDspTypes.h | ||
cwEuCon.cpp | ||
cwEuCon.h | ||
cwEuConDecls.h | ||
cwFFT.cpp | ||
cwFFT.h | ||
cwFile.cpp | ||
cwFile.h | ||
cwFileSys.cpp | ||
cwFileSys.h | ||
cwFlow.cpp | ||
cwFlow.h | ||
cwFlowProc.cpp | ||
cwFlowProc.h | ||
cwFlowTypes.cpp | ||
cwFlowTypes.h | ||
cwIo.cpp | ||
cwIo.h | ||
cwIoAudioMidi.cpp | ||
cwIoAudioMidi.h | ||
cwIoAudioMidiApp.cpp | ||
cwIoAudioMidiApp.h | ||
cwIoAudioPanel.cpp | ||
cwIoAudioPanel.h | ||
cwIoAudioRecordPlay.cpp | ||
cwIoAudioRecordPlay.h | ||
cwIoMidiRecordPlay.cpp | ||
cwIoMidiRecordPlay.h | ||
cwIoSocketChat.cpp | ||
cwIoSocketChat.h | ||
cwIoTest.cpp | ||
cwIoTest.h | ||
cwLex.cpp | ||
cwLex.h | ||
cwLib.cpp | ||
cwLib.h | ||
cwLog.cpp | ||
cwLog.h | ||
cwMath.cpp | ||
cwMath.h | ||
cwMdns.cpp | ||
cwMdns.h | ||
cwMem.cpp | ||
cwMem.h | ||
cwMidi.cpp | ||
cwMidi.h | ||
cwMidiAlsa.cpp | ||
cwMidiDecls.h | ||
cwMidiFile.cpp | ||
cwMidiFile.h | ||
cwMidiPort.cpp | ||
cwMidiPort.h | ||
cwMpScNbQueue.h | ||
cwMpScQueue.h | ||
cwMtx.cpp | ||
cwMtx.h | ||
cwMutex.cpp | ||
cwMutex.h | ||
cwNbMem.cpp | ||
cwNbMem.h | ||
cwNN.cpp | ||
cwNN.h | ||
cwNumericConvert.h | ||
cwObject.cpp | ||
cwObject.h | ||
cwObjectTemplate.h | ||
cwPvAudioFileProc.cpp | ||
cwPvAudioFileProc.h | ||
cwSerialPort.cpp | ||
cwSerialPort.h | ||
cwSerialPortDecls.h | ||
cwSerialPortSrv.cpp | ||
cwSerialPortSrv.h | ||
cwSocket.cpp | ||
cwSocket.h | ||
cwSocketDecls.h | ||
cwSpScBuf.cpp | ||
cwSpScBuf.h | ||
cwSpScQueueTmpl.cpp | ||
cwSpScQueueTmpl.h | ||
cwString.cpp | ||
cwString.h | ||
cwSvg.cpp | ||
cwSvg.h | ||
cwTcpSocket.cpp | ||
cwTcpSocket.h | ||
cwTcpSocketSrv.cpp | ||
cwTcpSocketSrv.h | ||
cwTcpSocketTest.cpp | ||
cwTcpSocketTest.h | ||
cwText.cpp | ||
cwText.h | ||
cwTextBuf.cpp | ||
cwTextBuf.h | ||
cwThread.cpp | ||
cwThread.h | ||
cwThreadMach.cpp | ||
cwThreadMach.h | ||
cwTime.cpp | ||
cwTime.h | ||
cwUi.cpp | ||
cwUi.h | ||
cwUiDecls.h | ||
cwUiTest.cpp | ||
cwUiTest.h | ||
cwUtility.cpp | ||
cwUtility.h | ||
cwVariant.cpp | ||
cwVariant.h | ||
cwVectOps.h | ||
cwWebSock.cpp | ||
cwWebSock.h | ||
cwWebSockDecls.h | ||
cwWebSockSvr.cpp | ||
cwWebSockSvr.h | ||
Makefile.am | ||
README.md |
To Do
-
Should a warning be issued by audioBuf functions which return a set of values: muteFlags(),toneFlags(), gain( ... gainA) but where the size of the dest array does not match the actual number of channesl?
-
Document the meaning and way that id's and names/labels are used, and intended to be used, and found by UI. As it is they are confusing.
-
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
-
Replace 24 bit read/write in cwAudioFile.cpp
-
Remove Audio file operations that have been superceded by 'flow' framework.
-
(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
- 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 ..
-
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
Flow Notes:
-
Add a version of var_register() that both registers and returns the value of the variable.
-
When a variable has a variant with a numberic channel should the 'all' channel variant be removed?
-
Check for duplicate 'vid'-'chIdx' pairs in var_regster(). (The concatenation of 'vid' and 'chIdx' should be unique
-
When a proc. goes into exec state there should be a guarantee that all registered variables can be successfully read. No error checking should be required.
(How about source variables? these can never be written.)
-
Make an example of a repeating input port. For example a mixer than takes audio input from multiple processors.
-
Make an example of a proc that has a generic port which allows any type, or a collection of specific types, to pass through. For example a 'selector' (n inputs, 1 output) or a router (1 signal to n outputs)
-
Create a master cross-fader.
Flow Instance Creation:
- Create all vars from the class description and initially set their value to the default value given in the class. chIdx=kAnyChIdx.
Note that all vars must be included in the class description.
- Apply the preset record from the class description according to the label given in the instance definition.
If the variable valures are given as a scalar then the existing variable is simply given a new value.
If the variable values are given as a list then new variables records will be created with explicit channels based on the index of the value in the list. This is referred to as 'channelizing' the variable because the variable will then be represented by multiple physical variable records - one for each channel. This means that all variables will have their initial record, with the chIdx set to 'any', and then they may also have further variable records will for each explicit channel number. The complete list of channelized variable record is kept, in channel order, using the 'ch_link' links with the base of the list on the 'any' record.
-
Apply the variable values defined in the instance 'args' record. This application is treated similarly to the 'class' preset. If the variable value is presented in a list then the value is assigned to a specific channel if the channel already exists then the value is simply replaced, if the channel does not exist then the variable is 'channelized'.
-
The varaibles listed in the 'in' list of the instance cfg. are connected to their source variables.
-
The custom class constructor is run for the instance.
Within the custom class constructor the variables to be used by the instance are 'registered' via var_register(). Registering a variable allows the variable to be assigned a constant id with which the instance can access the variable very efficiently.
If the channel associated with the registered variable does not yet exist for the variable then a channelized variable is first created before registering the variable.
- The internal variable id map is created to implement fast access to registered variables.