From eea896440e5ad49622c7b1a4095f0d63c3465aa2 Mon Sep 17 00:00:00 2001 From: "vincent.jeong" Date: Tue, 29 Dec 2015 02:28:00 +0900 Subject: - Refactoring Graph for AudioManagerMonitor 1) Redesign Graph object with method and property. 2) Remove unnecessary code. 3) Adjust offset of line color for AudioManagerGraph. 4) Draw Tranisent line of PulseAudioGraph according to play's status Signed-off-by: vincent.jeong Signed-off-by: Jooncheol Park --- Diagram.qml | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'Diagram.qml') diff --git a/Diagram.qml b/Diagram.qml index a320881..21f0a53 100644 --- a/Diagram.qml +++ b/Diagram.qml @@ -46,7 +46,7 @@ Item { onSinkInfoChanged: { console.log("onSinkInfoChanged " + sinkinfo.index + " Volume " + sinkinfo.volume); Code.savePASinkInfo(sinkinfo); - architectureDiagram.requestPaint(); + architectureDiagram.requestPaint(); audiomanagerChart.updateData(sinkinfo.name, sinkinfo.index, sinkinfo.volume); sinkInfoProcessed(0, sinkinfo.index); @@ -262,12 +262,13 @@ Item { id: audiomanagerChart graphName : "AudiomanagerChart" title: "Sinks of GENIVIĀ® Audio Manager" - description: "AM's Sink volume changes by Control Plugin" + description: "AM's Sink volume changes by Control Plugin" anchors.fill: parent defaultValue : 0 maxDataLength: 100 width: parent.width height: parent.height + type: Code.GraphType.CONTINUOUS_LINE } } @@ -281,13 +282,14 @@ Item { Graph { id: pulseaudioChart title: "Sink Inputs of PulseAudio" - description: "PA's Sink Input volume changes" + description: "PA's Sink Input volume changes" anchors.fill: parent graphName : "PulseAudioChart" defaultValue : 0 maxDataLength: 100 width: parent.width height: parent.height + type: Code.GraphType.TRANSIENT_LINE } } @@ -570,7 +572,7 @@ Item { } ); ctx.save(); - ctx.strokeStyle = Code.getGraphNodeData("AudiomanagerChart", sink.name).color; + ctx.strokeStyle = audiomanagerChart.getGraphNodeColor(sink.name); ctx.beginPath(); ctx.moveTo(tx+tw, ty+(th+th/4)*i+th/2); ctx.lineTo(tx+tw+tw*2/5, ty+(th+th/4)*i+th/2); @@ -626,7 +628,7 @@ Item { var sink = Code.paSinks[j]; if(sink.index == client.sinkInput.sinkIndex) { ctx.fillText(" Stream idx: "+sinkInput.index, tx+tw,ty+(th+th/4)*i+th/2); - ctx.strokeStyle = Code.getGraphNodeColor("PulseAudioChart", client.sinkInput.role); + ctx.strokeStyle = pulseaudioChart.getGraphNodeColor(client.sinkInput.role); ctx.beginPath(); ctx.moveTo(tx+tw,ty+(th+th/4)*i+th/2); ctx.lineTo(sinkJCX, sinkJCY+(sinkH+sinkH/4)*j+sinkH/2); -- cgit v1.2.1