Browse Source

some updates

master
Nils 6 months ago
parent
commit
97f6b6da78
  1. 4
      README.md
  2. 2
      calfbox
  3. 20
      tests/01.py
  4. 36
      tests/02.py
  5. 1
      tests/calfbox

4
README.md

@ -32,9 +32,13 @@ cd build
sudo meson install
```
You maybe need to run ldconfig after installing manually.
### Uninstall
```
cd build
sudo ninja uninstall
```
Don't forget to call ldconfig if you do a manual uninstall.

2
calfbox

@ -1 +1 @@
Subproject commit 59ac36808180249002d7468b4136fa5160627ec7
Subproject commit 96e5182b93243a009d240230e5e48243e0c156db

20
tests/01.py

@ -11,9 +11,23 @@ logging.basicConfig(level=logging.INFO) #this also sets _cbox2 logging level
#Without it will look for a vanilla "calfbox" library, but we are *-lss
os.environ["CALFBOXLIBABSPATH"] = os.path.abspath("../build/libcalfbox-lss.so")
from calfbox import cbox
#The cbox python files can be anywhere in the search path, which includes everything below the current path.
#In a real application the cbox python paths would be available relative to the root module, but
#since we are in the test directory we need to tell python where the files are.
#Variant 1
#sys.path.append(os.path.abspath("../calfbox/py/"))
#import cbox
#Variant 2
#sys.path.append(os.path.abspath("../calfbox/"))
#from py import cbox
#Variant 3
sys.path.append(os.path.abspath("../calfbox/"))
import py.nullbox #hardwires the cbox to a fake nullbox module and provides a "calfbox" parent module
#from calfbox import cbox #now we can import cbox but it really is the nullbox
from py import cbox #now we can import cbox but it really is the nullbox
def cmd_dumper(cmd, fb, args):
print ("%s(%s)" % (cmd, ",".join(list(map(repr,args)))))

36
tests/02.py

@ -0,0 +1,36 @@
#! /usr/bin/env python3
# -*- coding: utf-8 -*-
import os
import sys
import logging
logging.basicConfig(level=logging.INFO) #this also sets _cbox2 logging level
#_cbox2.py reads this environment variable and uses the lib directly.
#Without it will look for a vanilla "calfbox" library, but we are *-lss
os.environ["CALFBOXLIBABSPATH"] = os.path.abspath("../build/libcalfbox-lss.so")
#Variant 1
sys.path.append(os.path.abspath("../calfbox/py/"))
import cbox
def cmd_dumper(cmd, fb, args):
print ("%s(%s)" % (cmd, ",".join(list(map(repr,args)))))
cbox.init_engine("") #empty string for "no config file"
cbox.start_audio(cmd_dumper)
cbox.stop_audio()
cbox.shutdown_engine()
cbox.init_engine("")
cbox.start_audio(cmd_dumper)
cbox.stop_audio()
cbox.shutdown_engine()
cbox.init_engine("")
cbox.start_audio(cmd_dumper)
while True:
cbox.call_on_idle(cmd_dumper)

1
tests/calfbox

@ -1 +0,0 @@
/home/nils/lss/libcalfbox-lss/calfbox/py
Loading…
Cancel
Save