@ -45,8 +45,7 @@ QtObject {
var streams = [ ]
for ( var i = 0 , length = instantiator . count ; i < length ; ++ i ) {
var stream = instantiator . objectAt ( i ) ;
if ( stream [ key ] === value
|| ( key === "appName" && stream [ key ] . toLowerCase ( ) === value . toLowerCase ( ) ) ) {
if ( stream [ key ] === value || ( key === "appName" && stream [ key ] . toLowerCase ( ) === value . toLowerCase ( ) ) ) {
streams . push ( stream ) ;
}
}
@ -58,7 +57,23 @@ QtObject {
}
function streamsForPid ( pid ) {
return findStreams ( "pid" , pid ) ;
var streams = findStreams ( "pid" , pid ) ;
if ( streams . length === 0 ) {
for ( var i = 0 , length = instantiator . count ; i < length ; ++ i ) {
var stream = instantiator . objectAt ( i ) ;
if ( stream . parentPid === - 1 ) {
stream . parentPid = backend . parentPid ( stream . pid ) ;
}
if ( stream . parentPid === pid ) {
streams . push ( stream ) ;
}
}
}
return streams ;
}
/ / Q t O b j e c t h a s n o d e f a u l t p r o p e r t y , h e n c e a d d i n g t h e I n s t a n t i a t o r t o o n e e x p l i c i t l y .
@ -70,10 +85,13 @@ QtObject {
delegate: QtObject {
readonly property int pid: Client ? Client . properties [ "application.process.id" ] : 0
/ / D e t e r m i n e d o n d e m a n d .
property int parentPid: - 1
readonly property string appName: Client ? Client . properties [ "application.name" ] : ""
readonly property bool muted: Muted
/ / w h e t h e r t h e r e i s n o t h i n g a c t u a l l y g o i n g o n o n t h a t s t r e a m
readonly property bool corked: Corked
readonly property int volume: Math . round ( pulseVolume / PulseAudio . NormalVolume * 100.0 )
readonly property int pulseVolume: Volume