Documentation ¶
Index ¶
- Constants
- Variables
- func CalculateDefaultTotal(totalNotes, keymode int) float64
- func CheckBgaEventsAreUnified(bmsDir *Directory) (nbs []notUnifiedBgaEvents)
- func CheckBgaHeaderIdIsDuplicate(bmsonFile *BmsonFile) (dis []duplicateBgaHeaderId)
- func CheckBgaHeadersAreUnified(bmsDir *Directory) (nb *notUnifiedBgaHeader)
- func CheckBmsDirectory(bmsDir *Directory, doDiffCheck bool)
- func CheckBmsFile(bmsFile *BmsFile)
- func CheckBmsonFile(bmsonFile *BmsonFile)
- func CheckBpmValue(bmsFile *BmsFile) (ibs []invalidBpmObj)
- func CheckDefinedBgaFilesExistBmson(bmsDir *Directory, bmsonFile *BmsonFile) (nfs []notExistFileBmson)
- func CheckDefinedBmpFilesExist(bmsDir *Directory, bmsFile *BmsFile) (nfs []notExistFile)
- func CheckDefinedFilesExist(bmsDir *Directory, bmsFile *BmsFile) (nfs []notExistFile)
- func CheckDefinedInfoFilesExistBmson(bmsDir *Directory, bmsonFile *BmsonFile) (nfs []notExistFileBmson)
- func CheckDefinedSoundFilesExistBmson(bmsDir *Directory, bmsonFile *BmsonFile) (nfs []notExistFileBmson)
- func CheckDefinedUnplacedBgaHeader(bmsonFile *BmsonFile) (du *definedUnplacedBgaHeader)
- func CheckDefinedWavFilesExist(bmsDir *Directory, bmsFile *BmsFile) (nfs []notExistFile)
- func CheckDefinitionDiff(bmsDirPath string, bmsFileI, bmsFileJ *BmsFile) (dds []definitionDiff)
- func CheckDefinitionsAreUnified(bmsDir *Directory) (nds []notUnifiedDefinitions)
- func CheckDuplicateY(bmsonFile *BmsonFile) (yds []yDuplicate)
- func CheckEmptyDirectory(bmsDir *Directory) (eds []emptyDirectory)
- func CheckEndOfLNExistsAndNotesInLN(bmsFile *BmsFile) (nls []noteInLN, els []endMissingLN)
- func CheckEnvironmentDependentFilename(bmsDir *Directory) (efs []environmentDependentFilename)
- func CheckFirstNoteHasContinueFlag(bmsonFile *BmsonFile) (fcs []firstNoteHasContinueFlag)
- func CheckIndexedDefinitionsAreUnified(bmsDir *Directory) (nis []notUnifiedIndexedDefinition)
- func CheckIndexedDefinitionsHaveInvalidValue(bmsFile *BmsFile) (mds []missingIndexedDefinition, eds []emptyDefinition, ...)
- func CheckMeasureLength(bmsFile *BmsFile) (ims []invalidMeasureLength, dms []duplicateMeasureLength)
- func CheckNoWavSoundChannels(bmsonFile *BmsonFile) (nw *noWavSoundChannels)
- func CheckNonNotesSoundChannel(bmsonFile *BmsonFile) (nss []nonNotesSoundChannel)
- func CheckNoteInLNBmson(bmsonFile *BmsonFile) (nls []noteInLNBmson)
- func CheckNoteOverlap(bmsFile *BmsFile) (ons []overlapNotes)
- func CheckObjectDiff(bmsDirPath string, bmsFileI, bmsFileJ *BmsFile) (ods []objectDiff)
- func CheckObjectStructuresAreUnified(bmsDir *Directory) (nos []notUnifiedObjectStructure)
- func CheckOutOfLaneNotes(bmsonFile *BmsonFile) (on *outOfLaneNotes)
- func CheckOver1MinuteAudioFile(bmsDir *Directory) (oas []over1MinuteAudioFile)
- func CheckPlacedObjIsDefinedAndDefinedHeaderIsPlaced(bmsFile *BmsFile) (puos []placedUndefinedObj, duos []definedUnplacedObj)
- func CheckPlacedUndefiedBgaIds(bmsonFile *BmsonFile) (pus []placedUndefinedBgaIds)
- func CheckSameHashBmsFiles(bmsDir *Directory) (sbs []sameHashBmsFiles)
- func CheckSoundChannelNameIsInvalid(bmsonFile *BmsonFile) (iss []invalidSoundChannelName)
- func CheckSoundChannelsAreUnified(bmsDir *Directory) (ns *notUnifiedSoundChannels)
- func CheckSoundNotesIn0thMeasure(bmsonFile *BmsonFile) *soundNotesIn0thMeasure
- func CheckSoundOfMineExplosionIsUsed(bmsFile *BmsFile) *unusedMineSound
- func CheckTitleAndSubtitleHaveSameText(bmsFile *BmsFile) (ts *titleAndSubtitleHaveSameText)
- func CheckTitleTextsAreDuplicate(bmsonFile *BmsonFile) (tds []titleTextsAreDuplicate)
- func CheckTotalnotesIsZero(bmsFileBase *BmsFileBase) *totalnotesIsZero
- func CheckUnusedFile(bmsDir *Directory) (ufs []unusedFile)
- func CheckWavDuplicate(bmsFile *BmsFile) (dupWavs []duplicateWavs)
- func CheckWavObjExistsIn0thMeasure(bmsFile *BmsFile) *wavObjsIn0thMeasure
- func CheckWithoutKeysound(bmsFile *BmsFile, wavFileIsExist func(string) bool) (wm *withoutKeysoundMoments, wn *withoutKeysoundNotes)
- func CheckWithoutKeysoundBmson(bmsonFile *BmsonFile, wavFileIsExist func(string) bool) (wm *withoutKeysoundMomentsBmson, wn *withoutKeysoundNotesBmson)
- func IsBmsDirectory(path string) bool
- func IsBmsFile(path string) bool
- func IsBmsonFile(path string) bool
- func JudgeOverTotal(total float64, totalNotes, keymode int) int
- type AlertLevel
- type Bms
- type BmsFile
- type BmsFileBase
- type BmsonFile
- type Command
- type CommandNecessity
- type CommandType
- type DiffBmsDirResult
- type Directory
- type File
- type Log
- type Logs
- type NonBmsFile
- type SubLogType
Constants ¶
View Source
const ( Wav objType = iota + 1 Bmp Mine Bpm ExtendedBpm Stop Scroll )
View Source
const ( Error = AlertLevel("ERROR") Warning = AlertLevel("WARNING") Notice = AlertLevel("NOTICE") )
Variables ¶
View Source
var AUDIO_EXTS = []string{".wav", ".ogg", ".flac", ".mp3"}
View Source
var BMP_CHANNELS = []string{"04", "06", "07"}
View Source
var BMP_EXTS = append(IMAGE_EXTS, MOVIE_EXTS...)
View Source
var BPM_CHANNELS = []string{"03"}
View Source
var COMMANDS = []Command{ {"player", Int, Necessary, []int{1, 4}}, {"genre", String, Semi_necessary, nil}, {"title", String, Necessary, nil}, {"artist", String, Semi_necessary, nil}, {"subtitle", String, Unnecessary, nil}, {"subartist", String, Unnecessary, nil}, {"bpm", Float, Necessary, []float64{math.SmallestNonzeroFloat64, math.MaxFloat64}}, {"playlevel", Int, Semi_necessary, []int{0, math.MaxInt64}}, {"rank", Int, Semi_necessary, []int{0, 4}}, {"defexrank", Float, Unnecessary, []float64{0, math.MaxFloat64}}, {"total", Float, Semi_necessary, []float64{0, math.MaxFloat64}}, {"difficulty", Int, Semi_necessary, []int{0, 5}}, {"stagefile", Path, Unnecessary, IMAGE_EXTS}, {"banner", Path, Unnecessary, IMAGE_EXTS}, {"backbmp", Path, Unnecessary, IMAGE_EXTS}, {"preview", Path, Unnecessary, AUDIO_EXTS}, {"lntype", Int, Unnecessary, []int{1, 2}}, {"lnobj", String, Unnecessary, []string{`^[0-9a-zA-Z]{2}$`}}, {"lnmode", Int, Unnecessary, []int{1, 3}}, {"volwav", Int, Unnecessary, []int{0, math.MaxInt64}}, {"comment", String, Unnecessary, nil}, }
View Source
var EXTENDEDBPM_CHANNELS = []string{"08"}
View Source
var IMAGE_EXTS = []string{".bmp", ".png", ".jpg", ".jpeg", ".gif"}
View Source
var INDEXED_COMMANDS = []Command{ {"wav", Path, Necessary, AUDIO_EXTS}, {"bmp", Path, Unnecessary, BMP_EXTS}, {"bpm", Float, Unnecessary, []float64{math.SmallestNonzeroFloat64, math.MaxFloat64}}, {"stop", Float, Unnecessary, []float64{math.SmallestNonzeroFloat64, math.MaxFloat64}}, {"scroll", Float, Unnecessary, []float64{-math.MaxFloat64, math.MaxFloat64}}, }
View Source
var INVISIBLENOTE_CHANNELS = []string{
"31", "32", "33", "34", "35", "36", "37", "38", "39",
"41", "42", "43", "44", "45", "46", "47", "48", "49",
}
View Source
var LN_CHANNELS = []string{
"51", "52", "53", "54", "55", "56", "57", "58", "59",
"61", "62", "63", "64", "65", "66", "67", "68", "69",
}
View Source
var MEASURE_CHANNELS = []string{"02"}
View Source
var MINE_CHANNELS = []string{
"d1", "d2", "d3", "d4", "d5", "d6", "d7", "d8", "d9",
"e1", "e2", "e3", "e4", "e5", "e6", "e7", "e8", "e9",
}
View Source
var MOVIE_EXTS = []string{".mpg", ".mpeg", ".wmv", ".avi", ".mp4", ".webm", ".m4v", ".m1v", ".m2v"}
View Source
var NORMALNOTE_CHANNELS = []string{
"11", "12", "13", "14", "15", "16", "17", "18", "19",
"21", "22", "23", "24", "25", "26", "27", "28", "29",
}
View Source
var NOTE_CHANNELS = append(NORMALNOTE_CHANNELS, LN_CHANNELS...)
View Source
var SCROLL_CHANNELS = []string{"sc"}
View Source
var STOP_CHANNELS = []string{"09"}
View Source
var WAV_CHANNELS = append(append(append([]string{"01"}, NORMALNOTE_CHANNELS...), INVISIBLENOTE_CHANNELS...), LN_CHANNELS...)
Functions ¶
func CalculateDefaultTotal ¶
func CheckBgaEventsAreUnified ¶
func CheckBgaEventsAreUnified(bmsDir *Directory) (nbs []notUnifiedBgaEvents)
func CheckBgaHeaderIdIsDuplicate ¶
func CheckBgaHeaderIdIsDuplicate(bmsonFile *BmsonFile) (dis []duplicateBgaHeaderId)
func CheckBgaHeadersAreUnified ¶
func CheckBgaHeadersAreUnified(bmsDir *Directory) (nb *notUnifiedBgaHeader)
func CheckBmsDirectory ¶
func CheckBmsFile ¶
func CheckBmsFile(bmsFile *BmsFile)
func CheckBmsonFile ¶
func CheckBmsonFile(bmsonFile *BmsonFile)
func CheckBpmValue ¶
func CheckBpmValue(bmsFile *BmsFile) (ibs []invalidBpmObj)
func CheckDefinedFilesExist ¶
func CheckDefinedUnplacedBgaHeader ¶
func CheckDefinedUnplacedBgaHeader(bmsonFile *BmsonFile) (du *definedUnplacedBgaHeader)
func CheckDefinedWavFilesExist ¶
pathsOfdoNotExistWavs := []string{}
func CheckDefinitionDiff ¶
func CheckDefinitionsAreUnified ¶
func CheckDefinitionsAreUnified(bmsDir *Directory) (nds []notUnifiedDefinitions)
func CheckDuplicateY ¶
func CheckDuplicateY(bmsonFile *BmsonFile) (yds []yDuplicate)
func CheckEmptyDirectory ¶
func CheckEmptyDirectory(bmsDir *Directory) (eds []emptyDirectory)
func CheckEndOfLNExistsAndNotesInLN ¶
func CheckEndOfLNExistsAndNotesInLN(bmsFile *BmsFile) (nls []noteInLN, els []endMissingLN)
func CheckEnvironmentDependentFilename ¶
func CheckEnvironmentDependentFilename(bmsDir *Directory) (efs []environmentDependentFilename)
must do after used check
func CheckFirstNoteHasContinueFlag ¶
func CheckFirstNoteHasContinueFlag(bmsonFile *BmsonFile) (fcs []firstNoteHasContinueFlag)
func CheckIndexedDefinitionsAreUnified ¶
func CheckIndexedDefinitionsAreUnified(bmsDir *Directory) (nis []notUnifiedIndexedDefinition)
func CheckIndexedDefinitionsHaveInvalidValue ¶
func CheckIndexedDefinitionsHaveInvalidValue(bmsFile *BmsFile) (mds []missingIndexedDefinition, eds []emptyDefinition, ivs []invalidValueOfIndexedCommand, nwd *noWavExtDefs)
func CheckMeasureLength ¶
func CheckMeasureLength(bmsFile *BmsFile) (ims []invalidMeasureLength, dms []duplicateMeasureLength)
func CheckNoWavSoundChannels ¶
func CheckNoWavSoundChannels(bmsonFile *BmsonFile) (nw *noWavSoundChannels)
func CheckNonNotesSoundChannel ¶
func CheckNonNotesSoundChannel(bmsonFile *BmsonFile) (nss []nonNotesSoundChannel)
func CheckNoteInLNBmson ¶
func CheckNoteInLNBmson(bmsonFile *BmsonFile) (nls []noteInLNBmson)
func CheckNoteOverlap ¶
func CheckNoteOverlap(bmsFile *BmsFile) (ons []overlapNotes)
func CheckObjectDiff ¶
func CheckObjectStructuresAreUnified ¶
func CheckObjectStructuresAreUnified(bmsDir *Directory) (nos []notUnifiedObjectStructure)
func CheckOutOfLaneNotes ¶
func CheckOutOfLaneNotes(bmsonFile *BmsonFile) (on *outOfLaneNotes)
func CheckOver1MinuteAudioFile ¶
func CheckOver1MinuteAudioFile(bmsDir *Directory) (oas []over1MinuteAudioFile)
must do after CheckDefinedWavFilesExist TODO 引数としてUsedリストを受け取る?
func CheckPlacedObjIsDefinedAndDefinedHeaderIsPlaced ¶
func CheckPlacedObjIsDefinedAndDefinedHeaderIsPlaced(bmsFile *BmsFile) (puos []placedUndefinedObj, duos []definedUnplacedObj)
この実装だとログの出力される順番が変わる?Placed→Defined→Placed→Defined→...だったのがPlaced*5→Defined*5になる
func CheckPlacedUndefiedBgaIds ¶
func CheckPlacedUndefiedBgaIds(bmsonFile *BmsonFile) (pus []placedUndefinedBgaIds)
func CheckSameHashBmsFiles ¶
func CheckSameHashBmsFiles(bmsDir *Directory) (sbs []sameHashBmsFiles)
func CheckSoundChannelNameIsInvalid ¶
func CheckSoundChannelNameIsInvalid(bmsonFile *BmsonFile) (iss []invalidSoundChannelName)
func CheckSoundChannelsAreUnified ¶
func CheckSoundChannelsAreUnified(bmsDir *Directory) (ns *notUnifiedSoundChannels)
func CheckSoundNotesIn0thMeasure ¶
func CheckSoundNotesIn0thMeasure(bmsonFile *BmsonFile) *soundNotesIn0thMeasure
func CheckSoundOfMineExplosionIsUsed ¶
func CheckSoundOfMineExplosionIsUsed(bmsFile *BmsFile) *unusedMineSound
func CheckTitleAndSubtitleHaveSameText ¶
func CheckTitleAndSubtitleHaveSameText(bmsFile *BmsFile) (ts *titleAndSubtitleHaveSameText)
func CheckTitleTextsAreDuplicate ¶
func CheckTitleTextsAreDuplicate(bmsonFile *BmsonFile) (tds []titleTextsAreDuplicate)
func CheckTotalnotesIsZero ¶
func CheckTotalnotesIsZero(bmsFileBase *BmsFileBase) *totalnotesIsZero
func CheckUnusedFile ¶
func CheckUnusedFile(bmsDir *Directory) (ufs []unusedFile)
func CheckWavDuplicate ¶
func CheckWavDuplicate(bmsFile *BmsFile) (dupWavs []duplicateWavs)
func CheckWavObjExistsIn0thMeasure ¶
func CheckWavObjExistsIn0thMeasure(bmsFile *BmsFile) *wavObjsIn0thMeasure
func CheckWithoutKeysound ¶
func CheckWithoutKeysound(bmsFile *BmsFile, wavFileIsExist func(string) bool) (wm *withoutKeysoundMoments, wn *withoutKeysoundNotes)
実在しないファイル名を持つWAV定義を考慮する場合、wavFileIsExistを渡す。そうでなければnilを渡す。
func IsBmsDirectory ¶
func IsBmsonFile ¶
func JudgeOverTotal ¶
TOTALが過剰な値か判別する -1: 低すぎ 0: 適正 1: 高すぎ
Types ¶
type AlertLevel ¶
type AlertLevel string
func (AlertLevel) String_ja ¶
func (al AlertLevel) String_ja() string
type Bms ¶
type Bms struct { Header map[string]string HeaderWav []indexedDefinition HeaderBmp []indexedDefinition HeaderExtendedBpm []indexedDefinition HeaderStop []indexedDefinition HeaderScroll []indexedDefinition BmsWavObjs []bmsObj BmsBmpObjs []bmsObj BmsMineObjs []bmsObj BmsBpmObjs []bmsObj BmsExtendedBpmObjs []bmsObj BmsStopObjs []bmsObj BmsScrollObjs []bmsObj BmsMeasureLengths []measureLength }
type BmsFile ¶
type BmsFile struct { BmsFileBase Bms }
func NewBmsFile ¶
func NewBmsFile(bmsFileBase *BmsFileBase) *BmsFile
func (BmsFile) LogStringWithLang ¶
func (*BmsFile) ScanBmsFile ¶
type BmsFileBase ¶
type BmsFileBase struct { File FullText []byte Sha256 string Keymode int // 5, 7, 9, 10, 14, 24, 48 TotalNotes int Logs Logs }
func ReadBmsFileBase ¶
func ReadBmsFileBase(path string) (bmsFileBase *BmsFileBase, _ error)
func (BmsFileBase) LogString ¶
func (bf BmsFileBase) LogString(base bool) string
func (BmsFileBase) LogStringWithLang ¶
func (bf BmsFileBase) LogStringWithLang(base bool, lang string) string
type BmsonFile ¶
type BmsonFile struct { BmsFileBase bmson.Bmson IsInvalid bool // bmsonフォーマットエラーで無効なファイル }
func NewBmsonFile ¶
func NewBmsonFile(bmsFileBase *BmsFileBase) *BmsonFile
func (*BmsonFile) ScanBmsonFile ¶
type Command ¶
type Command struct { Name string Type CommandType Necessity CommandNecessity BoundaryValue interface{} // Intなら0と100,-10とnilとか。Stringなら*とか(多分不要)。Pathなら許容する拡張子.oog、.wav }
type CommandNecessity ¶
type CommandNecessity int
const ( Necessary CommandNecessity = iota + 1 Semi_necessary Unnecessary )
type DiffBmsDirResult ¶
type DiffBmsDirResult struct {
DirPath1, DirPath2 string
// contains filtered or unexported fields
}
func DiffBmsDirectories ¶
func DiffBmsDirectories(dirPath1, dirPath2 string) (result *DiffBmsDirResult, _ error)
2つのディレクトリ内のファイル分布が一致するか比較して確認する。比較はファイルパスで行う。 音声、画像、動画ファイルを比較する時は、パスの拡張子を取り除き、名前だけで比較する。 bmsfileは同名ファイルでsha256の比較をする。一致しなかった場合はファイル記述内容のdiffをとる。
func (DiffBmsDirResult) LogStringWithLang ¶
func (d DiffBmsDirResult) LogStringWithLang(lang string) (log string)
type Directory ¶
type Directory struct { File BmsFiles []BmsFile BmsonFiles []BmsonFile /*SoundFiles []NonBmsFile ImageFiles []NonBmsFile // TODO OtherFiles []NonBmsFile*/ NonBmsFiles []NonBmsFile Directories []Directory Logs Logs }
func ScanBmsDirectory ¶
func ScanDirectory ¶
type Log ¶
type Log struct { Level AlertLevel Message string Message_ja string SubLogs []string SubLogType SubLogType }
func (Log) StringWithLang ¶
type Logs ¶
type Logs []Log
func CheckBmsonInfo ¶
func CheckHeaderCommands ¶
func (Logs) StringWithLang ¶
type NonBmsFile ¶
func (NonBmsFile) UsedFromAny ¶
func (f NonBmsFile) UsedFromAny() bool
Source Files ¶
Click to show internal directories.
Click to hide internal directories.