1 // VoRS -- Vo(IP) Really Simple
2 // Copyright (C) 2024 Sergey Matveev <stargrave@stargrave.org>
4 // This program is free software: you can redistribute it and/or modify
5 // it under the terms of the GNU Affero General Public License as
6 // published by the Free Software Foundation, version 3 of the License.
8 // This program is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 // GNU General Public License for more details.
13 // You should have received a copy of the GNU General Public License
14 // along with this program. If not, see <http://www.gnu.org/licenses/>.
22 "github.com/jroimartin/gocui"
28 GUIReadyC = make(chan struct{})
32 func guiQuit(gui *gocui.Gui, v *gocui.View) error {
37 func mute(gui *gocui.Gui, v *gocui.View) error {
42 func guiLayout(gui *gocui.Gui) error {
44 maxX, GUIMaxY = gui.Size()
46 v, err := gui.SetView("logs", 0, prevY, maxX-1, prevY+10+2)
49 if err != gocui.ErrUnknownView {
52 v.Title = fmt.Sprintf("Logs name=%s room=%s", *Name, *Room)
55 sids := make([]int, 0, len(Streams))
56 for sid := range Streams {
57 sids = append(sids, int(sid))
61 for _, sid := range sids {
62 stream = Streams[byte(sid)]
63 v, err = gui.SetView(stream.name, 0, prevY, maxX/2-1, prevY+2)
65 if err != gocui.ErrUnknownView {
70 _, err = gui.SetView(stream.name+"-vol", maxX/2, prevY, maxX-1, prevY+2)
73 if err != gocui.ErrUnknownView {
81 gui.SetCurrentView(*Name)