run: |
sudo apt-get install libgtk-3-dev libcairo2-dev libglib2.0-dev
cd demo
- go build -v -buildmode=exe -tags gtk_3_24 -o demo.run -i main.go
+ go build -v -buildmode=exe -tags 'gtk gtk_3_24' -o demo.run -i main.go
- name: zip
run: zip -q -r ubuntu_go${{ matrix.go }}.zip *
with:
go-version: ${{ matrix.go }}
- - name: Set up Gtk
- uses: msys2/setup-msys2@v2
- with:
- msystem: MINGW64
- path-type: inherit
- update: true
- install: 'mingw-w64-x86_64-gtk2 mingw-w64-x86_64-gtk3 mingw-w64-x86_64-pkg-config base-devel'
-
- name: Check out code
uses: actions/checkout@v2
- name: Build
- shell: msys2 {0}
run: |
- export CGO_LDFLAGS_ALLOW="-Wl.*"
- export CGO_CFLAGS_ALLOW="-Wl.*"
- export CGO_CXXFLAGS_ALLOW="-Wl.*"
cd demo
- go build -v -buildmode=exe -tags gtk_3_24 -o demo.exe -i main.go
+ go build -v -buildmode=exe -o demo.exe -i main.go
- name: zip
run: .\7za.exe a -r .\windows_go${{ matrix.go }}.zip ./
run: |
sudo apt-get install libgtk-3-dev libcairo2-dev libglib2.0-dev
cd demo
- go build -v -buildmode=exe -tags gtk_3_24 -o demo.run -i main.go
+ go build -v -buildmode=exe -tags 'gtk gtk_3_24' -o demo.run -i main.go
- name: zip
run: zip -q -r ubuntu_go${{ matrix.go }}.zip *
with:
go-version: ${{ matrix.go }}
- - name: Set up Gtk
- uses: msys2/setup-msys2@v2
- with:
- msystem: MINGW64
- path-type: inherit
- update: true
- install: 'mingw-w64-x86_64-gtk2 mingw-w64-x86_64-gtk3 mingw-w64-x86_64-pkg-config base-devel'
-
- name: Check out code
uses: actions/checkout@v2
- name: Build
- shell: msys2 {0}
run: |
- export CGO_LDFLAGS_ALLOW="-Wl.*"
- export CGO_CFLAGS_ALLOW="-Wl.*"
- export CGO_CXXFLAGS_ALLOW="-Wl.*"
cd demo
- go build -v -buildmode=exe -tags gtk_3_24 -o demo.exe -i *.go
+ go build -v -buildmode=exe -o demo.exe -i main.go
- name: zip
run: .\7za.exe a -r .\windows_go${{ matrix.go }}.zip ./

[截图地址](//zdir.ntsdtt.bid/ALL/Admin/Remote/%E5%9B%BE%E7%89%87/Screenshot_20200926_173834.png)
-Gtk弹幕窗
+Gtk弹幕窗(Linux Only)

[截图地址](//zdir.ntsdtt.bid/ALL/Admin/Remote/%E5%9B%BE%E7%89%87/Screenshot_20201023_232029.png)
-Qt弹幕窗
-
-[截图地址](//zdir.ntsdtt.bid/ALL/Admin/Remote/%E5%9B%BE%E7%89%87/Screenshot_20201002_045627.png)
更多内容详见注释,如有疑问请发issues,欢迎pr
--- /dev/null
+package reply
+
+import (
+ s "github.com/qydysky/part/buf"
+)
+
+//从config.json初始化
+func init(){
+ buf := s.New()
+ buf.Load("config_F.json")
+ for k,v := range buf.B {
+ AllF[k] = v.(bool)
+ }
+}
F "github.com/qydysky/bili_danmu/F"
"github.com/christopher-dG/go-obs-websocket"
p "github.com/qydysky/part"
- s "github.com/qydysky/part/buf"
)
/*
//功能开关
var AllF = map[string]bool{
`ShowRev`:true,//显示本次营收
- "Gtk":false,//Gtk弹幕窗口
+ "Gtk":false,//Gtk弹幕窗口(使用go build -tags 'gtk gtk_3_24'编译,linux only)
"Saveflv":true,//保存直播流(默认高清,有cookie默认蓝光)
"Ass":true,//Ass弹幕生成,由于时间对应关系,仅开启流保存时生效
"Obs":false,//obs组件(仅录播)
"Shortdanmu":true,//上下文相同文字缩减
}
-//从config.json初始化
-func init(){
- buf := s.New()
- buf.Load("config_F.json")
- for k,v := range buf.B {
- AllF[k] = v.(bool)
- }
-}
-
//功能开关选取函数
func IsOn(s string) bool {
if v, ok := AllF[s]; ok && v {
}
}
-//Gtk 弹幕Gtk窗口
-func Gtkf(){
- if!IsOn("Gtk") {return}
- Gtk_danmu()
-}
-
//Ass 弹幕转字幕
type Ass struct {
"compress/zlib"
p "github.com/qydysky/part"
+ mq "github.com/qydysky/part/msgq"
F "github.com/qydysky/bili_danmu/F"
S "github.com/qydysky/bili_danmu/Send"
c "github.com/qydysky/bili_danmu/CV"
if auth != nil {msglog.I(auth, ":", msg)}
}
+type Danmu_mq_t struct {
+ uid string
+ msg string
+}
+var Danmu_mq = mq.New()
+
func Gui_show(m ...string){
//m[0]:msg m[1]:uid
- if Gtk_on {
- if len(m) > 1 {
- Gtk_danmuChan_uid <- m[1]
- } else {Gtk_danmuChan_uid <- ""}
- Gtk_danmuChan <- m[0]
- }
+ uid := ""
+ if len(m) > 1 {uid = m[1]}
+
+ Danmu_mq.Push(Danmu_mq_t{
+ uid:uid,
+ msg:m[0],
+ })
}
func Itos(i []interface{}) string {
+//+build gtk
+
package reply
import (
Gtk_danmuChan_uid chan string = make(chan string, 1000)
)
+func init(){
+ if!IsOn("Gtk") {return}
+ go func(){
+ go Gtk_danmu()
+ for {
+ o := Danmu_mq.Pull().(Danmu_mq_t)
+ Gtk_danmuChan_uid <- o.uid
+ Gtk_danmuChan <- o.msg
+ }
+ }()
+}
+
func Gtk_danmu() {
if Gtk_on {return}
gtk.Init(nil)
if p.Checkfile().IsExist("cookie.txt") {//附加功能 弹幕机
reply.Danmuji_auto(1)
}
- {//附加功能 直播流保存 Gtk窗口 营收
+ {//附加功能 直播流保存 营收
go reply.Saveflvf()
- go reply.Gtkf()
go reply.ShowRevf()
}
}()
github.com/miekg/dns v1.1.35 // indirect
github.com/mitchellh/mapstructure v1.3.3 // indirect
github.com/qydysky/bili_danmu v0.4.0
- github.com/qydysky/part v0.2.1 // indirect
+ github.com/qydysky/part v0.2.2-0.20201117225521-b27dd91d56af // indirect
github.com/shirou/gopsutil v3.20.10+incompatible // indirect
golang.org/x/crypto v0.0.0-20201016220609-9e8e0b390897 // indirect
golang.org/x/net v0.0.0-20201110031124-69a78807bb2b // indirect
github.com/qydysky/part v0.0.6/go.mod h1:+8N3UgJBVyJj8ar31eZtucwrKpLpay854Y5qq0xk3x0=
github.com/qydysky/part v0.2.1 h1:D/ZZzKPYA9yFbudzu0HtR7RffEzdacvGr/D4hGNggRI=
github.com/qydysky/part v0.2.1/go.mod h1:93s9ohLtzULet5ZPEUUWrT9BELC30oDZgRpgGSiDye4=
+github.com/qydysky/part v0.2.2-0.20201117213340-ef56d5480392 h1:8QRCTgpR+g0R6PY97eTYRcHqgnnT4q8KZdLrertM4so=
+github.com/qydysky/part v0.2.2-0.20201117213340-ef56d5480392/go.mod h1:93s9ohLtzULet5ZPEUUWrT9BELC30oDZgRpgGSiDye4=
+github.com/qydysky/part v0.2.2-0.20201117223624-77dfebe855ee h1:esBBaTeqkbxMKv4ixjVEUeResctj+/nbh7y/UytpIbw=
+github.com/qydysky/part v0.2.2-0.20201117223624-77dfebe855ee/go.mod h1:93s9ohLtzULet5ZPEUUWrT9BELC30oDZgRpgGSiDye4=
+github.com/qydysky/part v0.2.2-0.20201117225521-b27dd91d56af h1:wzpjAMxFBduOz9TWZreDYElmREXq7o752X1s4pc2NiE=
+github.com/qydysky/part v0.2.2-0.20201117225521-b27dd91d56af/go.mod h1:93s9ohLtzULet5ZPEUUWrT9BELC30oDZgRpgGSiDye4=
github.com/shirou/gopsutil v2.20.7+incompatible/go.mod h1:5b4v6he4MtMOwMlS0TUMTu2PcXUg8+E1lC7eC3UO/RA=
github.com/shirou/gopsutil v2.20.8+incompatible h1:8c7Atn0FAUZJo+f4wYbN0iVpdWniCQk7IYwGtgdh1mY=
github.com/shirou/gopsutil v2.20.8+incompatible/go.mod h1:5b4v6he4MtMOwMlS0TUMTu2PcXUg8+E1lC7eC3UO/RA=