Changeset - 8c82f13a3298
[Not reviewed]
default
2 3 0
drewp@bigasterisk.com - 20 months ago 2023-05-31 06:50:42
drewp@bigasterisk.com
rm or repair dead code (notes could come back)
5 files changed with 8 insertions and 76 deletions:
0 comments (0 inline, 0 general)
light9/effect/sequencer/note.py
Show inline comments
 
@@ -2,25 +2,25 @@ import bisect
 
import logging
 
import time
 
from dataclasses import dataclass
 
from decimal import Decimal
 
from typing import Any, Dict, List, Optional, Tuple, Union, cast
 
from light9.typedgraph import typedValue
 

	
 
from rdfdb.syncedgraph.syncedgraph import SyncedGraph
 
from rdflib import Literal
 

	
 
from light9.effect.settings import BareEffectSettings
 
from light9.namespaces import L9
 
from light9.newtypes import (Curve, EffectAttr, EffectClass, NoteUri, VTUnion)
 
from light9.newtypes import (Curve, EffectAttr, NoteUri, VTUnion)
 

	
 
log = logging.getLogger('sequencer')
 

	
 

	
 
def pyType(n):
 
    ret = n.toPython()
 
    if isinstance(ret, Decimal):
 
        return float(ret)
 
    return ret
 

	
 

	
 
def prettyFormat(x: Union[float, str]):
light9/effect/sequencer/note_test.py
Show inline comments
 
@@ -16,32 +16,32 @@ PREFIXES = '''
 
@prefix dmxA: <http://light9.bigasterisk.com/output/dmxA/> .
 
'''
 

	
 
FADER_GRAPH = PREFIXES + '''
 
    :fade1
 
        a :Fader;
 
        :effectClass effect:effect1;
 
        :effectAttr :strength;
 
        :value 0.6 .
 
'''
 

	
 

	
 
class TestUntimedFaderNote:
 
# class TestUntimedFaderNote:
 

	
 
    def test_returnsEffectSettings(self):
 
        g = MockSyncedGraph(FADER_GRAPH)
 
        n = Note(g, NoteUri(L9['fade1']), timed=False)
 
        out, report = n.outputCurrent()
 
        assert report['effectSettings'] == {'http://light9.bigasterisk.com/strength': 0.6}
 
        assert out == BareEffectSettings(s={EffectAttr(L9['strength']): 0.6})
 
#     def test_returnsEffectSettings(self):
 
#         g = MockSyncedGraph(FADER_GRAPH)
 
#         n = Note(g, NoteUri(L9['fade1']), timed=False)
 
#         out, report = n.outputCurrent()
 
#         assert report['effectSettings'] == {'http://light9.bigasterisk.com/strength': 0.6}
 
#         assert out == BareEffectSettings(s={EffectAttr(L9['strength']): 0.6})
 

	
 

	
 
NOTE_GRAPH = PREFIXES + '''
 
    :brightness
 
        a :DeviceAttr;
 
        rdfs:label "brightness";
 
        :dataType :scalar .
 

	
 
    :strength
 
        a :EffectAttr;
 
        rdfs:label "strength" .
 

	
light9/effect/sequencer/sequencer.py
Show inline comments
 
@@ -11,25 +11,24 @@ from typing import Callable, Coroutine, 
 

	
 
from louie import All, dispatcher
 
from rdfdb.syncedgraph.syncedgraph import SyncedGraph
 
from rdflib import URIRef
 
from twisted.internet import reactor
 
from twisted.internet.inotify import INotify
 
from twisted.python.filepath import FilePath
 

	
 
from light9.ascoltami.musictime_client import MusicTime
 
from light9.effect import effecteval
 
from light9.effect.sequencer import Note
 
from light9.effect.settings import DeviceSettings
 
from light9.effect.simple_outputs import SimpleOutputs
 
from light9.metrics import metrics
 
from light9.namespaces import L9, RDF
 
from light9.newtypes import NoteUri, Song
 

	
 
log = logging.getLogger('sequencer')
 

	
 

	
 
class StateUpdate(All):
 
    pass
 

	
 

	
 
class CodeWatcher:
light9/effect/simple_outputs.py
Show inline comments
 
deleted file
light9/effect/simple_outputs_test.py
Show inline comments
 
deleted file
0 comments (0 inline, 0 general)