func (s *Source) GetMeter() *Meter { id := fmt.Sprintf("source%d", s.core.Index) m, ok := meters[id] if !ok { core := pulse.NewSourceMeter(pulse.GetContext(), s.core.Index) core.ConnectChanged(func(v float64) { m.setPropVolume(v) }) m = NewMeter(id, core) dbus.InstallOnSession(m) meters[id] = m } return m }
func Start() { if _audio != nil { return } logger.BeginTracing() ctx := pulse.GetContext() _audio = NewAudio(ctx) if err := dbus.InstallOnSession(_audio); err != nil { logger.Error("Failed InstallOnSession:", err) finalize() return } }