sampler-fork/console/console.go

51 lines
828 B
Go
Raw Normal View History

package console
import (
"fmt"
2019-03-14 03:01:44 +00:00
ui "github.com/gizak/termui/v3"
"log"
"os"
"time"
)
const (
MaxRenderInterval = 1000 * time.Millisecond
MinRenderInterval = 100 * time.Millisecond
ColumnsCount = 80
RowsCount = 40
AppTitle = "sampler"
2019-08-07 02:34:12 +00:00
AppVersion = "1.0.2"
AppLicenseWarning = "NOT ACTIVATED. PLEASE CONSIDER TO PURCHASE PERSONAL OR COMMERCIAL LICENSE TO SUPPORT THE PROJECT. WWW.SAMPLER.DEV "
)
2019-03-08 04:04:46 +00:00
const (
BellCharacter = "\a"
2019-03-08 04:04:46 +00:00
)
type AsciiFont string
const (
2019-04-25 00:48:16 +00:00
AsciiFont2D AsciiFont = "2d"
AsciiFont3D AsciiFont = "3d"
)
func Init() {
fmt.Printf("\033]0;%s\007", AppTitle)
if err := ui.Init(); err != nil {
log.Fatalf("Failed to initialize ui: %v", err)
}
}
func Close() {
ui.Close()
}
func Exit(message string) {
if len(message) > 0 {
println(message)
}
os.Exit(0)
}