As the subject said, what is the easiest way to programmatically change the master volume of my raspberry pie with lazarus? (the same master volume as the one on my task bar)Thanks!
procedure ExecProgram(cmd:string; OutputStrings:Tstrings);var P:TProcess;begin P:=TProcess.Create(Nil); try P.CommandLine:=cmd; if OutputStrings=Nil then P.Execute // just run, no output, not waiting else begin // run, wait and pipe the output of the program to TStrings P.Options:=P.Options+[poWaitOnExit,poUsePipes]; P.Execute; OutputStrings.LoadFromStream(P.Output); end; except // Error end; P.Free;end; procedure TrackBarSoundChange(Sender: TObject);//Change Sound Volume of the Master paybackvar Vol:string;begin if not amixer_Exists then exit; Vol:=IntToStr(TrackBarSound.Position)+'%'; ExecProgram('amixer -c 0 -- sset Master playback '+Vol,Nil)end;